Wiki source code of AdministrationAddProject
Version 1.1 by Julien Fleury on 2020/12/19 00:26
Hide last authors
author | version | line-number | content |
---|---|---|---|
![]() |
1.1 | 1 | {{velocity}} |
2 | #set($discard = $services.localization.use('document', "$doc.wiki:TaskManager.TaskManagerTranslations")) | ||
3 | #if($hasAdmin) | ||
4 | #set($project = $request.project) | ||
5 | #if(!$stringtool.isBlank($project)) | ||
6 | #set($documentRef = $services.model.createDocumentReference($context.getDatabase(), 'TaskManager', $project)) | ||
7 | #set($document = $xwiki.getDocument($documentRef)) | ||
8 | #set($object = $document.getObject('TaskManager.ProjectClass', true)) | ||
9 | $object.set('project', "$project") | ||
10 | $document.save() | ||
11 | #end | ||
12 | |||
13 | {{html}} | ||
14 | <form class="xformInline" method="post"> | ||
15 | <label for="project">$services.localization.render('TaskManager.administration.addProject.label')</label> | ||
16 | <input id="project" name="project" type="text" size="20"/> | ||
17 | <span class="buttonwrapper"> | ||
18 | <button class="button" type="submit">$services.localization.render('TaskManager.administration.addProject.submit')</button> | ||
19 | </span> | ||
20 | </form> | ||
21 | {{/html}} | ||
22 | #set($columns = ['doc.name', 'doc.space', 'doc.date', 'doc.author', '_actions']) | ||
23 | #set($columnsProperties = { | ||
24 | 'doc.name' : { 'type' : 'text', 'size' : 30, 'link' : 'view', 'filterable' : false }, | ||
25 | 'doc.space' : { 'type' : 'text', 'link' : 'space', '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.ProjectClass' | ||
35 | }) | ||
36 | #livetable("projectTable" $columns $columnsProperties $options) | ||
37 | #else | ||
38 | {{info}}You need to be an Administrator{{/info}} | ||
39 | #end | ||
40 | {{/velocity}} |