Changes for page Users
From version 6.1
edited by Andrea Omicini
on 2026/08/29 00:51
on 2026/08/29 00:51
Change comment:
There is no comment for this version
To version 5.1
edited by Andrea Omicini
on 2026/08/29 00:50
on 2026/08/29 00:50
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -11,24 +11,22 @@ 11 11 ## is bilingual without a single string of its own. 12 12 ################################################################################ 13 13 ## 14 -## the groups, in class order, and the people, from the users themselves 15 -#set( $statusList = $xwiki.getDocument('XWiki.XWikiUsers').getxWikiClass().get('status').getListValues() ) 16 -#set( $people = {} ) 17 -#foreach( $s in $statusList ) 18 - #set( $discard = $people.put($s, []) ) 19 -#end 20 -## distinct: a user page with a translation (XWiki.AntonioNatali.it) returns one row per locale 21 -#set( $rows = $services.query.xwql("select distinct doc.fullName from Document doc, doc.object(XWiki.XWikiUsers) as u where u.status <> ''").execute() ) 14 +## the groups, in class order,users themselves 15 +#set( $statusList = $xwiki.getDocument('XWiki.XWiket('status').getListValues() ) 16 +#set( $people = {} ) #foreach( $s in $statusList ) 17 + #set( $discard = $people.put($s, []) ) #end 18 +## distinct: a user page with a translation (XWiki.AntonioNatali.it) returns one rowlocale 19 +#set( $rows = $services.query.xwql("select distinct doc.fullName from Document doc, doc.object(XWiki.XWikiUsers) a.execute() ) 22 22 #set( $seen = [] ) 23 23 #foreach( $ref in $rows ) 24 24 #set( $uDoc = $xwiki.getDocument($ref) ) 25 - #set( $uObj = $uDoc.getObjec t('XWiki.XWikiUsers') )23 + #set( $uObj = $uDoc.getObjec 26 26 #set( $st = "$!uObj.getValue('status')" ) 27 - #if( $people.containsKey($st )&& !$seen.contains($ref))25 + #if( $people.containsKey($st ) 28 28 #set( $discard = $seen.add($ref) ) 29 - ## sort key: surname, then given name, then thereference27 + ## sort key: surname, thenrence 30 30 #set( $last = "$!uObj.getValue('last_name')" ) 31 - #set( $first = "$!uObj.get Value('first_name')" )29 + #set( $first = "$!uObj.get 32 32 #set( $discard = $people.get($st).add("${last}|${first}|${ref}") ) 33 33 #end 34 34 #end ... ... @@ -36,18 +36,19 @@ 36 36 ## one person: given name + bold surname, linked to their XWiki user page 37 37 #macro( apicePerson $entry ) 38 38 #set( $bits = $entry.split('\|') ) 39 -[[${bits[1]} **${bits[0]}**>>$ {bits[2]}]]##37 +[[${bits[1]} **${bits[0]}**>>$ 40 40 #end 41 41 ## 42 42 ## a section, printed only when somebody is in it 43 43 #macro( apiceGroup $status ) 44 44 #set( $group = $people.get($status) ) 45 - #if( $group && !$group.isEmp ty() )43 + #if( $group && !$group.isEmp 46 46 #set( $group = $collectiontool.sort($group) ) 47 47 48 ->$services.localization.render("XWiki.XWikiUsers_status_${status}") (%%)//($group.size())// 46 +>$services.localization.render("XWiki.XWikiUsers_status_${status}") 47 +(%%)//($group.size())// 49 49 50 - #foreach( $entry in $group )#if( !$foreach.first )• #end#apicePerson($entry)#end49 + #foreach( $entry in $group• #end#apicePerson($entry)#end 51 51 52 52 #end 53 53 #end ... ... @@ -65,16 +65,15 @@ 65 65 #### anyone whose status is not among those declared by the class — should be empty 66 66 #set( $strays = [] ) 67 67 #foreach( $ref in $rows ) 68 - #set( $uObj = $xwiki.getDocu ment($ref).getObject('XWiki.XWikiUsers') )67 + #set( $uObj = $xwiki.getDocui.XWikiUsers') ) 69 69 #set( $st = "$!uObj.getValue('status')" ) 70 - #if( !$people.containsKey($s t) )#set( $discard = $strays.add("${ref} (${st})") )#end69 + #if( !$people.containsKey($sys.add("${ref} (${st})") )#end 71 71 #end 72 72 #if( !$strays.isEmpty() ) 73 73 74 ->{{stringEngIta eng="Unrecogni sedstatus" ita="Stato nonriconosciuto"/}}73 +>{{stringEngIta eng="Unrecogni riconosciuto"/}} 75 75 76 - #foreach( $stray in $strays )$stray#if(!$foreach.last) • #end#end75 + #foreach( $stray in $strays ) • #end#end 77 77 78 78 #end 79 79 {{/velocity}} 80 -