Changes for page Per Status

From version 71.2
edited by Andrea Omicini
on 02/01/2023 16:30
Change comment: There is no comment for this version
To version 73.1
edited by Andrea Omicini
on 02/01/2023 23:59
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -82,21 +82,9 @@
82 82   #end
83 83  #end
84 84  ##
85 -{{id name="top"/}}
86 -#if( $oneUser )#if( $oneStatus )
87 ->**{{pubStatus uppercase='true' plural='true'}}$statusPar{{/pubStatus}}** / $userFirstName $userLastName
88 -#else
89 ->**{{pubStatus uppercase='true' plural='true'}}unpublished{{/pubStatus}}** / $userFirstName $userLastName
90 -#end#elseif($oneStatus)
91 ->{{pubStatus uppercase='true' plural='true'}}$statusPar{{/pubStatus}}
92 -#else
93 ->{{pubStatus uppercase='true' plural='true'}}unpublished{{/pubStatus}}
94 -#end
95 -##
96 -#if( !$oneStatus )
97 -(% style="font-size: smaller; padding:1em 1.5em 0.25em 1.5em; background-color:$theme.highlightColor" %)(((#foreach( $status in $statusList )#if( $foreach.index > 0 ) | #end[[{{pubStatus}}$status{{/pubStatus}}>>||anchor=$status]]#end)))
98 -#end
99 -##
85 +## query to structures
86 +#set( $pubMap = {} )
87 +#set( $pubNo = 0 )
100 100  #foreach( $status in $statusList )
101 101   #set( $from = ", BaseObject as obj, LargeStringProperty as prop0, LargeStringProperty as prop1, StringProperty as prop2" )
102 102   #set( $where = "obj.name = doc.fullName and obj.className = '${objectSpace}.${objectClass}' and obj.name <> '${objectSpace}.${objectTemplate}' and prop0.id.id = obj.id and prop1.id.id = obj.id and prop2.id.id = obj.id and prop0.name = 'author' and prop1.name = 'editor' and ( prop0.value like '$userString' or ( prop0.value = '' and prop1.value like '$userString' ) ) and prop2.name = 'status' and prop2.value = '$status'" )
... ... @@ -104,13 +104,11 @@
104 104   #set( $pubFound = $xwiki.searchDocuments($sql) )
105 105   #set( $pubStatusNo = $pubFound.size() )
106 106   #if( $pubStatusNo > 0 )
107 - #if( !$oneStatus )
108 -(% style="border-style:solid hidden hidden solid; border-color:$theme.borderColor; text-align:left; font-style:oblique" %)|{{id name='$sort'/}}{{pubStatus plural='true' uppercase='false'}}$status{{/pubStatus}}{{id name="$status"/}}
109 - #end
110 - #foreach( $pub in $pubFound )#if( $xwiki.exists($pub) )#set( $pubDoc = $xwiki.getDocument($pub) )#if( $pubDoc.getObject("${objectSpace}.${objectClass}") )## handling visibility at show time
111 -|{{pub inline='false' linked='title'}}$pub{{/pub}}
112 - #end#end#end
113 -(% style="#if( !$oneStatus )border-style:hidden solid solid hidden;#end border-color:$theme.borderColor; text-align:right; font-style:oblique; font-weight:normal; font-size:smaller; color:gray" %)|($pubStatusNo #if( $pubStatusNo > 1 ){{pubStatus plural='true'}}$status{{/pubStatus}}#else{{pubStatus plural='false'}}$status{{/pubStatus}}#end) [[[top]>>||anchor="top"]]
95 + #set( $pubMap[$year] = $pubFound )
96 + #set( $pubNo = $pubNo + $pubYearNo )
114 114   #end
115 115  #end
99 +$pubMap
100 +
101 +
116 116  {{/velocity}}