mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
Adding some course->xxxx missing fields to backup & restore. MDL-10444
This commit is contained in:
parent
c69e712116
commit
ca133f6ec3
2 changed files with 41 additions and 5 deletions
|
@ -634,7 +634,6 @@
|
||||||
fwrite ($bf,full_tag("STUDENTS",3,false,$course->students));
|
fwrite ($bf,full_tag("STUDENTS",3,false,$course->students));
|
||||||
fwrite ($bf,full_tag("GUEST",3,false,$course->guest));
|
fwrite ($bf,full_tag("GUEST",3,false,$course->guest));
|
||||||
fwrite ($bf,full_tag("STARTDATE",3,false,$course->startdate));
|
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("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("SHOWRECENT",3,false,$course->showrecent)); INFO: This is out in 1.3
|
||||||
fwrite ($bf,full_tag("MAXBYTES",3,false,$course->maxbytes));
|
fwrite ($bf,full_tag("MAXBYTES",3,false,$course->maxbytes));
|
||||||
|
@ -657,6 +656,13 @@
|
||||||
} else {
|
} else {
|
||||||
$status = fwrite ($bf,full_tag("METACOURSE",3,false,$course->metacourse));
|
$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 local course overrides here?
|
||||||
write_role_overrides_xml($bf, $context, 3);
|
write_role_overrides_xml($bf, $context, 3);
|
||||||
|
|
|
@ -595,7 +595,6 @@
|
||||||
$course->guest = addslashes($course_header->course_guest);
|
$course->guest = addslashes($course_header->course_guest);
|
||||||
$course->startdate = addslashes($course_header->course_startdate);
|
$course->startdate = addslashes($course_header->course_startdate);
|
||||||
$course->startdate += $restore->course_startdateoffset;
|
$course->startdate += $restore->course_startdateoffset;
|
||||||
$course->enrolperiod = addslashes($course_header->course_enrolperiod);
|
|
||||||
$course->numsections = addslashes($course_header->course_numsections);
|
$course->numsections = addslashes($course_header->course_numsections);
|
||||||
//$course->showrecent = addslashes($course_header->course_showrecent); INFO: This is out in 1.3
|
//$course->showrecent = addslashes($course_header->course_showrecent); INFO: This is out in 1.3
|
||||||
$course->maxbytes = addslashes($course_header->course_maxbytes);
|
$course->maxbytes = addslashes($course_header->course_maxbytes);
|
||||||
|
@ -616,6 +615,19 @@
|
||||||
$course->timecreated = addslashes($course_header->course_timecreated);
|
$course->timecreated = addslashes($course_header->course_timecreated);
|
||||||
$course->timemodified = addslashes($course_header->course_timemodified);
|
$course->timemodified = addslashes($course_header->course_timemodified);
|
||||||
$course->metacourse = addslashes($course_header->course_metacourse);
|
$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
|
//Calculate sortorder field
|
||||||
$sortmax = get_record_sql('SELECT MAX(sortorder) AS max
|
$sortmax = get_record_sql('SELECT MAX(sortorder) AS max
|
||||||
FROM ' . $CFG->prefix . 'course
|
FROM ' . $CFG->prefix . 'course
|
||||||
|
@ -3845,9 +3857,6 @@
|
||||||
case "STARTDATE":
|
case "STARTDATE":
|
||||||
$this->info->course_startdate = $this->getContents();
|
$this->info->course_startdate = $this->getContents();
|
||||||
break;
|
break;
|
||||||
case "ENROLPERIOD":
|
|
||||||
$this->info->course_enrolperiod = $this->getContents();
|
|
||||||
break;
|
|
||||||
case "NUMSECTIONS":
|
case "NUMSECTIONS":
|
||||||
$this->info->course_numsections = $this->getContents();
|
$this->info->course_numsections = $this->getContents();
|
||||||
break;
|
break;
|
||||||
|
@ -3896,6 +3905,27 @@
|
||||||
case "METACOURSE":
|
case "METACOURSE":
|
||||||
$this->info->course_metacourse = $this->getContents();
|
$this->info->course_metacourse = $this->getContents();
|
||||||
break;
|
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") {
|
if ($this->tree[4] == "CATEGORY") {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue