xref: /plugin/bez/tpl/thread_box.php (revision fe5d6d1ebd253c129098b67fff8cf438a54d8650)
1<div    id="bds_issue_box"
2        class="pr<?php echo $template['issue']->priority ?>
3        <?php if (  $template['action'] === 'issue_edit_metadata') echo 'bez_metadata_edit_warn' ?>">
4
5<?php if ($template['action'] === 'issue_edit_metadata'): ?>
6
7<h1 style="color: #f00; border-bottom: 1px solid #f00;margin-bottom: 10px; margin-top: 25px;"><?php echo $bezlang['metadata_edit_header'] ?></h1>
8
9<?php endif ?>
10
11<h1>
12
13<a href="?id=<?php echo $this->id('issue', 'id', $template['issue']->id) ?>">
14    #<?php echo $template['issue']->id ?>
15</a>
16<?php if ($template['issue']->type_string != ''): ?>
17	<?php echo $template['issue']->type_string ?>
18<?php else: ?>
19	<i style="color: #777"><?php echo $bezlang['issue_type_no_specified'] ?></i>
20<?php endif ?>
21
22(<?php echo $template['issue']->state_string ?>)
23</h1>
24
25<h1 id="bez_issue_title"><?php echo $template['issue']->title ?></h1>
26
27<div class="bez_timebox">
28    <span>
29    <?php if (  $template['action'] === 'issue_edit_metadata' &&
30            $template['issue']->acl_of('date') >= BEZ_PERMISSION_CHANGE): ?>
31            <label><strong><?php echo $bezlang['open'] ?>:</strong> <input name="date" style="width:90px;" data-validation="required,date" value="<?php echo $value['date'] ?>" class="date start" /></label>
32    <?php else: ?>
33        <strong><?php echo $bezlang['open'] ?>:</strong> <?php echo $helper->time2date($template['issue']->date) ?>
34    <?php endif ?>
35    </span>
36
37
38<?php if ($template['issue']->state !== '0'): ?>
39    <span>
40    <?php if (  $template['action'] === 'issue_edit_metadata' &&
41            $template['issue']->acl_of('last_mod') >= BEZ_PERMISSION_CHANGE): ?>
42            <label><strong><?php echo $bezlang['closed'] ?>:</strong> <input name="last_mod" style="width:90px;" data-validation="required,date" value="<?php echo $value['last_mod'] ?>" class="date end" /></label>
43    <?php else: ?>
44
45            <strong><?php echo $bezlang['closed'] ?>:</strong>
46            <?php echo $helper->time2date($template['issue']->last_mod) ?>
47
48    <?php endif ?>
49    </span>
50
51	<span>
52		<strong><?php echo $bezlang['report_priority'] ?>: </strong>
53		<?php echo $helper->days((int)$template['issue']->last_mod - (int)$template['issue']->date) ?>
54	</span>
55<?php endif ?>
56</div>
57
58<table class="bez_box_data_table">
59<tr>
60    <th><?php echo $bezlang['reporter'] ?>:</th>
61    <td>
62        <?php if (  $template['action'] === 'issue_edit_metadata' &&
63            $template['issue']->acl_of('reporter') >= BEZ_PERMISSION_CHANGE): ?>
64
65            <select name="reporter" id="reporter" data-validation="required">
66                <option value="">--- <?php echo $bezlang['select'] ?>---</option>
67                <?php foreach ($template['users'] as $nick => $name): ?>
68                    <option <?php if ($value['reporter'] === $nick) echo 'selected' ?>
69                     value="<?php echo $nick ?>"><?php echo $name ?></option>
70                <?php endforeach ?>
71            </select>
72        <?php else: ?>
73            <?php echo $this->model->users->get_user_full_name($template['issue']->reporter) ?>
74        <?php endif ?>
75    </td>
76
77    <th><?php echo $bezlang['coordinator'] ?>:</th>
78    <td>
79        <?php if ($template['issue']->coordinator === '-proposal'): ?>
80            <i style="font-weight: normal; color: #aaa"><?php echo $bezlang['none'] ?></i>
81        <?php else: ?>
82            <?php echo $this->model->users->get_user_full_name($template['issue']->coordinator) ?>
83        <?php endif?>
84    </td>
85</tr>
86</table>
87
88<?php echo $template['issue']->description_cache ?>
89
90<?php if ($template['issue']->state !== '0'): ?>
91<h2>
92	<?php if ($template['issue']->state === '1'): ?>
93		<?php echo $bezlang['opinion'] ?>
94	<?php else: ?>
95		<?php echo $bezlang['reason'] ?>
96	<?php endif ?>
97</h2>
98	<?php echo $template['issue']->opinion_cache ?>
99<?php endif ?>
100
101<?php if (	$template['action'] === 'issue_close' ||
102			$template['action'] === 'issue_close_confirm'): ?>
103<h2>
104	<?php if ($template['issue']->assigned_tasks_count > 0): ?>
105		<?php echo $bezlang['opinion'] ?>
106	<?php else: ?>
107		<?php echo $bezlang['reason'] ?>
108	<?php endif ?>
109</h2>
110<?php $id = $this->id('issue', 'id', $template['issue']->id, 'action', 'issue_close_confirm') ?>
111<form action="?id=<?php echo $id ?>" method="POST" class="bez_form">
112	<input type="hidden" name="id" value="<?php echo $id ?>">
113	<div class="bez_opinion_toolbar"></div>
114	<textarea name="opinion" id="opinion" class="edit" data-validation="required"><?php echo $value['opinion'] ?></textarea>
115	<?php if ($template['issue']->assigned_tasks_count > 0): ?>
116		<input type="hidden" name="state" value="1" />
117		<input type="submit" value="<?php echo $bezlang['close_issue'] ?>">
118	<?php else: ?>
119	<input type="hidden" name="state" value="2" />
120		<input type="submit" value="<?php echo $bezlang['reject_issue'] ?>">
121	<?php endif ?>
122	 <a href="?id=<?php echo $this->id('issue', 'id', $template['issue']->id) ?>" class="bez_delete_button bez_link_button bez_cancel_button">
123		<?php echo $bezlang['cancel'] ?>
124	</a>
125</form>
126<?php elseif ($template['action'] === 'issue_edit_metadata'): ?>
127    <input type="submit" value="<?php echo $bezlang['save'] ?>">&nbsp;&nbsp;
128		<a href="?id=<?php echo $this->id('issue', 'id', $template['issue']->id) ?>"
129			 class="bez_delete_button bez_link_button">
130				<?php echo $bezlang['cancel'] ?>
131		</a>
132<?php else: ?>
133	<?php if ($template['issue']->opened_tasks_count > 0): ?>
134		<div class="info"><?php echo $bezlang['issue_unclosed_tasks'] ?></div>
135	<?php endif ?>
136	<?php if ($template['issue']->coordinator === '-proposal'): ?>
137		<div class="info"><?php echo $bezlang['issue_is_proposal'] ?></div>
138	<?php endif ?>
139	<?php if ($template['issue']->causes_without_tasks_count() > 0): ?>
140		<div class="info"><?php echo $bezlang['cause_without_task'] ?></div>
141	<?php endif ?>
142	<?php if (	$template['issue']->assigned_tasks_count === 0 &&
143				$template['issue']->state === '0'): ?>
144		<div class="info"><?php echo $bezlang['issue_no_tasks'] ?></div>
145	<?php endif ?>
146<div class="bez_buttons">
147        <?php if (count($template['issue']->changable_fields(
148                $template['issue']->get_meta_fields()
149            )) > 0): ?>
150        <a class="bds_inline_button_noborder" style="float:left;"
151            href="?id=<?php
152                echo $this->id('issue', 'id', $template['issue']->id, 'action', 'issue_edit_metadata') ?>">
153            <?php echo $bezlang['edit_metadata'] ?>
154        </a>
155    <?php endif ?>
156
157	<?php if ($template['issue']->acl_of('state') >= BEZ_PERMISSION_CHANGE): ?>
158		<?php if ($template['issue']->state !== '0'): ?>
159			<a href="?id=<?php echo $this->id('issue', 'id', $template['issue']->id, 'action', 'reopen') ?>" class="bds_inline_button">
160<?php echo $bezlang['issue_reopen'] ?>
161			</a>
162		<?php elseif (	$template['issue']->assigned_tasks_count > 0 &&
163						$template['issue']->opened_tasks_count === 0 &&
164						$template['issue']->causes_without_tasks_count() === 0): ?>
165			<a href="?id=<?php echo $this->id('issue', 'action', 'issue_close', 'id', $template['issue']->id) ?>" class="bds_inline_button">
166<?php echo $bezlang['close_issue'] ?>
167			</a>
168		<?php elseif ($template['issue']->assigned_tasks_count === 0): ?>
169			<a href="?id=<?php echo $this->id('issue', 'action', 'issue_close', 'id', $template['issue']->id) ?>" class="bds_inline_button">
170<?php echo $bezlang['reject_issue'] ?>
171			</a>
172		<?php endif ?>
173	<?php endif ?>
174
175	<?php if (count($template['issue']->changable_fields()) > 0): ?>
176		<a href="?id=<?php echo $this->id('issue_report', 'action', 'edit', 'id', $template['issue']->id) ?>" class="bds_inline_button">
177<?php echo $bezlang['edit'] ?>
178		</a>
179	<?php endif ?>
180
181	<a class="bds_inline_button" href="
182		<?php echo $helper->mailto($template['issue']->coordinator_email,
183		$bezlang['issue'].': #'.$template['issue']->id.' '.$template['issue']->title,
184		DOKU_URL . 'doku.php?id='.$this->id('issue', 'id', $template['issue']->id)) ?>">
185<?php echo $bezlang['send_mail'] ?>
186	</a>
187
188	<a href="<?php echo $helper->link_8d($template['issue']->id) ?>" class="bds_inline_button bds_report_button">
189<?php echo $bezlang['8d_report'] ?>
190	</a>
191</div>
192<?php endif ?>
193</div>
194
195