mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
Merge branch 'MDL-46248_m26' of https://github.com/markn86/moodle into MOODLE_26_STABLE
This commit is contained in:
commit
20c80d9e2f
1 changed files with 16 additions and 7 deletions
|
@ -114,14 +114,23 @@ class event_form extends moodleform {
|
||||||
$mform->addRule('timestart', get_string('required'), 'required');
|
$mform->addRule('timestart', get_string('required'), 'required');
|
||||||
|
|
||||||
$mform->addElement('header', 'durationdetails', get_string('eventduration', 'calendar'));
|
$mform->addElement('header', 'durationdetails', get_string('eventduration', 'calendar'));
|
||||||
$mform->addElement('radio', 'duration', null, get_string('durationnone', 'calendar'), 0);
|
|
||||||
|
|
||||||
$mform->addElement('radio', 'duration', null, get_string('durationuntil', 'calendar'), 1);
|
$group = array();
|
||||||
$mform->addElement('date_time_selector', 'timedurationuntil', ' ');
|
$group[] =& $mform->createElement('radio', 'duration', null, get_string('durationnone', 'calendar'), 0);
|
||||||
$mform->disabledIf('timedurationuntil','duration','noteq', 1);
|
$group[] =& $mform->createElement('radio', 'duration', null, get_string('durationuntil', 'calendar'), 1);
|
||||||
|
$group[] =& $mform->createElement('date_time_selector', 'timedurationuntil', '');
|
||||||
|
$group[] =& $mform->createElement('radio', 'duration', null, get_string('durationminutes', 'calendar'), 2);
|
||||||
|
$group[] =& $mform->createElement('text', 'timedurationminutes', null);
|
||||||
|
|
||||||
|
$mform->addGroup($group, 'durationgroup', '', '<br />', false);
|
||||||
|
|
||||||
|
$mform->disabledIf('timedurationuntil', 'duration', 'noteq', 1);
|
||||||
|
$mform->disabledIf('timedurationuntil[day]', 'duration', 'noteq', 1);
|
||||||
|
$mform->disabledIf('timedurationuntil[month]', 'duration', 'noteq', 1);
|
||||||
|
$mform->disabledIf('timedurationuntil[year]', 'duration', 'noteq', 1);
|
||||||
|
$mform->disabledIf('timedurationuntil[hour]', 'duration', 'noteq', 1);
|
||||||
|
$mform->disabledIf('timedurationuntil[minute]', 'duration', 'noteq', 1);
|
||||||
|
|
||||||
$mform->addElement('radio', 'duration', null, get_string('durationminutes', 'calendar'), 2);
|
|
||||||
$mform->addElement('text', 'timedurationminutes', null);
|
|
||||||
$mform->setType('timedurationminutes', PARAM_INT);
|
$mform->setType('timedurationminutes', PARAM_INT);
|
||||||
$mform->disabledIf('timedurationminutes','duration','noteq', 2);
|
$mform->disabledIf('timedurationminutes','duration','noteq', 2);
|
||||||
|
|
||||||
|
@ -130,7 +139,7 @@ class event_form extends moodleform {
|
||||||
if ($newevent) {
|
if ($newevent) {
|
||||||
|
|
||||||
$mform->addElement('header', 'repeatevents', get_string('repeatedevents', 'calendar'));
|
$mform->addElement('header', 'repeatevents', get_string('repeatedevents', 'calendar'));
|
||||||
$mform->addElement('checkbox', 'repeat', get_string('repeatevent', 'calendar'), null, 'repeat');
|
$mform->addElement('checkbox', 'repeat', get_string('repeatevent', 'calendar'), null);
|
||||||
$mform->addElement('text', 'repeats', get_string('repeatweeksl', 'calendar'), 'maxlength="10" size="10"');
|
$mform->addElement('text', 'repeats', get_string('repeatweeksl', 'calendar'), 'maxlength="10" size="10"');
|
||||||
$mform->setType('repeats', PARAM_INT);
|
$mform->setType('repeats', PARAM_INT);
|
||||||
$mform->setDefault('repeats', 1);
|
$mform->setDefault('repeats', 1);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue