Changes for page Per Status

From version 86.6
edited by Andrea Omicini
on 22/06/2023 12:15
Change comment: There is no comment for this version
To version 86.7
edited by Andrea Omicini
on 22/06/2023 12:35
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -107,10 +107,9 @@
107 107  #set( $itemNo = 0 )
108 108  ## cycle over sorts
109 109  #foreach( $status in $statusList )
110 - #set( $from = ", BaseObject as obj, LargeStringProperty as prop0, LargeStringProperty as prop1, StringProperty as prop2, StringProperty as prop3" )
111 - #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 prop3.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' and prop3.name = 'access'#if( !$hasEdit ) and prop3.value <> 'hidden'#end" )
112 - #set( $sql = $from + " where " + $where )
113 - #set( $pubFound = $xwiki.searchDocuments($sql) )
110 + #set( $query = ", BaseObject as obj, #if( $oneUser ) LargeStringProperty as propAuthor, LargeStringProperty as propEditor, #end StringProperty as propStatus #if( !$hasEdit ), StringProperty as propAccess #end
111 + where obj.name = doc.fullName and obj.className = '${objectSpace}.${objectClass}' and obj.name <> '${objectSpace}.${objectTemplate}' and propAuthor.id.id = obj.id and propEditor.id.id = obj.id and propStatus.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' ) ) 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" )
112 + #set( $pubFound = $xwiki.searchDocuments($query) )
114 114   #set( $pubStatusNo = $pubFound.size() )
115 115   #if( $pubStatusNo > 0 )
116 116   #set( $pubMap[$status] = $pubFound )