Wiki source code of SectionsClassSheet
Last modified by Eugen Colesnicov on 2013/03/24 06:00
Hide last authors
author | version | line-number | content |
---|---|---|---|
1.1 | 1 | {{velocity}} | |
2 | {{html wiki="true"}} | ||
3 | #includeForm("etvcCorrespondence2Code.SelectingDocsTemplate") | ||
4 | #set($docextras = []) | ||
5 | $xwiki.ssx.use("etvcCorrespondence2Code.AboutSheet") | ||
6 | |||
7 | #set($l1=$doc.display("PParent")) | ||
8 | #set($l2=$doc.display("Parent")) | ||
9 | #set($l3=$doc.display("NameFull")) | ||
10 | |||
11 | #if ($context.action == "view") | ||
12 | == [[$doc.display("Index") - $l3>>$doc.getFullName()]] == | ||
13 | |||
14 | #if($l1!="" || $l2!="") | ||
15 | |**$msg.get("corr.sections.caption.hierarchy"):**|=((( | ||
16 | #if ($l1!="") | ||
17 | $l1<BR> | ||
18 | #end | ||
19 | #if ($l2!="") | ||
20 | $l2<BR> | ||
21 | #end | ||
22 | $l3 | ||
23 | ))) | ||
24 | |||
25 | #end | ||
26 | |||
27 | #set ($cur = $doc.getFullName()) | ||
28 | #set($docSpace=$doc.getSpace()) | ||
29 | #set($showActivity=false) | ||
30 | #set($class="etvcCorrespondence2Code.SectionsClass") | ||
31 | #set($template="etvcCorrespondence2Code.SectionsClassTemplate") | ||
32 | #set($xwlquery="from doc.object($class) as obj where doc.fullName <> '$template' and doc.space='$docSpace' order by obj.Index") | ||
33 | #set($list=$services.query.xwql($xwlquery).execute()) | ||
34 | #foreach($item in $list) | ||
35 | #if($foreach.count==1) | ||
36 | #if($foreach.hasNext==false) #set($showActivity=true) #end | ||
37 | #break | ||
38 | #end | ||
39 | #end | ||
40 | #if($showActivity==true) | ||
41 | #set($useActivity=$xwiki.getDocument($doc.getParent()).getObject("etvcCorrespondence2Code.GroupSectionsClass").getProperty('UseHistory').getValue()) | ||
42 | #if($useActivity!=1) #set($showActivity=false) #end | ||
43 | #end | ||
44 | |||
45 | #if($showActivity==true) | ||
46 | {{tabs idsToLabels="tabId11=$msg.get("corr.sections.caption.tab1"), tabId12=$msg.get("corr.sections.caption.tab2"), tabId13=$msg.get("corr.sections.caption.tab3")"/}} | ||
47 | #else | ||
48 | {{tabs idsToLabels="tabId11=$msg.get("corr.sections.caption.tab1"), tabId12=$msg.get("corr.sections.caption.tab2")"/}} | ||
49 | #end | ||
50 | (% id="tabId11" %)((( | ||
51 | |||
52 | #set($columns = [ | ||
53 | "Num", | ||
54 | "Index", | ||
55 | "Title", | ||
56 | "Term", | ||
57 | "Notes", | ||
58 | "Link", | ||
59 | "Section", | ||
60 | "_actions" | ||
61 | ]) | ||
62 | #set($columnsProperties = { | ||
63 | "Num" : { "type" : "hidden" }, | ||
64 | "Index" : { "type" : "text" , "link" : "view" }, | ||
65 | "Title" : { "type" : "text" , "link" : "view" }, | ||
66 | "Term" : { "type" : "text" }, | ||
67 | "Notes" : { "type" : "text" }, | ||
68 | "Link" : { "type" : "hidden" }, | ||
69 | "Section" : { "type" : "hidden", "filterable": false, "sortable": false}, | ||
70 | "_actions" : { "actions": ["edit","delete"]} | ||
71 | }) | ||
72 | ###set($tf1 = '<input type="hidden" title="FilterSection" size="${colprop.size}" name="Section" id="1" value="') | ||
73 | ###set($tf2 = '" />') | ||
74 | ###set($tf = "$tf1$cur$tf2") | ||
75 | #set($options = { | ||
76 | "className" : "etvcCorrespondence2Code.FoldersClass", | ||
77 | "translationPrefix" : "corr.folders.livetable.", | ||
78 | "rowCount" : 50, | ||
79 | "defaultOrder" : "asc", | ||
80 | "extraParams" : "&Section=$cur" | ||
81 | }) | ||
82 | #livetable("folders" $columns $columnsProperties $options) | ||
83 | )))(% id="tabId12" %)((( | ||
84 | |||
85 | #selectDocTemplate("etvcCorrespondence2Code.SectionsClass" $doc.display("DocTemplate", "view") $context.action) | ||
86 | |||
87 | #if($showActivity==true) | ||
88 | |||
89 | )))(% id="tabId13" %)((( | ||
90 | {{activity spaces="$doc.space" /}} | ||
91 | #end | ||
92 | |||
93 | ))) | ||
94 | |||
95 | #elseif ($context.action == "inline") | ||
96 | #set($class = $doc.getObject('etvcCorrespondence2Code.SectionsClass').xWikiClass) | ||
97 | #set($obj = "") | ||
98 | #set($obj = $doc.getObject("etvcCorrespondence2Code.SectionsClass")) | ||
99 | #set($class = $obj.xWikiClass) | ||
100 | #set($suff=":") | ||
101 | <table> | ||
102 | #foreach($prop in $class.properties) | ||
103 | #set($desc=$prop.prettyName) | ||
104 | #set($field=$prop.getName()) | ||
105 | <tr> | ||
106 | <td class="label"><label>$msg.get($desc)$suff</label></td> | ||
107 | <td>$doc.display($field)</td> | ||
108 | </tr> | ||
109 | #end | ||
110 | #end | ||
111 | |||
112 | {{/velocity}} |