1<?php /* @var \dokuwiki\plugin\bez\meta\Tpl $tpl */ ?>
2<?php $url = $tpl->url('thread', 'id', $tpl->get('thread')->id, 'action',
3	$tpl->param('action') == 'commcause_edit' ? 'commcause_edit' : 'commcause_add',
4'kid', $tpl->param('kid')) ?>
5<a id="k_"></a>
6<form class="bez_form_blank" action="<?php echo $url ?>" method="POST">
7	<input type="hidden" name="id" value="">
8	<div class="bez_comment bez_comment_form">
9		<div class="bez_avatar">
10			<img src="<?php echo DOKU_URL ?>lib/plugins/bez/images/avatar_default.png" />
11		</div>
12		<div class="bez_text_comment">
13			<span class="bez_arrow-tip-container">
14				<span class="bez_arrow-tip">
15					<span class="bez_arrow-tip-grad"></span>
16				</span>
17			</span>
18			<div class="commcause_content">
19			<h2>
20				<?php if ($tpl->get('thread_comment')->acl_of('type') >= BEZ_PERMISSION_CHANGE &&
21                          $tpl->get('thread')->can_add_causes()): ?>
22				<ul class="bez_tabs">
23					<li
24                        <?php if (  $tpl->value('type') == '' ||
25                                    $tpl->value('type') == 'comment') echo 'class="active"' ?>
26                        <?php if (  $tpl->param('kid') !== '' &&
27                                    $tpl->get('thread_comment')->task_count > 0)
28                                echo 'style="display:none;"';
29                        ?>
30                    >
31                        <input style="display: none" type="radio" name="type" value="comment" <?php if($tpl->value('type') == '' || $tpl->value('type') === 'comment') echo 'checked="checked"' ?>>
32                        <a href="#comment"><?php echo $tpl->getLang('comment_noun') ?></a>
33                    </li>
34					<li <?php if($tpl->value('type') === 'cause') echo 'class="active"' ?>>
35                        <input style="display: none" type="radio" name="type" value="cause" <?php if($tpl->value('type') === 'cause') echo 'checked="checked"' ?>>
36                        <a href="#cause"><?php echo $tpl->getLang('cause_noun') ?></a>
37                    </li>
38                    <li <?php if($tpl->value('type') === 'risk') echo 'class="active"' ?>>
39                        <input style="display: none" type="radio" name="type" value="risk" <?php if($tpl->value('type') === 'risk') echo 'checked="checked"' ?>>
40                        <a href="#cause"><?php echo $tpl->getLang('risk_noun') ?></a>
41                    </li>
42                    <li <?php if($tpl->value('type') === 'opportunity') echo 'class="active"' ?>>
43                        <input style="display: none" type="radio" name="type" value="opportunity" <?php if($tpl->value('type') === 'opportunity') echo 'checked="checked"' ?>>
44                        <a href="#cause"><?php echo $tpl->getLang('opportunity_noun') ?></a>
45                    </li>
46				</ul>
47                <?php else: ?>
48                <ul class="bez_tabs">
49                    <li class="active">
50                        <a href="#comment"><?php echo $tpl->getLang('comment_noun') ?></a>
51                    </li>
52                </ul>
53				<?php endif ?>
54			</h2>
55			</div>
56			<div class="bez_content">
57                <div class="bez_toolbar" style="line-height:0"></div>
58				<textarea name="content" class="bez_textarea_content" id="content1"><?php echo $tpl->value('content') ?></textarea>
59
60                <div class="plugin__bez_form_buttons">
61
62                <div class="plugin__bez_form_buttons_container">
63                <?php if ($tpl->param('kid') != ''): ?>
64                    <a href="<?php echo $tpl->url('thread', 'id', $tpl->get('thread')->id) ?><?php if ($tpl->param('kid') != '') echo '#k'.$tpl->param('kid') ?>"
65                       class="plugin__bez_button plugin__bez_button_red">
66                        <?php echo $tpl->getLang('cancel') ?>
67                    </a>
68                <?php endif ?>
69
70                <?php if ($tpl->get('thread')->can_add_comments()): ?>
71                    <button class="plugin__bez_button plugin__bez_button_green" name="fn" value="comment_add">
72                        <?php echo $tpl->param('kid') != '' ? $tpl->getLang('correct') : $tpl->getLang('add') ?>
73                    </button>
74                <?php endif ?>
75                <?php if ($tpl->param('kid') == '' && $tpl->get('thread')->acl_of('state') >= BEZ_PERMISSION_CHANGE): ?>
76                    <?php if ($tpl->get('thread')->can_be_closed()): ?>
77                        <button class="plugin__bez_button plugin__bez_button_gray" name="fn" value="thread_close">
78                            <?php echo $tpl->getLang('js')['close_issue' . $tpl->get('lang_suffix')] ?>
79                        </button>
80                    <?php elseif ($tpl->get('thread')->can_be_rejected()): ?>
81                        <button class="plugin__bez_button plugin__bez_button_gray" name="fn" value="thread_reject">
82                            <?php echo $tpl->getLang('js')['reject_issue' . $tpl->get('lang_suffix')] ?>
83                        </button>
84                    <?php elseif ($tpl->get('thread')->can_be_reopened()): ?>
85                        <button class="plugin__bez_button plugin__bez_button_gray" name="fn" value="thread_reopen">
86                            <?php echo $tpl->getLang('js')['reopen_issue'. $tpl->get('lang_suffix')]  ?>
87                        </button>
88                    <?php endif ?>
89                <?php endif ?>
90                </div>
91                </div>
92		</div>
93        <?php if (  $tpl->param('kid') != '' &&
94                    $tpl->get('thread_comment')->task_count > 0): ?>
95            <div style="margin-top: 10px; margin-left: 40px">
96                <?php foreach ($tpl->get('tasks ' . $tpl->get('thread_comment')->id, array()) as $task): ?>
97                    <?php $tpl->set('task', $task) ?>
98                    <?php if (	$tpl->param('action') == 'task_edit' &&
99                        $tpl->param('tid') == $task->id): ?>
100                        <?php include 'task_form.php' ?>
101                    <?php else: ?>
102                        <?php include 'task_box.php' ?>
103                    <?php endif ?>
104                <?php endforeach ?>
105            </div>
106        <?php endif ?>
107    </div>
108    </div>
109</form>
110