From 9e9b288017dd87ff33d746b7cc1384c76c9b987d Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Fri, 17 Oct 2008 14:32:44 +0000 Subject: [PATCH] MDL-13259 Redirecting to creation of new scale when none exists. --- grade/edit/outcome/edit.php | 6 ++++++ lang/en_utf8/grades.php | 1 + 2 files changed, 7 insertions(+) diff --git a/grade/edit/outcome/edit.php b/grade/edit/outcome/edit.php index ac0eaf80137..678042a7dd7 100644 --- a/grade/edit/outcome/edit.php +++ b/grade/edit/outcome/edit.php @@ -133,6 +133,12 @@ if ($courseid) { admin_externalpage_print_header(); } +if (!grade_scale::fetch_all_local($courseid) && !grade_scale::fetch_all_global()) { + notice_yesno(get_string('noscales', 'grades'), $CFG->wwwroot.'/grade/edit/scale/edit.php?courseid='.$courseid, $returnurl); + print_footer($course); + die(); +} + $mform->display(); if ($courseid) { diff --git a/lang/en_utf8/grades.php b/lang/en_utf8/grades.php index 91a0d35b51b..eca520f39f9 100644 --- a/lang/en_utf8/grades.php +++ b/lang/en_utf8/grades.php @@ -348,6 +348,7 @@ $string['nonweightedpct'] = 'non-weighted %%'; $string['nooutcome'] = 'No outcome'; $string['nooutcomes'] = 'Outcome items must be linked to a course outcome, but there are no outcomes for this course. Would you like to add one?'; $string['nopublish'] = 'Do not publish'; +$string['noscales'] = 'Outcomes must be linked to a course scale or global scale, but there are none. Would you like to add one?'; $string['noselectedcategories'] = 'no categories were selected.'; $string['noselecteditems'] = 'no items were selected.'; $string['notteachererror'] = 'You must be a teacher to use this feature.';