xref: /plugin/bez/tpl/task.php (revision 260e885eca7d099324ac54faba0c1e7584bdf44f)
1510f3b21Sghi<a name="z<?php echo $task['id'] ?>"></a>
2510f3b21Sghi<div id="z<?php echo $task['id'] ?>" class="task
3510f3b21Sghi	<?php
4510f3b21Sghi		switch($task['state']) {
5510f3b21Sghi			case $bezlang['task_opened']:
6510f3b21Sghi				echo 'opened';
7510f3b21Sghi				break;
8510f3b21Sghi			case $bezlang['task_done']:
9510f3b21Sghi				echo 'closed';
10510f3b21Sghi				break;
11510f3b21Sghi			case $bezlang['task_rejected']:
12510f3b21Sghi				echo 'rejected';
13510f3b21Sghi				break;
14510f3b21Sghi		}
15510f3b21Sghi	?>">
16510f3b21Sghi
17510f3b21Sghi<div class="bez_timebox">
18510f3b21Sghi	<span><strong><?php echo $bezlang['open'] ?>:</strong> <?php echo $helper->time2date($task['date']) ?></span>
19510f3b21Sghi	<?php if ($task['state'] != $bezlang['task_opened']): ?>
20510f3b21Sghi		<span>
21510f3b21Sghi			<strong><?php echo $task['state']?>:</strong>
22510f3b21Sghi			<?php echo $helper->time2date($task['close_date']) ?>
23510f3b21Sghi		</span>
24*260e885eSghi			<span>
25*260e885eSghi		<strong><?php echo $bezlang['report_priority'] ?>: </strong>
26*260e885eSghi		<?php echo $helper->days((int)$task['close_date'] - (int)$task['date']) ?>
27*260e885eSghi	</span>
28510f3b21Sghi	<?php endif ?>
29510f3b21Sghi</div>
30510f3b21Sghi
31510f3b21Sghi<h2>
3227712358Sghi	<a href="?id=<?php echo $this->id('issue_task', 'id', $template['issue']['id'], 'tid', $task['id']) ?>">
3327712358Sghi		#z<?php echo $task['id'] ?>
3427712358Sghi	</a>
35510f3b21Sghi	<?php echo lcfirst($task['action']) ?>
36510f3b21Sghi	(<?php echo lcfirst($task['state']) ?>)
37510f3b21Sghi</h2>
38510f3b21Sghi
39510f3b21Sghi<table>
40510f3b21Sghi<tr>
4127712358Sghi		<td>
4227712358Sghi			<strong><?php echo $bezlang['executor'] ?>:</strong>
4327712358Sghi			<?php echo $task['executor'] ?>
4427712358Sghi		</td>
45510f3b21Sghi
46510f3b21Sghi		<?php if ($task['cost'] != 0): ?>
4727712358Sghi			<td>
4827712358Sghi				<strong><?php echo $bezlang['cost'] ?>:</strong>
4927712358Sghi				<?php echo $task['cost'] ?>
5027712358Sghi			</td>
51510f3b21Sghi		<?php endif ?>
52510f3b21Sghi</tr>
53510f3b21Sghi</table>
54510f3b21Sghi
55510f3b21Sghi<?php echo $task['task'] ?>
56510f3b21Sghi
5760fa9366Sghi<?php if (isset($nparams['state'])): ?>
58489061b8Sghi	<a name="form"></a>
5960fa9366Sghi	<?php if ($nparams['state'] == 2): ?>
6060fa9366Sghi		<h3><?php echo $bezlang['reason'] ?></h3>
6160fa9366Sghi	<?php else: ?>
6260fa9366Sghi		<h3><?php echo $bezlang['evaluation'] ?></h3>
6360fa9366Sghi	<?php endif ?>
6460fa9366Sghi	<form class="bez_form bez_task_form" action="?id=<?php echo $helper->nparams_to_id($this->action, $nparams) ?>:action:update" method="POST">
6560fa9366Sghi		<textarea name="reason" id="reason"><?php echo $value['reason'] ?></textarea>
6660fa9366Sghi		<br>
6760fa9366Sghi		<?php if ($nparams['state'] == 2): ?>
6860fa9366Sghi			<input type="submit" value="<?php echo $bezlang['task_reject'] ?>">
6960fa9366Sghi		<?php else: ?>
7060fa9366Sghi			<input type="submit" value="<?php echo $bezlang['task_do'] ?>">
7160fa9366Sghi		<?php endif ?>
7260fa9366Sghi		<a href="?id=<?php echo $helper->nparams_to_id($this->action, array_diff_key($nparams, array('state'=>''))); ?>"
7360fa9366Sghi			 class="bez_delete_button bez_link_button">
7460fa9366Sghi				<?php echo $bezlang['cancel'] ?>
7560fa9366Sghi		</a>
7660fa9366Sghi	</form>
7760fa9366Sghi<?php else: ?>
789a30fd19Sghi	<?php if ($task['raw_state'] == 2): ?>
79510f3b21Sghi		<h3><?php echo $bezlang['reason'] ?></h3>
8060fa9366Sghi	<?php elseif ($task['raw_state'] == 1): ?>
819a30fd19Sghi		<h3><?php echo $bezlang['evaluation'] ?></h3>
8260fa9366Sghi	<?php endif ?>
839a30fd19Sghi	<?php echo $task['reason'] ?>
84510f3b21Sghi<?php endif ?>
85510f3b21Sghi
8660fa9366Sghi<?php if (!isset($nparams['state'])): ?>
8727712358Sghi<div class="bez_buttons">
8860fa9366Sghi	<?php if ($task['raw_state'] == 0): ?>
8960fa9366Sghi		<?php if($task['executor_nick'] == $INFO['client'] || $helper->user_coordinator($template['issue']['id'])): ?>
9060fa9366Sghi			<a class="bds_inline_button"
9160fa9366Sghi				href="?id=<?php
9260fa9366Sghi					if (isset($nparams['cid']))
9360fa9366Sghi						echo $helper->id('issue_cause_task', 'id', $template['issue']['id'], 'cid', $cause['id'], 'tid', $task['id'], 'state', '1');
9460fa9366Sghi					else
95489061b8Sghi						echo $helper->id('issue_task', 'id', $template['issue']['id'], 'tid', $task['id'], 'state', '1');
96489061b8Sghi				?>#form">
9760fa9366Sghi<?php echo $bezlang['task_do'] ?>
9860fa9366Sghi			</a>
9960fa9366Sghi			<a class="bds_inline_button"
100489061b8Sghi				href="?id=<?php
101489061b8Sghi					if (isset($nparams['cid']))
102489061b8Sghi						echo $helper->id('issue_cause_task', 'id', $template['issue']['id'], 'cid', $cause['id'], 'tid', $task['id'], 'state', '2');
103489061b8Sghi					else
104489061b8Sghi						echo $helper->id('issue_task', 'id', $template['issue']['id'], 'tid', $task['id'], 'state', '2');
105489061b8Sghi				?>#form">
10660fa9366Sghi<?php echo $bezlang['task_reject'] ?>
10760fa9366Sghi			</a>
10860fa9366Sghi		<?php endif ?>
10960fa9366Sghi	<?php endif ?>
11060fa9366Sghi	<?php if($helper->user_coordinator($template['issue']['id'])): ?>
11160fa9366Sghi		<a class="bds_inline_button"
11260fa9366Sghi			href="?id=<?php echo $this->id('task_form', 'id', $template['issue']['id'], 'cid', $cause[id], 'tid', $task['id']) ?>">
11360fa9366Sghi<?php echo $bezlang['edit'] ?>
11460fa9366Sghi		</a>
11560fa9366Sghi	<?php endif ?>
11660fa9366Sghi
11727712358Sghi	<a class="bds_inline_button" href="
118510f3b21Sghi	<?php echo $helper->mailto($task['executor_email'],
119510f3b21Sghi	$bezlang['task'].': #'.$task['issue'].' '.$template['issue']['title'].' | #z'.$task['id'].' '.$task['action'],
120dccbf163Sghi	DOKU_URL . 'doku.php?id='.$this->id('issue_task', 'id', $template['issue']['id'], 'tid', $task['id'])) ?>">
121510f3b21Sghi<?php echo $bezlang['send_mail'] ?>
122510f3b21Sghi	</a>
12327712358Sghi</div>
12460fa9366Sghi<?php endif ?>
12560fa9366Sghi
12627712358Sghi</div>
12727712358Sghi
128