mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-39932 mod_feedback - Mapping Feedback when Course is Deleted - thx to David N. Johnson
This commit is contained in:
parent
ae61eea349
commit
a33fc4907e
1 changed files with 3 additions and 2 deletions
|
@ -68,6 +68,7 @@ require_login($course, true, $cm);
|
||||||
require_capability('mod/feedback:mapcourse', $context);
|
require_capability('mod/feedback:mapcourse', $context);
|
||||||
|
|
||||||
if ($coursefilter) {
|
if ($coursefilter) {
|
||||||
|
$map = new stdClass;
|
||||||
$map->feedbackid = $feedback->id;
|
$map->feedbackid = $feedback->id;
|
||||||
$map->courseid = $coursefilter;
|
$map->courseid = $coursefilter;
|
||||||
// insert a map only if it does exists yet
|
// insert a map only if it does exists yet
|
||||||
|
@ -123,6 +124,7 @@ echo '</form>';
|
||||||
|
|
||||||
if ($coursemap = feedback_get_courses_from_sitecourse_map($feedback->id)) {
|
if ($coursemap = feedback_get_courses_from_sitecourse_map($feedback->id)) {
|
||||||
$table = new flexible_table('coursemaps');
|
$table = new flexible_table('coursemaps');
|
||||||
|
$table->baseurl = $url;
|
||||||
$table->define_columns( array('course'));
|
$table->define_columns( array('course'));
|
||||||
$table->define_headers( array(get_string('mappedcourses', 'feedback')));
|
$table->define_headers( array(get_string('mappedcourses', 'feedback')));
|
||||||
|
|
||||||
|
@ -130,9 +132,8 @@ if ($coursemap = feedback_get_courses_from_sitecourse_map($feedback->id)) {
|
||||||
|
|
||||||
$unmapurl = new moodle_url('/mod/feedback/unmapcourse.php');
|
$unmapurl = new moodle_url('/mod/feedback/unmapcourse.php');
|
||||||
foreach ($coursemap as $cmap) {
|
foreach ($coursemap as $cmap) {
|
||||||
$cmapcontext = context_course::instance($cmap->id);
|
|
||||||
$cmapshortname = format_string($cmap->shortname, true, array('context' => $cmapcontext));
|
|
||||||
$coursecontext = context_course::instance($cmap->courseid);
|
$coursecontext = context_course::instance($cmap->courseid);
|
||||||
|
$cmapshortname = format_string($cmap->shortname, true, array('context' => $coursecontext));
|
||||||
$cmapfullname = format_string($cmap->fullname, true, array('context' => $coursecontext));
|
$cmapfullname = format_string($cmap->fullname, true, array('context' => $coursecontext));
|
||||||
$unmapurl->params(array('id'=>$id, 'cmapid'=>$cmap->id));
|
$unmapurl->params(array('id'=>$id, 'cmapid'=>$cmap->id));
|
||||||
$anker = '<a href="'.$unmapurl->out().'">';
|
$anker = '<a href="'.$unmapurl->out().'">';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue