Wiki source code of Macros
Last modified by Eugen Colesnicov on 2011/01/12 13:19
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | <style> | ||
2 | #includeInContext("TasksCode.Skin") | ||
3 | </style> | ||
4 | |||
5 | #includeMacros("GWT.GWTPropEditor") | ||
6 | |||
7 | ## macros | ||
8 | |||
9 | #macro(tasksbydoc $docName) | ||
10 | #foreach($taskDocName in $xwiki.searchDocuments(", BaseObject as obj, StringProperty as prop where doc.fullName=obj.name and obj.className='TasksCode.IssueClass' and obj.id=prop.id.id and prop.id.name='page' and prop.value='${docName}' order by doc.date desc")) | ||
11 | #set($taskdoc = $xwiki.getDocument($taskDocName)) | ||
12 | #set($ok = $taskdoc.use("TasksCode.IssueClass")) | ||
13 | <fieldset> | ||
14 | <legend class="fieldset">[$msg.its_task $taskdoc.display("id")>$taskDocName] - [$taskdoc.display("title")>$taskDocName]</legend> | ||
15 | * $msg.its_task_status : $taskdoc.display("status") | ||
16 | * $msg.its_task_assignee : $xwiki.getLocalUserName($taskdoc.display("assignee")) | ||
17 | |||
18 | $taskdoc.display("description") | ||
19 | </fieldset> | ||
20 | #end | ||
21 | #end | ||
22 | |||
23 | #macro(tasksbydocpanel $docName) | ||
24 | #set($pagetasks = $xwiki.searchDocuments(", BaseObject as obj, StringProperty as prop where doc.fullName=obj.name and obj.className='TasksCode.IssueClass' and obj.id=prop.id.id and prop.id.name='page' and prop.value='${docName}' order by doc.date desc")) | ||
25 | #if($pagetasks.size() > 0) | ||
26 | #foreach($taskDocName in $pagetasks) | ||
27 | #set($taskdoc = $xwiki.getDocument($taskDocName)) | ||
28 | #set($ok = $taskdoc.use("TasksCode.IssueClass")) | ||
29 | <div> | ||
30 | <span style="font-size: 1.2em;">[$msg.its_task $taskdoc.display("id","view")>$taskDocName] - [$taskdoc.display("title","view")>$taskDocName]</span> | ||
31 | * $msg.its_task_status : $taskdoc.display("status","view") | ||
32 | * $msg.its_task_assignee : $xwiki.getLocalUserName($taskdoc.display("assignee","view")) | ||
33 | </div> | ||
34 | #end | ||
35 | #else | ||
36 | $msg.its_pagetasks_notask | ||
37 | #end | ||
38 | #end | ||
39 | |||
40 | #macro(mytaskspanel) | ||
41 | #set($mytasks = $xwiki.searchDocuments(",BaseObject as obj, StringProperty as prop, StringProperty as statusprop where doc.fullName=obj.name and obj.className='TasksCode.IssueClass' and obj.id=prop.id.id and prop.id.name='assignee' and prop.value='${context.localUser}' and obj.id=statusprop.id.id and statusprop.id.name='status' and statusprop.value in ('new','open','reopened') order by doc.date desc", 5, 0)) | ||
42 | #if($mytasks.size() > 0) | ||
43 | #foreach($taskDocName in $mytasks) | ||
44 | #set($taskdoc = $xwiki.getDocument($taskDocName)) | ||
45 | #set($ok = $taskdoc.use("TasksCode.IssueClass")) | ||
46 | <div> | ||
47 | <span style="font-size: 1.2em;"> [$msg.its_task $taskdoc.display("id", "view")>$taskDocName] - [$taskdoc.display("title", "view")>$taskDocName] </span> | ||
48 | * $msg.its_task_status : $taskdoc.display("status", "view") | ||
49 | * $msg.its_task_assignee : $xwiki.getUserName($taskdoc.display("assignee", "view")) | ||
50 | </div> | ||
51 | #end | ||
52 | #else | ||
53 | $msg.its_mytasks_notask | ||
54 | #end | ||
55 | #end | ||
56 | |||
57 | #macro(mytasksbyspacepanel $space) | ||
58 | #foreach($taskDocName in $xwiki.searchDocuments(",BaseObject as obj, StringProperty as prop, StringProperty as statusprop where doc.fullName=obj.name and obj.className='TasksCode.IssueClass' and obj.id=prop.id.id and prop.id.name='assignee' and prop.value='${context.localUser}' and doc.web='${space}' and obj.id=statusprop.id.id and statusprop.id.name='status' and statusprop.value in ('new','open','reopened') order by doc.date desc")) | ||
59 | #set($taskdoc = $xwiki.getDocument($taskDocName)) | ||
60 | #set($ok = $taskdoc.use("TasksCode.IssueClass")) | ||
61 | <div style="margin: 5px;"> | ||
62 | <span style="font-size: 1.2em;"> [$msg.its_task $taskdoc.display("id", "view")>$taskDocName] - [$taskdoc.display("title", "view")>$taskDocName] </span> | ||
63 | * $msg.its_task_status : $taskdoc.display("status", "view") | ||
64 | * $msg.its_task_assignee : $xwiki.getUserName($taskdoc.display("assignee", "view")) | ||
65 | </div> | ||
66 | #end | ||
67 | #end | ||
68 | |||
69 | #macro(mytasks) | ||
70 | #tasksbyspace($context.localUser "") | ||
71 | #end | ||
72 | |||
73 | #macro(crmtasks $user) | ||
74 | #tasksbyspace($user "CRM") | ||
75 | #end | ||
76 | |||
77 | #macro(tasks $assignee) | ||
78 | #tasksbyspace($assignee "") | ||
79 | #end | ||
80 | |||
81 | #macro(tasksbyspace $assignee $space) | ||
82 | <table id="searchTableTasks" class="grid sortable filterable doOddEven" cellSpacing=0 cellpadding="0" border="1"> | ||
83 | <tr class="sortHeader"> | ||
84 | <th> $msg.its_task_id </th> | ||
85 | <th> $msg.its_task_title </th> | ||
86 | <th> $msg.its_task_assignee </th> | ||
87 | <th> $msg.its_task_status </th> | ||
88 | <th> $msg.its_task_severity </th> | ||
89 | </tr> | ||
90 | #if($space=="") | ||
91 | #set($sql = ",BaseObject as obj, StringProperty as prop, StringProperty as statusprop where doc.fullName=obj.name and obj.className='TasksCode.IssueClass' and obj.id=prop.id.id and prop.id.name='assignee' and prop.value='${assignee}' and obj.id=statusprop.id.id and statusprop.id.name='status' and statusprop.value in ('new','open','reopened') order by doc.date desc") | ||
92 | #else | ||
93 | #set($sql = ",BaseObject as obj, StringProperty as prop, StringProperty as statusprop where doc.fullName=obj.name and obj.className='TasksCode.IssueClass' and obj.id=prop.id.id and prop.id.name='assignee' and prop.value='${assignee}' and doc.web='${space}' and obj.id=statusprop.id.id and statusprop.id.name='status' and statusprop.value in ('new','open','reopened') order by doc.date desc") | ||
94 | #end | ||
95 | #foreach($taskDocName in $xwiki.searchDocuments($sql)) | ||
96 | #set($taskdoc = $xwiki.getDocument($taskDocName)) | ||
97 | #set($classname = "TasksCode.IssueClass") | ||
98 | #set($ok = $taskdoc.use("TasksCode.IssueClass")) | ||
99 | <tr> | ||
100 | <td> [$msg.its_task $taskdoc.display("id")>$taskDocName] </td> | ||
101 | <td> [$taskdoc.display("title")>$taskDocName] </td> | ||
102 | #display($taskdoc $classname "assignee" "") | ||
103 | #display($taskdoc $classname "status" "") | ||
104 | #display($taskdoc $classname "severity" "") | ||
105 | </tr> | ||
106 | #end | ||
107 | </table> | ||
108 | #end | ||
109 | |||
110 | #macro(myreportedtasks) | ||
111 | #reportedtasks($context.localUser) | ||
112 | #end | ||
113 | |||
114 | #macro(reportedtasks $reporter) | ||
115 | <table id="searchTableReportedTasks" class="grid sortable filterable doOddEven" cellSpacing=0 cellpadding="0" border="1"> | ||
116 | <tr class="sortHeader"> | ||
117 | <th> $msg.its_task_id </th> | ||
118 | <th> $msg.its_task_title </th> | ||
119 | <th> $msg.its_task_assignee </th> | ||
120 | <th> $msg.its_task_status </th> | ||
121 | <th> $msg.its_task_severity </th> | ||
122 | </tr> | ||
123 | #foreach($taskDocName in $xwiki.searchDocuments(",BaseObject as obj, StringProperty as prop where doc.fullName=obj.name and obj.className='TasksCode.IssueClass' and obj.id=prop.id.id and prop.id.name='reporter' and prop.value='${reporter}' order by doc.date desc")) | ||
124 | #set($taskdoc = $xwiki.getDocument($taskDocName)) | ||
125 | #set($classname = "TasksCode.IssueClass") | ||
126 | #set($ok = $taskdoc.use("TasksCode.IssueClass")) | ||
127 | <tr> | ||
128 | <td> [$msg.its_task $taskdoc.display("id")>$taskDocName] </td> | ||
129 | <td> [$taskdoc.display("title")>$taskDocName] </td> | ||
130 | #display($taskdoc $classname "assignee" "") | ||
131 | #display($taskdoc $classname "status" "") | ||
132 | #display($taskdoc $classname "severity" "") | ||
133 | </tr> | ||
134 | #end | ||
135 | </table> | ||
136 | #end | ||
137 | |||
138 | |||
139 | #macro(activetasks) | ||
140 | <table id="searchTableActiveTasks" class="grid sortable filterable doOddEven" cellSpacing=0 cellpadding="0" border="1"> | ||
141 | <tr class="sortHeader"> | ||
142 | <th> $msg.its_task_id </th> | ||
143 | <th> $msg.its_task_title </th> | ||
144 | <th> $msg.its_task_assignee </th> | ||
145 | <th> $msg.its_task_status </th> | ||
146 | <th> $msg.its_task_severity </th> | ||
147 | </tr> | ||
148 | #foreach($taskDocName in $xwiki.searchDocuments(",BaseObject as obj, StringProperty as prop where doc.fullName=obj.name and obj.className='TasksCode.IssueClass' and obj.id=prop.id.id and prop.id.name='status' and prop.value in ('new','open','reopened') and doc.fullName<>'TasksCode.TasksClassTemplate' and doc.fullName<>'TasksCode.IssueClassTemplate' order by doc.date desc", 20, 0)) | ||
149 | #set($taskdoc = $xwiki.getDocument($taskDocName)) | ||
150 | #set($classname = "TasksCode.IssueClass") | ||
151 | #set($ok = $taskdoc.use("$classname")) | ||
152 | <tr> | ||
153 | <td> [$msg.its_task $taskdoc.display("id")>$taskDocName] </td> | ||
154 | <td> [$taskdoc.display("title")>$taskDocName] </td> | ||
155 | #display($taskdoc $classname "assignee" "") | ||
156 | #display($taskdoc $classname "status" "") | ||
157 | #display($taskdoc $classname "severity" "") | ||
158 | </tr> | ||
159 | #end | ||
160 | </table> | ||
161 | #end |