diff --git a/enrol/authorize/locallib.php b/enrol/authorize/locallib.php index 6dc069e162c..058b1b08d15 100644 --- a/enrol/authorize/locallib.php +++ b/enrol/authorize/locallib.php @@ -54,7 +54,7 @@ function authorize_print_orders($courseid, $userid) { $searchtype = optional_param('searchtype', 'orderid', PARAM_ALPHA); $status = optional_param('status', AN_STATUS_NONE, PARAM_INT); - $coursecontext = get_context_instance(CONTEXT_USER, $USER->id); + $coursecontext = get_context_instance(CONTEXT_COURSE, $courseid); $searchmenu = array('orderid' => $authstrs->orderid, 'transid' => $authstrs->transid, 'cclastfour' => $authstrs->cclastfour); $buttons = "
"; @@ -63,7 +63,7 @@ function authorize_print_orders($courseid, $userid) { $buttons .= ""; $buttons .= "
"; - if (has_capability('enrol/authorize:uploadcsv', $coursecontext)) { + if (has_capability('enrol/authorize:uploadcsv', get_context_instance(CONTEXT_USER, $USER->id))) { $buttons .= "
"; } diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index eaa12d32129..85b4afb0eec 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -6698,7 +6698,7 @@ FROM if ($oldversion < 2011090800) { // Increase the length of the of the course shortname field as it is now going - // to be consistently filtered and 100 characters if practically useless for + // to be consistently filtered and 100 characters is practically useless for // things like the multilang filter. $table = new xmldb_table('course'); diff --git a/mod/assignment/lib.php b/mod/assignment/lib.php index 6f17416f5f4..881137093cc 100644 --- a/mod/assignment/lib.php +++ b/mod/assignment/lib.php @@ -122,7 +122,7 @@ class assignment_base { print_error('invalidid', 'assignment'); } $this->coursecontext = get_context_instance(CONTEXT_COURSE, $this->course->id); - $courseshortname = format_text($this->course->shortname, true, array('context' => $coursecontext)); + $courseshortname = format_text($this->course->shortname, true, array('context' => $this->coursecontext)); if ($assignment) { $this->assignment = $assignment; diff --git a/mod/chat/gui_header_js/index.php b/mod/chat/gui_header_js/index.php index 5c298ba6f50..43d0f0b56d4 100644 --- a/mod/chat/gui_header_js/index.php +++ b/mod/chat/gui_header_js/index.php @@ -67,7 +67,7 @@ $courseshortname = format_string($course->shortname, true, array('context' => ge - <?php echo "$strchat: " . $courseshortname . ": ".format_string($chat->name, true, array('context' => $context)) . "$groupname" ?> + <?php echo "$strchat: " . $courseshortname . ": " . format_string($chat->name, true, array('context' => $context)) . "$groupname" ?> diff --git a/mod/chat/gui_sockets/index.php b/mod/chat/gui_sockets/index.php index 40cc52e6146..4a5de8bfdda 100644 --- a/mod/chat/gui_sockets/index.php +++ b/mod/chat/gui_sockets/index.php @@ -60,7 +60,7 @@ $courseshortname = format_string($course->shortname, true, array('context' => ge - <?php echo "$strchat: " . $courseshortname . ": ".format_string($chat->name, true, array('context' => $context)) . "$groupname" ?> + <?php echo "$strchat: " . $courseshortname . ": " . format_string($chat->name, true, array('context' => $context)) . "$groupname" ?> diff --git a/mod/feedback/analysis_course.php b/mod/feedback/analysis_course.php index 1b500df8cd0..548d4c8964b 100644 --- a/mod/feedback/analysis_course.php +++ b/mod/feedback/analysis_course.php @@ -128,7 +128,7 @@ if ($courseitemfilter > 0) { $sep_thous = get_string('separator_thousand', 'feedback'); foreach ($courses as $c) { - $shortname = format_string($course->shortname, true, array('context' => get_context_instance(CONTEXT_COURSE, $c->course_id))); + $shortname = format_string($c->shortname, true, array('context' => get_context_instance(CONTEXT_COURSE, $c->course_id))); echo ''.$shortname.''.number_format(($c->avgvalue), 2, $sep_dec, $sep_thous).''; } echo ''; diff --git a/mod/feedback/mapcourse.php b/mod/feedback/mapcourse.php index 8495cf7d84f..a0a24b0945b 100644 --- a/mod/feedback/mapcourse.php +++ b/mod/feedback/mapcourse.php @@ -116,7 +116,7 @@ if($coursemap = feedback_get_courses_from_sitecourse_map($feedback->id)) { $unmapurl = new moodle_url('/mod/feedback/unmapcourse.php'); foreach ($coursemap as $cmap) { $cmapcontext = get_context_instance(CONTEXT_COURSE, $cmap->id); - $cmapshortname = format_string($cmap->shortname, true, array('context' => $coursecontext)); + $cmapshortname = format_string($cmap->shortname, true, array('context' => $cmapcontext)); $unmapurl->params(array('id'=>$id, 'cmapid'=>$cmap->id)); $table->add_data(array('Delete ('.$cmapshortname.') '.$cmap->fullname)); }