Modifiche per il documento In arrivo

Dalla versione 41.1
modificato da Andrea Omicini
il 23/04/2023 23:17
Cambia il commento: Nessun commento per questa versione
Alla versione 39.3
modificato da Andrea Omicini
il 01/04/2023 19:26
Cambia il commento: Nessun commento per questa versione

Summary

Details

Page properties
Content
... ... @@ -1,27 +1,31 @@
1 1  = {{italiano}}In arrivo{{/italiano}}{{english}}Forthcoming{{/english}} =
2 2  
3 -{{include reference="Macros.Velocity" excludeFirstHeading="true"/}}{{include reference="Events.Environment" excludeFirstHeading="true"/}}{{velocity}}
4 -## set page display
5 -#noshortcuts()
6 -#set( $eventMenu = true )
7 -##
3 +{{include reference="Events.Environment" excludeFirstHeading="true"/}}{{velocity}}
8 8  #if( !$userName || $userName == "" || !$userSpace || $userSpace == "" || !$userFullname || $userFullname == "" )
9 9  ## overall forthcoming events
10 - #set( $query = "select doc.fullName from XWikiDocument doc, BaseObject obj, DateProperty as prop
11 - 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 + #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 +(%%)
12 12  #else
15 +## user forthcoming events new
13 13   #set( $query = "select doc.fullName from XWikiDocument doc, BaseObject as obj0, BaseObject as obj1, LargeStringProperty as prop1, DateProperty as prop2
14 14   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 " )
15 -#end
16 16  ## execute query
17 -#set( $eventsFound = $xwiki.search($query) )
19 + #set( $eventsFound = $xwiki.search($query) )
18 18  ##
19 -#if( $eventsFound.size() > 0 )
21 + #if( $eventsFound.size() > 0 )
20 20  >{{stringEngIta eng="Forthcoming Events" ita="Eventi in arrivo"/}}
21 21  
22 - #foreach($event in $eventsFound)
23 - #set( $eventDoc = $xwiki.getDocument($event) )
24 -#if( !$foreach.first ){{themeTextSecondary}}•{{/themeTextSecondary}} #end{{event short="true"}}$eventDoc{{/event}} #end
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
25 25  (%%)
29 + #end
26 26  #end
27 27  {{/velocity}}