Modifiche per il documento Per stato
Dalla versione 86.11
modificato da Andrea Omicini
il 22/06/2023 12:53
il 22/06/2023 12:53
Cambia il commento:
Nessun commento per questa versione
Alla versione 92.1
modificato da Andrea Omicini
il 22/06/2023 13:10
il 22/06/2023 13:10
Cambia il commento:
Nessun commento per questa versione
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -31,9 +31,11 @@ 31 31 ## HANDLE INLINE / END 32 32 ## 33 33 ## HANDLE STATUS / START 34 +#template('apice_publications.vm') 34 34 ## $oneStatus false gets a list of statuses, true just one 35 35 #set( $oneStatus = false ) 36 36 #set( $showRejected = false ) 38 +#set( $showPublished = false ) 37 37 ## $statusList gets the list of statuses to be shown 38 38 #set( $statusList = $publicationStatuses ) 39 39 ## ... ... @@ -41,12 +41,18 @@ 41 41 #if( $statusPar.toLowerCase() == "all" ) 42 42 ## 'all' value gets all unpublished papers including "Rejected" ones 43 43 #set( $showRejected = true ) 44 -#else 45 - #if( $publicationStatuses.contains($statusPar) ) 46 - ## 'status' parameter is an admissible publication status value 47 - #set( $oneStatus = true ) 48 - #set( $statusList = [$statusPar] ) 49 - #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] ) 50 50 #end 51 51 ## 52 52 ## HANDLE STATUS / END ... ... @@ -105,16 +105,18 @@ 105 105 ## map & counter initialisation 106 106 #set( $itemMap = {} ) 107 107 #set( $itemNo = 0 ) 108 -## cycle over s orts116 +## cycle over statuses 109 109 #foreach( $status in $statusList ) 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 <> '${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" ) 112 - #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) ) 113 113 ## set counters 114 - #set( $itemStatusNo = $itemFound.size() ) 115 - #if( $itemStatusNo > 0 ) 116 - #set( $itemMap[$status] = $itemFound ) 117 - #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 118 118 #end 119 119 #end 120 120 ## ... ... @@ -143,8 +143,8 @@ 143 143 <div style="flex-grow: 1"> 144 144 </div> 145 145 <div"> 146 - <a class="basebutton" style="padding: .5em" href='$doc.getURL("view","bibtex=$showBibtex&inline=#if( $showInline )false#{else}true#end#if( $oneS ort )&status=${statusList[0]}#end#if( $apiceUser )&user=$userName#elseif( $oneUser )&name=$userFirstName&surname=$userLastName#end")'>#if( $showBibtex )#if( $showInline )formatted#{else}plain#end#else#if( $showInline )long#{else}short#end#end</a>147 - <a class="basebutton" style="padding: .5em" href='$doc.getURL("view","inline=$showInline&bibtex=#if( $showBibtex )false#{else}true#end#if( $oneS ort )&status=${statusList[0]}#end#if( $apiceUser )&user=$userName#elseif( $oneUser )&name=$userFirstName&surname=$userLastName#end")'>#if( $showBibtex )text#{else}bib#end</a>156 + <a class="basebutton" style="padding: .5em" href='$doc.getURL("view","bibtex=$showBibtex&inline=#if( $showInline )false#{else}true#end#if( $oneStatus )&status=${statusList[0]}#end#if( $apiceUser )&user=$userName#elseif( $oneUser )&name=$userFirstName&surname=$userLastName#end")'>#if( $showBibtex )#if( $showInline )formatted#{else}plain#end#else#if( $showInline )long#{else}short#end#end</a> 157 + <a class="basebutton" style="padding: .5em" href='$doc.getURL("view","inline=$showInline&bibtex=#if( $showBibtex )false#{else}true#end#if( $oneStatus )&status=${statusList[0]}#end#if( $apiceUser )&user=$userName#elseif( $oneUser )&name=$userFirstName&surname=$userLastName#end")'>#if( $showBibtex )text#{else}bib#end</a> 148 148 </div> 149 149 </div> 150 150 ## stop if no pubs are found ... ... @@ -155,7 +155,7 @@ 155 155 ## some pubs found 156 156 ## page index 157 157 #if( $itemMap.keySet().size() > 1 ) 158 -## found more than one s ort168 +## found more than one status 159 159 <div class="mainselectbar" id="index"> 160 160 #foreach( $status in $itemMap.keySet() ) 161 161 #if( !$foreach.first ) ... ... @@ -166,14 +166,51 @@ 166 166 </div> 167 167 #end 168 168 ## 169 -## pubs displayed per year 170 -#foreach( $status in $pubMap.keySet() ) 171 -(% style="border-style:solid hidden hidden solid; border-color:$theme.borderColor; text-align:left; font-style:oblique" %)|{{id name='$status'/}}[[{{pubStatus uppercase='false' plural='true'}}$status{{/pubStatus}}>>$doc.name||queryString='status=$status#if( $oneUser )#if( $apiceUser )&user=$userName#{else}&name=$userFirstName&surname=$userLastName#end#end']] 172 - #foreach( $pub in $pubMap[$status] ) 173 -(% style="border-style:hidden hidden hidden hidden" %)|{{pub inline='false' linked='title'}}$pub{{/pub}} 179 +#template('apice_publication_macros.vm') 180 +## 181 +#foreach( $status in $itemMap.keySet() ) 182 +## status top / start 183 +<div class="mainselectseparator"> 184 + <a class="mainselectseparatorlink" id="$status" href=$xwiki.getURL($doc,"view","status=$status#if( $apiceUser )&user=$userName#elseif( $oneUser )&name=$userFirstName&surname=$userLastName#end")> 185 + $services.localization.render("${objectSpace}.${objectClass}_status_${status}_plural").toLowerCase() 186 + </a> 187 +</div> 188 +## status top / end 189 +## 190 +## status display / start 191 +<div> 192 + #if( $showInline && !$showBibtex ) 193 + <ul> 194 + #foreach( $item in $itemMap[$status] ) 195 + <li>#publinked($item)</li> 196 +## <li>#pubperstatus($item)</li> 197 + #end 198 + </ul> 199 + #else 200 + #foreach( $item in $itemMap[$sort] ) 201 + #if( $showBibtex) 202 + #if( $showInline ) 203 + ((({{{ $xwiki.getDocument($item).getValue('bibtex') }}}))) 204 + #else 205 + ((({{code language="bibtex"}}$xwiki.getDocument($item).getValue('bibtex'){{/code}}))) 206 + #end 207 + #else 208 + <div style="border-style:hidden hidden hidden hidden; font-size:smaller; line-height: 1.25em; margin-bottom: .5em"> 209 + #pubauthed($item)<br/> 210 + #pubtitle($item)<br/> 211 + <span class="textsecondary">(#pubstatus($item))</span> {{pubVenue linked="false"}}$item{{/pubVenue}} 212 + </div> 213 + #end 214 + #end 174 174 #end 175 - #set( $pubStatusNo = $pubMap[$status].size() ) 176 -(% style="border-style:hidden solid solid hidden; border-color:$theme.borderColor; text-align:right; font-style:oblique; font-size:smaller" %)|($pubStatusNo #if( $pubStatusNo == 1 ){{stringEngIta eng='publication' ita='pubblicazione'/}} {{pubStatus uppercase='false' plural='false'}}$status{{/pubStatus}}#{else}{{stringEngIta eng='publications' ita='pubblicazioni'/}} {{pubStatus uppercase='false' plural='true'}}$status{{/pubStatus}}#end) [[[{{stringEngIta eng='top' ita='in cima'/}}]>>||anchor="top"]] [[[{{stringEngIta eng='bottom' ita='in fondo'/}}]>>||anchor="bottom"]] 216 +</div> 217 +## status display / end 218 +## 219 +## status bottom / start 220 +<div #if( $foreach.last )id="bottom"#end class="mainselectbottom"> 221 + #set( $itemStatusNo = $itemMap[$status].size() ) 222 +$itemStatusNo #if( $itemStatusNo == 1 )$services.localization.render("${objectSpace}.${objectClass}_status_${status}").toLowerCase()#{else}$services.localization.render("${objectSpace}.${objectClass}_status_${status}_plural").toLowerCase()#end • [[{{stringEngIta eng='top' ita='in cima'/}}>>||anchor="top"]] • [[{{stringEngIta eng='index' ita='indice'/}}>>||anchor="index"]] • [[{{stringEngIta eng='bottom' ita='in fondo'/}}>>||anchor="bottom"]] 223 +</div> 177 177 ## status bottom / end 178 178 #end 179 179 {{/html}}