| Línea 211... |
Línea 211... |
| 211 |
$group = [];
|
211 |
$group = [];
|
| 212 |
$group[] = $mform->createElement('radio', 'duration', null, get_string('durationnone', 'calendar'), 0);
|
212 |
$group[] = $mform->createElement('radio', 'duration', null, get_string('durationnone', 'calendar'), 0);
|
| 213 |
$group[] = $mform->createElement('radio', 'duration', null, get_string('durationuntil', 'calendar'), 1);
|
213 |
$group[] = $mform->createElement('radio', 'duration', null, get_string('durationuntil', 'calendar'), 1);
|
| 214 |
$group[] = $mform->createElement('date_time_selector', 'timedurationuntil', '');
|
214 |
$group[] = $mform->createElement('date_time_selector', 'timedurationuntil', '');
|
| 215 |
$group[] = $mform->createElement('radio', 'duration', null, get_string('durationminutes', 'calendar'), 2);
|
215 |
$group[] = $mform->createElement('radio', 'duration', null, get_string('durationminutes', 'calendar'), 2);
|
| 216 |
$group[] = $mform->createElement('text', 'timedurationminutes', get_string('durationminutes', 'calendar'));
|
216 |
$group[] = $mform->createElement('text', 'timedurationminutes',
|
| - |
|
217 |
get_string('durationminutes', 'calendar'), 'maxlength="7" size="7"');
|
| Línea 217... |
Línea 218... |
| 217 |
|
218 |
|
| 218 |
$mform->addGroup($group, 'durationgroup', get_string('eventduration', 'calendar'), '<br />', false);
|
219 |
$mform->addGroup($group, 'durationgroup', get_string('eventduration', 'calendar'), '<br />', false);
|
| Línea 219... |
Línea 220... |
| 219 |
$mform->setAdvanced('durationgroup');
|
220 |
$mform->setAdvanced('durationgroup');
|
| Línea 225... |
Línea 226... |
| 225 |
$mform->disabledIf('timedurationuntil[hour]', 'duration', 'noteq', 1);
|
226 |
$mform->disabledIf('timedurationuntil[hour]', 'duration', 'noteq', 1);
|
| 226 |
$mform->disabledIf('timedurationuntil[minute]', 'duration', 'noteq', 1);
|
227 |
$mform->disabledIf('timedurationuntil[minute]', 'duration', 'noteq', 1);
|
| Línea 227... |
Línea 228... |
| 227 |
|
228 |
|
| 228 |
$mform->setType('timedurationminutes', PARAM_INT);
|
229 |
$mform->setType('timedurationminutes', PARAM_INT);
|
| - |
|
230 |
$mform->disabledIf('timedurationminutes', 'duration', 'noteq', 2);
|
| - |
|
231 |
$mform->addGroupRule('durationgroup', [
|
| - |
|
232 |
'timedurationminutes' => [[get_string('maximumchars', '', 7), 'maxlength', 7, 'server']],
|
| Línea 229... |
Línea 233... |
| 229 |
$mform->disabledIf('timedurationminutes', 'duration', 'noteq', 2);
|
233 |
]);
|
| 230 |
|
234 |
|
| Línea 231... |
Línea 235... |
| 231 |
$mform->setDefault('duration', 0);
|
235 |
$mform->setDefault('duration', 0);
|
| Línea 236... |
Línea 240... |
| 236 |
*
|
240 |
*
|
| 237 |
* @param MoodleQuickForm $mform
|
241 |
* @param MoodleQuickForm $mform
|
| 238 |
*/
|
242 |
*/
|
| 239 |
protected function add_event_repeat_elements($mform) {
|
243 |
protected function add_event_repeat_elements($mform) {
|
| 240 |
$mform->addElement('checkbox', 'repeat', get_string('repeatevent', 'calendar'), null);
|
244 |
$mform->addElement('checkbox', 'repeat', get_string('repeatevent', 'calendar'), null);
|
| 241 |
$mform->addElement('text', 'repeats', get_string('repeatweeksl', 'calendar'), 'maxlength="10" size="10"');
|
245 |
$mform->addElement('text', 'repeats', get_string('repeatweeksl', 'calendar'), 'maxlength="3" size="3"');
|
| 242 |
$mform->setType('repeats', PARAM_INT);
|
246 |
$mform->setType('repeats', PARAM_INT);
|
| 243 |
$mform->setDefault('repeats', 1);
|
247 |
$mform->setDefault('repeats', 1);
|
| 244 |
$mform->disabledIf('repeats', 'repeat', 'notchecked');
|
248 |
$mform->disabledIf('repeats', 'repeat', 'notchecked');
|
| 245 |
$mform->setAdvanced('repeat');
|
249 |
$mform->setAdvanced('repeat');
|
| 246 |
$mform->setAdvanced('repeats');
|
250 |
$mform->setAdvanced('repeats');
|
| - |
|
251 |
$mform->addRule('repeats', get_string('maximumchars', '', 3), 'maxlength', 3, 'server');
|
| 247 |
}
|
252 |
}
|
| 248 |
}
|
253 |
}
|