xref: /plugin/bez/tpl/thread_box.php (revision 8a6381983135ed7de69b33e64aa0c1b16dbf69b0)
1<?php /* @var \dokuwiki\plugin\bez\meta\Tpl $tpl */ ?>
2<div    id="bds_issue_box"
3        class="pr<?php echo $tpl->get('thread')->priority ?>
4        <?php if (  $template['action'] === 'issue_edit_metadata') echo 'bez_metadata_edit_warn' ?>">
5
6<h1>
7
8<a href="<?php echo $tpl->url('thread', 'id', $tpl->get('thread')->id) ?>">
9    #<?php echo $tpl->get('thread')->id ?>
10</a>
11
12<?php if (!empty($tpl->get('thread')->label_name)): ?>
13	<?php echo $tpl->get('thread')->label_name ?>
14<?php else: ?>
15	<i style="color: #777"><?php echo $tpl->getLang('issue_type_no_specified') ?></i>
16<?php endif ?>
17
18(<?php echo $tpl->getLang('state_' . $tpl->get('thread')->state) ?>)
19</h1>
20
21<h1 id="bez_issue_title"><?php echo $tpl->get('thread')->title ?></h1>
22
23<div class="bez_timebox">
24    <span>
25        <strong><?php echo $tpl->getLang('open') ?>:</strong>
26        <?php echo dformat(strtotime($tpl->get('thread')->create_date), '%Y-%m-%d') ?>
27    </span>
28
29
30<?php if ($tpl->get('thread')->state == 'closed' || $tpl->get('thread')->state == 'rejected'): ?>
31    <span>
32        <strong><?php echo $tpl->getLang('closed') ?>:</strong>
33        <?php echo dformat(strtotime($tpl->get('thread')->close_date), '%Y-%m-%d') ?>
34    </span>
35
36	<span>
37		<strong><?php echo $tpl->getLang('report_priority') ?>: </strong>
38        <?php $dStart = new DateTime($tpl->get('thread')->create_date) ?>
39        <?php $dEnd = new DateTime($tpl->get('thread')->close_date) ?>
40 		<?php echo $dStart->diff($dEnd)->days ?> <?php echo $tpl->getLang('days') ?>
41	</span>
42<?php endif ?>
43</div>
44
45<table class="bez_box_data_table">
46<tr>
47    <th><?php echo $tpl->getLang('reporter') ?>:</th>
48    <td>
49        <?php echo $tpl->user_name($tpl->get('thread')->original_poster) ?>
50    </td>
51
52    <th><?php echo $tpl->getLang('coordinator') ?>:</th>
53    <td>
54        <?php if ($tpl->get('thread')->coordinator == ''): ?>
55            <i style="font-weight: normal; color: #aaa"><?php echo $tpl->getLang('none') ?></i>
56        <?php else: ?>
57            <?php echo $tpl->user_name($tpl->get('thread')->coordinator) ?>
58        <?php endif?>
59    </td>
60</tr>
61</table>
62
63<?php echo $tpl->get('thread')->content_html ?>
64
65<?php if ($tpl->get('thread')->task_count - $tpl->get('thread')->task_count_closed > 0): ?>
66    <div class="info"><?php echo $tpl->getLang('issue_unclosed_tasks') ?></div>
67<?php endif ?>
68<?php if ($tpl->get('thread')->state == 'proposal'): ?>
69    <div class="info"><?php echo $tpl->getLang('issue_is_proposal') ?></div>
70<?php endif ?>
71<?php if ($tpl->get('thread')->causes_without_tasks_count() > 0): ?>
72    <div class="info"><?php echo $tpl->getLang('cause_without_task') ?></div>
73<?php endif ?>
74<?php if ($tpl->get('thread')->state == 'open' && $tpl->get('thread')->task_count == 0): ?>
75    <div class="info"><?php echo $tpl->getLang('issue_no_tasks') ?></div>
76<?php endif ?>
77
78<div class="bez_buttons">
79
80	<?php if (count($tpl->get('thread')->changable_fields()) > 0): ?>
81		<a href="<?php echo $tpl->url('thread_report', 'action', 'edit', 'id', $tpl->get('thread')->id) ?>" class="bds_inline_button">
82<?php echo $tpl->getLang('edit') ?>
83		</a>
84	<?php endif ?>
85
86	<a class="bds_inline_button" href="
87		<?php echo $tpl->mailto($tpl->user_email($tpl->get('thread')->coordinator),
88                                   '#'.$tpl->get('thread')->id.' '.$tpl->get('thread')->title,
89		$tpl->url('thread', 'id', $tpl->get('thread')->id)) ?>">
90<?php echo $tpl->getLang('send_mail') ?>
91	</a>
92
93	<a href="<?php echo $tpl->url('8d', $tpl->get('thread')->id) ?>" class="bds_inline_button bds_report_button">
94<?php echo $tpl->getLang('8d_report') ?>
95	</a>
96</div>
97
98</div>
99
100