Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-17273 Added a back button to the error message and fixed missing …

…handling of "custom" scope
  • Loading branch information...
commit 4d07f1c87ea2d7e2b1b95c0229d132e823910dae 1 parent dec8167
nicolasconnault authored
Showing with 18 additions and 4 deletions.
  1. +13 −4 grade/edit/outcome/import.php
  2. +5 −0 theme/standard/styles_layout.css
View
17 grade/edit/outcome/import.php
@@ -101,7 +101,7 @@
}
/// which scope are we importing the outcomes in?
-if (isset($courseid) && ($scope == 'local')) {
+if (isset($courseid) && ($scope == 'local' || $scope == 'custom')) {
// custom scale
$local_scope = true;
} elseif (($scope == 'global') && has_capability('moodle/grade:manage', get_context_instance(CONTEXT_SYSTEM))) {
@@ -148,7 +148,10 @@
}
}
if ($error) {
- print_box(get_string('importoutcomenofile', 'grades', $line));
+ print_box_start('generalbox importoutcomenofile');
+ echo get_string('importoutcomenofile', 'grades', $line);
+ echo print_single_button($CFG->wwwroot.'/grade/edit/outcome/index.php', array('id'=> $courseid), get_string('back'), 'get', '_self', true);
+ print_box_end();
$fatal_error = true;
break;
}
@@ -164,7 +167,10 @@
// sanity check #2: every line must have the same number of columns as there are
// headers. If not, processing stops.
if ( count($csv_data) != count($file_headers) ) {
- print_box(get_string('importoutcomenofile', 'grades', $line));
+ print_box_start('generalbox importoutcomenofile');
+ echo get_string('importoutcomenofile', 'grades', $line);
+ echo print_single_button($CFG->wwwroot.'/grade/edit/outcome/index.php', array('id'=> $courseid), get_string('back'), 'get', '_self', true);
+ print_box_end();
$fatal_error = true;
//print_box(var_export($csv_data, true) ."<br />". var_export($header, true));
break;
@@ -173,7 +179,10 @@
// sanity check #3: all required fields must be present on the current line.
foreach ($headers as $header => $position) {
if ($csv_data[$imported_headers[$header]] == '') {
- print_box(get_string('importoutcomenofile', 'grades', $line));
+ print_box_start('generalbox importoutcomenofile');
+ echo get_string('importoutcomenofile', 'grades', $line);
+ echo print_single_button($CFG->wwwroot.'/grade/edit/outcome/index.php', array('id'=> $courseid), get_string('back'), 'get', '_self', true);
+ print_box_end();
$fatal_error = true;
break;
}
View
5 theme/standard/styles_layout.css
@@ -2227,6 +2227,11 @@ div.allcoursegrades {
text-align: right;
padding: 4px 0px 5px 0px;
}
+
+.importoutcomenofile .singlebutton {
+ text-align: center;
+ margin-top: 5px;
+}
/* gradebook edit tree */
.grade-edit-tree .gradetreebox {
Please sign in to comment.
Something went wrong with that request. Please try again.