Skip to content

Commit

Permalink
Merge branch 'MDL-69156_master' of https://github.com/ffhs/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Oct 30, 2020
2 parents 5009d50 + eec0367 commit 0ac855a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions backup/util/ui/classes/output/copy_form.php
Expand Up @@ -152,13 +152,14 @@ public function definition() {
$mform->addHelpButton('relativedatesmodegroup', 'relativedatesmode');
}

// Course id number.
// Course ID number (default to the current course ID number; blank for users who can't change ID numbers).
$mform->addElement('text', 'idnumber', get_string('idnumbercourse'), 'maxlength="100" size="10"');
$mform->setDefault('idnumber', $course->idnumber);
$mform->addHelpButton('idnumber', 'idnumbercourse');
$mform->setType('idnumber', PARAM_RAW);
if (!empty($course->id) and !has_capability('moodle/course:changeidnumber', $coursecontext)) {
if (!has_capability('moodle/course:changeidnumber', $coursecontext)) {
$mform->hardFreeze('idnumber');
$mform->setConstants('idnumber', $course->idnumber);
$mform->setConstant('idnumber', '');
}

// Keep source course user data.
Expand All @@ -172,7 +173,7 @@ public function definition() {
);
if (!has_all_capabilities($requiredcapabilities, $coursecontext)) {
$mform->hardFreeze('userdata');
$mform->setConstants('userdata', 0);
$mform->setConstant('userdata', 0);
}

// Keep manual enrolments.
Expand Down

0 comments on commit 0ac855a

Please sign in to comment.