MDL-29189 course Minor fixups after code review

This commit is contained in:
Sam Hemelryk
2011-09-13 11:17:18 +12:00
parent efd9c8e5b6
commit eb38d45b4e
7 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -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 = "<form method='post' action='index.php' autocomplete='off'><div>";
@@ -63,7 +63,7 @@ function authorize_print_orders($courseid, $userid) {
$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>";
}
+1 -1
View File
@@ -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');
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -67,7 +67,7 @@ $courseshortname = format_string($course->shortname, true, array('context' => ge
<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">
+1 -1
View File
@@ -60,7 +60,7 @@ $courseshortname = format_string($course->shortname, true, array('context' => ge
<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">
+1 -1
View File
@@ -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 '<tr><td>'.$shortname.'</td><td align="right">'.number_format(($c->avgvalue), 2, $sep_dec, $sep_thous).'</td></tr>';
}
echo '</table></td></tr>';
+1 -1
View File
@@ -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('<a href="'.$unmapurl->out().'"><img src="'.$OUTPUT->pix_url('t/delete') . '" alt="Delete" /></a> ('.$cmapshortname.') '.$cmap->fullname));
}