1<?php 2/* @var \dokuwiki\plugin\bez\meta\Tpl $tpl */ 3if ($tpl->action() == 'thread') { 4 $url = $tpl->url('thread', 'id', $tpl->get('thread')->id, 'action', $tpl->param('action'), 'tid', $tpl->param('tid'), 'kid', $tpl->param('kid')); 5 $id = 'bez:thread' . $tpl->get('thread')->id; 6} elseif ($tpl->action() == 'task_form') { 7 $url = $tpl->url('task_form', 'action', $tpl->param('action'), 'tid', $tpl->param('tid')); 8 $id = 'bez:tasks'; 9} else { 10 $url = $tpl->url('task', 'action', $tpl->param('action'), 'tid', $tpl->param('tid')); 11 $id = 'bez:tasks'; 12} 13?> 14<a name="z_"></a> 15<form class="bez_form bez_task_form" 16 action="<?php echo $url ?>" method="POST"> 17 <input type="hidden" name="id" value="<?php echo $id ?>"> 18 19 <fieldset class="bds_form"> 20 <?php if ($tpl->param('tid') != ''): ?> 21 <div class="row"> 22 <label for="id"><?php echo $tpl->getLang('id') ?>:</label> 23 <span><strong>#z<?php echo $tpl->get('task')->id ?></strong></span> 24 </div> 25 26 <?php if ($tpl->get('thread') != '' && 27 $tpl->get('task')->acl_of('thread_comment_id') >= BEZ_PERMISSION_CHANGE): ?> 28 <div class="row"> 29 <label for="thread_comment_id"><?php echo ucfirst($tpl->getLang('cause')) ?>:</label> 30 <span> 31 <select name="thread_comment_id" id="thread_comment_id"> 32 <option <?php if ($tpl->value('thread_comment_id') == '') echo 'selected' ?> 33 value="">--- <?php echo $tpl->getLang('correction') ?> ---</option> 34 35 <?php foreach ($tpl->get('thread')->get_causes() as $cause_id): ?> 36 <option <?php if ($tpl->value('thread_comment_id') == $cause_id) echo 'selected' ?> 37 value="<?php echo $cause_id ?>">#p<?php echo $cause_id ?></option> 38 <?php endforeach ?> 39 </select> 40 </span> 41 </div> 42 <?php endif ?> 43 <?php endif ?> 44 <div class="row"> 45 <label for="executor"><?php echo $tpl->getLang('executor') ?>:</label> 46 <span> 47 <?php if ($tpl->get('task')->acl_of('assignee') >= BEZ_PERMISSION_CHANGE): ?> 48 <select name="assignee" id="assignee" data-validation="required"> 49 <option value="">--- <?php echo $tpl->getLang('select') ?>---</option> 50 <?php foreach ($tpl->get('users') as $nick => $name): ?> 51 <option <?php if ($tpl->value('assignee') == $nick) echo 'selected' ?> 52 value="<?php echo $nick ?>"><?php echo $name ?></option> 53 <?php endforeach ?> 54 </select> 55 <?php else: ?> 56 <input type="hidden" name="assignee" value="<?php echo $tpl->value('assignee') ?>"> 57 <strong> 58 <?php echo $tpl->user_name($tpl->value('assignee')) ?> 59 </strong> 60 <?php endif ?> 61 62 63 </span> 64 </div> 65 66 <div class="row"> 67 <label for="content"><?php echo $tpl->getLang('description') ?>:</label> 68 <span> 69 <?php if ($tpl->get('task')->acl_of('content') >= BEZ_PERMISSION_CHANGE): ?> 70 <div class="bez_toolbar"></div> 71 <?php endif ?> 72 <textarea name="content" id="content" data-validation="required" <?php if ($tpl->get('task')->acl_of('content') < BEZ_PERMISSION_CHANGE) echo 'disabled' ?>><?php echo $tpl->value('content') ?></textarea> 73 </span> 74 </div> 75 76 <div class="row task_plan_field"> 77 <label for="plan_date"><?php echo $tpl->getLang('plan_date') ?>:</label> 78 <span> 79 <input name="plan_date" style="width:90px;" data-validation="required,date" value="<?php echo $tpl->value('plan_date') ?>" 80 <?php if ($tpl->get('task')->acl_of('plan_date') < BEZ_PERMISSION_CHANGE) echo 'disabled' ?> 81 /> 82 <div style="display:inline" id="task_datapair"> 83 <?php echo $tpl->getLang('from_hour') ?> 84 <input name="start_time" style="width:60px;" class="time start" value="<?php echo $tpl->value('start_time') ?>" 85 data-validation="required,custom" 86 data-validation-regexp="^(\d{1,2}):(\d{1,2})$" 87 data-validation-depends-on="all_day_event" 88 <?php if ($tpl->get('task')->acl_of('plan_date') < BEZ_PERMISSION_CHANGE) echo 'disabled' ?> 89 /> 90 <?php echo $tpl->getLang('to_hour') ?> 91 <input name="finish_time" style="width:60px;" class="time end" value="<?php echo $tpl->value('finish_time') ?>" 92 data-validation="required,custom" 93 data-validation-regexp="^(\d{1,2}):(\d{1,2})$" 94 data-validation-depends-on="all_day_event" 95 <?php if ($tpl->get('task')->acl_of('plan_date') < BEZ_PERMISSION_CHANGE) echo 'disabled' ?> 96 /> 97 </div> 98 </span> 99 </div> 100 101 <div class="row"> 102 <label></label> 103 <span> 104 <label> 105 <?php if ($tpl->get('task')->acl_of('all_day_event') >= BEZ_PERMISSION_CHANGE): ?> 106 <input type="checkbox" name="all_day_event" value="1" 107 <?php if ($tpl->value('all_day_event') == '' || 108 $tpl->value('all_day_event') == '1'): ?> 109 checked 110 <?php endif ?> /> 111 <?php else: ?> 112 <input type="checkbox" disabled 113 <?php if ($tpl->get('task')->all_day_event == '1'): ?> 114 checked 115 <?php endif ?> /> 116 <?php endif ?> <?php echo $tpl->getLang('all_day_event') ?> 117 </label> 118 119 </span> 120 </div> 121 122 <div class="row"> 123 <label for="tasktype"><?php echo $tpl->getLang('task_type') ?>:</label> 124 <span> 125 <select id="task_program_id" name="task_program_id" <?php if ($tpl->get('task')->acl_of('task_program_id') < BEZ_PERMISSION_CHANGE) echo 'disabled' ?>> 126 <?php if ($tpl->get('thread') != ''): ?> 127 <option <?php if ($tpl->value('task_program_id') == '') echo 'selected' ?> value=""><?php echo $tpl->getLang('tasks_no_type') ?></option> 128 <?php endif; ?> 129 130 <?php foreach ($tpl->get('task_programs') as $task_program): ?> 131 <option <?php if ($tpl->value('task_program_id') == $task_program->id) echo 'selected' ?> value="<?php echo $task_program->id ?>"><?php echo $task_program->name ?></option> 132 <?php endforeach ?> 133 </select> 134 </span> 135 </div> 136 137 <div class="row"> 138 <label for="cost"><?php echo $tpl->getLang('cost') ?>:</label> 139 <span><input type="number" name="cost" id="cost" 140 min="0" step="0.01" 141 value="<?php echo $tpl->value('cost') ?>" 142 <?php if ($tpl->get('task')->acl_of('plan_date') < BEZ_PERMISSION_CHANGE) echo 'disabled' ?>></span> 143 </div> 144 <?php if ($tpl->param('tid') != ''): ?> 145 <div class="row"> 146 <label for="task_state"><?php echo $tpl->getLang('task_state') ?>:</label> 147 <span> 148 <strong><?php echo $tpl->getLang('task_' . $tpl->get('task')->state) ?></strong> 149 </span> 150 </div> 151 <?php endif ?> 152 <div class="row"> 153 <label></label> 154 <span style="padding-top:10px;"> 155 <input type="submit" value="<?php echo $tpl->param('tid') == '' ? $tpl->getLang('add') : $tpl->getLang('correct') ?>"> 156 <a href="<?php 157 if ($tpl->action() == 'thread') { 158 echo $tpl->url('thread', 'id', $tpl->get('thread')->id); 159 } else if ($tpl->action() == 'task' && $tpl->get('task')->id != '') { 160 echo $tpl->url('task', 'tid', $tpl->get('task')->id); 161 } else if ($tpl->get('task')->program != '') { 162 echo $tpl->url('tasks', 'tasktype', $tpl->get('task')->program); 163 } else { 164 echo $tpl->url('tasks'); 165 } 166 ?><?php if ($tpl->param('tid') != '') echo '#z'.$tpl->param('tid') ?>" 167 class="bez_delete_button bez_link_button"> 168 <?php echo $tpl->getLang('cancel') ?> 169 </a> 170 </span> 171 </div> 172 </fieldset> 173</form> 174