Changes for page Contributors
Last modified by Yana Oksner on 2026/01/08 11:01
From version 4.1
edited by Yana Oksner
on 2024/12/03 16:51
on 2024/12/03 16:51
Change comment:
Install extension [com.xwiki.pro:xwiki-pro-macros-ui/1.25.1]
To version 1.1
edited by Yana Oksner
on 2023/11/30 14:52
on 2023/11/30 14:52
Change comment:
Install extension [com.xwiki.pro:xwiki-pro-macros/1.14.0]
Summary
-
Page properties (2 modified, 0 added, 0 removed)
-
Objects (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Parent
-
... ... @@ -1,1 +1,1 @@ 1 -WebHome 1 +Confluence.Macros.WebHome - Content
-
... ... @@ -24,7 +24,7 @@ 24 24 ))) 25 25 |showCount|Show count|false|Show the contribution count for each user. 26 26 |showLastTime|Show last time|false|Show the last contribution time for each user. 27 -|page|Page|current|The page for which to list the contributions. If both page and space are empty, the current page is used. 27 +|page|Page|current|The page for which to list the contributions. If both page and space are empty, the current page is used. 28 28 |spaces|Spaces|current|((( 29 29 Space(s) containing the page specified in the page parameter, or the space(s) to search. Several spaces can be specified using commas. 30 30
- XWiki.WikiMacroClass[0]
-
- Macro 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 s)32 - #foreach($r in $query.bindValue('d', $page s).execute())31 +#macro (addContributions $query $page) 32 + #foreach($r in $query.bindValue('d', $page).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" || $scope == "descendants")96 + #elseif ($scope == "descendents") 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,18 +103,22 @@ 103 103 #end 104 104 #end 105 105 #else 106 - FALLBACK 107 107 #set($pages = [$page]) 108 108 #end 109 109 #set($contributors = {}) 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) 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 113 113 #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 118 118 #set($contributions = $xcontext.get('sortContributions').doCall($contributors.values(), $order, $reverse)) 119 119 120 120 {{html clean=false}} ... ... @@ -168,12 +168,16 @@ 168 168 #end 169 169 {{/velocity}} 170 170 175 +{{include reference="Licenses.Code.VelocityMacros"/}} 176 + 171 171 {{velocity}} 172 172 ## We need to check if there is a valid license because the macro is registered even if the user doesn't have view right 173 173 ## on the macro definition page. See XWIKI-14828: Rendering macros defined in wiki pages are available to users that 174 174 ## don't have view right on those pages. 175 -#if ($services. promacrolicensing.hasLicensureForEntity($xcontext.macro.doc.documentReference))181 +#if ($services.licensing.licensor.hasLicensureForEntity($xcontext.macro.doc.documentReference)) 176 176 #executeMacro 177 177 #else 178 - {{missingLicenseMessage extensionName="proMacros.extension.name"/}} 184 + {{error}} 185 + #getMissingLicenseMessage('proMacros.extension.name') 186 + {{/error}} 179 179 #end