Changes for page Forthcoming

From version 39.6
edited by Andrea Omicini
on 01/04/2023 19:32
Change comment: There is no comment for this version
To version 39.4
edited by Andrea Omicini
on 01/04/2023 19:28
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -3,21 +3,33 @@
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( $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 " )
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 + #if( $eventsFound.size() > 0 )
10 +>{{stringEngIta eng="Forthcoming Events" ita="Eventi in arrivo"/}}
11 +
12 + #foreach($event in $eventFound)
13 + #set( $eventDoc = $xwiki.getDocument($event) )
14 +#if( !$foreach.first ){{themeTextSecondary}}•{{/themeTextSecondary}} #end##
15 +{{eventAcronym}}$eventDoc{{/eventAcronym}} (% style='color:$theme.textPrimaryColor' %)({{eventDates}}$eventDoc{{/eventDates}}) #end
16 +(%%)
17 + #end
8 8  #else
19 +## user forthcoming events new
9 9   #set( $query = "select doc.fullName from XWikiDocument doc, BaseObject as obj0, BaseObject as obj1, LargeStringProperty as prop1, DateProperty as prop2
10 10   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 " )
11 -#end
12 12  ## execute query
13 -#set( $eventsFound = $xwiki.search($query) )
23 + #set( $eventsFound = $xwiki.search($query) )
14 14  ##
15 -#if( $eventsFound.size() > 0 )
25 + #if( $eventsFound.size() > 0 )
16 16  >{{stringEngIta eng="Forthcoming Events" ita="Eventi in arrivo"/}}
17 17  
18 - #foreach($event in $eventsFound)
19 - #set( $eventDoc = $xwiki.getDocument($event) )
20 -#if( !$foreach.first ){{themeTextSecondary}}•{{/themeTextSecondary}} #end{{event}}$eventDoc{{/event}} #end
28 + #foreach($event in $eventsFound)
29 + #set( $eventDoc = $xwiki.getDocument($event) )
30 +#if( !$foreach.first ){{themeTextSecondary}}•{{/themeTextSecondary}} #end##
31 +{{eventAcronym}}$eventDoc{{/eventAcronym}} (% style='color:$theme.textPrimaryColor' %)({{eventDates}}$eventDoc{{/eventDates}}) #end
21 21  (%%)
33 + #end
22 22  #end
23 23  {{/velocity}}