Changes for page Per Status
From version 75.1
edited by Andrea Omicini
on 03/01/2023 00:00
on 03/01/2023 00:00
Change comment:
There is no comment for this version
To version 80.1
edited by Andrea Omicini
on 03/01/2023 00:09
on 03/01/2023 00:09
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -81,7 +81,6 @@ 81 81 #set( $statusList = [$statusPar] ) 82 82 #end 83 83 #end 84 -$statusList 85 85 ## 86 86 ## query to structures 87 87 #set( $pubMap = {} ) ... ... @@ -91,13 +91,28 @@ 91 91 #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'" ) 92 92 #set( $sql = $from + " where " + $where ) 93 93 #set( $pubFound = $xwiki.searchDocuments($sql) ) 94 - #set( $pubStatusNo = $pubFound.size() ) 95 95 #if( $pubStatusNo > 0 ) 96 96 #set( $pubMap[$status] = $pubFound ) 97 - #set( $pubNo = $pubNo + $pub YearNo )95 + #set( $pubNo = $pubNo + $pubStatusNo ) 98 98 #end 99 99 #end 100 100 $pubMap 99 +## output results 100 +## page subtitle 101 +{{id name="top"/}} 102 +>(%%)$pubNo #if( $pubNo == 1 ){{stringEngIta eng="$objectEngSingular.toLowerCase()" ita="$objectItaSingular.toLowerCase()"/}}#{else}{{stringEngIta eng="$objectEngPlural.toLowerCase()" ita="$objectItaPlural.toLowerCase()"/}}#{end} / #if( $oneStatus ){{pubStatus uppercase='true' plural='true'}}$statusPar{{/pubStatus}}#{else}{{pubStatus uppercase='true' plural='true'}}unpublished{{/pubStatus}}#{end}#if( $oneUser ) / $userFirstName $userLastName#{end}(%%) 103 +## stop if no pubs are found 104 +#if( $pubNo == 0 || $pubMap.keySet().size() == 0 ) 105 +## redundant double check 106 + #stop 107 +#end 108 +## some pubs found 109 +## page index 110 +#if( $pubMap.keySet().size() > 1 ) 111 +## found more than one status 112 +{{id name="index"/}} 113 +(% style="font-size:smaller; text-align:right; padding:1em 1.5em 0.25em 1.5em; background-color:$theme.highlightColor" %)(((#foreach( $status in $pubMap.keySet() )#if( !$foreach.first ) | #end[[{{pubStatus uppercase='false' plural='true'}}$statusPar{{/pubStatus}}>>||anchor="$status"]]#end))) 114 +#end 101 101 102 102 103 103 {{/velocity}}