1<?php /* @var \dokuwiki\plugin\bez\meta\Tpl $tpl */ ?>
2<div class="bds_block">
3
4<?php if ($tpl->param('id') != ''): ?>
5    <?php $url = $tpl->url('thread_report', 'action', 'update', 'id', $tpl->param('id')) ?>
6<?php else: ?>
7    <?php $url = $tpl->url('thread_report', 'action', 'add') ?>
8<?php endif ?>
9
10<?php if ($tpl->param('id') != ''): ?>
11    <?php $type = $tpl->get('thread')->type ?>
12<?php else: ?>
13    <?php $type = $tpl->param('type') ?>
14<?php endif ?>
15
16<form class="bez_form" action="<?php echo $url ?>" method="POST">
17
18<?php if ($type == 'project'): ?>
19    <input type="hidden" name="type" value="project" />
20<?php else: ?>
21    <input type="hidden" name="type" value="issue" />
22<?php endif ?>
23
24<input type="hidden" name="id" value="bez:threads">
25
26<?php $class = 'prNone'; ?>
27<?php if ($tpl->param('id') != ''): ?>
28    <?php $class = 'pr' . $tpl->get('thread')->priority ?>
29<?php endif ?>
30<fieldset id="bds_issue_box"  class="bds_form <?php echo $class ?>">
31
32<?php if ($tpl->param('action') == 'edit'): ?>
33<div class="row">
34<label for="id"><?php echo $tpl->getLang('id') ?>:</label>
35<span><strong>#<?php echo $tpl->get('thread')->id ?></strong></span>
36</div>
37<?php endif ?>
38
39<?php if ($type != 'project' &&
40    $tpl->get('thread')->acl_of('label_id') >= BEZ_PERMISSION_CHANGE): ?>
41<div class="row">
42<label for="label_id"><?php echo $tpl->getLang('type') ?>:</label>
43<span>
44<select name="label_id" id="label_id">
45<option <?php if ($tpl->value('label_id') == '') echo 'selected' ?>
46	value="">--- <?php echo $tpl->getLang('issue_type_no_specified') ?> ---</option>
47<?php foreach ($tpl->get('labels') as $label): ?>
48	<option <?php if ($tpl->value('label_id') == $label->id) echo 'selected' ?>
49	 value="<?php echo $label->id ?>"><?php echo $label->name ?></option>
50<?php endforeach ?>
51</select>
52</span>
53</div>
54<?php endif ?>
55
56<?php if ($tpl->get('thread')->acl_of('coordinator') >= BEZ_PERMISSION_CHANGE): ?>
57<div class="row">
58<label for="coordinator"><?php echo $tpl->getLang('coordinator') ?>:</label>
59<span>
60<select name="coordinator" id="coordinator" data-validation="required">
61    <option value="">--- <?php echo $tpl->getLang('select') ?>---</option>
62<?php foreach ($tpl->get('users') as $nick => $name): ?>
63	<option <?php if ($tpl->value('coordinator') == $nick) echo 'selected' ?>
64	 value="<?php echo $nick ?>"><?php echo $name ?></option>
65<?php endforeach ?>
66</select>
67</span>
68</div>
69<?php endif ?>
70
71<div class="row">
72<label for="title"><?php echo $tpl->getLang('title') ?>:</label>
73<span>
74<input name="title" id="title" value="<?php echo $tpl->value('title') ?>" data-validation="required">
75</span>
76</div>
77
78<div class="row">
79<label for="content"><?php echo $tpl->getLang('description') ?>:</label>
80<span>
81	<div class="bez_description_toolbar"></div>
82	<textarea name="content" id="content" class="edit" data-validation="required"><?php echo $tpl->value('content') ?></textarea>
83</span>
84</div>
85
86<?php if ($tpl->get('thread')->acl_of('private') >= BEZ_PERMISSION_CHANGE): ?>
87    <div class="row">
88        <label for="private"><?php echo $tpl->getLang('private') ?>:</label>
89        <span><input <?php if ($tpl->value('private') == '1') echo 'checked' ?>
90                    type="checkbox" name="private" value="1" id="private" /></span>
91    </div>
92<?php endif ?>
93
94<div class="row">
95    <label></label>
96    <span style="padding-top:0px;">
97        <input type="submit" value="<?php echo $tpl->getLang('save') ?>">&nbsp;&nbsp;
98
99        <?php if ($tpl->param('id') != ''): ?>
100            <?php $url = $tpl->url('thread', 'id', $tpl->get('thread')->id) ?>
101        <?php else: ?>
102            <?php $url = $tpl->url('threads') ?>
103        <?php endif ?>
104
105        <a href="<?php echo $url ?>" class="bez_delete_button bez_link_button">
106            <?php echo $tpl->getLang('cancel')?>
107        </a>
108    </span>
109</div>
110</fieldset>
111
112</form>
113</div>
114