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