xref: /plugin/bez/tpl/task_form.php (revision b80149e122b1cf2976cb18cf5d4966ad744b3810)
1<?php if ($template['issue'][raw_state] == 0 &&
2		 ($helper->user_coordinator($template[issue][id]) || isset($nparams[tid]))): ?>
3	<?php $issue = $template[issue] ?>
4	<?php include "issue_box.php" ?>
5	<br>
6	<?php if (isset($template[cause])): ?>
7		<?php $cause = $template[cause] ?>
8		<div class="bds_block" id="bez_causes">
9			<?php include "cause.php" ?>
10		</div>
11		<br>
12	<?php endif ?>
13
14	<form class="bez_form bez_task_form" action="?id=<?php echo $template['task_action'] ?>" method="POST">
15			<fieldset class="bds_form">
16				<?php if (isset($nparams[tid])): ?>
17					<div class="row">
18					<label for="id"><?php echo $bezlang['id'] ?>:</label>
19					<span><strong>#z<?php echo $nparams[tid] ?></strong></span>
20					</div>
21				<?php endif ?>
22				<?php if (!$helper->user_coordinator($template[issue][id])) $disabled = 'disabled' ?>
23				<div class="row">
24				<label for="executor"><?php echo $bezlang['executor'] ?>:</label>
25				<span>
26				<select name="executor" id="executor" <?php echo $disabled ?>>
27				<?php foreach ($template['users'] as $nick => $name): ?>
28					<option <?php if ($value['executor'] == $nick) echo 'selected' ?>
29					 value="<?php echo $nick ?>"><?php echo $name ?></option>
30				<?php endforeach ?>
31				</select>
32				</span>
33				</div>
34				<div class="row">
35				<label for="action"><?php echo $bezlang['action'] ?>:</label>
36				<span>
37
38					<strong>
39						<?php if (!isset($template[cause])): ?>
40							<?php echo $bezlang['correction'] ?>
41							<input type="hidden" name="action" value="0" />
42						<?php elseif ($template[cause][potential] == 0): ?>
43							<?php echo $bezlang['corrective_action'] ?>
44							<input type="hidden" name="action" value="1" />
45						<?php else: ?>
46							<?php echo $bezlang['preventive_action'] ?>
47							<input type="hidden" name="action" value="2" />
48						<?php endif ?>
49					</strong>
50				</span>
51				</div>
52
53				<div class="row">
54					<label for="task"><?php echo $bezlang['description'] ?>:</label>
55					<span><textarea name="task" id="task" <?php echo $disabled ?>><?php echo $value['task'] ?></textarea></span>
56				</div>
57
58				<div class="row">
59					<label for="cost"><?php echo $bezlang['cost'] ?>:</label>
60					<span><input name="cost" id="cost" value="<?php echo $value['cost'] ?>" <?php echo $disabled ?>></span>
61				</div>
62				<?php if (isset($nparams[tid])): ?>
63					<div class="row">
64					<label for="task_state"><?php echo $bezlang['task_state'] ?>:</label>
65					<span>
66					<select name="state" id="task_state">
67					<?php foreach ($template['task_states'] as $code => $name): ?>
68						<option <?php if ($value['state'] == $code) echo 'selected' ?>
69						 value="<?php echo $code?>"><?php echo $name ?></option>
70					<?php endforeach ?>
71					</select>
72					</span>
73					</div>
74					<div class="row">
75						<label for="reason"><?php echo $bezlang['reason'] ?>/<?php echo $bezlang[evaluation] ?>:</label>
76						<span><textarea name="reason" id="reason"><?php echo $value['reason'] ?></textarea></span>
77					</div>
78				<?php endif ?>
79			</fieldset>
80			<input type="submit" value="<?php echo $template['task_button'] ?>">
81			<a href="?id=<?php
82				if (isset($nparams[tid]))
83					echo $this->id('issue_task', 'id', $template['issue']['id'], 'tid', $nparams[tid]);
84				else
85					echo $this->id('issue_tasks', 'id', $template['issue']['id']);
86				?>"
87			 class="bez_delete_button bez_link_button">
88				<?php echo $bezlang['cancel'] ?>
89			</a>
90
91		</form>
92	<?php endif ?>
93	<a name="z_"></a>
94	</div>
95</div>
96
97