Commit 4de2456f authored by Francois Gannaz's avatar Francois Gannaz
Browse files

Activity form: mission selector

parent 5e063536
......@@ -45,8 +45,14 @@ class mod_labnbook_mod_form extends moodleform_mod {
$mform = $this->_form;
$missions = session::load()->getMissions();
$missionsList = array_map(
function($x) { return "[{$x->code}] {$x->name}"; },
$missions
);
$mform->addElement('header', 'general', "LabNbook");
$mform->addElement('select', 'missionid', get_string('mission', 'mod_labnbook'), session::load()->getMissions());
$mform->addElement('select', 'missionid', get_string('mission', 'mod_labnbook'), array_merge(['' => "-"], $missionsList));
$mform->addRule('missionid', null, 'required', null, 'client');
// Adding the "general" fieldset, where all the common settings are showed.
$mform->addElement('header', 'general', get_string('general', 'form'));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment