Modifiche per il documento Per stato
Dalla versione 90.1
modificato da Andrea Omicini
il 22/06/2023 13:01
il 22/06/2023 13:01
Cambia il commento:
Nessun commento per questa versione
Alla versione 95.1
modificato da Andrea Omicini
il 22/06/2023 15:15
il 22/06/2023 15:15
Cambia il commento:
Nessun commento per questa versione
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -35,6 +35,7 @@ 35 35 ## $oneStatus false gets a list of statuses, true just one 36 36 #set( $oneStatus = false ) 37 37 #set( $showRejected = false ) 38 +#set( $showPublished = false ) 38 38 ## $statusList gets the list of statuses to be shown 39 39 #set( $statusList = $publicationStatuses ) 40 40 ## ... ... @@ -42,12 +42,18 @@ 42 42 #if( $statusPar.toLowerCase() == "all" ) 43 43 ## 'all' value gets all unpublished papers including "Rejected" ones 44 44 #set( $showRejected = true ) 45 -#else 46 - #if( $publicationStatuses.contains($statusPar) ) 47 - ## 'status' parameter is an admissible publication status value 48 - #set( $oneStatus = true ) 49 - #set( $statusList = [$statusPar] ) 50 - #end 46 +#elseif( $statusPar.toLowerCase() == "published" ) 47 + #set( $oneStatus = true ) 48 + #set( $statusList = ["published"] ) 49 + #set( $showPublished = true ) 50 +#elseif( $statusPar.toLowerCase() == "rejected" ) 51 + #set( $oneStatus = true ) 52 + #set( $statusList = ["rejected"] ) 53 + #set( $showRejected = true ) 54 +#elseif( $publicationStatuses.contains($statusPar) ) 55 +## 'status' parameter is an admissible publication status value 56 + #set( $oneStatus = true ) 57 + #set( $statusList = [$statusPar] ) 51 51 #end 52 52 ## 53 53 ## HANDLE STATUS / END ... ... @@ -108,17 +108,18 @@ 108 108 #set( $itemNo = 0 ) 109 109 ## cycle over statuses 110 110 #foreach( $status in $statusList ) 111 - #set( $query = ", BaseObject as obj, #if( $oneUser ) LargeStringProperty as propAuthor, LargeStringProperty as propEditor, #end StringProperty as propStatus #if( !$hasEdit ), StringProperty as propAccess #end 112 - 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" ) 113 - #set( $itemFound = $xwiki.searchDocuments($query) ) 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) ) 114 114 ## set counters 115 - #set( $itemStatusNo = $itemFound.size() ) 116 - #if( $itemStatusNo > 0 ) 117 - #set( $itemMap[$status] = $itemFound ) 118 - #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 119 119 #end 120 120 #end 121 -$itemStatusNo 122 122 ## 123 123 ## output results 124 124 ## page subtitle ... ... @@ -127,14 +127,26 @@ 127 127 $itemNo 128 128 #if( $oneStatus ) 129 129 #if( $itemNo == 1 ) 138 + $services.localization.render('work').toLowerCase() 139 + <span class="textsecondary"> / </span> 130 130 $services.localization.render("${objectSpace}.${objectClass}_status_${statusList[0]}").toLowerCase() 131 131 #else 132 -$services.localization.render("${objectSpace}.${objectClass}_status_${statusList[0]}_plural").toLowerCase() #end 142 + $services.localization.render('works').toLowerCase() 143 + <span class="textsecondary"> / </span> 144 + $services.localization.render("${objectSpace}.${objectClass}_status_${statusList[0]}_plural").toLowerCase() #end 133 133 #else 134 134 #if( $itemNo == 1 ) 135 - $services.localization.render('yetunpublished_singular').toLowerCase() 147 + #if( $showPublished ) 148 + $services.localization.render('work').toLowerCase() 149 + #else 150 + $services.localization.render('yetunpublished_singular').toLowerCase() 151 + #end 136 136 #else 137 - $services.localization.render('yetunpublished').toLowerCase() 153 + #if( $showPublished ) 154 + $services.localization.render('works').toLowerCase() 155 + #else 156 + $services.localization.render('yetunpublished').toLowerCase() 157 + #end 138 138 #end 139 139 #end 140 140 #if( $oneUser ) ... ... @@ -184,12 +184,11 @@ 184 184 #if( $showInline && !$showBibtex ) 185 185 <ul> 186 186 #foreach( $item in $itemMap[$status] ) 187 - <li>#publinked($item)</li> 188 -## <li>#pubperstatus($item)</li> 207 + <li>#pubperstatus($item)</li> 189 189 #end 190 190 </ul> 191 191 #else 192 - #foreach( $item in $itemMap[$s ort] )211 + #foreach( $item in $itemMap[$status] ) 193 193 #if( $showBibtex) 194 194 #if( $showInline ) 195 195 ((({{{ $xwiki.getDocument($item).getValue('bibtex') }}})))