Modifiche per il documento Per stato
Dalla versione 94.3
modificato da Andrea Omicini
il 22/06/2023 15:15
il 22/06/2023 15:15
Cambia il commento:
Nessun commento per questa versione
Alla versione 91.1
modificato da Andrea Omicini
il 22/06/2023 13:09
il 22/06/2023 13:09
Cambia il commento:
Nessun commento per questa versione
Summary
-
Page properties (1 modified, 0 added, 0 removed)
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,15 +116,14 @@ 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 - 120 - 121 - 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 ) 127 - #end 123 + #set( $itemStatusNo = $itemFound.size() ) 124 + #if( $itemStatusNo > 0 ) 125 + #set( $itemMap[$status] = $itemFound ) 126 + #set( $itemNo = $itemNo + $itemStatusNo ) 128 128 #end 129 129 #end 130 130 ## ... ... @@ -135,26 +135,14 @@ 135 135 $itemNo 136 136 #if( $oneStatus ) 137 137 #if( $itemNo == 1 ) 138 - $services.localization.render('work').toLowerCase() 139 - <span class="textsecondary"> / </span> 140 140 $services.localization.render("${objectSpace}.${objectClass}_status_${statusList[0]}").toLowerCase() 141 141 #else 142 - $services.localization.render('works').toLowerCase() 143 - <span class="textsecondary"> / </span> 144 - $services.localization.render("${objectSpace}.${objectClass}_status_${statusList[0]}_plural").toLowerCase() #end 139 +$services.localization.render("${objectSpace}.${objectClass}_status_${statusList[0]}_plural").toLowerCase() #end 145 145 #else 146 146 #if( $itemNo == 1 ) 147 - #if( $showPublished ) 148 - $services.localization.render('work').toLowerCase() 149 - #else 150 - $services.localization.render('yetunpublished_singular').toLowerCase() 151 - #end 142 + $services.localization.render('yetunpublished_singular').toLowerCase() 152 152 #else 153 - #if( $showPublished ) 154 - $services.localization.render('works').toLowerCase() 155 - #else 156 - $services.localization.render('yetunpublished').toLowerCase() 157 - #end 144 + $services.localization.render('yetunpublished').toLowerCase() 158 158 #end 159 159 #end 160 160 #if( $oneUser ) ... ... @@ -204,11 +204,12 @@ 204 204 #if( $showInline && !$showBibtex ) 205 205 <ul> 206 206 #foreach( $item in $itemMap[$status] ) 207 - <li>#pubperstatus($item)</li> 194 + <li>#publinked($item)</li> 195 +## <li>#pubperstatus($item)</li> 208 208 #end 209 209 </ul> 210 210 #else 211 - #foreach( $item in $itemMap[$st atus] )199 + #foreach( $item in $itemMap[$sort] ) 212 212 #if( $showBibtex) 213 213 #if( $showInline ) 214 214 ((({{{ $xwiki.getDocument($item).getValue('bibtex') }}})))