xref: /plugin/bez/tpl/commcause_box.php (revision a99642a4e080c577ca6bae05ecac75de931fb219)
1<div class="bez_comment
2	<?php
3		if ($template['commcause']->type > 0) {
4			echo "bez_cause";
5		} else {
6			echo 'bez_type_0';
7		}
8	?>
9	<?php
10		if ($template['commcause']->reporter == $this->model->users->get_user_full_name($INFO['client'])) {
11			echo "bez_my_comment";
12		}
13	?>">
14	<div class="bez_avatar">
15		<img src="<?php echo DOKU_URL ?>lib/plugins/bez/images/avatar_default.png" />
16	</div>
17	<div class="bez_text_comment">
18		<span class="bez_arrow-tip-container">
19			<span class="bez_arrow-tip">
20				<span class="bez_arrow-tip-grad"></span>
21			</span>
22		</span>
23		<h2>
24			<strong><?php echo $this->model->users->get_user_full_name($template['commcause']->reporter) ?></strong>
25			<?php echo $bezlang['comment_added'] ?>
26			<?php echo $template['commcause']->datetime ?>
27
28		<div class="bez_comment_buttons">
29		<?php if ($template['issue']->state === '0' &&
30				(	($template['commcause']->type === '0' && $template['commcause']->reporter == $INFO['client']) ||
31					$template['issue']->get_level() >= 15)
32			): ?>
33
34			<a class="bez_comment_button"
35			href="?id=<?php echo $this->id('issue', 'id', $template['issue']->id, 'action', 'commcause_edit', 'kid', $template['commcause']->id) ?>#k_">
36				<span class="bez_awesome">&#xf040;</span>
37			</a>
38			<a class="bez_comment_button bez_delete_prompt"
39			href="?id=<?php echo $this->id('issue', 'id', $template['issue']->id, 'action', 'commcause_delete', 'kid', $template['commcause']->id) ?>">
40				<span class="bez_awesome">&#xf00d;</span>
41			</a>
42		<?php endif ?>
43		</div>
44
45		</h2>
46		<div class="bez_content">
47			<?php echo $template['commcause']->content_cache; ?>
48		</div>
49		<?php if ($template['issue']->get_level() >= 15 && $template['commcause']->type !== '0'): ?>
50			<div class="bez_second_lv_buttons" style="margin-top: 5px; margin-left: 14px">
51			<?php if (	$template['action'] === 'task_commcause_add' &&
52						$template['kid'] === $template['commcause']->id): ?>
53				<?php include 'task_form.php' ?>
54			<?php elseif ($template['commcause']->type !== '0'): ?>
55					<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">
56						<span class="bez_awesome">&#xf0fe;</span>&nbsp;&nbsp;
57						<?php if ($template['commcause']->type === '1'): ?>
58							<?php echo $bezlang['corrective_action_add'] ?>
59						<?php else: ?>
60							<?php echo $bezlang['preventive_action_add'] ?>
61						<?php endif ?>
62					</a>
63				<?php endif ?>
64			</div>
65		<?php endif ?>
66	</div>
67</div>
68