This repository has been archived by the owner on Nov 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mod_form.php
87 lines (67 loc) · 3.91 KB
/
mod_form.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
/**
* This view allows checking deck states
*
* @package mod-scheduler
* @category mod
* @author Valery Fremaux
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
*/
/**
* Requires and includes
*/
require_once ($CFG->dirroot.'/course/moodleform_mod.php');
/**
* overrides moodleform for test setup
*/
class mod_scheduler_mod_form extends moodleform_mod {
function definition() {
global $CFG, $COURSE;
$mform =& $this->_form;
$mform->addElement('text', 'name', get_string('name'), array('size'=>'64'));
$mform->setType('name', PARAM_CLEANHTML);
$mform->addRule('name', null, 'required', null, 'client');
$mform->addElement('htmleditor', 'description', get_string('description'));
$mform->setType('description', PARAM_RAW);
$mform->setHelpButton('description', array('writing', 'richtext'), false, 'editorhelpbutton');
$mform->addElement('text', 'staffrolename', get_string('staffrolename', 'scheduler'), array('size'=>'48'));
$mform->setType('name', PARAM_CLEANHTML);
$mform->setHelpButton('staffrolename', array('staffrolename', get_string('staffrolename', 'scheduler'), 'scheduler'));
$modeoptions['onetime'] = get_string('oneatatime', 'scheduler');
$modeoptions['oneonly'] = get_string('oneappointmentonly', 'scheduler');
$mform->addElement('select', 'schedulermode', get_string('mode', 'scheduler'), $modeoptions);
$mform->setHelpButton('schedulermode', array('appointmentmode', get_string('mode', 'scheduler'), 'scheduler'));
$reuseguardoptions[24] = 24 . ' ' . get_string('hours');
$reuseguardoptions[48] = 48 . ' ' . get_string('hours');
$reuseguardoptions[72] = 72 . ' ' . get_string('hours');
$reuseguardoptions[96] = 96 . ' ' . get_string('hours');
$reuseguardoptions[168] = 168 . ' ' . get_string('hours');
$mform->addElement('select', 'reuseguardtime', get_string('reuseguardtime', 'scheduler'), $reuseguardoptions);
$mform->setHelpButton('reuseguardtime', array('reuseguardtime', get_string('reuseguardtime', 'scheduler'), 'scheduler'));
$mform->addElement('text', 'defaultslotduration', get_string('defaultslotduration', 'scheduler'), array('size'=>'2'));
$mform->setType('defaultslotduration', PARAM_INT);
$mform->setHelpButton('defaultslotduration', array('defaultslotduration', get_string('defaultslotduration', 'scheduler'), 'scheduler'));
$mform->setDefault('defaultslotduration', 15);
$yesno[0] = get_string('no');
$yesno[1] = get_string('yes');
$mform->addElement('select', 'allowmulticourseappointment', get_string('multicoursesteacherappointment', 'scheduler'), $yesno);
$mform->setHelpButton('allowmulticourseappointment', array('multicoursesappointment', get_string('multicoursesteacherappointment', 'scheduler'), 'scheduler'));
$mform->setDefault('allowmulticourseappointment', 0);
$mform->addElement('modgrade', 'scale', get_string('grade'));
$mform->setDefault('scale', 0);
$mform->addElement('select', 'allownotifications', get_string('notifications', 'scheduler'), $yesno);
$mform->setHelpButton('allownotifications', array('notifications', get_string('notifications', 'scheduler'), 'scheduler'));
$gradingstrategy[SCHEDULER_MEAN_GRADE] = get_string('meangrade', 'scheduler');
$gradingstrategy[SCHEDULER_MAX_GRADE] = get_string('maxgrade', 'scheduler');
$mform->addElement('select', 'gradingstrategy', get_string('gradingstrategy', 'scheduler'), $gradingstrategy);
$mform->setHelpButton('gradingstrategy', array('gradingstrategy', get_string('gradingstrategy', 'scheduler'), 'scheduler'));
$mform->disabledIf('gradingstrategy', 'scale', 'eq', 0);
$features = new stdClass;
$features->groups = true;
$features->groupings = true;
$features->groupmembersonly = true;
$this->standard_coursemodule_elements($features);
$this->add_action_buttons();
}
}
?>