Show last authors
1 {{include reference="Events.Environment"/}}{{include reference="Environment"/}}{{velocity}}
2 #set( $eventMenu = true )
3 #### Setting year variables
4 ## set from caller page: $firstYearEv, $lastYearEv
5 ## get environment variables & derived
6 #set( $firstYear = $mathtool.toInteger($firstYearEv) )
7 #set( $lastYear = $mathtool.toInteger($lastYearEv) )
8 #set( $yearList = [$lastYear..$firstYear] )
9 ### START YEAR
10 ## defaults
11 #set( $oneYear = false )
12 #set( $selectedYear = '' )
13 ## year parameters
14 #if( $request.year )
15 #set( $yearPar = $mathtool.toInteger($request.year) )
16 #end
17 #if( $request.from )
18 #set( $fromPar = $mathtool.toInteger($request.from) )
19 #end
20 #if( $request.to )
21 #set( $toPar = $mathtool.toInteger($request.to) )
22 #end
23 ##set years
24 #if( $yearPar > 0 )
25 #set( $oneYear = true )
26 #set( $firstYear = $yearPar )
27 #set( $lastYear = $yearPar )
28 #set( $selectedYear = $yearPar )
29 #set( $yearList = [$yearPar] )
30 #else
31 #if( $fromPar != '' && ($fromPar > $firstYear) )
32 #set( $firstYear = $fromPar )
33 #set( $yearList = [$lastYear..$firstYear] )
34 #end
35 #if( $toPar != '' && ($toPar < $lastYear) )
36 #set( $lastYear = $toPar )
37 #set( $yearList = [$lastYear..$firstYear] )
38 #end
39 #if( $lastYear <= $firstYear )
40 #set( $oneYear = true )
41 #set( $lastYear = $firstYear )
42 #set( $selectedYear = $firstYear )
43 #set( $yearList = [$firstYear] )
44 #else
45 #set( $yearList = [$lastYear..$firstYear] )
46 #end
47 #end
48 ## $selectedYear, $yearList and $oneYear set properly
49 ### END YEAR
50 ##
51 ### START USER
52 ## default values
53 #set( $oneUser = false )
54 #set( $selectedUser = '' )
55 #set( $userFirstName = "" )
56 #set( $userLastName = "" )
57 ## user parameter
58 #if( $request.user )
59 #set( $userNamePar = $request.user.trim() )
60 #end
61 #if( $userName || $userNamePar )
62 ## try to specify a user
63 #if( !$userName )
64 #set( $selectedUser = "XWiki.$userNamePar" )
65 #else
66 #set( $selectedUser = $userName )
67 #end
68 #if( $xwiki.exists($selectedUser) )
69 #set( $oneUser = true )
70 #set( $userdoc = $xwiki.getDocument($selectedUser) )
71 #set( $userFirstName = $userdoc.display("first_name") )
72 #set( $userLastName = $userdoc.display("last_name") )
73 #else
74 {{warning}} $selectedUser is not an {{apice/}} user{{/warning}}
75 #stop
76 #end
77 #end
78 ## $selectedUser and $oneUser set properly
79 ### END USER
80 ##
81 #### Preparing the web page
82 ##
83 ## top anchor
84 ##{{id='top'/}}
85 ##
86 ## Page title
87 ##
88 >{{stringEngIta eng='Events' ita='Eventi'/}} / **#if( $oneYear )$selectedYear#else$firstYear–$lastYear#end**#if( $oneUser ) / $userFirstName $userLastName#end
89 {{id name="top"/}}
90 (((#if( !$oneYear )
91 #foreach( $year in $yearList )
92 #if( $velocityCount > 1 ) | #end[[$year>>$doc||anchor=$year]]#end
93 #end)))
94 #set( $eventsNo = 0 )
95 #foreach( $year in $yearList )
96 #set( $eventYearNo = 0 )
97 #if( $oneUser )
98 #set( $sql = ", BaseObject as obj, DateProperty as prop, LargeStringProperty as prop1, LargeStringProperty as prop2, LargeStringProperty as prop3, LargeStringProperty as prop4, LargeStringProperty as prop5, LargeStringProperty as prop6, LargeStringProperty as prop7
99 where obj.name = doc.fullName and obj.className = 'Events.EventClass' and obj.name <> 'Events.EventTemplate' 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 prop5.id.id = obj.id and prop6.id.id = obj.id and prop7.id.id = obj.id and prop.name = 'end_date' and prop1.name = 'general_chair' and prop2.name = 'program_chair' and prop2.name = 'program_chair' and prop3.name = 'organising_chair' and prop4.name = 'pc_member' and prop5.name = 'organiser' and prop6.name = 'lecturer' and prop7.name = 'other_role_player_1' and year(prop.value) = $year and (prop1.value like '%$selectedUser%' or prop2.value like '%$selectedUser%' or prop3.value like '%$selectedUser%' or prop4.value like '%$selectedUser%' or prop5.value like '%$selectedUser%' or prop6.value like '%$selectedUser%' or prop7.value like '%$selectedUser%' ) order by prop.value desc" )
100 #else
101 #set ($sql = ", BaseObject as obj, DateProperty as prop
102 where obj.name = doc.fullName and obj.className = 'Events.EventClass' and obj.name <> 'Events.EventTemplate' and prop.id.id = obj.id and prop.name = 'year' and year(prop.value) = $year
103 order by prop.value desc" )
104 #end
105 ##
106 #set( $eventsFound = $xwiki.searchDocuments($sql) )
107 #set( $eventsYearNo = $eventsFound.size() )
108 #if( $eventsYearNo > 0 )
109 #set( $eventsNo = $eventsNo + $eventsYearNo )
110 #if( !$oneYear )
111 (% style="border-style:solid hidden hidden solid; border-color:$theme.borderColor; text-align:left; font-style:oblique" %)|{{id name='$year'/}}[[$year>>$doc.name||queryString='year=$year']]
112 #end
113 #foreach( $event in $eventsFound )
114 * {{event}}$event{{/event}}
115 #end
116 #if( !$oneYear )
117 (% style="border-style:hidden solid solid hidden; border-color:$theme.borderColor; text-align:right; font-style:oblique; font-weight:normal; font-size:smaller; color:$theme.textSecondaryColor" %)|($eventsYearNo #if($eventsYearNo == 1){{stringEngIta eng='event in' ita='evento nel'/}}#else{{stringEngIta eng='events in' ita='eventi nel'/}}#end $year{{id name='$year-bottom'/}}) [[[{{stringEngIta eng='top' ita='in cima'/}}]>>||anchor="top"]] [[[{{stringEngIta eng='bottom' ita='in fondo'/}}]>>||anchor="bottom"]]
118 #end
119 #end
120 #end
121 #if( $eventsNo > 0 )
122 (% style="text-align:right; font-style:oblique; font-weight:normal; font-size:smaller; color:$theme.textSecondaryColor; border-color:$theme.borderColor; border-bottom-style:dotted" %)|($eventsNo #if($thesisNo == 1){{stringEngIta eng='event' ita='evento'/}}#else{{stringEngIta eng='events' ita='eventi'/}}#end#if( $oneYear ) {{stringEngIta eng='in' ita='nel'/}} $selectedYear#else {{stringEngIta eng='from' ita='dal'/}} $firstYear {{stringEngIta eng='to' ita='al'/}} $lastYear#end)
123 #end
124 {{/velocity}}

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