Changes for page Per Status
From version 72.1
edited by Andrea Omicini
on 02/01/2023 23:55
on 02/01/2023 23:55
Change comment:
There is no comment for this version
To version 68.1
edited by Andrea Omicini
on 31/12/2022 02:23
on 31/12/2022 02:23
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -9,7 +9,7 @@ 9 9 #set( $firstNamePar = $request.name.trim() ) 10 10 #set( $lastNamePar = $request.surname.trim() ) 11 11 ## which status 12 -#set( 12 +#set($statusPar = $request.status.trim()) 13 13 ## 14 14 #### handle who 15 15 #if( $userName ) ... ... @@ -61,7 +61,7 @@ 61 61 #set( $userString = "%$userFirstName $userLastName%" ) 62 62 #end 63 63 #else 64 - #set( $userString = " %%" )64 + #set( $userString = "" ) 65 65 #end 66 66 ## 67 67 #### handle status ... ... @@ -68,17 +68,16 @@ 68 68 ## $oneStatus false gets a list of statuses, true just one 69 69 #set( $oneStatus = false ) 70 70 ## $statusList gets the list of statuses to be shown 71 -#set( $statusList = [] ) 72 72 ## default: all unpublished papers except Rejected ones 73 -#set( $ discard= $statusList.addAll($unpublishedStatuses))72 +#set( $statusList = $statusRangeUnpublished ) 74 74 #if( $statusPar.toLowerCase() == "all" ) 75 75 ## 'all' value gets all unpublished papers including "Rejected" ones 76 - #set( discard= $statusList.add("rejected"))75 + #set($statusList = $statusRangeUnpublishedFull) 77 77 #else 78 - #if( $ allStatusesPlus.contains($statusPar) )77 + #if( $statusRangeFull.contains($statusPar) ) 79 79 ## 'status' parameter is an admissible publication status value 80 - #set( 81 - #set( 79 + #set($oneStatus = true) 80 + #set($statusList = [$statusPar]) 82 82 #end 83 83 #end 84 84 ## ... ... @@ -99,13 +99,13 @@ 99 99 ## 100 100 #foreach( $status in $statusList ) 101 101 #set( $from = ", BaseObject as obj, LargeStringProperty as prop0, LargeStringProperty as prop1, StringProperty as prop2" ) 102 - #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 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'" )101 + #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 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'" ) 103 103 #set( $sql = $from + " where " + $where ) 104 104 #set( $pubFound = $xwiki.searchDocuments($sql) ) 105 105 #set( $pubStatusNo = $pubFound.size() ) 106 106 #if( $pubStatusNo > 0 ) 107 107 #if( !$oneStatus ) 108 -(% style="border-style:solid hidden hidden solid; border-color:$theme.borderColor; text-align:left; font-style:oblique" %)|{{id name='$sort'/}}{{pubStatus plural='true' uppercase=' false'}}$status{{/pubStatus}}{{id name="$status"/}}107 +(% style="border-style:solid hidden hidden solid; border-color:$theme.borderColor; text-align:left; font-style:oblique" %)|{{id name='$sort'/}}{{pubStatus plural='true' uppercase='true'}}$status{{/pubStatus}}{{id name="$status"/}} 109 109 #end 110 110 #foreach( $pub in $pubFound )#if( $xwiki.exists($pub) )#set( $pubDoc = $xwiki.getDocument($pub) )#if( $pubDoc.getObject("${objectSpace}.${objectClass}") )## handling visibility at show time 111 111 |{{pub inline='false' linked='title'}}$pub{{/pub}}