xref: /plugin/bez/tpl/task_box.php (revision addc91ee3302cfabdbe6588b98874f0b355a06f3)
1<?php /* @var \dokuwiki\plugin\bez\meta\Tpl $tpl */ ?>
2
3<a name="z<?php echo $tpl->get('task')->id ?>"></a>
4<div id="z<?php echo $tpl->get('task')->id ?>"
5	class="bds_block task <?php echo 'state_' . $tpl->get('task')->state ?>">
6
7<div class="bez_timebox">
8    <span>
9        <strong><?php echo $tpl->getLang('open') ?>:</strong>
10        <?php echo $tpl->date($tpl->get('task')->create_date) ?>
11    </span>
12
13	<?php if ($tpl->get('task')->state != 'opened'): ?>
14
15        <span>
16            <strong><?php echo $tpl->getLang('task_' . $tpl->get('task')->state) ?>:</strong>
17            <?php echo $tpl->date($tpl->get('task')->close_date) ?>
18        </span>
19
20		<span>
21			<strong><?php echo $tpl->getLang('report_priority') ?>: </strong>
22            <?php echo $tpl->date_diff_days($tpl->get('task')->create_date, $tpl->get('task')->close_date, '%a'); ?>
23		</span>
24	<?php endif ?>
25</div>
26
27<h2>
28	<a href="<?php echo $tpl->url('task', 'tid', $tpl->get('task')->id) ?>">
29		#z<?php echo $tpl->get('task')->id ?>
30	</a>
31    <?php if ($tpl->get('task')->thread_id != '' && $tpl->get('task')->thread->type != 'project'): ?>
32	    <?php echo lcfirst($tpl->getLang('task_type_' . $tpl->get('task')->type)) ?>
33    <?php endif ?>
34	(<?php echo lcfirst($tpl->getLang('task_' . $tpl->get('task')->state)) ?>)
35</h2>
36
37<table class="bez_box_data_table">
38<tr>
39    <th><?php echo $tpl->getLang('reporter') ?>:</th>
40    <td>
41        <?php echo $tpl->user_name($tpl->get('task')->original_poster) ?>
42    </td>
43
44    <th><?php echo $tpl->getLang('executor') ?>:</th>
45    <td><?php echo $tpl->user_name($tpl->get('task')->assignee) ?></td>
46</tr>
47
48<tr>
49    <th style="white-space: nowrap;"><?php echo $tpl->getLang('plan_date') ?>:</th>
50    <td>
51        <?php echo $tpl->get('task')->plan_date ?><?php if ($tpl->get('task')->all_day_event == '0'): ?>,
52            <?php echo $tpl->get('task')->start_time ?> - <?php echo $tpl->get('task')->finish_time ?>
53        <?php endif ?>
54    </td>
55
56    <th><?php echo $tpl->getLang('task_type') ?>:</th>
57    <td>
58    <?php if ($tpl->get('task')->task_program_id == ''): ?>
59        ---
60    <?php else: ?>
61        <?php echo $tpl->get('task')->task_program_name ?>
62    <?php endif ?>
63    </td>
64</tr>
65
66<tr>
67    <th><?php echo $tpl->getLang('cost') ?>:</th>
68    <td colspan="3">
69    <?php if ($tpl->get('task')->cost == ''): ?>
70        ---
71    <?php else: ?>
72        <?php echo $tpl->get('task')->cost ?>
73    <?php endif ?>
74    </td>
75</tr>
76
77</table>
78
79<?php echo $tpl->get('task')->content_html ?>
80
81    <div class="bez_buttons">
82
83        <?php if (count($tpl->get('task')->changable_fields(
84                array('content', 'plan_date', 'all_day_event', 'start_time', 'finish_time', 'task_program_id', 'cost')
85            )) > 0): ?>
86                <a class="bds_inline_button"
87                    href="<?php
88                        if ($tpl->action() == 'thread') {
89                            echo $tpl->url('thread', 'id', $tpl->get('thread')->id, 'tid', $tpl->get('task')->id, 'action', 'task_edit');
90                        } else {
91                            echo $tpl->url('task', 'tid', $tpl->get('task')->id, 'action', 'task_edit');
92                        }
93                    ?>#z_">
94<?php echo $tpl->getLang('edit') ?>
95                </a>
96        <?php endif ?>
97
98        <a class="bds_inline_button" href="
99        <?php echo $tpl->mailto($tpl->user_email($tpl->get('task')->assignee),
100        '#z'.$tpl->get('task')->id,
101        $tpl->url('task', 'tid', $tpl->get('task')->id)) ?>">
102<?php echo $tpl->getLang('send_mail') ?>
103        </a>
104
105        <?php if ($tpl->get('task')->task_program_id != '' &&
106                  $tpl->acl('task', 'id') >= BEZ_PERMISSION_CHANGE): ?>
107            <a class="bds_inline_button"
108                    href="<?php echo $tpl->url('task_form', 'duplicate', $tpl->get('task')->id, 'task_program_id', $tpl->get('task')->task_program_id) ?>">
109<?php echo $tpl->getLang('duplicate') ?>
110            </a>
111        <?php endif ?>
112	</div>
113</div>