xref: /plugin/bez/tpl/task.php (revision addc91ee3302cfabdbe6588b98874f0b355a06f3)
1<?php /* @var \dokuwiki\plugin\bez\meta\Tpl $tpl */ ?>
2<?php if ($tpl->get('task')->thread_id != '' && $tpl->get('task')->thread->acl_of('id') > BEZ_PERMISSION_VIEW): ?>
3    <div id="bds_issue_box" class="pr<?php echo $tpl->get('task')->thread->priority ?>">
4        <div>
5            <strong><?php echo $tpl->getLang('issue') ?>:</strong>
6            <a href="<?php echo $tpl->url('thread', 'id', $tpl->get('task')->thread->id) ?>">
7                #<?php echo $tpl->get('task')->thread->id ?>
8            </a>
9            <strong>
10            <?php if ($tpl->get('task')->thread->type == 'project'): ?>
11                <?php echo $tpl->getLang('project') ?>
12            <?php elseif (!empty($tpl->get('task')->thread->label_name)): ?>
13                <?php echo $tpl->get('task')->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('task')->thread->state) ?>):
19            </strong>
20            <?php echo $tpl->get('task')->thread->title ?>
21        </div>
22
23        <?php if ($tpl->get('task')->thread_comment_id != ''): ?>
24            <div style="margin-top: 12px;">
25                <h2>
26                    <a href="<?php echo $tpl->url('thread', 'id', $tpl->get('task')->thread->id) ?>#k<?php echo $tpl->get('task')->thread_comment->id ?>">
27                        #k<?php echo $tpl->get('task')->thread_comment->id ?>
28                    </a>
29                    <?php echo ucfirst($tpl->getLang('cause')) ?>
30                    (<?php echo $tpl->getLang($tpl->get('task')->thread_comment->type) ?>)
31                </h2>
32                <?php echo $tpl->get('task')->thread_comment->content_html ?>
33            </div>
34        <?php endif ?>
35    </div>
36
37
38    <br>
39<?php endif ?>
40
41<?php if (	$tpl->param('action') == 'task_edit' &&
42    $tpl->param('tid') == $tpl->get('task')->id): ?>
43    <?php include 'task_form.php' ?>
44<?php else: ?>
45    <?php include 'task_box.php' ?>
46<?php endif ?>
47
48<br>
49<div class="bez_comments">
50    <div class="bez_left_col">
51    <?php foreach ($tpl->get('task_comments') as $task_comment): ?>
52        <?php $tpl->set('task_comment', $task_comment) ?>
53        <?php if (	$tpl->param('action') == 'comment_edit' &&
54            $tpl->param('zkid') == $task_comment->id): ?>
55            <?php include 'task_comment_form.php' ?>
56        <?php else: ?>
57            <?php include 'task_comment_box.php' ?>
58        <?php endif ?>
59    <?php endforeach ?>
60
61    <?php if ($tpl->get('task')->state == 'done'): ?>
62        <div class="plugin__bez_status_label">
63            <span class="icon icon_green">
64                <?php echo inlineSVG(DOKU_PLUGIN . 'bez/images/tick.svg') ?>
65            </span>
66            <?php printf($tpl->getLang('user_did_task'),
67                           '<strong>' . $tpl->user_name($tpl->get('task')->closed_by) . '</strong>',
68                           $tpl->date_fuzzy_age($tpl->get('task')->close_date)) ?>
69        </div>
70    <?php endif ?>
71
72    <?php if($tpl->param('action') != 'task_edit' && $tpl->param('action') != 'comment_edit'): ?>
73         <?php if (
74                 ($tpl->get('task')->thread_id != '' &&
75                    $tpl->get('task')->thread->can_add_tasks()) ||
76
77                 $tpl->get('task')->state == 'opened' ||
78
79                ($tpl->get('task')->state == 'done' &&
80                    $tpl->get('task')->acl_of('state') >= BEZ_PERMISSION_CHANGE)): ?>
81            <?php include 'task_comment_form.php' ?>
82        <?php endif?>
83    <?php endif ?>
84
85    </div>
86
87<div class="bez_right_col" style="position:relative; top: -15px;">
88
89    <div class="bez_box bez_subscribe_box">
90        <h2><?php echo $tpl->getLang('norifications') ?></h2>
91        <?php if ($tpl->get('task')->is_subscribent()): ?>
92            <a href="<?php echo $tpl->url('task', 'tid', $tpl->get('task')->id, 'action', 'unsubscribe') ?>" class="bez_subscribe_button"><span class="bez_awesome">&#xf1f6;</span>&nbsp;&nbsp;<?php echo $tpl->getLang('unsubscribe') ?></a>
93            <p><?php echo $tpl->getLang('task_subscribed_info') ?></p>
94        <?php else: ?>
95            <a href="<?php echo $tpl->url('task', 'tid', $tpl->get('task')->id, 'action', 'subscribe') ?>" class="bez_subscribe_button"><span class="bez_awesome">&#xf0f3;</span>&nbsp;&nbsp;<?php echo $tpl->getLang('subscribe') ?></a>
96            <p><?php echo $tpl->getLang('task_not_subscribed_info') ?></p>
97        <?php endif ?>
98
99    </div>
100
101    <div class="bez_box">
102        <h2><?php echo $tpl->getLang('comment_participants') ?></h2>
103        <ul id="issue_participants">
104            <?php foreach ($tpl->get('task')->get_participants() as $participant): ?>
105                <li><a href="<?php echo $tpl->mailto($tpl->user_email($participant['user_id']),
106                                                     '#z'.$tpl->get('task')->id,
107                                                     $tpl->url('task', 'tid', $tpl->get('task')->id)) ?>"
108                       title="<?php echo $participant['user_id'] ?>">
109                        <span class="bez_name"><?php echo $tpl->user_name($participant['user_id']) ?></span>
110                        <span class="bez_icons">
111		<?php if($participant['original_poster']): ?>
112            <span class="bez_awesome"
113                  title="<?php echo $tpl->getLang('reporter') ?>">
114				&#xf058;
115			</span>
116        <?php endif ?>
117            <?php if($participant['assignee']): ?>
118                <span class="bez_awesome"
119                      title="<?php echo $tpl->getLang('executor') ?>">
120				&#xf073;
121			</span>
122                <?php endif ?>
123                <?php if($participant['commentator']): ?>
124                    <span class="bez_awesome"
125                          title="<?php echo $tpl->getLang('commentator') ?>">
126				&#xf27a;
127			</span>
128                <?php endif ?>
129                <?php if($participant['subscribent']): ?>
130                    <span class="bez_awesome"
131                          title="<?php echo $tpl->getLang('subscribent') ?>">
132				&#xf0e0;
133			</span>
134                            <?php endif ?>
135		</span>
136                    </a></li>
137            <?php endforeach ?>
138        </ul>
139
140        <?php if ($tpl->get('task')->acl_of('participants') >= BEZ_PERMISSION_CHANGE): ?>
141            <h2><?php echo $tpl->getLang('issue_invite_header') ?></h2>
142            <form action="<?php echo $tpl->url('task', 'tid', $tpl->get('task')->id, 'action', 'invite') ?>" method="post" id="bez_invite_users_form">
143                <div id="bez_invite_users" class="ui-widget">
144                    <select name="client">
145                        <option value="">--- <?php echo $tpl->getLang('select') ?> ---</option>
146                        <?php foreach (array_diff_key($tpl->get('users'), $tpl->get('task')->get_participants('subscribent')) as $user_id => $ignore): ?>
147                            <option value="<?php echo $user_id ?>"><?php echo $tpl->user_name($user_id) ?></option>
148                        <?php endforeach ?>
149                    </select>
150                </div>
151                <button class="bez_subscribe_button"><?php echo $tpl->getLang('issue_invite_button') ?></button>
152            </form>
153        <?php endif ?>
154
155
156    </div>
157
158
159</div>
160
161</div>
162
163