Wiki source code of Add Status
Last modified by Julien Fleury on 2020/12/22 01:31
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | {{velocity}} | ||
2 | #set($discard = $services.localization.use('document', "$doc.wiki:TaskManager.TaskManagerTranslations")) | ||
3 | #if($hasAdmin) | ||
4 | #set($status = $request.status) | ||
5 | #if(!$stringtool.isBlank($status)) | ||
6 | #set($documentRef = $services.model.createDocumentReference($xcontext.getDatabase(), 'TaskManager', $status)) | ||
7 | #set($document = $xwiki.getDocument($documentRef)) | ||
8 | #set($discard = $document.setHidden(true)) | ||
9 | #set($object = $document.getObject('TaskManager.StatusClass', true)) | ||
10 | $object.set('status', "$status") | ||
11 | $document.save() | ||
12 | #end | ||
13 | |||
14 | {{html}} | ||
15 | <form class="xformInline" method="post"> | ||
16 | <label for="status">$services.localization.render('TaskManager.administration.addStatus.label')</label> | ||
17 | <input id="status" name="status" type="text" size="20"/> | ||
18 | <span class="buttonwrapper"> | ||
19 | <button class="button" type="submit">$services.localization.render('TaskManager.administration.addStatus.submit')</button> | ||
20 | </span> | ||
21 | </form> | ||
22 | {{/html}} | ||
23 | #set($columns = ['doc.name', 'doc.date', 'doc.author', '_actions']) | ||
24 | #set($columnsProperties = { | ||
25 | 'doc.name' : { 'displayName' : $services.localization.render('taskmanager.livetable.status'), 'type' : 'text' , 'size' : 30, 'link' : 'view', 'filterable' : false }, | ||
26 | 'doc.date' : { 'type' : 'date', 'filterable' : false }, | ||
27 | 'doc.author': { 'type' : 'text', 'link' : 'author', 'filterable' : false }, | ||
28 | '_actions' : { 'actions' : ['delete'] } | ||
29 | }) | ||
30 | #set($options = { | ||
31 | 'translationPrefix' : 'xe.index.', | ||
32 | 'rowCount' : 15, | ||
33 | 'description' : 'This table lists all the documents found on this wiki. The columns can be sorted and some can be filtered.', | ||
34 | 'className' : 'TaskManager.StatusClass', | ||
35 | 'queryFilters': ' ' | ||
36 | }) | ||
37 | #livetable("statusTable" $columns $columnsProperties $options) | ||
38 | #else | ||
39 | {{info}}You need to be an Administrator{{/info}} | ||
40 | #end | ||
41 | {{/velocity}} |