mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
Adding some course->xxxx missing fields to backup & restore. MDL-10444
Merged from MOODLE_18_STABLE
This commit is contained in:
parent
bb384a8e29
commit
85250cb314
@ -634,7 +634,6 @@
|
||||
fwrite ($bf,full_tag("STUDENTS",3,false,$course->students));
|
||||
fwrite ($bf,full_tag("GUEST",3,false,$course->guest));
|
||||
fwrite ($bf,full_tag("STARTDATE",3,false,$course->startdate));
|
||||
fwrite ($bf,full_tag("ENROLPERIOD",3,false,$course->enrolperiod));
|
||||
fwrite ($bf,full_tag("NUMSECTIONS",3,false,$course->numsections));
|
||||
//fwrite ($bf,full_tag("SHOWRECENT",3,false,$course->showrecent)); INFO: This is out in 1.3
|
||||
fwrite ($bf,full_tag("MAXBYTES",3,false,$course->maxbytes));
|
||||
@ -657,6 +656,13 @@
|
||||
} else {
|
||||
$status = fwrite ($bf,full_tag("METACOURSE",3,false,$course->metacourse));
|
||||
}
|
||||
fwrite ($bf,full_tag("EXPIRENOTIFY",3,false,$course->expirynotify));
|
||||
fwrite ($bf,full_tag("NOTIFYSTUDENTS",3,false,$course->notifystudents));
|
||||
fwrite ($bf,full_tag("EXPIRYTHRESHOLD",3,false,$course->expirythreshold));
|
||||
fwrite ($bf,full_tag("ENROLLABLE",3,false,$course->enrollable));
|
||||
fwrite ($bf,full_tag("ENROLSTARTDATE",3,false,$course->enrolstartdate));
|
||||
fwrite ($bf,full_tag("ENROLENDDATE",3,false,$course->enrolenddate));
|
||||
fwrite ($bf,full_tag("ENROLPERIOD",3,false,$course->enrolperiod));
|
||||
|
||||
/// write local course overrides here?
|
||||
write_role_overrides_xml($bf, $context, 3);
|
||||
|
@ -596,7 +596,6 @@
|
||||
$course->guest = addslashes($course_header->course_guest);
|
||||
$course->startdate = addslashes($course_header->course_startdate);
|
||||
$course->startdate += $restore->course_startdateoffset;
|
||||
$course->enrolperiod = addslashes($course_header->course_enrolperiod);
|
||||
$course->numsections = addslashes($course_header->course_numsections);
|
||||
//$course->showrecent = addslashes($course_header->course_showrecent); INFO: This is out in 1.3
|
||||
$course->maxbytes = addslashes($course_header->course_maxbytes);
|
||||
@ -617,6 +616,19 @@
|
||||
$course->timecreated = addslashes($course_header->course_timecreated);
|
||||
$course->timemodified = addslashes($course_header->course_timemodified);
|
||||
$course->metacourse = addslashes($course_header->course_metacourse);
|
||||
$course->expirynotify = isset($course_header->course_expirynotify) ? addslashes($course_header->course_expirynotify):0;
|
||||
$course->notifystudents = isset($course_header->course_notifystudents) ? addslashes($course_header->course_notifystudents) : 0;
|
||||
$course->expirythreshold = isset($course_header->course_expirythreshold) ? addslashes($course_header->course_expirythreshold) : 0;
|
||||
$course->enrollable = isset($course_header->course_enrollable) ? addslashes($course_header->course_enrollable) : 1;
|
||||
$course->enrolstartdate = isset($course_header->course_enrolstartdate) ? addslashes($course_header->course_enrolstartdate) : 0;
|
||||
if ($course->enrolstartdate) { //Roll course dates
|
||||
$course->enrolstartdate += $restore->course_startdateoffset;
|
||||
}
|
||||
$course->enrolenddate = isset($course_header->course_enrolenddate) ? addslashes($course_header->course_enrolenddate) : 0;
|
||||
if ($course->enrolenddate) { //Roll course dates
|
||||
$course->enrolenddate += $restore->course_startdateoffset;
|
||||
}
|
||||
$course->enrolperiod = addslashes($course_header->course_enrolperiod);
|
||||
//Calculate sortorder field
|
||||
$sortmax = get_record_sql('SELECT MAX(sortorder) AS max
|
||||
FROM ' . $CFG->prefix . 'course
|
||||
@ -3966,9 +3978,6 @@
|
||||
case "STARTDATE":
|
||||
$this->info->course_startdate = $this->getContents();
|
||||
break;
|
||||
case "ENROLPERIOD":
|
||||
$this->info->course_enrolperiod = $this->getContents();
|
||||
break;
|
||||
case "NUMSECTIONS":
|
||||
$this->info->course_numsections = $this->getContents();
|
||||
break;
|
||||
@ -4017,6 +4026,27 @@
|
||||
case "METACOURSE":
|
||||
$this->info->course_metacourse = $this->getContents();
|
||||
break;
|
||||
case "EXPIRENOTIFY":
|
||||
$this->info->course_expirynotify = $this->getContents();
|
||||
break;
|
||||
case "NOTIFYSTUDENTS":
|
||||
$this->info->course_notifystudents = $this->getContents();
|
||||
break;
|
||||
case "EXPIRYTHRESHOLD":
|
||||
$this->info->course_expirythreshold = $this->getContents();
|
||||
break;
|
||||
case "ENROLLABLE":
|
||||
$this->info->course_enrollable = $this->getContents();
|
||||
break;
|
||||
case "ENROLSTARTDATE":
|
||||
$this->info->course_enrolstartdate = $this->getContents();
|
||||
break;
|
||||
case "ENROLENDDATE":
|
||||
$this->info->course_enrolenddate = $this->getContents();
|
||||
break;
|
||||
case "ENROLPERIOD":
|
||||
$this->info->course_enrolperiod = $this->getContents();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($this->tree[4] == "CATEGORY") {
|
||||
|
Loading…
x
Reference in New Issue
Block a user