Changes for page Users

From version 9.1
edited by Andrea Omicini
on 2026/08/29 01:11
Change comment: There is no comment for this version
To version 4.1
edited by Andrea Omicini
on 2026/08/29 00:47
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -5,8 +5,7 @@
5 5  ## Nothing is hand-maintained here: the groups are the values declared by
6 6  ## XWiki.XWikiUsers.status, in the class's own order, and every user carrying a
7 7  ## status appears in exactly one of them. Add a status to the class and it shows
8 -## up here; change someone's status and they move. Disabled accounts (active = 0)
9 -## are left out.
8 +## up here; change someone's status and they move.
10 10  ##
11 11  ## Headings use the translation keys XWiki.XWikiUsers_status_<value>, so the page
12 12  ## is bilingual without a single string of its own.
... ... @@ -18,17 +18,12 @@
18 18  #foreach( $s in $statusList )
19 19   #set( $discard = $people.put($s, []) )
20 20  #end
21 -## distinct: a user page with a translation (XWiki.AntonioNatali.it) returns one row per locale
22 -#set( $rows = $services.query.xwql("select distinct doc.fullName from Document doc, doc.object(XWiki.XWikiUsers) as u where u.status <> ''").execute() )
23 -#set( $seen = [] )
20 +#set( $rows = $services.query.xwql("from doc.object(XWiki.XWikiUsers) as u where u.status <> ''").execute() )
24 24  #foreach( $ref in $rows )
25 25   #set( $uDoc = $xwiki.getDocument($ref) )
26 26   #set( $uObj = $uDoc.getObject('XWiki.XWikiUsers') )
27 27   #set( $st = "$!uObj.getValue('status')" )
28 - ## `active` is unset on most user objects, so only an explicit 0 counts as disabled
29 - #set( $isActive = ("$!uObj.getValue('active')" != '0') )
30 - #if( $people.containsKey($st) && $isActive && !$seen.contains($ref) )
31 - #set( $discard = $seen.add($ref) )
25 + #if( $people.containsKey($st) )
32 32   ## sort key: surname, then given name, then the reference
33 33   #set( $last = "$!uObj.getValue('last_name')" )
34 34   #set( $first = "$!uObj.getValue('first_name')" )
... ... @@ -36,10 +36,14 @@
36 36   #end
37 37  #end
38 38  ##
39 -## one person: given name + bold surname, linked to their XWiki user page
33 +## one person: given name + bold surname, linked to the personal space when there is one
40 40  #macro( apicePerson $entry )
41 41   #set( $bits = $entry.split('\|') )
42 -[[${bits[1]} **${bits[0]}**>>${bits[2]}]]##
36 + #set( $pDoc = $xwiki.getDocument($bits[2]) )
37 + #set( $pObj = $pDoc.getObject('XWiki.XWikiUsers') )
38 + #set( $space = "$!pObj.getValue('personalWiki')" )
39 + #if( $space != '' && $xwiki.exists("${space}.WebHome") )#set( $target = "${space}.WebHome" )#else#set( $target = $bits[2] )#end
40 +[[${bits[1]} **${bits[0]}**>>${target}]]##
43 43  #end
44 44  ##
45 45  ## a section, printed only when somebody is in it
... ... @@ -48,7 +48,7 @@
48 48   #if( $group && !$group.isEmpty() )
49 49   #set( $group = $collectiontool.sort($group) )
50 50  
51 ->$services.localization.render("XWiki.XWikiUsers_status_${status}")
49 +>$services.localization.render("XWiki.XWikiUsers_status_${status}") (%%)//($group.size())//
52 52  
53 53   #foreach( $entry in $group )#if( !$foreach.first ) • #end#apicePerson($entry)#end
54 54  
... ... @@ -62,6 +62,9 @@
62 62   #end
63 63  #end
64 64  ##
63 +#### STUDENTS
64 +#apiceGroup('Student')
65 +##
65 65  #### PAST MEMBERS
66 66  #apiceGroup('Gone')
67 67  ##
... ... @@ -80,4 +80,3 @@
80 80  
81 81  #end
82 82  {{/velocity}}
83 -