Show last authors
1 {{velocity}}
2 #macro(selectDocTemplate $txtClass $template $mode)
3 ##########################################
4 ## Макрос обеспечивает возможности по смене представления для документов. Параметры:
5 ## $txtClass - для какого класса делается переключение (docs/folders/sections)
6 ## $template - указатель шаблона (standart/mini)
7 ## $mode - указатель режима (view/inline) для класса docs
8 ##########################################
9 #if($template=="supermini")
10 #set($propsUse = ["Section", "Folder", "Num", "DateReg", "Content", "_attachments", "_actions"])
11 #elseif($template=="4meetings")
12 #set($propsUse = ["Section", "Folder", "Num", "DateTimeInit", "Place", "DateReg", "_attachments", "_actions"])
13 #elseif($template=="correspondence")
14 #set($propsUse = ["Section", "Folder", "Num", "NoRef", "DateInit", "DateReg", "Content", "Reference", "Copied", "_attachments", "Notes", "_actions"])
15 #elseif($template=="mini")
16 #set($propsUse = ["Section", "Folder", "Num", "DateReg", "Content", "_attachments", "Pages", "Notes", "_actions"])
17 #else
18 #set($propsUse = ["Section", "Folder", "Num", "NoRef", "DateReg", "DateInit", "Type", "Content", "Sender", "Recipient", "_attachments", "Pages", "Notes", "_actions"])
19 #end
20 ##########################################
21 #if($txtClass=="etvcCorrespondence2Code.DocsClass")
22 #set($obj = "")
23 #set($obj = $doc.getObject($txtClass))
24 #set($class = $obj.xWikiClass)
25 #foreach($propTxt in $propsUse)
26 #if($propTxt != "Section" && $propTxt != "Folder" && $propTxt != "Num" && $propTxt != "Pages" && $propTxt != "_attachments" && $propTxt != "_actions")
27 |=$msg.get($doc.displayPrettyName($propTxt)):|$doc.display($propTxt)
28 #end
29 #end
30 ##########################################
31 #elseif($txtClass=="etvcCorrespondence2Code.FoldersClass" || $txtClass=="etvcCorrespondence2Code.SectionsClass")
32 #if($txtClass=="etvcCorrespondence2Code.FoldersClass")
33 #set($extraParams="&Folder="+$doc.getFullName())
34 #set($selectedColumn="Num")
35 #set($viewFolder="hidden")
36 #elseif($txtClass=="etvcCorrespondence2Code.SectionsClass")
37 #set($extraParams="&Section="+$doc.getFullName())
38 #set($selectedColumn="DateReg")
39 #set($viewFolder="text")
40 #end
41 #set($columns = $propsUse)
42 #set($columnsProperties = {
43 "Section" : { "type" : "hidden", "html" : false, "filterable" : false, "sortable" : false, "size" : 3 },
44 "Folder" : { "type" : "$viewFolder", "html" : false, "filterable" : false, "sortable" : false, "size" : 3 },
45 "Num" : { "type" : "number", "html" : false, "filterable" : true, "sortable" : true, "size" : 2 },
46 "NoRef" : { "type" : "text", "link" : "view", "filterable" : true, "sortable" : true, "size" : 2 },
47 "DateReg" : { "type" : "date", "html" : false, "filterable" : true, "sortable" : true, "size" : 10 },
48 "DateInit" : { "type" : "date", "html" : false, "filterable" : true, "sortable" : true, "size" : 10 },
49 "DateTimeInit" : { "type" : "date", "html" : false, "filterable" : true, "sortable" : true, "size" : 20 },
50 "Content" : { "type" : "text", "link" : "view", "filterable" : true, "sortable" : true, "size" : 20 },
51 "Type" : { "type" : "text", "html" : false, "filterable" : false, "sortable" : true, "size" : 5 },
52 "Place" : { "type" : "text", "html" : false, "filterable" : false, "sortable" : true, "size" : 20 },
53 "Reference" : { "type" : "text", "html" : false, "filterable" : true, "sortable" : true, "size" : 5 },
54 "Sender" : { "type" : "text", "html" : false, "filterable" : false, "sortable" : true, "size" : 5 },
55 "Recipient" : { "type" : "text", "html" : false, "filterable" : false, "sortable" : true, "size" : 5 },
56 "Copied" : { "type" : "text", "html" : false, "filterable" : false, "sortable" : true, "size" : 5 },
57 "Notes" : { "type" : "text", "html" : false, "filterable" : true, "sortable" : true, "size" : 10 },
58 "Pages" : { "type" : "text", "html" : true, "filterable" : false, "sortable" : false, "size" : 15 },
59 "_attachments" : { "type" : "text", "html" : false, "filterable" : false, "sortable" : false, "size" : 15 },
60 "_actions" : { "actions": ["edit", "delete"]}
61 })
62 #set($options = {
63 "className" :"etvcCorrespondence2Code.DocsClass",
64 "resultPage" : "etvcCorrespondence2Code.DocsJSON",
65 "translationPrefix" : "corr.docs.livetable.",
66 "rowCount" : 30,
67 "pageSizeBounds" : [30,100,10],
68 "selectedColumn" : "$selectedColumn",
69 "defaultOrder" : "desc",
70 "extraParams" : "$extraParams"
71 })
72 #if($template=="supermini" || $template=="4meetings")
73 #livetable("docs2" $columns $columnsProperties $options)
74 #else
75 <div class="smallLivetableContainer"> #livetable("docs2" $columns $columnsProperties $options) </div>
76 #end
77 #end
78 #end
79 {{/velocity}}