Änderungen von Dokument Contributors
Zuletzt geändert von xwikiadmin am 2025/01/07 12:27
Von Version 1.1
bearbeitet von xwikiadmin
am 2024/06/24 15:04
am 2024/06/24 15:04
Änderungskommentar:
Install extension [com.xwiki.pro:xwiki-pro-macros-ui/1.19.4]
Auf Version 2.1
bearbeitet von xwikiadmin
am 2025/01/07 12:27
am 2025/01/07 12:27
Änderungskommentar:
Install extension [com.xwiki.pro:xwiki-pro-macros-ui/1.25.4]
Zusammenfassung
-
Objekte (1 geändert, 0 hinzugefügt, 0 gelöscht)
Details
- XWiki.WikiMacroClass[0]
-
- Makro-Code
-
... ... @@ -28,8 +28,8 @@ 28 28 <span class="contributor-last-contribution-date">($xwiki.formatDate($contribution['update']))</span> 29 29 #end 30 30 #end 31 -#macro (addContributions $query $page) 32 - #foreach($r in $query.bindValue('d', $page).execute()) 31 +#macro (addContributions $query $pages) 32 + #foreach($r in $query.bindValue('d', $pages).execute()) 33 33 #set($c = $contributors[$r[0]]) 34 34 #if (!$c) 35 35 #set($contributors[$r[0]] = {"name": $r[0], "update": $r[1], "count": $r[2]}) ... ... @@ -93,7 +93,7 @@ 93 93 #else 94 94 #set($pages = $services.query.hql("select distinct doc.fullName from XWikiDocument doc where doc.space in :spaces and doc.fullName not like '%.WebPreferences' $hqlHiddenFilter $hqlOrder").bindValue('spaces', $spaces).execute()) 95 95 #end 96 - #elseif ($scope == "descendents") 96 + #elseif ($scope == "descendents" || $scope == "descendants") 97 97 #set($pages = []) 98 98 #if ($global) 99 99 #set($pages = $services.query.xwql("select distinct doc.fullName from Document doc where doc.fullName not like '%.WebPreferences' $hqlHiddenFilter $hqlOrder").execute()) ... ... @@ -103,22 +103,18 @@ 103 103 #end 104 104 #end 105 105 #else 106 + FALLBACK 106 106 #set($pages = [$page]) 107 107 #end 108 108 #set($contributors = {}) 109 - #foreach ($page in $pages) 110 - #set($d = $xwiki.getDocument($page)) 111 - #if (!$d.isNew()) 112 - #if ($include.contains('authors')) 113 - #set($query = $services.query.hql("select rcs.author, max(rcs.date), 1 from XWikiDocument doc, XWikiRCSNodeInfo rcs where doc.fullName = :d and doc.id = rcs.id.docId group by rcs.author")) 114 - #addContributions($query, $page) 115 - #end 116 - #if ($include.contains('comments')) 117 - #set($query = $services.query.xwql("select comment.author, max(comment.date), count(distinct comment) from Document doc, doc.object('XWiki.XWikiComments') comment where doc.fullName = :d group by comment.author")) 118 - #addContributions($query, $page) 119 - #end 120 - #end 110 + #if ($include.contains('authors')) 111 + #set($query = $services.query.hql("select rcs.author, max(rcs.date), 1 from XWikiDocument doc, XWikiRCSNodeInfo rcs where doc.fullName in (:d) and doc.id = rcs.id.docId group by rcs.author")) 112 + #addContributions($query, $pages) 121 121 #end 114 + #if ($include.contains('comments')) 115 + #set($query = $services.query.xwql("select comment.author, max(comment.date), count(distinct comment) from Document doc, doc.object('XWiki.XWikiComments') comment where doc.fullName in (:d) group by comment.author")) 116 + #addContributions($query, $pages) 117 + #end 122 122 #set($contributions = $xcontext.get('sortContributions').doCall($contributors.values(), $order, $reverse)) 123 123 124 124 {{html clean=false}}