Changes for page Forthcoming
From version 39.3
edited by Andrea Omicini
on 01/04/2023 19:26
on 01/04/2023 19:26
Change comment:
There is no comment for this version
To version 46.4
edited by Andrea Omicini
on 06/05/2023 16:13
on 06/05/2023 16:13
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1,31 +1,24 @@ 1 1 = {{italiano}}In arrivo{{/italiano}}{{english}}Forthcoming{{/english}} = 2 2 3 3 {{include reference="Events.Environment" excludeFirstHeading="true"/}}{{velocity}} 4 +## 4 4 #if( !$userName || $userName == "" || !$userSpace || $userSpace == "" || !$userFullname || $userFullname == "" ) 5 5 ## overall forthcoming events 6 - #set( $sql = "select doc.fullName from XWikiDocument doc, BaseObject obj, DateProperty as prop 7 - where doc.fullName = obj.name and obj.className = '$objectSpace.$objectClass' and obj.name <> '$objectSpace.$objectTemplate' and prop.id.id = obj.id and prop.name = 'start_date' and ( ( year(prop.value) > year(current_date()) ) or ( year(prop.value) = year(current_date()) and month(prop.value) > month(current_date()) ) or ( year(prop.value) = year(current_date()) and month(prop.value) = month(current_date()) and day(prop.value) > day(current_date()) ) ) order by date(prop.value) asc ") 8 - #set( $eventFound = $xwiki.search($sql) ) 9 - #foreach($event in $eventFound) 10 - #set( $eventDoc = $xwiki.getDocument($event) ) 11 -#if( !$foreach.first ){{themeTextSecondary}}•{{/themeTextSecondary}} #end## 12 -{{eventAcronym}}$eventDoc{{/eventAcronym}} (% style='color:$theme.textPrimaryColor' %)({{eventDates}}$eventDoc{{/eventDates}}) #end 13 -(%%) 7 + #set( $query = ", BaseObject obj, DateProperty as prop 8 + where doc.fullName = obj.name and obj.className = '${objectSpace}.${objectClass}' and obj.name <> '${objectPool}.${objectTemplate}' and prop.id.id = obj.id and prop.name = 'start_date' and ( ( year(prop.value) > year(current_date()) ) or ( year(prop.value) = year(current_date()) and month(prop.value) > month(current_date()) ) or ( year(prop.value) = year(current_date()) and month(prop.value) = month(current_date()) and day(prop.value) > day(current_date()) ) ) order by date(prop.value) asc " ) 14 14 #else 15 -# #userforthcoming eventsnew16 - #set($query= "selectdoc.fullNamefromXWikiDocumentdoc, BaseObject, BaseObject asobj1,LargeStringProperty asprop1,DateProperty as prop217 - where obj0.name =doc.fullName and obj0.className = '${objectSpace}.${objectClass}' and obj0.name <> '${objectSpace}.${objectTemplate}' and prop2.id.id = obj0.id and prop2.name = 'end_date' and ( ( year(prop2.value) > year(current_date()) ) or ( year(prop2.value) = year(current_date()) and month(prop2.value) > month(current_date()) ) or ( year(prop2.value) = year(current_date()) and month(prop2.value) = month(current_date()) and day(prop2.value) > day(current_date()) ) ) and obj1.name = doc.fullName and obj1.className = '${objectSpace}.Roles.${objectClass}' and prop1.id.id = obj1.id and prop1.name = 'who' and prop1.value like '%$userName%' order by date(prop2.value) asc " )10 + #set( $query = ", BaseObject as obj0, BaseObject as obj1, LargeStringProperty as prop1, DateProperty as prop2 11 + where obj0.name = doc.fullName and obj0.className = '${objectSpace}.${objectClass}' and obj0.name <> '${objectPool}.${objectTemplate}' and prop2.id.id = obj0.id and prop2.name = 'end_date' and ( ( year(prop2.value) > year(current_date()) ) or ( year(prop2.value) = year(current_date()) and month(prop2.value) > month(current_date()) ) or ( year(prop2.value) = year(current_date()) and month(prop2.value) = month(current_date()) and day(prop2.value) > day(current_date()) ) ) and obj1.name = doc.fullName and obj1.className = '${objectSpace}.Roles.${objectClass}' and prop1.id.id = obj1.id and prop1.name = 'who' and prop1.value like '%$userName%' order by date(prop2.value) asc " ) 12 +#end 18 18 ## execute query 19 - 14 +#set( $eventsFound = $xwiki.searchDocuments($query) ) 20 20 ## 21 - 22 ->{{stringEngIta eng=" ForthcomingEvents" ita="Eventi in arrivo"/}}16 +#if( $eventsFound.size() > 0 ) 17 +>{{stringEngIta eng="forthcoming events" ita="eventi in arrivo"/}} 23 23 24 - #foreach($event in $eventsFound) 25 - #set( $eventDoc = $xwiki.getDocument($event) ) 26 -#if( !$foreach.first ){{themeTextSecondary}}•{{/themeTextSecondary}} #end## 27 -{{eventAcronym}}$eventDoc{{/eventAcronym}} (% style='color:$theme.textPrimaryColor' %)({{eventDates}}$eventDoc{{/eventDates}}) #end 19 + #foreach($event in $eventsFound) 20 + #set( $eventDoc = $xwiki.getDocument($event) ) 21 +#if( !$foreach.first ){{themeTextSecondary}}•{{/themeTextSecondary}} #end#if( $eventDoc.getValue('sort') != 'special issue' ){{event short="true"}}$eventDoc{{/event}}#{else}{{event short="title"}}$eventDoc{{/event}}#end #end 28 28 (%%) 29 - #end 30 30 #end 31 -{{/velocity}} 24 +{{/velocity}}{{noShortcuts/}}