| Línea 119... |
Línea 119... |
| 119 |
$group = array();
|
119 |
$group = array();
|
| 120 |
$group[] =& $mform->createElement('radio', 'duration', null, get_string('durationnone', 'calendar'), 0);
|
120 |
$group[] =& $mform->createElement('radio', 'duration', null, get_string('durationnone', 'calendar'), 0);
|
| 121 |
$group[] =& $mform->createElement('radio', 'duration', null, get_string('durationuntil', 'calendar'), 1);
|
121 |
$group[] =& $mform->createElement('radio', 'duration', null, get_string('durationuntil', 'calendar'), 1);
|
| 122 |
$group[] =& $mform->createElement('date_time_selector', 'timedurationuntil', '');
|
122 |
$group[] =& $mform->createElement('date_time_selector', 'timedurationuntil', '');
|
| 123 |
$group[] =& $mform->createElement('radio', 'duration', null, get_string('durationminutes', 'calendar'), 2);
|
123 |
$group[] =& $mform->createElement('radio', 'duration', null, get_string('durationminutes', 'calendar'), 2);
|
| 124 |
$group[] =& $mform->createElement('text', 'timedurationminutes', get_string('durationminutes', 'calendar'));
|
124 |
$group[] =& $mform->createElement('text', 'timedurationminutes',
|
| - |
|
125 |
get_string('durationminutes', 'calendar'), 'maxlength="7" size="7"');
|
| Línea 125... |
Línea 126... |
| 125 |
|
126 |
|
| Línea 126... |
Línea 127... |
| 126 |
$mform->addGroup($group, 'durationgroup', '', '<br />', false);
|
127 |
$mform->addGroup($group, 'durationgroup', '', '<br />', false);
|
| 127 |
|
128 |
|
| Línea 132... |
Línea 133... |
| 132 |
$mform->disabledIf('timedurationuntil[hour]', 'duration', 'noteq', 1);
|
133 |
$mform->disabledIf('timedurationuntil[hour]', 'duration', 'noteq', 1);
|
| 133 |
$mform->disabledIf('timedurationuntil[minute]', 'duration', 'noteq', 1);
|
134 |
$mform->disabledIf('timedurationuntil[minute]', 'duration', 'noteq', 1);
|
| Línea 134... |
Línea 135... |
| 134 |
|
135 |
|
| 135 |
$mform->setType('timedurationminutes', PARAM_INT);
|
136 |
$mform->setType('timedurationminutes', PARAM_INT);
|
| - |
|
137 |
$mform->disabledIf('timedurationminutes','duration','noteq', 2);
|
| - |
|
138 |
$mform->addGroupRule('durationgroup', [
|
| - |
|
139 |
'timedurationminutes' => [[get_string('maximumchars', '', 7), 'maxlength', 7, 'server']],
|
| Línea 136... |
Línea 140... |
| 136 |
$mform->disabledIf('timedurationminutes','duration','noteq', 2);
|
140 |
]);
|
| Línea 137... |
Línea 141... |
| 137 |
|
141 |
|
| Línea 138... |
Línea 142... |
| 138 |
$mform->setDefault('duration', ($hasduration)?1:0);
|
142 |
$mform->setDefault('duration', ($hasduration)?1:0);
|
| 139 |
|
143 |
|
| 140 |
if ($newevent) {
|
144 |
if ($newevent) {
|
| 141 |
|
145 |
|
| 142 |
$mform->addElement('header', 'repeatevents', get_string('repeatedevents', 'calendar'));
|
146 |
$mform->addElement('header', 'repeatevents', get_string('repeatedevents', 'calendar'));
|
| 143 |
$mform->addElement('checkbox', 'repeat', get_string('repeatevent', 'calendar'), null);
|
147 |
$mform->addElement('checkbox', 'repeat', get_string('repeatevent', 'calendar'), null);
|
| - |
|
148 |
$mform->addElement('text', 'repeats', get_string('repeatweeksl', 'calendar'), 'maxlength="3" size="3"');
|
| Línea 144... |
Línea 149... |
| 144 |
$mform->addElement('text', 'repeats', get_string('repeatweeksl', 'calendar'), 'maxlength="10" size="10"');
|
149 |
$mform->setType('repeats', PARAM_INT);
|
| Línea 145... |
Línea 150... |
| 145 |
$mform->setType('repeats', PARAM_INT);
|
150 |
$mform->setDefault('repeats', 1);
|
| 146 |
$mform->setDefault('repeats', 1);
|
151 |
$mform->disabledIf('repeats','repeat','notchecked');
|