xref: /plugin/bez/tpl/task.php (revision 5c4f5b9586015b9688a72a89d8d79cafe4a6fac2) !
1*5c4f5b95SSzymon Olewniczak<a name="z<?php echo $task->id ?>"></a>
2*5c4f5b95SSzymon Olewniczak<div id="z<?php echo $task->id ?>"
3*5c4f5b95SSzymon Olewniczak	class="task <?php $task->state_string($task->state)	?>">
4510f3b21Sghi
5510f3b21Sghi<div class="bez_timebox">
6*5c4f5b95SSzymon Olewniczak	<span><strong><?php echo $bezlang['open'] ?>:</strong> <?php echo $helper->time2date($task->date) ?></span>
7*5c4f5b95SSzymon Olewniczak
8*5c4f5b95SSzymon Olewniczak	<?php if ($task->state !== '0'): ?>
9510f3b21Sghi		<span>
10*5c4f5b95SSzymon Olewniczak			<strong><?php echo $bezlang[$task->state_string($task->state)] ?>:</strong>
11*5c4f5b95SSzymon Olewniczak			<?php echo $helper->time2date($task->close_date) ?>
12510f3b21Sghi		</span>
13260e885eSghi		<span>
14260e885eSghi			<strong><?php echo $bezlang['report_priority'] ?>: </strong>
15*5c4f5b95SSzymon Olewniczak			<?php echo $helper->days((int)$task->close_date - (int)$task->date) ?>
16260e885eSghi		</span>
17510f3b21Sghi	<?php endif ?>
18510f3b21Sghi</div>
19510f3b21Sghi
20510f3b21Sghi<h2>
21*5c4f5b95SSzymon Olewniczak	<a href="?id=<?php echo $this->id('show_task', 'tid', $task->id) ?>">
22*5c4f5b95SSzymon Olewniczak		#z<?php echo $task->id ?>
2327712358Sghi	</a>
24*5c4f5b95SSzymon Olewniczak	<?php echo lcfirst($bezlang[$task->action_string($task->action)]) ?>
25*5c4f5b95SSzymon Olewniczak	(<?php echo lcfirst($bezlang[$task->state_string($task->state)]) ?>)
26510f3b21Sghi</h2>
27510f3b21Sghi
28fc2a4337Sghi<?php
29*5c4f5b95SSzymon Olewniczak	$cost_colspan = 1;
30*5c4f5b95SSzymon Olewniczak	$tasktype_colspan = 1;
31*5c4f5b95SSzymon Olewniczak	$plan_date_colspan = 1;
32168ecf58Sghi
33*5c4f5b95SSzymon Olewniczak	if ($task->cost == '' && $task->all_day_event == '1') {
34*5c4f5b95SSzymon Olewniczak		$plan_date_colspan = 2;
35*5c4f5b95SSzymon Olewniczak	} elseif ($task->cost == '' && $task->all_day_event == '0') {
36*5c4f5b95SSzymon Olewniczak		$tasktype_colspan = 2;
37*5c4f5b95SSzymon Olewniczak	} elseif ($task->cost != '' && $task->all_day_event == '1') {
38*5c4f5b95SSzymon Olewniczak		$plan_date_colspan = 3;
39*5c4f5b95SSzymon Olewniczak	}
40fc2a4337Sghi?>
41*5c4f5b95SSzymon Olewniczak
42510f3b21Sghi<table>
43510f3b21Sghi<tr>
44*5c4f5b95SSzymon Olewniczak		<td>
4527712358Sghi			<strong><?php echo $bezlang['executor'] ?>:</strong>
46*5c4f5b95SSzymon Olewniczak			<?php echo $this->model->users->get_user_full_name($task->executor) ?>
4727712358Sghi		</td>
48510f3b21Sghi
49*5c4f5b95SSzymon Olewniczak		<td colspan="<?php echo $tasktype_colspan ?>">
50168ecf58Sghi			<strong><?php echo $bezlang['task_type'] ?>:</strong>
51*5c4f5b95SSzymon Olewniczak			<?php echo $task->tasktype_string ?>
52168ecf58Sghi		</td>
53168ecf58Sghi
54*5c4f5b95SSzymon Olewniczak		<?php if ($task->cost != ''): ?>
55*5c4f5b95SSzymon Olewniczak			<td colspan="<?php echo $cost_colspan ?>">
5627712358Sghi				<strong><?php echo $bezlang['cost'] ?>:</strong>
57*5c4f5b95SSzymon Olewniczak				<?php echo $task->cost ?>
5827712358Sghi			</td>
59510f3b21Sghi		<?php endif ?>
60510f3b21Sghi</tr>
61fc2a4337Sghi
62fc2a4337Sghi<tr>
63*5c4f5b95SSzymon Olewniczak	<td colspan="<?php echo $plan_date_colspan ?>"><strong><?php echo $bezlang['plan_date'] ?>:</strong>
64*5c4f5b95SSzymon Olewniczak	<?php echo $task->plan_date ?></td>
65fc2a4337Sghi
66*5c4f5b95SSzymon Olewniczak	<?php if ($task->all_day_event == '0'): ?>
67fc2a4337Sghi		<td><strong><?php echo $bezlang['start_time'] ?>:</strong>
68*5c4f5b95SSzymon Olewniczak		<?php echo $task->start_time ?></td>
69fc2a4337Sghi		<td><strong><?php echo $bezlang['finish_time'] ?>:</strong>
70*5c4f5b95SSzymon Olewniczak		<?php echo $task->finish_time ?></td>
71*5c4f5b95SSzymon Olewniczak	<?php endif ?>
72*5c4f5b95SSzymon Olewniczak
73fc2a4337Sghi</tr>
74168ecf58Sghi
75510f3b21Sghi</table>
76510f3b21Sghi
77*5c4f5b95SSzymon Olewniczak<?php echo $task->task_cache ?>
78510f3b21Sghi
7960fa9366Sghi<?php if (isset($nparams['state'])): ?>
80489061b8Sghi	<a name="form"></a>
8160fa9366Sghi	<?php if ($nparams['state'] == 2): ?>
8260fa9366Sghi		<h3><?php echo $bezlang['reason'] ?></h3>
8360fa9366Sghi	<?php else: ?>
8460fa9366Sghi		<h3><?php echo $bezlang['evaluation'] ?></h3>
8560fa9366Sghi	<?php endif ?>
8660fa9366Sghi	<form class="bez_form bez_task_form" action="?id=<?php echo $helper->nparams_to_id($this->action, $nparams) ?>:action:update" method="POST">
8760fa9366Sghi		<textarea name="reason" id="reason"><?php echo $value['reason'] ?></textarea>
8860fa9366Sghi		<br>
8960fa9366Sghi		<?php if ($nparams['state'] == 2): ?>
9060fa9366Sghi			<input type="submit" value="<?php echo $bezlang['task_reject'] ?>">
9160fa9366Sghi		<?php else: ?>
9260fa9366Sghi			<input type="submit" value="<?php echo $bezlang['task_do'] ?>">
9360fa9366Sghi		<?php endif ?>
9460fa9366Sghi		<a href="?id=<?php echo $helper->nparams_to_id($this->action, array_diff_key($nparams, array('state'=>''))); ?>"
9560fa9366Sghi			 class="bez_delete_button bez_link_button">
9660fa9366Sghi				<?php echo $bezlang['cancel'] ?>
9760fa9366Sghi		</a>
9860fa9366Sghi	</form>
9960fa9366Sghi<?php else: ?>
100*5c4f5b95SSzymon Olewniczak	<?php if ($task->state == '2'): ?>
101510f3b21Sghi		<h3><?php echo $bezlang['reason'] ?></h3>
102*5c4f5b95SSzymon Olewniczak		<?php echo $task->reason_cache ?>
103*5c4f5b95SSzymon Olewniczak	<?php elseif ($task->state == '1'): ?>
1049a30fd19Sghi		<h3><?php echo $bezlang['evaluation'] ?></h3>
105*5c4f5b95SSzymon Olewniczak		<?php echo $task->reason_cache ?>
106510f3b21Sghi	<?php endif ?>
10725a999c8SSzymon Olewniczak<?php endif ?>
108510f3b21Sghi
109fc2a4337Sghi
110fc2a4337Sghi
111*5c4f5b95SSzymon Olewniczak<?php if (!isset($nparams['state'])): ?>
11227712358Sghi<div class="bez_buttons">
113*5c4f5b95SSzymon Olewniczak
114168ecf58Sghi	<a class="bds_inline_button"
115*5c4f5b95SSzymon Olewniczak		href="?id=<?php echo $helper->id('icalendar', 'tid', $task->id) ?>">
116168ecf58Sghi		��  <?php echo $bezlang['download_in_icalendar'] ?>
117168ecf58Sghi	</a>
118fc2a4337Sghi
119*5c4f5b95SSzymon Olewniczak	<?php if ($task->state == '0' && $task->get_level() >= 10): ?>
12060fa9366Sghi		<a class="bds_inline_button"
12160fa9366Sghi			href="?id=<?php
122*5c4f5b95SSzymon Olewniczak				if($task->issue == '') {
123*5c4f5b95SSzymon Olewniczak					echo $helper->id('show_task', 'tid', $task->id, 'state', '1');
124*5c4f5b95SSzymon Olewniczak				} elseif (isset($nparams['cid'])) {
125*5c4f5b95SSzymon Olewniczak					echo $helper->id('issue_cause_task', 'id', $task->issue, 'cid', $task->cause, 'tid', $task->id, 'state', '1');
126*5c4f5b95SSzymon Olewniczak				} else {
127*5c4f5b95SSzymon Olewniczak					echo $helper->id('issue_task', 'id', $task->issue, 'tid', $task->id, 'state', '1');
128*5c4f5b95SSzymon Olewniczak				}
129489061b8Sghi			?>#form">
13060fa9366Sghi<?php echo $bezlang['task_do'] ?>
13160fa9366Sghi		</a>
13260fa9366Sghi		<a class="bds_inline_button"
133489061b8Sghi			href="?id=<?php
134*5c4f5b95SSzymon Olewniczak				if($task->issue == '') {
135*5c4f5b95SSzymon Olewniczak					echo $helper->id('show_task', 'tid', $task->id, 'state', '2');
136*5c4f5b95SSzymon Olewniczak				} elseif (isset($nparams['cid'])) {
137*5c4f5b95SSzymon Olewniczak					echo $helper->id('issue_cause_task', 'id', $task->issue, 'cid', $task->cause, 'tid', $task->id, 'state', '2');
138*5c4f5b95SSzymon Olewniczak				} else {
139*5c4f5b95SSzymon Olewniczak					echo $helper->id('issue_task', 'id', $task->issue, 'tid', $task->id, 'state', '2');
140*5c4f5b95SSzymon Olewniczak				}
141489061b8Sghi			?>#form">
14260fa9366Sghi<?php echo $bezlang['task_reject'] ?>
14360fa9366Sghi		</a>
144*5c4f5b95SSzymon Olewniczak	<?php elseif ($task->get_level() >= 10): ?>
14560fa9366Sghi		<a class="bds_inline_button"
146*5c4f5b95SSzymon Olewniczak				href="?id=<?php
147*5c4f5b95SSzymon Olewniczak					if($task->issue == '') {
148*5c4f5b95SSzymon Olewniczak						echo $helper->id('show_task', 'tid', $task->id, 'state', '0');
149*5c4f5b95SSzymon Olewniczak					} elseif (isset($nparams['cid'])) {
150*5c4f5b95SSzymon Olewniczak						echo $helper->id('issue_cause_task', 'id', $task->issue, 'cid', $task->cause, 'tid', $task->id, 'state', '0');
151*5c4f5b95SSzymon Olewniczak					} else {
152*5c4f5b95SSzymon Olewniczak						echo $helper->id('issue_task', 'id', $task->issue, 'tid', $task->id, 'state', '0');
153*5c4f5b95SSzymon Olewniczak					}
154*5c4f5b95SSzymon Olewniczak				?>#form">
155*5c4f5b95SSzymon Olewniczak<?php echo $bezlang['task_reopen'] ?>
156168ecf58Sghi			</a>
157168ecf58Sghi	<?php endif ?>
158*5c4f5b95SSzymon Olewniczak
159*5c4f5b95SSzymon Olewniczak	<?php if($task->get_level() >= 15): ?>
160*5c4f5b95SSzymon Olewniczak			<a class="bds_inline_button"
161*5c4f5b95SSzymon Olewniczak				href="?id=<?php
162*5c4f5b95SSzymon Olewniczak					if($task->issue == '') {
163*5c4f5b95SSzymon Olewniczak						echo $helper->id('task_report', 'tasktype', $task->tasktype, 'tid', $task->id);
164*5c4f5b95SSzymon Olewniczak					} elseif ($task->cause == '') {
165*5c4f5b95SSzymon Olewniczak						echo $helper->id('task_form', 'id', $task->issue, 'tid', $task->id);
166*5c4f5b95SSzymon Olewniczak					} else {
167*5c4f5b95SSzymon Olewniczak						echo $helper->id('task_form', 'id', $task->issue, 'cid', $task->cause, 'tid', $task->id);
168*5c4f5b95SSzymon Olewniczak					}
169*5c4f5b95SSzymon Olewniczak				?>">
170*5c4f5b95SSzymon Olewniczak<?php echo $bezlang['edit'] ?>
171*5c4f5b95SSzymon Olewniczak			</a>
17260fa9366Sghi	<?php endif ?>
17360fa9366Sghi
17427712358Sghi	<a class="bds_inline_button" href="
175*5c4f5b95SSzymon Olewniczak	<?php echo $helper->mailto($this->model->users->get_user_email($task->executor),
176*5c4f5b95SSzymon Olewniczak	$bezlang['task'].': #z'.$task->id.' '.lcfirst($bezlang[$task->action_string($task->action)]),
177*5c4f5b95SSzymon Olewniczak	$task->issue != '' ?
178*5c4f5b95SSzymon Olewniczak		DOKU_URL . 'doku.php?id='.$this->id('issue_task', 'id', $task->issue, 'tid', $task->id)
179*5c4f5b95SSzymon Olewniczak		: DOKU_URL . 'doku.php?id='.$this->id('show_task', 'tid', $task->id)) ?>">
180510f3b21Sghi<?php echo $bezlang['send_mail'] ?>
181510f3b21Sghi	</a>
1822c7864e8Sghi
183*5c4f5b95SSzymon Olewniczak	<?php if($task->get_level() >= 12): ?>
1842c7864e8Sghi		<a class="bds_inline_button"
185*5c4f5b95SSzymon Olewniczak				href="?id=<?php echo $this->id('task_report', 'duplicate', $task->id, 'tasktype', $task->tasktype) ?>">
1862c7864e8Sghi<?php echo $bezlang['duplicate'] ?>
1872c7864e8Sghi		</a>
188*5c4f5b95SSzymon Olewniczak	<?php endif ?>
18927712358Sghi</div>
19060fa9366Sghi<?php endif ?>
19160fa9366Sghi
19227712358Sghi</div>
193