Fixed various bugs in add_teacher() those caused the function not populating record correctly (Merged from MOODLE_15_STABLE)

This commit is contained in:
patrickslee 2005-10-10 21:41:21 +00:00
parent 8b658d8abf
commit aef46c081f

View file

@ -2881,9 +2881,10 @@ function add_teacher($userid, $courseid, $editall=1, $role='', $timestart=0, $ti
$teacher->course = $courseid; $teacher->course = $courseid;
$teacher->editall = $editall; $teacher->editall = $editall;
$teacher->role = $role; $teacher->role = $role;
$teacher->enrol = $enrol;
$teacher->timemodified = time(); $teacher->timemodified = time();
$newteacher->timestart = $timestart; $teacher->timestart = $timestart;
$newteacher->timeend = $timeend; $teacher->timeend = $timeend;
if ($student = get_record('user_students', 'userid', $userid, 'course', $courseid)) { if ($student = get_record('user_students', 'userid', $userid, 'course', $courseid)) {
$teacher->timestart = $student->timestart; $teacher->timestart = $student->timestart;
$teacher->timeend = $student->timeend; $teacher->timeend = $student->timeend;