xref: /plugin/bez/tpl/commcause_box.php (revision aa89e6f87daa9b559eea182b8567d772dfa4ce7f)
1<a id="k<?php echo $template['commcause']->id ?>"></a>
2<div class="bez_comment
3	<?php
4		if ($template['commcause']->type > 0) {
5			echo "bez_cause";
6		} else {
7			echo 'bez_type_0';
8		}
9	?>
10	<?php
11		if ($template['commcause']->reporter == $this->model->users->get_user_full_name($INFO['client'])) {
12			echo "bez_my_comment";
13		}
14	?>">
15	<div class="bez_avatar">
16		<img src="<?php echo DOKU_URL ?>lib/plugins/bez/images/avatar_default.png" />
17	</div>
18	<div class="bez_text_comment">
19		<span class="bez_arrow-tip-container">
20			<span class="bez_arrow-tip">
21				<span class="bez_arrow-tip-grad"></span>
22			</span>
23		</span>
24		<div class="commcause_content">
25			<h2>
26				<strong><?php echo $this->model->users->get_user_full_name($template['commcause']->reporter) ?></strong>
27				<?php echo $bezlang['comment_added'] ?>
28				<?php echo $template['commcause']->datetime ?>
29
30			<div class="bez_comment_buttons">
31			<?php if (
32                (!isset($template['no_edit']) || $template['no_edit'] === false) &&
33                $template['issue']->state === '0' &&
34                (   ($template['commcause']->type === '0' &&
35                     $template['commcause']->reporter == $INFO['client']) ||
36						$template['issue']->get_level() >= 15)
37				): ?>
38
39				<a class="bez_comment_button"
40				href="?id=<?php echo $this->id('issue', 'id', $template['issue']->id, 'action', 'commcause_edit', 'kid', $template['commcause']->id) ?>#k_">
41					<span class="bez_awesome">&#xf040;</span>
42				</a>
43                <?php if ($template['commcause']->tasks_count === 0): ?>
44				<a class="bez_comment_button bez_commcause_delete_prompt"
45					data-kid="<?php echo $template['commcause']->id ?>"
46					href="?id=<?php echo $this->id('issue', 'id', $template['issue']->id, 'action', 'commcause_delete', 'kid', $template['commcause']->id) ?>">
47					<span class="bez_awesome">&#xf00d;</span>
48				</a>
49                <?php endif ?>
50			<?php endif ?>
51			</div>
52
53			</h2>
54			<div class="bez_content">
55				<?php echo $template['commcause']->content_cache; ?>
56			</div>
57		</div>
58
59		<?php if (is_array($template['commcauses_tasks'][$template['commcause']->id])): ?>
60		<div style="margin-top: 10px; margin-left: 40px">
61			<?php foreach ($template['commcauses_tasks'][$template['commcause']->id] as $task): ?>
62				<?php $template['task'] = $task ?>
63				<?php if (	$template['action'] === 'task_edit' &&
64							$template['tid'] === $template['task']->id): ?>
65					<?php include 'task_form.php' ?>
66				<?php else: ?>
67					<?php include 'task_box.php' ?>
68				<?php endif ?>
69			<?php endforeach ?>
70			<?php if ($template['issue']->get_level() >= 15): ?>
71				<?php if (	$template['action'] === 'task_commcause_add' &&
72							$template['kid'] === $template['commcause']->id): ?>
73					<?php include 'task_form.php' ?>
74				<?php elseif (	(!isset($template['no_edit']) || $template['no_edit'] === false) &&
75                                $template['commcause']->type !== '0' &&
76                              	$template['issue']->state === '0' &&
77								$template['action'] !== 'task_edit'): ?>
78						<div class="bez_second_lv_buttons">
79							<a href="?id=<?php echo $this->id('issue', 'id', $template['issue']->id, 'kid', $template['commcause']->id, 'action', 'task_commcause_add') ?>#z_" class="bez_subscribe_button">
80								<span class="bez_awesome">&#xf0fe;</span>&nbsp;&nbsp;
81								<?php if ($template['commcause']->type === '1'): ?>
82									<?php echo $bezlang['corrective_action_add'] ?>
83								<?php else: ?>
84									<?php echo $bezlang['preventive_action_add'] ?>
85								<?php endif ?>
86							</a>
87						</div>
88					<?php endif ?>
89			<?php endif ?>
90		</div>
91		<?php endif ?>
92	</div>
93</div>
94