1<?php /* @var \dokuwiki\plugin\bez\meta\Tpl $tpl */ ?>
2<a id="k<?php echo $tpl->get('thread_comment')->id ?>"></a>
3<div class="bez_comment
4	<?php echo $tpl->get('thread_comment')->type == 'comment' ? 'bez_type_0' : 'bez_cause' ?>
5	<?php
6		if ($tpl->get('thread_comment')->author == $tpl->current_user()) {
7			echo 'bez_my_comment';
8		}
9	?>">
10	<div class="bez_avatar">
11		<img src="<?php echo DOKU_URL ?>lib/plugins/bez/images/avatar_default.png" />
12	</div>
13	<div class="bez_text_comment">
14		<span class="bez_arrow-tip-container ">
15			<span class="bez_arrow-tip ">
16				<span class="bez_arrow-tip-grad"></span>
17			</span>
18		</span>
19		<div class="commcause_content">
20			<h2>
21                <a href="#k<?php echo $tpl->get('thread_comment')->id ?>">#k<?php echo $tpl->get('thread_comment')->id ?></a>
22                <strong><?php echo $tpl->user_name($tpl->get('thread_comment')->author) ?></strong>
23
24               <?php echo $tpl->getLang($tpl->get('thread_comment')->type . '_added') ?>
25
26                <?php echo $tpl->datetime($tpl->get('thread_comment')->create_date) ?>
27
28
29                <?php if ($tpl->param('kid') != $tpl->get('thread_comment')->id): ?>
30                    <div class="bez_comment_buttons">
31                        <?php if (  $tpl->get('thread')->can_add_comments() &&
32                                    count($tpl->get('thread_comment')->changable_fields()) > 0): ?>
33                            <a class="bez_comment_button"
34                               href="<?php echo $tpl->url('thread', 'id', $tpl->get('thread')->id, 'action', 'commcause_edit', 'kid', $tpl->get('thread_comment')->id) ?>#k_">
35                                <span class="bez_awesome">&#xf040;</span>
36                            </a>
37                            <?php if (  $tpl->get('thread_comment')->acl_of('id') >= BEZ_PERMISSION_DELETE &&
38                                        $tpl->get('thread_comment')->task_count == 0): ?>
39                                <a class="bez_comment_button bez_commcause_delete_prompt"
40                                   data-kid="<?php echo $tpl->get('thread_comment')->id ?>"
41                                   href="<?php echo $tpl->url('thread', 'id', $tpl->get('thread')->id, 'action', 'commcause_delete', 'kid', $tpl->get('thread_comment')->id) ?>">
42                                    <span class="bez_awesome">&#xf00d;</span>
43                                </a>
44                            <?php endif ?>
45                        <?php endif ?>
46                    </div>
47                <?php endif ?>
48			</h2>
49			<div class="bez_content">
50				<?php echo $tpl->get('thread_comment')->content_html; ?>
51            </div>
52		</div>
53
54		<?php if ($tpl->get('thread_comment')->type !== 'comment'): ?>
55        <?php if ($tpl->get('tasks ' . $tpl->get('thread_comment')->id) == '')
56            $tpl->set('causes_without_tasks', true) ?>
57		<div style="margin-top: 10px; margin-left: 40px">
58			<?php foreach ($tpl->get('tasks ' . $tpl->get('thread_comment')->id, array()) as $task): ?>
59				<?php $tpl->set('task', $task) ?>
60				<?php if (	$tpl->param('action') == 'task_edit' &&
61                            $tpl->param('tid') == $task->id): ?>
62					<?php include 'task_form.php' ?>
63				<?php else: ?>
64					<?php include 'task_box.php' ?>
65                    <br>
66				<?php endif ?>
67			<?php endforeach ?>
68			<?php if ($tpl->get('thread')->user_is_coordinator()): ?>
69				<?php if (	$tpl->param('action') == 'task_add' &&
70                            $tpl->param('kid') == $tpl->get('thread_comment')->id): ?>
71					<?php include 'task_form.php' ?>
72				<?php elseif (	$tpl->get('thread_comment')->type != 'comment' &&
73                                $tpl->get('thread')->can_add_tasks() &&
74                                $tpl->param('action') != 'task_edit'): ?>
75						<div class="bez_second_lv_buttons" style="margin-top:10px">
76							<a href="<?php echo $tpl->url('thread', 'id', $tpl->get('thread')->id, 'kid', $tpl->get('thread_comment')->id, 'action', 'task_add') ?>#z_" class="bez_subscribe_button">
77								<span class="bez_awesome">&#xf0fe;</span>&nbsp;&nbsp;
78								<?php if ($tpl->get('thread_comment')->type == 'cause'): ?>
79									<?php echo $tpl->getLang('corrective_action_add') ?>
80								<?php else: ?>
81									<?php echo $tpl->getLang('improvement_action_add') ?>
82								<?php endif ?>
83							</a>
84						</div>
85					<?php endif ?>
86			<?php endif ?>
87		</div>
88		<?php endif ?>
89
90	</div>
91</div>
92