Depuis la version 1.1 >
modifié par superadmin
sur 2020/08/28 14:22
À la version < 3.1
modifié par superadmin
sur 2022/05/16 17:25
Commentaire de modification : Install extension [com.xwiki.licensing:application-licensing-licensor-ui/1.22.1]

Résumé

Détails

Icon Propriétés de la Page
Contenu
... ... @@ -9,7 +9,12 @@
9 9  
10 10  #macro (getPaidExtensions)
11 11   #set ($paidExtensionsByNamespace = $services.extension.installed.getBackwardDependencies($licensorId))
12 - #set ($paidExtensions = $collectionstool.set)
12 + ## CollectionsTool is deprecated since 12.1RC1.
13 + #if ($collectiontool)
14 + #set ($paidExtensions = $collectiontool.set)
15 + #else
16 + #set ($paidExtensions = $collectionstool.set)
17 + #end
13 13   #foreach ($paidExtensionsOnNamespace in $paidExtensionsByNamespace.values())
14 14   #set ($discard = $paidExtensions.addAll($paidExtensionsOnNamespace))
15 15   #end
... ... @@ -17,7 +17,12 @@
17 17  
18 18  #macro (getVisiblePaidExtensions)
19 19   #getPaidExtensions
20 - #set ($visiblePaidExtensions = $collectionstool.set)
25 + ## CollectionsTool is deprecated since 12.1RC1.
26 + #if ($collectiontool)
27 + #set ($visiblePaidExtensions = $collectiontool.set)
28 + #else
29 + #set ($visiblePaidExtensions = $collectionstool.set)
30 + #end
21 21   #foreach ($paidExtension in $paidExtensions)
22 22   ## Filter out the paid extensions that are dependencies of other paid extensions (because the license of a paid
23 23   ## extension should cover its paid dependencies).
... ... @@ -30,7 +30,12 @@
30 30  
31 31  #macro (isRequiredBy $installedExtension $extensions)
32 32   #set ($isRequiredBy = false)
33 - #set ($backwardDependencies = $collectionstool.queue)
43 + ## CollectionsTool is deprecated since 12.1RC1.
44 + #if ($collectiontool)
45 + #set ($backwardDependencies = $collectiontool.queue)
46 + #else
47 + #set ($backwardDependencies = $collectionstool.queue)
48 + #end
34 34   #addBackwardDependencies($installedExtension $backwardDependencies)
35 35   ## We can't iterate the queue while modifying it and we can't write a "while" loop in Velocity so we're forced to
36 36   ## rely on a range loop (limiting the number of backward dependencies that we analyze).
... ... @@ -50,7 +50,12 @@
50 50  #end
51 51  
52 52  #macro (addBackwardDependencies $installedExtension $backwardDependencies)
53 - #set ($backwardDependenciesSet = $collectionstool.set)
68 + ## CollectionsTool is deprecated since 12.1RC1.
69 + #if ($collectiontool)
70 + #set ($backwardDependenciesSet = $collectiontool.set)
71 + #else
72 + #set ($backwardDependenciesSet = $collectionstool.set)
73 + #end
54 54   #set ($discard = $backwardDependenciesSet.addAll($backwardDependencies))
55 55   #set ($backwardDependenciesByNamespace = $services.extension.installed.getBackwardDependencies($installedExtension.id))
56 56   #foreach ($backwardDependenciesOnNamespace in $backwardDependenciesByNamespace.values())
... ... @@ -142,6 +142,30 @@
142 142   data-button="$escapetool.xml($jsontool.serialize($jsonData))">$label</button>
143 143  #end
144 144  
165 +#macro (moreActionsButton $extensionId)
166 + #set ($licensingConfigDoc = $xwiki.getDocument('Licenses.Code.LicensingConfig'))
167 + #set ($autoUpgradesObj = $licensingConfigDoc.getObject('Licenses.Code.AutomaticUpgradesClass'))
168 + #set ($isAutoUpgrade = $autoUpgradesObj.getValue('allowlist').contains($extensionId))
169 + <div class="btn-group">
170 + <a class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false"
171 + title="$services.localization.render("licensor.moreActions")" role="button">
172 + <span class="fa fa-ellipsis-v"></span>
173 + </a>
174 + <ul class="dropdown-menu dropdown-left">
175 + <li class="dropdown-header">
176 + <form target="_blank" class="xform half">
177 + <input type="hidden" name="form_token" value="$!escapetool.xml($services.csrf.token)" />
178 + <input type="hidden" name="extensionId" value="$extensionId" />
179 + <input type="checkbox" name="autoUpgrade" #if ($isAutoUpgrade) checked #end />
180 + <label for="autoUpgrade">
181 + $services.localization.render("licensor.moreActions.autoUpgrade.allow")
182 + </label>
183 + </form>
184 + </li>
185 + </ul>
186 + </div>
187 +#end
188 +
145 145  #macro (getLicenseActions $license $extension $actions)
146 146   ## Use the JSON format in order to be parsable in JavaScript.
147 147   #set ($jsonData = {
... ... @@ -161,6 +161,7 @@
161 161   #elseif ($license.type == 'PAID')
162 162   #set ($discard = $actions.add("#licenseButton('PAID' 'success' 'extendPaid' $jsonData)"))
163 163   #end
208 + #set ($discard = $actions.add("#moreActionsButton($jsonData.featureId)"))
164 164  #end
165 165  
166 166  #macro (licenseActions $license $extension)
This wiki is licensed under a Creative Commons 2.0 license
XWiki 13.10 - Documentation - Conditions