Changes for page Per Status

From version 91.1
edited by Andrea Omicini
on 22/06/2023 13:09
Change comment: There is no comment for this version
To version 92.1
edited by Andrea Omicini
on 22/06/2023 13:10
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -53,8 +53,8 @@
53 53   #set( $showRejected = true )
54 54  #elseif( $publicationStatuses.contains($statusPar) )
55 55  ## 'status' parameter is an admissible publication status value
56 - #set( $oneStatus = true )
57 - #set( $statusList = [$statusPar] )
56 + #set( $oneStatus = true )
57 + #set( $statusList = [$statusPar] )
58 58  #end
59 59  ##
60 60  ## HANDLE STATUS / END
... ... @@ -116,14 +116,15 @@
116 116  ## cycle over statuses
117 117  #foreach( $status in $statusList )
118 118   #if( $status != "published" && $status != "rejected" || $status == "published" && $showPublished || $status == "rejected" && $showRejected )
119 - #set( $query = ", BaseObject as obj, #if( $oneUser ) LargeStringProperty as propAuthor, LargeStringProperty as propEditor, #end StringProperty as propStatus #if( !$hasEdit ), StringProperty as propAccess #end
120 - where obj.name = doc.fullName and obj.className = '${objectSpace}.${objectClass}' and obj.name <> '${objectPool}.${objectTemplate}' #if( $oneUser ) and propAuthor.id.id = obj.id and propEditor.id.id = obj.id and propAuthor.name = 'author' and propEditor.name = 'editor' and ( propAuthor.value like '$userString' or ( propAuthor.value = '' and propEditor.value like '$userString' ) ) #end and propStatus.id.id = obj.id and propStatus.name = 'status' and propStatus.value = '$status' #if( !$hasEdit ) and propAccess.id.id = obj.id and propAccess.name = 'access' and propAccess.value <> 'hidden' #end" )
121 - #set( $itemFound = $xwiki.searchDocuments($query) )
119 + #set( $query = ", BaseObject as obj, #if( $oneUser ) LargeStringProperty as propAuthor, LargeStringProperty as propEditor, #end StringProperty as propStatus #if( !$hasEdit ), StringProperty as propAccess #end
120 + where obj.name = doc.fullName and obj.className = '${objectSpace}.${objectClass}' and obj.name <> '${objectPool}.${objectTemplate}' #if( $oneUser ) and propAuthor.id.id = obj.id and propEditor.id.id = obj.id and propAuthor.name = 'author' and propEditor.name = 'editor' and ( propAuthor.value like '$userString' or ( propAuthor.value = '' and propEditor.value like '$userString' ) ) #end and propStatus.id.id = obj.id and propStatus.name = 'status' and propStatus.value = '$status' #if( !$hasEdit ) and propAccess.id.id = obj.id and propAccess.name = 'access' and propAccess.value <> 'hidden' #end" )
121 + #set( $itemFound = $xwiki.searchDocuments($query) )
122 122  ## set counters
123 - #set( $itemStatusNo = $itemFound.size() )
124 - #if( $itemStatusNo > 0 )
125 - #set( $itemMap[$status] = $itemFound )
126 - #set( $itemNo = $itemNo + $itemStatusNo )
123 + #set( $itemStatusNo = $itemFound.size() )
124 + #if( $itemStatusNo > 0 )
125 + #set( $itemMap[$status] = $itemFound )
126 + #set( $itemNo = $itemNo + $itemStatusNo )
127 + #end
127 127   #end
128 128  #end
129 129  ##