Changes for page Per A.Y.

From version 48.3
edited by Andrea Omicini
on 20/07/2023 10:26
Change comment: There is no comment for this version
To version 51.15
edited by Andrea Omicini
on 27/08/2023 18:52
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,6 +1,8 @@
1 1  {{velocity}}
2 2  {{html clean="false" wiki="true"}}
3 3  #template('apice_macros.vm')
4 +#nodoclang()
5 +#nolangpar()
4 4  #setobjectspace("Courses")
5 5  #template('apice_course_macros.vm')
6 6  #template('apice_user_param.vm')
... ... @@ -15,18 +15,18 @@
15 15   #stop
16 16   #end
17 17   #if( $personalCourseDoc.maxYears && $personalCourseDoc.maxYears != "" )
18 - #set( $maxCourseYears = $personalCourseDoc.display('maxYears','view') )
20 + #set( $maxCourseYears = $numbertool.toNumber($personalCourseDoc.display('maxYears','view')) )
19 19   #end
20 20   #if( $personalCourseDoc.firstYear && $personalCourseDoc.firstYear != "" )
21 - #set( $firstYearCourse = $personalCourseDoc.display('firstYear','view') )
23 + #set( $firstYearCourse = $numbertool.toNumber($personalCourseDoc.display('firstYear','view')) )
22 22   #end
23 23   #if( $personalCourseDoc.lastYear && $personalCourseDoc.lastYear != "" )
24 - #set( $lastYearCourse = $personalCourseDoc.display('lastYear','view') )
26 + #set( $lastYearCourse = $numbertool.toNumber($personalCourseDoc.display('lastYear','view')) )
25 25   #end
26 26  #end
27 27  ## years / parameters takes precedence
28 -#set( $firstYear = $firstYearCourse )
29 -#set( $lastYear = $lastYearCourse )
30 +#set( $firstYear = $numbertool.toNumber($firstYearCourse) )
31 +#set( $lastYear = $numbertool.toNumber($lastYearCourse) )
30 30  #template('apice_year_param.vm')
31 31  ##
32 32  ## DATA STRUCTURES / START
... ... @@ -33,11 +33,11 @@
33 33  #set( $itemMap = {} )
34 34  #set( $itemNo = 0 )
35 35  ## cycle over years
36 -#foreach( $year in $yearList)
38 +#foreach( $year in $yearList )
37 37   #set( $year1 = $year + 1 )
38 38   #set( $ayear = $year + "/" + $year1 )
39 - #set( $query = ", BaseObject as objCourse, StringProperty as propYear, LargeStringProperty as propProfessor, LargeStringProperty as propOtherprofessors, LargeStringProperty as propTutors
40 - where objCourse.name = doc.fullName and objCourse.className = '${mainSpace}.Class' and objCourse.name <> '${objectPool}.Template' and propYear.id.id = objCourse.id and propProfessor.id.id = objCourse.id and propOtherprofessors.id.id = objCourse.id and propTutors.id.id = objCourse.id and propYear.name = 'ay' and propProfessor.name = 'professor' and propOtherprofessors.name = 'otherProfessors' and propTutors.name = 'tutors' and propYear.value = '$ayear' #if( $oneUser )and ( propProfessor.value like '%$userName%' or propOtherprofessors.value like '%$userName%' or propTutors.value like '%$userName%' )#end ")
41 + #set( $query = ", BaseObject as objCourse, StringProperty as propName, StringProperty as propYear, LargeStringProperty as propProfessor, LargeStringProperty as propOtherprofessors, LargeStringProperty as propTutors
42 + where objCourse.name = doc.fullName and objCourse.className = '${mainSpace}.Class' and objCourse.name <> '${objectPool}.Template' and propName.id.id = objCourse.id and propYear.id.id = objCourse.id and propProfessor.id.id = objCourse.id and propOtherprofessors.id.id = objCourse.id and propTutors.id.id = objCourse.id and propName.name = #if( $services.localization.currentLocale == 'it' )'ita'#{else}'eng'#end and propYear.name = 'ay' and propProfessor.name = 'professor' and propOtherprofessors.name = 'otherProfessors' and propTutors.name = 'tutors' and propYear.value = '$ayear' #if( $oneUser )and ( propProfessor.value like '%$userName%' or propOtherprofessors.value like '%$userName%' or propTutors.value like '%$userName%' )#end order by propName.value asc")
41 41  ## execute query
42 42   #set( $itemFound = $xwiki.searchDocuments($query) )
43 43  ## set counters
... ... @@ -64,7 +64,11 @@
64 64   #set( $ayear = $year + "/" + $year1 )
65 65   $ayear
66 66  #else
67 - $firstYear–$lastYear
69 + #set( $firstYear1 = $firstYear + 1 )
70 + #set( $lastYear1 = $lastYear + 1 )
71 + #set( $aFirstYear = $firstYear + "/" + $firstYear1 )
72 + #set( $aLastYear = $lastYear + "/" + $lastYear1 )
73 + $aFirstYear<span class="textsecondary">&ensp;&mdash;&ensp;</span>$aLastYear
68 68  #end
69 69  #if( $oneUser )
70 70   <span class="textsecondary">&ensp;/&ensp;</span>
... ... @@ -104,11 +104,17 @@
104 104  ## year top / end
105 105  ##
106 106  ## year display / start
107 -<div style="font-style: normal"><ul>
113 + <div class='menumainbody' style='margin-top: .25em'>
108 108   #foreach( $item in $itemMap[$year] )
109 -<li>{{course}}$item{{/course}}</li>
115 + #if( $oneUser)
116 + #coursename($item)&ensp;(#coursecycle($item))
117 + #else
118 + #coursename($item)&ensp;<span class='textsecondary'>(#coursecycle($item)) &mdash; </span>#courseprofessor($item)
119 + #end
120 + #if( !$foreach.last )
121 + &ensp;&bull;&ensp;
122 + #end
110 110   #end
111 -</ul></div>
112 112  ## year display / end
113 113  ##
114 114  ## year bottom / start