Changes for page Forthcoming
From version 35.5
edited by Andrea Omicini
on 31/03/2023 17:12
on 31/03/2023 17:12
Change comment:
There is no comment for this version
To version 40.1
edited by Andrea Omicini
on 01/04/2023 19:46
on 01/04/2023 19:46
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -3,36 +3,21 @@ 3 3 {{include reference="Events.Environment" excludeFirstHeading="true"/}}{{velocity}} 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 -(%%) 6 + #set( $query = "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 " ) 14 14 #else 15 -## user forthcoming events old 16 - #set( $query = "select doc.fullName from XWikiDocument doc, BaseObject 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, LargeStringProperty as prop8 17 - where doc.fullName = obj.name and obj.className = '$objectSpace.$objectClass' and obj.name <> '$objectSpace.$objectTemplate' 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 prop8.id.id = obj.id and prop.name = 'start_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 = 'spc_member' and prop6.name = 'organiser' and prop7.name = 'lecturer' and prop8.name = 'other_role_player_1' 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()) ) ) and ( prop1.value like '%$userName%' or prop2.value like '%$userName%' or prop3.value like '%$userName%' or prop4.value like '%$userName%' or prop5.value like '%$userName%' or prop6.value like '%$userName%' or prop7.value like '%$userName%' or prop8.value like '%$userName%' ) order by date(prop.value) asc ") 18 - #set( $eventsFound = $xwiki.search($query) ) 19 -## user forthcoming events new 20 - #set( $query = ", BaseObject as obj0, BaseObject as obj1, LargeStringProperty as prop1, DateProperty as prop2 9 + #set( $query = "select doc.fullName from XWikiDocument doc, BaseObject as obj0, BaseObject as obj1, LargeStringProperty as prop1, DateProperty as prop2 21 21 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 " ) 22 -## execute query new 23 - #set( $eventsFoundNew = $xwiki.searchDocuments($query) ) 24 - #if( $eventsFoundNew.size() > 0 ) 25 - #set( $discard = $eventsFound.addAll($eventsFoundNew) ) 26 - #end 11 +#end 12 +## execute query 13 +#set( $eventsFound = $xwiki.search($query) ) 27 27 ## 28 - 15 +#if( $eventsFound.size() > 0 ) 29 29 >{{stringEngIta eng="Forthcoming Events" ita="Eventi in arrivo"/}} 30 30 31 - #foreach($event in $eventsFound) 32 - #set( $eventDoc = $xwiki.getDocument($event) ) 33 -#if( !$foreach.first ){{themeTextSecondary}}•{{/themeTextSecondary}} #end## 34 -{{eventAcronym}}$eventDoc{{/eventAcronym}} (% style='color:$theme.textPrimaryColor' %)({{eventDates}}$eventDoc{{/eventDates}}) #end 18 + #foreach($event in $eventsFound) 19 + #set( $eventDoc = $xwiki.getDocument($event) ) 20 +#if( !$foreach.first ){{themeTextSecondary}}•{{/themeTextSecondary}} #end{{event short="true"}}$eventDoc{{/event}} #end 35 35 (%%) 36 - #end 37 37 #end 38 38 {{/velocity}}