Show last authors
1 = {{italiano}}Per A.A.{{/italiano}}{{english}}Per A.Y.{{/english}} =
2
3 {{include reference="Courses.Environment" excludeFirstHeading="true"/}}{{velocity}}
4 #set( $courseMenu = true )
5 #set( $currentCourseDoc = "" )
6 #### get parameters
7 ## when
8 #set( $yearPar = $context.getRequest().getParameter("year") )
9 #set( $firstYearPar = $context.getRequest().getParameter("from") )
10 #set( $lastYearPar = $context.getRequest().getParameter("to") )
11 ## who
12 #set( $userNamePar = $context.getRequest().getParameter("user") )
13 #set( $professorNamePar = $context.getRequest().getParameter("professor") )
14 #set( $tutorNamePar = $context.getRequest().getParameter("tutor") )
15 #### handle who
16 #if ( $userName )
17 ## from a personal page, "XWiki.UserName" $userName form
18 #set( $userdoc = $xwiki.getDocument($userName) )
19 #set( $userFirstName = $userdoc.display("first_name") )
20 #set( $userLastName = $userdoc.display("last_name") )
21 #elseif ( $userNamePar )
22 ## from the URL, "user=UserName" parameter
23 #set( $userName = "XWiki.$userNamePar" )
24 #set( $userdoc = $xwiki.getDocument($userName) )
25 #set( $userFirstName = $userdoc.display("first_name") )
26 #set( $userLastName = $userdoc.display("last_name") )
27 #else
28 #set( $userName = "" )
29 #set( $userFirstName = "" )
30 #set( $userLastName = "" )
31 #end
32 #if ( $professorName )
33 ## from a personal page, "XWiki.UserName" $professorName form
34 #set( $professordoc = $xwiki.getDocument($professorName) )
35 #set( $professorFirstName = $professordoc.display("first_name") )
36 #set( $professorLastName = $professordoc.display("last_name") )
37 #elseif ( $professorNamePar )
38 ## from the URL, "professor=UserName" parameter
39 #set( $professorName = "XWiki.$professorNamePar" )
40 #set( $professordoc = $xwiki.getDocument($professorName) )
41 #set( $professorFirstName = $professordoc.display("first_name") )
42 #set( $professorLastName = $professordoc.display("last_name") )
43 #else
44 #set( $professorName = "" )
45 #set( $professorFirstName = "" )
46 #set( $professorLastName = "" )
47 #end
48 #if ( $tutorName )
49 ## from a personal page, "XWiki.UserName" $tutorName form
50 #set( $tutordoc = $xwiki.getDocument($tutorName) )
51 #set( $tutorFirstName = $tutordoc.display("first_name") )
52 #set( $tutorLastName = $tutordoc.display("last_name") )
53 #elseif ( $tutorNamePar )
54 ## from the URL, "tutor=UserName" parameter
55 #set( $tutorName = "XWiki.$tutorNamePar" )
56 #set( $tutordoc = $xwiki.getDocument($tutorName) )
57 #set( $tutorFirstName = $tutordoc.display("first_name") )
58 #set( $tutorLastName = $tutordoc.display("last_name") )
59 #else
60 #set( $tutorName = "" )
61 #set( $tutorFirstName = "" )
62 #set( $tutorLastName = "" )
63 #end
64 ## professor takes precedence over tutor
65 #if( $professorName != "" )#set( $tutorName = "" )#end
66 ## user takes precedence over both professor and tutor and gets them all
67 #if( $userName != "" )#set( $professorName = $userName )#set( $tutorName = $userName )#end
68 ##
69 #if( $firstYearCou )#set( $firstYear = $firstYearCou )#end
70 #if( $lastYearCou )#set( $lastYear = $lastYearCou )#end
71 #if( $firstYearCourse )#set( $firstYear = $firstYearCourse )#end
72 #if( $lastYearCourse )#set( $lastYear = $lastYearCourse )#end
73 #set( $firstYear1 = $firstYear + 1 )#set( $firstAYear = $firstYear + "/" + $firstYear1 )
74 #set( $lastYear1 = $lastYear + 1 )#set( $lastAYear = $lastYear + "/" + $lastYear1 )
75 #set( $yearRange = [$lastYear..$firstYear] )
76 #if(!$oneYear)#set( $oneYear = false )#end
77 ##
78 #set( $yearPar = $context.getRequest().getParameter("year") )
79 #set( $firstYearPar = $context.getRequest().getParameter("from") )
80 #set( $lastYearPar = $context.getRequest().getParameter("to") )
81 #if($firstYearPar)
82 #set( $yearFirst = $util.parseInt($firstYearPar) )
83 #if ( $yearRange.contains($yearFirst) )
84 #set( $firstYear = $yearFirst )
85 #set( $yearRange = [$lastYear..$firstYear] )
86 #set( $firstYear1 = $firstYear + 1 )
87 #set( $firstAYear = $firstYear + "/" + $firstYear1 )
88 #end
89 #end
90 #if($lastYearPar)
91 #set( $yearLast = $util.parseInt($lastYearPar) )
92 #if ( $yearRange.contains($yearLast) )
93 #set( $lastYear = $yearLast )
94 #set( $yearRange = [$lastYear..$firstYear] )
95 #set( $lastYear1 = $lastYear + 1 )
96 #set( $lastAYear = $lastYear + "/" + $lastYear1 )
97 #end
98 #end
99 #set($yearList = $yearRange)
100 #if($yearPar)
101 #set($year = $util.parseInt($yearPar))
102 #if ($yearRange.contains($year) )
103 #set($yearList = [$year])
104 #set($oneYear = true)
105 #set($year1 = $year + 1 )
106 #set($aYear = $year + "/" + $year1 )
107 #end
108 #end
109 >{{stringEngIta eng = "Courses" ita = "Corsi"/}} / **#if( $oneYear )$aYear#else$lastAYear**–**$firstAYear#end**#if( $userName != "" ) / $userFirstName $userLastName#elseif( $professorName != "" ) / $professorFirstName $professorLastName#elseif( $tutorName != "" ) / $tutorFirstName $tutorLastName (tutor)#end{{id name="top"/}}
110 ##
111 #if( !$oneYear )
112 (% style="font-size: smaller; padding:1em 1.5em 0.25em 1.5em; background-color:$theme.highlightColor" %)(((#foreach ($yearr in $yearList)#set($yearr1 = $yearr + 1)#set($ayearr = "$yearr/$yearr1")#if( $foreach.index > 0 ) | #end[[$ayearr>>$doc||anchor=$yearr]]#end)))
113 #end
114 ##
115 #if( $services.localization.currentLocale == "it" )#set( $sortField = "ita")#else#set( $sortField = "eng")#end
116 #set( $courseNo = 0 )
117 #foreach( $yearr in $yearList)#set($yearr1 = $yearr + 1)#set($ayearr = $yearr + "/" + $yearr1 )
118 #set ($sql = ", BaseObject as obj, StringProperty as prop, LargeStringProperty as prop1, LargeStringProperty as prop2, LargeStringProperty as prop3, StringProperty as prop4
119 where obj.name = doc.fullName and obj.className = '${objectSpace}.${objectClass}' and obj.name <> '${objectSpace}.${objectTemplate}' and prop.id.id = obj.id and prop1.id.id = obj.id and prop2.id.id = obj.id and prop3.id.id = obj.id and prop4.id.id = obj.id and prop.name = 'ay' and prop1.name = 'professor' and prop2.name = 'otherProfessors' and prop3.name = 'tutors' and prop4.name = '$sortField' and prop.value = '$ayearr' and ( prop1.value like '%$professorName%' or prop2.value like '%$professorName%' or prop3.value like '%$tutorName%' ) order by prop4.value asc ")
120 #set( $courseFound = $xwiki.searchDocuments($sql) )
121 #set( $courseYearNo = $courseFound.size() )
122 #if( $$courseYearNo >0 )
123 #set( $courseNo = $courseNo + $courseYearNo )
124 #if( !$oneYear )
125 (% style="border-style:solid hidden hidden solid; border-color:$theme.borderColor; text-align:left; font-style:oblique" %)|{{id name='$yearr'/}}[[$ayearr>>$doc||queryString='year=$yearr#if( $userName != "" )&user=$userName#elseif( $professorName != "" )&professor=$professorName#elseif( $tutorName != "" )&tutor=$tutorName#end']]
126 #end
127 #foreach( $courseDoc in $courseFound )
128 * {{courseName}}$courseDoc{{/courseName}}
129 #end
130 (% style="#if( !$oneYear )border-style:hidden solid solid hidden; border-color:$theme.borderColor;#end text-align:right; font-style:oblique; font-size:smaller" %)|($courseYearNo #if( $courseYearNo == 1 ){{stringEngIta eng='course in' ita='corso nel'/}}#else{{stringEngIta eng='courses in' ita='corsi nel'/}}#end $ayearr) [[[{{stringEngIta eng='top' ita='in cima'/}}]>>||anchor="top"]] [[[{{stringEngIta eng='bottom' ita='in fondo'/}}]>>||anchor="bottom"]]
131 #end
132 #end
133 #if( !$oneYear )(% style="text-align:right; font-style:oblique; font-size:smaller; border-bottom-style:dotted; border-color:$theme.borderColor" %)|($courseNo #if( $courseNo == 1 ){{stringEngIta eng='course' ita='corso'/}}#else{{stringEngIta eng='courses' ita='corsi'/}}#end)#end
134 {{/velocity}}

Partita IVA: 01131710376 - Copyright © 2008-2022 APICe@DISI Research Group - PRIVACY