xref: /plugin/bez/tpl/task.php (revision 038c5d4a6a969d879580f53f12ade1bfabd5474f)
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' && $tpl->get('task')->can_add_comments()): ?>
73        <?php include 'task_comment_form.php' ?>
74    <?php endif ?>
75
76    </div>
77
78<div class="bez_right_col" style="position:relative; top: -15px;">
79
80    <div class="bez_box bez_subscribe_box">
81        <h2><?php echo $tpl->getLang('norifications') ?></h2>
82        <?php if ($tpl->get('task')->is_subscribent()): ?>
83            <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>
84            <p><?php echo $tpl->getLang('task_subscribed_info') ?></p>
85        <?php else: ?>
86            <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>
87            <p><?php echo $tpl->getLang('task_not_subscribed_info') ?></p>
88        <?php endif ?>
89
90    </div>
91
92    <div class="bez_box">
93        <h2><?php echo $tpl->getLang('comment_participants') ?></h2>
94        <ul id="issue_participants">
95            <?php foreach ($tpl->get('task')->get_participants() as $participant): ?>
96                <li><a href="<?php echo $tpl->mailto($tpl->user_email($participant['user_id']),
97                                                     '#z'.$tpl->get('task')->id,
98                                                     $tpl->url('task', 'tid', $tpl->get('task')->id)) ?>"
99                       title="<?php echo $participant['user_id'] ?>">
100                        <span class="bez_name"><?php echo $tpl->user_name($participant['user_id']) ?></span>
101                        <span class="bez_icons">
102		<?php if($participant['original_poster']): ?>
103            <span class="bez_awesome"
104                  title="<?php echo $tpl->getLang('reporter') ?>">
105				&#xf058;
106			</span>
107        <?php endif ?>
108            <?php if($participant['assignee']): ?>
109                <span class="bez_awesome"
110                      title="<?php echo $tpl->getLang('executor') ?>">
111				&#xf073;
112			</span>
113                <?php endif ?>
114                <?php if($participant['commentator']): ?>
115                    <span class="bez_awesome"
116                          title="<?php echo $tpl->getLang('commentator') ?>">
117				&#xf27a;
118			</span>
119                <?php endif ?>
120                <?php if($participant['subscribent']): ?>
121                    <span class="bez_awesome"
122                          title="<?php echo $tpl->getLang('subscribent') ?>">
123				&#xf0e0;
124			</span>
125                            <?php endif ?>
126		</span>
127                    </a></li>
128            <?php endforeach ?>
129        </ul>
130
131        <?php if ($tpl->get('task')->acl_of('participants') >= BEZ_PERMISSION_CHANGE): ?>
132            <h2><?php echo $tpl->getLang('issue_invite_header') ?></h2>
133            <form action="<?php echo $tpl->url('task', 'tid', $tpl->get('task')->id, 'action', 'invite') ?>" method="post" id="bez_invite_users_form">
134                <div id="bez_invite_users" class="ui-widget">
135                    <select name="client">
136                        <option value="">--- <?php echo $tpl->getLang('select') ?> ---</option>
137                        <?php foreach (array_diff_key($tpl->get('users'), $tpl->get('task')->get_participants('subscribent')) as $user_id => $ignore): ?>
138                            <option value="<?php echo $user_id ?>"><?php echo $tpl->user_name($user_id) ?></option>
139                        <?php endforeach ?>
140                    </select>
141                </div>
142                <button class="bez_subscribe_button"><?php echo $tpl->getLang('issue_invite_button') ?></button>
143            </form>
144        <?php endif ?>
145
146
147    </div>
148
149
150</div>
151
152</div>
153
154