Modifiche per il documento Utenti

Dalla versione 13.1
modificato da Andrea Omicini
il 2026/08/29 17:51
Cambia il commento: show every declared status, students and past members included
Alla versione 10.1
modificato da Andrea Omicini
il 2026/08/29 17:36
Cambia il commento: status recode: match the new lowercase values

Summary

Details

Page properties
Content
... ... @@ -14,11 +14,6 @@
14 14  ##
15 15  ## the groups, in class order, and the people, from the users themselves
16 16  #set( $statusList = $xwiki.getDocument('XWiki.XWikiUsers').getxWikiClass().get('status').getListValues() )
17 -## an optional ?status=<value> filter. The value is validated against the list the
18 -## class itself declares, so no status value is written down here: change the class
19 -## and both the grouping and the filter follow.
20 -#set( $wanted = "$!request.getParameter('status')" )
21 -#set( $known = ( $wanted == '' || $statusList.contains($wanted) ) )
22 22  #set( $people = {} )
23 23  #foreach( $s in $statusList )
24 24   #set( $discard = $people.put($s, []) )
... ... @@ -60,27 +60,16 @@
60 60   #end
61 61  #end
62 62  ##
63 -#if( !$known )
64 -#### the class does not declare this value — say so, and show what it does declare
65 ->{{stringEngIta eng="Unknown status" ita="Stato sconosciuto"/}}: **$escapetool.xml($wanted)**
66 -
67 - #foreach( $s in $statusList )[[$services.localization.render("XWiki.XWikiUsers_status_${s}")>>path:$doc.getURL('view', "status=${s}")]]#if( !$foreach.last ) • #end#end
68 -
69 -#elseif( $wanted != '' )
70 -#### ONE GROUP, ASKED FOR BY ?status= — students included, like any other value
71 - #if( $people.get($wanted).isEmpty() )
72 -
73 ->{{stringEngIta eng="Nobody has this status" ita="Nessuno ha questo stato"/}}
74 -
75 - #else
76 - #apiceGroup($wanted)
77 - #end
78 -#else
79 -#### EVERY GROUP THE CLASS DECLARES, in the class's own order
58 +#### CURRENT PEOPLE — every status except students and past members
80 80  #foreach( $s in $statusList )
81 - #apiceGroup($s)
60 + #if( $s != 'student' && $s != 'gone' )
61 + #apiceGroup($s)
62 + #end
82 82  #end
83 83  ##
65 +#### PAST MEMBERS
66 +#apiceGroup('gone')
67 +##
84 84  #### anyone whose status is not among those declared by the class — should be empty
85 85  #set( $strays = [] )
86 86  #foreach( $ref in $rows )
... ... @@ -95,6 +95,5 @@
95 95   #foreach( $stray in $strays )$stray#if( !$foreach.last ) • #end#end
96 96  
97 97  #end
98 -#end
99 99  {{/velocity}}
100 100