(re)fixing bug #4199: import course activities offering non taught courses to import from. got lost in the course import rewrite

This commit is contained in:
mjollnir_
2005-11-08 20:51:27 +00:00
parent 9704c86631
commit 7d5258795c
+21 -1
View File
@@ -9,8 +9,23 @@
}
$strimport = get_string("importdata");
$tcourseids = '';
if ($teachers = get_records_select('user_teachers', "userid = $USER->id AND editall = 1",'','id,course')) {
foreach ($teachers as $teacher) {
if ($teacher->course != $course->id && $teacher->course != $site->id){
$tcourseids .= $teacher->course.',';
}
}
}
$taught_courses = array();
if (!empty($tcourseids)) {
$tcourseids = substr($tcourseids,0,-1);
$taught_courses = get_records_list('course', 'id', $tcourseids);
}
$taught_courses = get_my_courses($USER->id,"visible DESC,sortorder ASC",0,1);
if (!empty($creator)) {
$cat_courses = get_courses($course->category);
} else {
@@ -26,6 +41,11 @@
}
}
if (empty($options) && empty($creator)) {
notify(get_string('courseimportnotaught'));
return; // yay , this will pass control back to the file that included or required us.
}
$fm = '<form method="post" action="'.$CFG->wwwroot.'/course/import/activities/index.php"><input type="hidden" name="id" value="'.$course->id.'" />';
$submit = '<input type="submit" value="'.get_string('usethiscourse').'" /></form>';