Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-34645: enrol_manual: enrolment init to pass default duration setting

  • Loading branch information...
commit 2e7e9403b2ce05c75ae7de5171765eee0c7d0757 1 parent 55a568f
@aolley aolley authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  enrol/manual/lib.php
View
2  enrol/manual/lib.php
@@ -215,6 +215,7 @@ public function get_manual_enrol_button(course_enrolment_manager $manager) {
$today = time();
$today = make_timestamp(date('Y', $today), date('m', $today), date('d', $today), 0, 0, 0);
$startdateoptions[3] = get_string('today') . ' (' . userdate($today, $timeformat) . ')' ;
+ $defaultduration = $instance->enrolperiod > 0 ? $instance->enrolperiod / 86400 : '';
$modules = array('moodle-enrol_manual-quickenrolment', 'moodle-enrol_manual-quickenrolment-skin');
$arguments = array(
@@ -224,6 +225,7 @@ public function get_manual_enrol_button(course_enrolment_manager $manager) {
'url' => $manager->get_moodlepage()->url->out(false),
'optionsStartDate' => $startdateoptions,
'defaultRole' => $instance->roleid,
+ 'defaultDuration' => $defaultduration,
'disableGradeHistory' => $CFG->disablegradehistory,
'recoverGradesDefault'=> ''
);
Please sign in to comment.
Something went wrong with that request. Please try again.