$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 = "<form method='post' action='index.php' autocomplete='off'><div>";
$buttons .= "<input type='submit' value='$strs->search' />";
$buttons .= "</div></form>";
- if (has_capability('enrol/authorize:uploadcsv', $coursecontext)) {
+ if (has_capability('enrol/authorize:uploadcsv', get_context_instance(CONTEXT_USER, $USER->id))) {
$buttons .= "<form method='get' action='uploadcsv.php'><div><input type='submit' value='".get_string('uploadcsv', 'enrol_authorize')."' /></div></form>";
}
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');
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;
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>
- <?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" ?>
</title>
</head>
<frameset cols="*,200" border="5" framespacing="no" frameborder="yes" marginwidth="2" marginheight="1">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>
- <?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" ?>
</title>
</head>
<frameset cols="*,200" border="5" framespacing="no" frameborder="yes" marginwidth="2" marginheight="1">
$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 '<tr><td>'.$shortname.'</td><td align="right">'.number_format(($c->avgvalue), 2, $sep_dec, $sep_thous).'</td></tr>';
}
echo '</table></td></tr>';
$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('<a href="'.$unmapurl->out().'"><img src="'.$OUTPUT->pix_url('t/delete') . '" alt="Delete" /></a> ('.$cmapshortname.') '.$cmap->fullname));
}