xref: /plugin/bez/tpl/tasks.php (revision e8827d732aaeeee6f7b703c5654f86ca97056383)
1<?php if ($tpl->static_acl('task', 'id') >= BEZ_PERMISSION_CHANGE): ?>
2    <a href="<?php echo $tpl->url('task_form') ?>" class="bez_start_button" id="bez_report_issue_button">
3        <?php echo $tpl->getLang('add_task') ?>
4    </a>
5<?php endif ?>
6
7<br /><br />
8
9<div class="bez_filter_form">
10<form action="<?php echo $tpl->url('tasks') ?>" method="POST">
11
12<label><?php echo $tpl->getLang('issue') ?>:
13	<select name="thread_id">
14		<option <?php if ($tpl->value('thread_id') == '-all') echo 'selected' ?>
15			value="-all">--- <?php echo $tpl->getLang('all') ?> ---</option>
16	<?php foreach ($tpl->get('thread_ids') as $thread_id): ?>
17		<option <?php if ($tpl->value('thread_id') == $thread_id) echo 'selected' ?>
18			value="<?php echo $thread_id ?>">#<?php echo $thread_id ?></option>
19	<?php endforeach ?>
20	</select>
21</label>
22
23<label><?php echo $tpl->getLang('class') ?>:
24	<select name="type">
25		<option <?php if ($tpl->value('type') == '-all') echo 'selected' ?>
26			value="-all">--- <?php echo $tpl->getLang('all') ?> ---</option>
27	<?php foreach (\dokuwiki\plugin\bez\mdl\Task::get_types() as $type): ?>
28		<option <?php if ($tpl->value('$type') == $type) echo 'selected' ?>
29			value="<?php echo $type ?>"><?php echo $tpl->getLang('task_type_' . $type) ?></option>
30	<?php endforeach ?>
31	</select>
32</label>
33
34<label><?php echo $tpl->getLang('state') ?>:
35	<select name="state">
36		<option <?php if ($tpl->value('state') == '-all') echo 'selected' ?>
37			value="-all">--- <?php echo $tpl->getLang('all') ?> ---</option>
38	<?php foreach (\dokuwiki\plugin\bez\mdl\Task::get_states() as $state): ?>
39		<option <?php if ($tpl->value('state') == $state) echo 'selected' ?>
40			value="<?php echo $state ?>"><?php echo $tpl->getLang('task_state_' . $state) ?></option>
41	<?php endforeach ?>
42	</select>
43</label>
44
45<label><?php echo $tpl->getLang('task_type') ?>:
46	<select name="task_program_id">
47		<option <?php if ($tpl->value('task_program_id') == '-all') echo 'selected' ?>
48			value="-all">--- <?php echo $tpl->getLang('all') ?> ---</option>
49		<option <?php if ($tpl->value('task_program_id') == '-none') echo 'selected' ?>
50			value="-none">-- <?php echo $tpl->getLang('none') ?> --</option>
51	<?php foreach ($tpl->get('task_programs') as $task_program): ?>
52		<option <?php if ($tpl->value('task_program_id') == $task_program->id) echo 'selected' ?>
53			value="<?php echo $task_program->id ?>"><?php echo $task_program->name ?></option>
54	<?php endforeach ?>
55	</select>
56</label>
57
58<label><?php echo $tpl->getLang('executor') ?>:
59    <select name="assignee">
60        <option <?php if ($tpl->value('assignee') == '-all') echo 'selected' ?>
61                value="-all">--- <?php echo $tpl->getLang('all') ?> ---</option>
62        <optgroup label="<?php echo $tpl->getLang('users') ?>">
63            <?php foreach ($tpl->get('users') as $nick => $name): ?>
64                <option <?php if ($tpl->value('assignee') == $nick) echo 'selected' ?>
65                        value="<?php echo $nick ?>"><?php echo $name ?></option>
66            <?php endforeach ?>
67        </optgroup>
68        <optgroup label="<?php echo $tpl->getLang('groups') ?>">
69            <?php foreach ($tpl->get('groups') as $name): ?>
70                <?php $group = "@$name" ?>
71                <option <?php if ($tpl->value('assignee') == $group) echo 'selected' ?>
72                        value="<?php echo $group ?>"><?php echo $group ?></option>
73            <?php endforeach ?>
74        </optgroup>
75    </select>
76</label>
77
78
79<label><?php echo $tpl->getLang('description') ?>:
80	<input name="content" value="<?php echo $tpl->value('content') ?>" />
81</label>
82
83
84<div class="time_filter">
85	<label>
86		<select name="date_type">
87			<option <?php if ($tpl->value('date_type') == 'plan') echo 'selected' ?>
88				value="plan"><?php echo $tpl->getLang('plan_date') ?></option>
89			<option <?php if ($tpl->value('date_type') == 'open') echo 'selected' ?>
90				value="open"><?php echo $tpl->getLang('open_date') ?></option>
91			<option <?php if ($tpl->value('date_type') == 'closed') echo 'selected' ?>
92				value="closed"><?php echo $tpl->getLang('close_date') ?></option>
93		</select>:
94	</label>
95	<label><?php echo $tpl->getLang('month') ?>:
96		<select name="month">
97			<option <?php if ($tpl->value('month') == '-all') echo 'selected' ?>
98				value="-all">--- <?php echo $tpl->getLang('all') ?> ---</option>
99		<?php foreach ($tpl->get('months') as $nr => $month): ?>
100			<option <?php if ($value['month'] == $nr) echo 'selected' ?>
101				value="<?php echo $nr ?>"><?php echo $tpl->getLang($month) ?></option>
102		<?php endforeach ?>
103		</select>
104	</label>
105	<label><?php echo $tpl->getLang('year') ?>:
106		<select name="year">
107			<option <?php if ($tpl->value('year') == '-all') echo 'selected' ?>
108				value="-all">--- <?php echo $tpl->getLang('all') ?> ---</option>
109		<?php foreach ($tpl->get('years') as $year): ?>
110			<option <?php if ($tpl->value('year') == $year) echo 'selected' ?>
111				value="<?php echo $year ?>"><?php echo $year ?></option>
112		<?php endforeach ?>
113		</select>
114	</label>
115	<label><input type="submit" value="<?php echo $tpl->getLang('filter') ?>" /></label>
116</div>
117</form>
118</div>
119
120<?php if ($template['view'] == 'realization'): ?>
121	[ <a href="#" id="bez_show_desc">
122		<span class="show"><?php echo $bezlang['show_desc_and_eval'] ?></span>
123		<span class="hide" style="display:none"><?php echo $bezlang['hide_desc_and_eval'] ?></span>
124		</a> ]
125<?php else: ?>
126	[ <a href="#" id="bez_show_desc">
127		<span class="show"><?php echo $bezlang['show_desc'] ?></span>
128		<span class="hide" style="display:none"><?php echo $bezlang['hide_desc'] ?></span>
129
130	</a> ]
131<?php endif ?>
132
133<table class="bez bez_sumarise">
134<tr>
135	<th><?php echo $tpl->getLang('id') ?></th>
136	<th><?php echo $tpl->getLang('state') ?></th>
137	<th><?php echo $tpl->getLang('task_type') ?></th>
138	<th><?php echo $tpl->getLang('description') ?></th>
139
140	<th><?php echo $tpl->getLang('executor') ?></th>
141	<th><?php echo $tpl->getLang('plan') ?></th>
142	<th><?php echo $tpl->getLang('cost') ?></th>
143
144	<th><?php echo $tpl->getLang('closed') ?></th>
145	<th><?php echo $tpl->getLang('hours_no') ?></th>
146
147</tr>
148<?php foreach ($tpl->get('tasks') as $task): ?>
149	<tr class="pr<?php echo $task->priority ?>" data-bez-row-id="<?php echo $task->id ?>">
150		<td>
151            <a href="<?php echo $tpl->url('task', 'tid', $task->id) ?>">
152               <?php if (!empty($task->thread_id)) echo '#'.$task->thread_id ?>
153		       #z<?php echo $task['id'] ?>
154	       </a>
155		</td>
156		<td>
157			<?php echo lcfirst($task['state']) ?>
158			<?php if ($task['priority'] == '0'): ?>
159			(<?php echo lcfirst($bezlang['task_outdated']) ?>)
160			<?php endif ?>
161		</td>
162		<td>
163			<?php if ($task['tasktype'] == ''): ?>
164				<em>---</em>
165			<?php else: ?>
166				<?php echo $task['tasktype'] ?>
167			<?php endif ?>
168		</td>
169		<td>
170			<div style="max-width:200px;max-height:60px;overflow:hidden;">
171			<?php echo $task['task'] ?>
172			</div>
173			 <a class="bez_show_single_desc" href="#">(...)</a>
174			</td>
175		<td><?php echo $task['executor'] ?></td>
176
177		<td>
178		<?php if ($task['plan_date'] != ''): ?>
179			<?php echo $task['plan_date'] ?>
180			<?php if ($task['raw_state'] == '0'): ?>
181				(<?php echo $helper->days_left($task['plan_date']) ?>)
182			<?php endif ?>
183			<?php if ($task['all_day_event'] == '0'): ?>
184				<?php echo $task['start_time'] ?>&nbsp;-&nbsp;<?php echo $task['finish_time'] ?>
185			<?php endif ?>
186		<?php else: ?>
187			<em>---</em>
188		<?php endif ?>
189		</td>
190
191		<td>
192			<?php if ($task['cost'] == ''): ?>
193				<em>---</em>
194			<?php else: ?>
195				<?php echo $task['cost'] ?>
196			<?php endif ?>
197		</td>
198
199		<td>
200			<?php if ($task['state'] == $bezlang['task_opened']): ?>
201				<em>---</em>
202			<?php else: ?>
203				<?php echo $helper->time2date($task['close_date']) ?>
204			<?php endif ?>
205		</td>
206		<td>
207			<?php if ($task['start_time'] == ''): ?>
208				<em>---</em>
209			<?php else: ?>
210				<?php echo $task['hours'] ?>
211			<?php endif ?>
212		</td>
213		</tr>
214		<tr class="bez_desc_row task<?php echo $task['id'] ?>">
215			<td colspan="10">
216				<?php echo $task['task'] ?>
217			</td>
218		</tr>
219		<?php if ($template['view'] == 'realization'): ?>
220		<tr class="bez_desc_row task<?php echo $task['id'] ?>">
221			<td colspan="10">
222				<?php if ($task['reason'] == ''): ?>
223					<em>---</em>
224				<?php else: ?>
225					<?php echo $task['reason'] ?>
226				<?php endif ?>
227			</td>
228		</tr>
229		<?php endif ?>
230	<?php endforeach ?>
231	<tr>
232		<th><?php echo $bezlang['report_total'] ?></th>
233		<td colspan="5"><?php echo $template['tasks_stats']['total'] ?></td>
234		<td colspan="2"><?php echo $template['tasks_stats']['totalcost'] ?></td>
235		<td colspan="1"><?php echo $template['tasks_stats']['totalhours'] ?></td>
236	</tr>
237</table>
238</div>
239