xref: /plugin/bez/tpl/thread.php (revision 7fbf4c3966fc9b63e77e3ef6f091279dbce0d34f)
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('corrections') as $task): ?>
10				<?php $tpl->set('task', $task) ?>
11				<?php if (	$tpl->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->action() == 'task_correction_add'): ?>
20				<?php include 'task_form.php' ?>
21			<?php endif ?>
22		</div>
23
24		<div class="bez_second_lv_buttons" style="margin-top: 10px">
25			<?php if (	$tpl->get('thread')->user_is_coordinator() &&
26                        $tpl->get('thread')->state == 'opened'): ?>
27				<a href="<?php echo $tpl->url('thread', 'id', $tpl->get('thread')->id, 'action', 'task_correction_add') ?>#z_" class="bez_subscribe_button">
28					<span class="bez_awesome">&#xf0fe;</span>&nbsp;&nbsp;<?php echo $tpl->getLang('correction_add') ?>
29				</a>
30			<?php endif ?>
31			<a href="#" class="bez_subscribe_button bez_hide_comments">
32				<span class="bez_awesome">&#xf070;</span>&nbsp;&nbsp;<?php echo $tpl->getLang('hide_comments') ?>
33			</a>
34			<a href="#" class="bez_subscribe_button bez_show_comments">
35				<span class="bez_awesome">&#xf06e;</span>&nbsp;&nbsp;<?php echo $tpl->getLang('show_comments') ?>
36			</a>
37		</div>
38
39		<?php foreach ($tpl->get('thread_comments') as $thread_comment): ?>
40            <?php $tpl->set('thread_comment', $thread_comment) ?>
41			<?php if (	$tpl->action() == 'commcause_edit' &&
42						$tpl->param('kid') == $thread_comment->id): ?>
43				<?php include 'commcause_form.php' ?>
44			<?php else: ?>
45				<?php include 'commcause_box.php' ?>
46			<?php endif ?>
47		<?php endforeach ?>
48
49<?php if (	$tpl->get('thread')->state == 'opened' &&
50			!(strpos($tpl->action(), 'task') === 0) &&
51            $tpl->action() != 'commcause_edit'): ?>
52
53<?php include 'commcause_form.php' ?>
54
55<?php endif ?>
56
57</div>
58<div class="bez_right_col">
59
60<div class="bez_box">
61<h2><?php echo $tpl->getLang('comment_last_activity') ?></h2>
62
63<?php echo dformat(strtotime($tpl->get('thread')->last_activity_date), '%Y-%m-%d') ?>
64
65
66</div>
67
68<div class="bez_box bez_subscribe_box">
69<h2><?php echo $tpl->getLang('norifications') ?></h2>
70<?php if ($tpl->get('thread')->is_subscribent()): ?>
71	<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>
72	<p><?php echo $tpl->getLang('subscribed_info') ?></p>
73<?php else: ?>
74	<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>
75	<p><?php echo $tpl->getLang('subscribed_info') ?></p>
76<?php endif ?>
77
78</div>
79
80<div class="bez_box">
81<h2><?php echo $tpl->getLang('comment_participants') ?></h2>
82<ul id="issue_participants">
83<?php foreach ($tpl->get('thread')->get_participants() as $participant): ?>
84	<li><a href="<?php echo $tpl->mailto($tpl->user_email($participant['user_id']),
85		'#'.$tpl->get('thread')->id.' '.$tpl->get('thread')->title,
86		$tpl->url('thread', 'id', $tpl->get('thread')->id)) ?>"  title="<?php echo $participant['user_id'] ?>">
87		<span class="bez_name"><?php echo $tpl->user_name($participant['user_id']) ?></span>
88		<span class="bez_icons">
89		<?php if($participant['original_poster']): ?>
90			<span class="bez_awesome"
91				title="<?php echo $tpl->getLang('reporter') ?>">
92				&#xf058;
93			</span>
94		<?php endif ?>
95		<?php if($participant['coordinator']): ?>
96			<span class="bez_awesome"
97				title="<?php echo $tpl->getLang('coordinator') ?>">
98				&#xf0e3;
99			</span>
100		<?php endif ?>
101		<?php if($participant['task_assignee']): ?>
102			<span class="bez_awesome"
103				title="<?php echo $tpl->getLang('executor') ?>">
104				&#xf073;
105			</span>
106		<?php endif ?>
107		<?php if($participant['commentator']): ?>
108			<span class="bez_awesome"
109				title="<?php echo $tpl->getLang('commentator') ?>">
110				&#xf27a;
111			</span>
112		<?php endif ?>
113		<?php if($participant['subscribent']): ?>
114			<span class="bez_awesome"
115				title="<?php echo $tpl->getLang('subscribent') ?>">
116				&#xf0e0;
117			</span>
118		<?php endif ?>
119		</span>
120	</a></li>
121<?php endforeach ?>
122</ul>
123
124<?php if (	$tpl->get('thread')->user_is_coordinator() &&
125            $tpl->get('thread')->state == 'opened'): ?>
126    <h2><?php echo $tpl->getLang('issue_invite_header') ?></h2>
127    <form action="<?php echo $tpl->url('thread', 'id', $tpl->get('thread')->id, 'action', 'invite') ?>" method="post" id="bez_invite_users_form">
128    <div id="bez_invite_users" class="ui-widget">
129        <select name="client">
130            <option value="">--- <?php echo $tpl->getLang('select') ?> ---</option>
131            <?php foreach (array_key_diff($tpl->get('users'), $tpl->get('thread')->get_participants('subscribent')) as $user_id => $ignore): ?>
132                <option value="<?php echo $user_id ?>"><?php echo $tpl->user_name($user_id) ?></option>
133            <?php endforeach ?>
134        </select>
135    </div>
136    <button class="bez_subscribe_button"><?php echo $tpl->getLang('issue_invite_button') ?></button>
137    </form>
138<?php endif ?>
139
140
141</div>
142
143
144</div>
145
146