Changes for page Per A.Y.
From version 51.12
edited by Andrea Omicini
on 27/08/2023 18:38
on 27/08/2023 18:38
Change comment:
There is no comment for this version
To version 48.4
edited by Andrea Omicini
on 20/07/2023 10:28
on 20/07/2023 10:28
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1,8 +1,6 @@ 1 1 {{velocity}} 2 2 {{html clean="false" wiki="true"}} 3 3 #template('apice_macros.vm') 4 -#nodoclang() 5 -#nolangpar() 6 6 #setobjectspace("Courses") 7 7 #template('apice_course_macros.vm') 8 8 #template('apice_user_param.vm') ... ... @@ -17,18 +17,18 @@ 17 17 #stop 18 18 #end 19 19 #if( $personalCourseDoc.maxYears && $personalCourseDoc.maxYears != "" ) 20 - #set( $maxCourseYears = $ numbertool.toNumber($personalCourseDoc.display('maxYears','view')))18 + #set( $maxCourseYears = $personalCourseDoc.display('maxYears','view') ) 21 21 #end 22 22 #if( $personalCourseDoc.firstYear && $personalCourseDoc.firstYear != "" ) 23 - #set( $firstYearCourse = $ numbertool.toNumber($personalCourseDoc.display('firstYear','view')))21 + #set( $firstYearCourse = $personalCourseDoc.display('firstYear','view') ) 24 24 #end 25 25 #if( $personalCourseDoc.lastYear && $personalCourseDoc.lastYear != "" ) 26 - #set( $lastYearCourse = $ numbertool.toNumber($personalCourseDoc.display('lastYear','view')))24 + #set( $lastYearCourse = $personalCourseDoc.display('lastYear','view') ) 27 27 #end 28 28 #end 29 29 ## years / parameters takes precedence 30 -#set( $firstYear = $ numbertool.toNumber($firstYearCourse))31 -#set( $lastYear = $ numbertool.toNumber($lastYearCourse))28 +#set( $firstYear = $firstYearCourse ) 29 +#set( $lastYear = $lastYearCourse ) 32 32 #template('apice_year_param.vm') 33 33 ## 34 34 ## DATA STRUCTURES / START ... ... @@ -35,11 +35,11 @@ 35 35 #set( $itemMap = {} ) 36 36 #set( $itemNo = 0 ) 37 37 ## cycle over years 38 -#foreach( $year in $yearList 36 +#foreach( $year in $yearList) 39 39 #set( $year1 = $year + 1 ) 40 40 #set( $ayear = $year + "/" + $year1 ) 41 - #set( $query = ", BaseObject as objCourse, StringProperty as prop Name, StringProperty as propYear, LargeStringProperty as propProfessor, LargeStringProperty as propOtherprofessors, LargeStringProperty as propTutors42 - where objCourse.name = doc.fullName and objCourse.className = '${mainSpace}.Class' and objCourse.name <> '${objectPool}.Template' and prop Name.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%' )#endorder by propName.value asc")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 ") 43 43 ## execute query 44 44 #set( $itemFound = $xwiki.searchDocuments($query) ) 45 45 ## set counters ... ... @@ -67,8 +67,8 @@ 67 67 $ayear 68 68 #else 69 69 #set( $firstYear1 = $firstYear + 1 ) 70 - #set( $lastYear1 = $lastYear + 1 ) 71 71 #set( $aFirstYear = $firstYear + "/" + $firstYear1 ) 69 + #set( $lastYear1 = $lastYear + 1 ) 72 72 #set( $aLastYear = $lastYear + "/" + $lastYear1 ) 73 73 $aFirstYear<span class="textsecondary"> — </span>$aLastYear 74 74 #end ... ... @@ -110,22 +110,11 @@ 110 110 ## year top / end 111 111 ## 112 112 ## year display / start 113 - #if( $oneUser) 114 - <div class='menumainbody'> 115 - #foreach( $item in $itemMap[$year] ) 116 - #coursename($item) (#coursecycle($item)) 117 - #if( !$foreach.last ) 118 -  •  119 - #end 120 - #end 121 - </div> 122 - #else 123 - <div style="font-style: normal"><ul> 124 - #foreach( $item in $itemMap[$year] ) 125 - <li>#coursename($item) <span class='textsecondary'>(#coursecycle($item)) — </span>#courseprofessor($item)</li> 126 - #end 127 -</ul></div> 111 +<div style="font-style: normal"><ul> 112 + #foreach( $item in $itemMap[$year] ) 113 +<li>{{course}}$item{{/course}}</li> 128 128 #end 115 +</ul></div> 129 129 ## year display / end 130 130 ## 131 131 ## year bottom / start