xref: /plugin/bez/tpl/thread_box.php (revision f4ba43dc4c2ffd4a56d5db3392811439ede14cfb)
1<?php /* @var \dokuwiki\plugin\bez\meta\Tpl $tpl */ ?>
2<div    id="bds_issue_box"
3        data-type="<?php echo $tpl->get('thread')->type ?>"
4        class="pr<?php
5        if ($tpl->get('thread')->state != 'opened') {
6            echo '-1';
7        } elseif($tpl->get('thread')->priority != '') {
8            echo $tpl->get('thread')->priority;
9        } else {
10            echo 'None';
11        }
12        ?>">
13
14<h1 class="bez__plugin_thread_title">
15
16<a href="<?php echo $tpl->url('thread', 'id', $tpl->get('thread')->id) ?>">
17    #<?php echo $tpl->get('thread')->id ?>
18</a>
19
20<?php if ($tpl->get('thread')->type == 'project'): ?>
21    <?php echo $tpl->getLang('project') ?>
22<?php elseif (!empty($tpl->get('thread')->label_name)): ?>
23	<?php echo $tpl->get('thread')->label_name ?>
24<?php else: ?>
25	<i style="color: #777"><?php echo $tpl->getLang('issue_type_no_specified') ?></i>
26<?php endif ?>
27
28(<?php echo $tpl->getLang('state_' . $tpl->get('thread')->state) ?>)
29
30<?php if ($tpl->get('thread')->private == '1'): ?>
31    <?php echo inlineSVG(DOKU_PLUGIN . 'bez/images/lock.svg') ?>
32<?php endif ?>
33</h1>
34
35<h1 id="bez_issue_title"><?php echo $tpl->get('thread')->title ?></h1>
36
37<div class="bez_timebox">
38    <span>
39        <strong><?php echo $tpl->getLang('open') ?>:</strong>
40        <?php echo $tpl->date($tpl->get('thread')->create_date) ?>
41    </span>
42
43
44<?php if ($tpl->get('thread')->state == 'closed' || $tpl->get('thread')->state == 'rejected'): ?>
45    <span>
46        <strong><?php echo $tpl->getLang('closed') ?>:</strong>
47        <?php echo $tpl->date($tpl->get('thread')->close_date) ?>
48    </span>
49
50	<span>
51		<strong><?php echo $tpl->getLang('report_priority') ?>: </strong>
52        <?php echo $tpl->date_diff_days($tpl->get('task')->create_date, $tpl->get('task')->close_date, '%a') ?>
53	</span>
54<?php endif ?>
55</div>
56
57<table class="bez_box_data_table">
58<tr>
59    <th><?php echo $tpl->getLang('reporter') ?>:</th>
60    <td>
61        <?php echo $tpl->user_name($tpl->get('thread')->original_poster) ?>
62    </td>
63
64    <th><?php echo $tpl->getLang('coordinator') ?>:</th>
65    <td>
66        <?php if ($tpl->get('thread')->coordinator == ''): ?>
67            <i style="font-weight: normal; color: #aaa"><?php echo $tpl->getLang('none') ?></i>
68        <?php else: ?>
69            <?php echo $tpl->user_name($tpl->get('thread')->coordinator) ?>
70        <?php endif?>
71    </td>
72</tr>
73</table>
74
75<?php echo $tpl->get('thread')->content_html ?>
76
77<div class="bez_buttons">
78	<?php if (count($tpl->get('thread')->changable_fields(array('label_id', 'title', 'content', 'coordinator'))) > 0): ?>
79		<a href="<?php echo $tpl->url('thread_report', 'action', 'edit', 'id', $tpl->get('thread')->id) ?>" class="bds_inline_button">
80<?php echo $tpl->getLang('edit') ?>
81		</a>
82	<?php endif ?>
83
84	<a class="bds_inline_button" href="
85		<?php echo $tpl->mailto($tpl->user_email($tpl->get('thread')->coordinator),
86                                   '#'.$tpl->get('thread')->id.' '.$tpl->get('thread')->title,
87		$tpl->url('thread', 'id', $tpl->get('thread')->id)) ?>">
88<?php echo $tpl->getLang('send_mail') ?>
89	</a>
90
91    <?php if ($tpl->get('thread')->type == 'issue'): ?>
92        <a href="<?php echo $tpl->url('8d', 'id', $tpl->get('thread')->id) ?>" class="bds_inline_button bds_report_button">
93<?php echo $tpl->getLang('8d_report') ?>
94        </a>
95    <?php else: ?>
96        <a href="<?php echo $tpl->url('kp', 'id', $tpl->get('thread')->id) ?>" class="bds_inline_button bds_report_button">
97<?php echo $tpl->getLang('kp_report') ?>
98        </a>
99    <?php endif ?>
100</div>
101
102</div>
103
104