Skip to content

Commit

Permalink
MDL-49417 enrol_cohort: use ajax searchable selector for cohorts.
Browse files Browse the repository at this point in the history
  • Loading branch information
danmarsden committed Mar 1, 2018
1 parent 296a3aa commit 1a11bf3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions enrol/cohort/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,9 @@ public function edit_instance_form($instance, MoodleQuickForm $mform, $coursecon
$options = $this->get_status_options();
$mform->addElement('select', 'status', get_string('status', 'enrol_cohort'), $options);

$options = $this->get_cohort_options($instance, $coursecontext);
$mform->addElement('select', 'customint1', get_string('cohort', 'cohort'), $options);
$options = ['contextid' => $coursecontext->id, 'multiple' => false];
$mform->addElement('cohort', 'customint1', get_string('cohort', 'cohort'), $options);

if ($instance->id) {
$mform->setConstant('customint1', $instance->customint1);
$mform->hardFreeze('customint1', $instance->customint1);
Expand Down
1 change: 1 addition & 0 deletions lib/form/cohort.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

global $CFG;
require_once($CFG->libdir . '/form/autocomplete.php');
require_once($CFG->dirroot . '/cohort/lib.php');

/**
* Form field type for choosing a cohort.
Expand Down

0 comments on commit 1a11bf3

Please sign in to comment.