Show last authors
1 = {{english}}Talks per Year{{/english}}{{italiano}}Presentazioni per anno{{/italiano}} =
2
3 {{include reference="Talks.Environment" excludeFirstHeading="true"/}}{{include reference="Environment" excludeFirstHeading="true"/}}{{velocity}}
4 #set( $talkMenu = true )
5 #### get parameters
6 ## when
7 #set( $yearPar = $request.year.trim() )
8 #set( $firstYearPar = $request.from.trim() )
9 #set( $lastYearPar = $request.to.trim() )
10 ## who
11 #set( $userNamePar = $request.user.trim() )
12 #set( $firstNamePar = $request.name.trim() )
13 #set( $lastNamePar = $request.surname.trim() )
14 #### handle who
15 #if( $userName )
16 ## from a personal page, "XWiki.$userName" $userName form
17 #if( !$xwiki.exists( $userName ) )
18 {{warning}}User $userName does not exist{{/warning}}
19 #stop
20 #end
21 #set( $apiceUser = true )
22 #set( $oneUser = true )
23 #set( $userdoc = $xwiki.getDocument($userName) )
24 #set( $userFirstName = $userdoc.display("first_name") )
25 #set( $userLastName = $userdoc.display("last_name") )
26 #elseif( $userNamePar )
27 ## from the URL, "user=$userNamePar" parameter
28 #if( $userNamePar.contains('XWiki.') )
29 #set( $userName = "$userNamePar" )
30 #else
31 #set( $userName = "XWiki.$userNamePar" )
32 #end
33 #if( !$xwiki.exists( $userName ) )
34 {{warning}}User $userNamePar does not exist{{/warning}}
35 #stop
36 #end
37 #set( $apiceUser = true )
38 #set( $oneUser = true)
39 #set( $userdoc = $xwiki.getDocument($userName) )
40 #set( $userFirstName = $userdoc.display("first_name") )
41 #set( $userLastName = $userdoc.display("last_name") )
42 #elseif( $firstNamePar && $lastNamePar )
43 ## from the URL, "name=Firstname&surname=Lastname" parameter
44 #set( $apiceUser = false )
45 #set( $oneUser = true )
46 #set( $userFirstName = $firstNamePar )
47 #set( $userLastName = $lastNamePar )
48 #else
49 #set( $apiceUser = false )
50 #set( $oneUser = false )
51 #set( $userFirstName = "" )
52 #set( $userLastName = "" )
53 #end
54 #### handle when
55 #if( $yearPar )
56 ## 'year' parameter takes precedence
57 #set( $year = $util.parseInt($yearPar) )
58 #set( $yearList = [$year] )
59 #set( $oneYear = true )
60 #else
61 #set( $oneYear = false )
62 #set( $lastYear = $lastYearTalk )
63 #set( $firstYear = $firstYearTalk )
64 #set( $yearList = [$lastYear..$firstYear] )
65 #if( $firstYearPar )
66 #set( $yearFirst = $util.parseInt($firstYearPar) )
67 #if( $yearList.contains($yearFirst) )
68 #set( $firstYear = $yearFirst )
69 #set( $yearList = [$lastYear..$firstYear] )
70 #end
71 #end
72 #if( $lastYearPar )
73 #set( $yearLast = $util.parseInt($lastYearPar) )
74 #if( $yearList.contains($yearLast) )
75 #set( $lastYear = $yearLast )
76 #set( $yearList = [$lastYear..$firstYear] )
77 #end
78 #end
79 #if( $lastYear == $firstYear )
80 #set( $year = $lastYear )
81 #set( $yearList = [$year] )
82 #set( $oneYear = true )
83 #end
84 #end
85 #### Preparing page
86 ## Page title
87 >{{stringEngIta eng="Talks" ita="Presentazioni"/}} / **#if( $oneYear )$year#else$firstYear–$lastYear#end**#if( $oneUser ) / $userFirstName $userLastName#end{{id name="top"/}}
88 ##
89 #if( !$oneYear )
90 (% style="font-size: smaller; padding:1em 1.5em 0.25em 1.5em; background-color:$theme.highlightColor" %)(((#foreach( $year in $yearList )#if( $velocityCount > 1 ) | #end[[$year>>||anchor="$year"]]#end)))
91 #end
92 ##
93 #set( $talkNo = 0 )
94 #foreach( $year in $yearList )
95 #if( $oneUser )
96 #if( $apiceUser )
97 ## one APICe user
98 #set ($sql = ", BaseObject as obj, DateProperty as prop, LargeStringProperty as prop1, LargeStringProperty as prop2
99 where obj.name = doc.fullName and obj.className = 'Talks.TalkClass' and obj.name <> 'Talks.TalkTemplate' and prop.id.id = obj.id and prop1.id.id = obj.id and prop2.id.id = obj.id and prop.name = 'date' and prop1.name = 'authors' and prop2.name = 'speakers' and year(prop.value) = $year and ( prop1.value like '%$userName%' or prop2.value like '%$userName%' ) order by prop.value desc")
100 #else
101 ## one non APICe user
102 #set( $sql = ", BaseObject as obj, DateProperty as prop, StringProperty as prop1, StringProperty as prop2
103 where obj.name = doc.fullName and obj.className = 'Talks.TalkClass' and obj.name <> 'Talks.TalkTemplate' and prop.id.id = obj.id and prop1.id.id = obj.id and prop2.id.id = obj.id and prop.name = 'date' and prop1.name = 'externalAuthors' and prop2.name = 'externalSpeakers' and year(prop.value) = $year and ( prop1.value like '%$userLastName, $userFirstName%' or prop2.value like '%$userLastName, $userFirstName%' ) order by prop.value desc" )
104 #end
105 #else
106 ##all users
107 #set( $sql = ", BaseObject as obj, DateProperty as prop
108 where obj.name = doc.fullName and obj.className = 'Talks.TalkClass' and obj.name <> 'Talks.TalkTemplate' and prop.id.id = obj.id and prop.name = 'date' and year(prop.value) = $year order by prop.value desc" )
109 #end
110 #set( $talkFound = $xwiki.searchDocuments($sql) )
111 #set( $talkYearNo = $talkFound.size() )
112 #if( $talkYearNo > 0 )
113 #if( !$oneYear )
114 (% 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#if( $oneUser )#if( $apiceUser )&user=$userName#else&name=$userFirstName&surname=$userLastName#end#end']]
115 #end
116 #foreach( $talkDoc in $talkFound )
117 #set( $talkNo = $talkNo + 1 )
118 (% style="border-style:hidden hidden hidden hidden" %)|{{talk inline='false' linked='title'}}$talkDoc{{/talk}}
119 #end
120 (% style="#if( !$oneYear )border-style:hidden solid solid hidden; border-color:$theme.borderColor;#end text-align:right; font-style:oblique; font-size:smaller" %)|($talkYearNo {{stringEngIta ita="presentazioni nel" eng="talks in"/}} $year) [[[{{stringEngIta eng='top' ita='in cima'/}}]>>||anchor="top"]] [[[{{stringEngIta eng='bottom' ita='in fondo'/}}]>>||anchor="bottom"]]
121 #end
122 #end
123 #if( !$oneYear )(% style="text-align:right; font-style:oblique; font-size:smaller" %)|($talkNo #if( $talkNo == 1 ){{stringEngIta eng='talk' ita='presentazione'/}}#else{{stringEngIta eng='talks' ita='presentazioni'/}}#end)#end
124 {{/velocity}}
125 {{id name="bottom"/}}
Partita IVA: 01131710376 - Copyright © 2008-2022 APICe@DISI Research Group - PRIVACY