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