xref: /plugin/bez/tpl/thread.php (revision ff14b1073c2dab2f863cab3b8baf8b1a01f7993a)
1<?php /* @var \dokuwiki\plugin\bez\meta\Tpl $tpl */ ?>
2<?php include "thread_box.php" ?>
3
4<!-- Comments -->
5<div class="bez_comments">
6	<div class="bez_left_col">
7		<!-- Correction -->
8		<div style="margin-top: 10px">
9			<?php foreach ($tpl->get('tasks')['corrections'] as $task): ?>
10				<?php $tpl->set('task', $task) ?>
11				<?php if (	$tpl->param('action') == 'task_edit' &&
12                            $tpl->param('tid') == $task->id): ?>
13					<?php include 'task_form.php' ?>
14				<?php else: ?>
15					<?php include 'task_box.php' ?>
16				<?php endif ?>
17
18			<?php endforeach ?>
19			<?php if (  $tpl->param('action') == 'task_add' &&
20                        $tpl->param('kid') == ''): ?>
21				<?php include 'task_form.php' ?>
22			<?php endif ?>
23		</div>
24
25		<div class="bez_second_lv_buttons" style="margin-top: 10px">
26			<?php if (	$tpl->get('thread')->user_is_coordinator() &&
27                        $tpl->get('thread')->state == 'opened'): ?>
28				<a href="<?php echo $tpl->url('thread', 'id', $tpl->get('thread')->id, 'action', 'task_add') ?>#z_" class="bez_subscribe_button">
29					<span class="bez_awesome">&#xf0fe;</span>&nbsp;&nbsp;<?php echo $tpl->getLang('correction_add') ?>
30				</a>
31			<?php endif ?>
32			<a href="#" class="bez_subscribe_button bez_hide_comments">
33				<span class="bez_awesome">&#xf070;</span>&nbsp;&nbsp;<?php echo $tpl->getLang('hide_comments') ?>
34			</a>
35			<a href="#" class="bez_subscribe_button bez_show_comments">
36				<span class="bez_awesome">&#xf06e;</span>&nbsp;&nbsp;<?php echo $tpl->getLang('show_comments') ?>
37			</a>
38		</div>
39
40		<?php foreach ($tpl->get('thread_comments') as $thread_comment): ?>
41            <?php $tpl->set('thread_comment', $thread_comment) ?>
42			<?php if (	$tpl->param('action') == 'commcause_edit' &&
43						$tpl->param('kid') == $thread_comment->id): ?>
44				<?php include 'commcause_form.php' ?>
45			<?php else: ?>
46                <?php //$tpl->set('causes_without_tasks') ?>
47				<?php include 'commcause_box.php' ?>
48			<?php endif ?>
49		<?php endforeach ?>
50
51        <?php if ($tpl->get('thread')->state == 'closed'): ?>
52            <div class="plugin__bez_status_label">
53            <span class="icon icon_green">
54                <?php echo inlineSVG(DOKU_PLUGIN . 'bez/images/tick.svg') ?>
55            </span>
56                <?php printf($tpl->getLang('user_closed_issue'),
57                             '<strong>' . $tpl->user_name($tpl->get('thread')->closed_by) . '</strong>',
58                             $tpl->date_fuzzy_age($tpl->get('thread')->close_date)) ?>
59            </div>
60        <?php elseif ($tpl->get('thread')->state == 'rejected'): ?>
61                <div class="plugin__bez_status_label">
62            <span class="icon icon_red">
63                <?php echo inlineSVG(DOKU_PLUGIN . 'bez/images/close.svg') ?>
64            </span>
65                    <?php printf($tpl->getLang('user_rejected_issue'),
66                                 '<strong>' . $tpl->user_name($tpl->get('thread')->closed_by) . '</strong>',
67                                 $tpl->date_fuzzy_age($tpl->get('thread')->close_date)) ?>
68                </div>
69        <?php endif ?>
70
71
72<?php if (	!(strpos($tpl->param('action'), 'task') === 0) &&
73            $tpl->param('action') != 'commcause_edit'): ?>
74
75    <?php include 'commcause_form.php' ?>
76
77    <br>
78    <?php if ($tpl->get('thread')->task_count - $tpl->get('thread')->task_count_closed > 0): ?>
79        <div class="info"><?php echo $tpl->getLang('issue_unclosed_tasks') ?></div>
80    <?php endif ?>
81    <?php if ($tpl->get('thread')->state == 'proposal'): ?>
82        <div class="info"><?php echo $tpl->getLang('issue_is_proposal') ?></div>
83    <?php endif ?>
84    <?php if ($tpl->get('causes_without_tasks')): ?>
85        <div class="info"><?php echo $tpl->getLang('cause_without_task') ?></div>
86    <?php endif ?>
87    <?php if ($tpl->get('thread')->state == 'opened' && $tpl->get('thread')->task_count == 0): ?>
88        <div class="info"><?php echo $tpl->getLang('issue_no_tasks') ?></div>
89    <?php endif ?>
90<?php endif ?>
91
92
93</div>
94<div class="bez_right_col">
95
96<div class="bez_box">
97<h2><?php echo $tpl->getLang('comment_last_activity') ?></h2>
98
99<?php echo $tpl->datetime($tpl->get('thread')->last_activity_date) ?>
100
101
102</div>
103
104<div class="bez_box bez_subscribe_box">
105<h2><?php echo $tpl->getLang('norifications') ?></h2>
106<?php if ($tpl->get('thread')->is_subscribent()): ?>
107	<a href="<?php echo $tpl->url('thread', 'id', $tpl->get('thread')->id, 'action', 'unsubscribe') ?>" class="bez_subscribe_button"><span class="bez_awesome">&#xf1f6;</span>&nbsp;&nbsp;<?php echo $tpl->getLang('unsubscribe') ?></a>
108	<p><?php echo $tpl->getLang('subscribed_info') ?></p>
109<?php else: ?>
110	<a href="<?php echo $tpl->url('thread', 'id', $tpl->get('thread')->id, 'action', 'subscribe') ?>" class="bez_subscribe_button"><span class="bez_awesome">&#xf0f3;</span>&nbsp;&nbsp;<?php echo $tpl->getLang('subscribe') ?></a>
111	<p><?php echo $tpl->getLang('subscribed_info') ?></p>
112<?php endif ?>
113
114</div>
115
116<div class="bez_box">
117<h2><?php echo $tpl->getLang('comment_participants') ?></h2>
118<ul id="issue_participants">
119<?php foreach ($tpl->get('thread')->get_participants() as $participant): ?>
120	<li><a href="<?php echo $tpl->mailto($tpl->user_email($participant['user_id']),
121		'#'.$tpl->get('thread')->id.' '.$tpl->get('thread')->title,
122		$tpl->url('thread', 'id', $tpl->get('thread')->id)) ?>"  title="<?php echo $participant['user_id'] ?>">
123		<span class="bez_name"><?php echo $tpl->user_name($participant['user_id']) ?></span>
124		<span class="bez_icons">
125		<?php if($participant['original_poster']): ?>
126			<span class="bez_awesome"
127				title="<?php echo $tpl->getLang('reporter') ?>">
128				&#xf058;
129			</span>
130		<?php endif ?>
131		<?php if($participant['coordinator']): ?>
132			<span class="bez_awesome"
133				title="<?php echo $tpl->getLang('coordinator') ?>">
134				&#xf0e3;
135			</span>
136		<?php endif ?>
137		<?php if($participant['task_assignee']): ?>
138			<span class="bez_awesome"
139				title="<?php echo $tpl->getLang('executor') ?>">
140				&#xf073;
141			</span>
142		<?php endif ?>
143		<?php if($participant['commentator']): ?>
144			<span class="bez_awesome"
145				title="<?php echo $tpl->getLang('commentator') ?>">
146				&#xf27a;
147			</span>
148		<?php endif ?>
149		<?php if($participant['subscribent']): ?>
150			<span class="bez_awesome"
151				title="<?php echo $tpl->getLang('subscribent') ?>">
152				&#xf0e0;
153			</span>
154		<?php endif ?>
155		</span>
156	</a></li>
157<?php endforeach ?>
158</ul>
159
160<?php if (	$tpl->get('thread')->user_is_coordinator() &&
161            $tpl->get('thread')->state == 'opened'): ?>
162    <h2><?php echo $tpl->getLang('issue_invite_header') ?></h2>
163    <form action="<?php echo $tpl->url('thread', 'id', $tpl->get('thread')->id, 'action', 'invite') ?>" method="post" id="bez_invite_users_form">
164    <div id="bez_invite_users" class="ui-widget">
165        <select name="client">
166            <option value="">--- <?php echo $tpl->getLang('select') ?> ---</option>
167            <?php foreach (array_diff_key($tpl->get('users'), $tpl->get('thread')->get_participants('subscribent')) as $user_id => $ignore): ?>
168                <option value="<?php echo $user_id ?>"><?php echo $tpl->user_name($user_id) ?></option>
169            <?php endforeach ?>
170        </select>
171    </div>
172    <button class="bez_subscribe_button"><?php echo $tpl->getLang('issue_invite_button') ?></button>
173    </form>
174<?php endif ?>
175
176
177</div>
178
179
180</div>
181
182