From 042596946b314189ee0fc8932a4ed22bd651878b Mon Sep 17 00:00:00 2001 From: skodak Date: Tue, 31 Jul 2007 09:10:35 +0000 Subject: [PATCH] tabbed Edit/Outcomes interface, link from course admin block, added manage outcomes capability, other cleanup --- blocks/admin/block_admin.php | 6 + .../index.php => outcome/course.php} | 16 ++- .../form.html => outcome/course_form.html} | 4 +- grade/edit/outcome/index.php | 3 + grade/edit/outcome/tabs.php | 21 +++ grade/lib.php | 19 ++- grade/report/grader/lib.php | 10 +- grade/report/outcomes/editoutcomes.php | 98 -------------- grade/report/outcomes/site.php | 127 ------------------ grade/report/outcomes/tabs.php | 32 ----- lang/en_utf8/grades.php | 3 +- lib/db/access.php | 11 ++ version.php | 2 +- 13 files changed, 67 insertions(+), 285 deletions(-) rename grade/edit/{courseoutcomes/index.php => outcome/course.php} (89%) rename grade/edit/{courseoutcomes/form.html => outcome/course_form.html} (87%) create mode 100644 grade/edit/outcome/tabs.php delete mode 100755 grade/report/outcomes/editoutcomes.php delete mode 100755 grade/report/outcomes/site.php delete mode 100644 grade/report/outcomes/tabs.php diff --git a/blocks/admin/block_admin.php b/blocks/admin/block_admin.php index 60e4b5c4a9..394ee7b30e 100644 --- a/blocks/admin/block_admin.php +++ b/blocks/admin/block_admin.php @@ -155,6 +155,12 @@ class block_admin extends block_list { $this->content->icons[] = ''; } + /// Used outcomes + if (has_capability('moodle/course:update', $context) && ($course->id!==SITEID)) { + $this->content->items[]=''.get_string('outcomes', 'grades').''; + $this->content->icons[]=''; //TODO: add outcomes icon + } + /// View course grades (or just your own grades, same link) if ((has_capability('moodle/grade:viewall', $context) or (has_capability('moodle/grade:view', $context) && $course->showgrades)) && ($course->id!==SITEID)) { diff --git a/grade/edit/courseoutcomes/index.php b/grade/edit/outcome/course.php similarity index 89% rename from grade/edit/courseoutcomes/index.php rename to grade/edit/outcome/course.php index 3db1af56c3..0aae40c463 100644 --- a/grade/edit/courseoutcomes/index.php +++ b/grade/edit/outcome/course.php @@ -17,7 +17,7 @@ require_capability('moodle/course:update', $context); /// form processing if ($data = data_submitted()) { - require_capability('gradereport/outcomes:manage', get_context_instance(CONTEXT_COURSE, $courseid)); + require_capability('moodle/grade:manageoutcomes', get_context_instance(CONTEXT_COURSE, $courseid)); if (!empty($data->add) && !empty($data->addoutcomes)) { /// add all selected to course list foreach ($data->addoutcomes as $add) { @@ -34,10 +34,10 @@ if ($data = data_submitted()) { } /// return tracking object -$gpr = new grade_plugin_return(array('type'=>'edit', 'plugin'=>'favoutcomes', 'courseid'=>$courseid)); +$gpr = new grade_plugin_return(array('type'=>'edit', 'plugin'=>'outcomes', 'courseid'=>$courseid)); $strgrades = get_string('grades'); -$pagename = get_string('courseoutcomes', 'grades'); +$pagename = get_string('outcomescourse', 'grades'); $navlinks = array(array('name'=>$strgrades, 'link'=>$CFG->wwwroot.'/grade/index.php?id='.$courseid, 'type'=>'misc'), array('name'=>$pagename, 'link'=>'', 'type'=>'misc')); @@ -51,7 +51,7 @@ if ($coutcomes = get_records_sql('SELECT go.id, go.fullname WHERE goc.courseid = '.$courseid.' AND goc.outcomeid = go.id')) { foreach ($coutcomes as $id=>$coutcome) { - $courseoutcomes[$id] = new grade_outcome(array('id'=>$id)); + $courseoutcomes[$id] = new grade_outcome(array('id'=>$id)); } } @@ -64,11 +64,13 @@ if (empty($courseoutcomes)) { print_header_simple($strgrades.': '.$pagename, ': '.$strgrades, $navigation, '', '', true, '', navmenu($course)); /// Print the plugin selector at the top -print_grade_plugin_selector($courseid, 'edit', 'courseoutcomes'); -print_heading(get_string('courseoutcomes', 'grades')); +print_grade_plugin_selector($courseid, 'edit', 'outcome'); + +$currenttab = 'courseoutcomes'; +require('tabs.php'); check_theme_arrows(); -include_once('form.html'); +require('course_form.html'); print_footer($course); ?> \ No newline at end of file diff --git a/grade/edit/courseoutcomes/form.html b/grade/edit/outcome/course_form.html similarity index 87% rename from grade/edit/courseoutcomes/form.html rename to grade/edit/outcome/course_form.html index 63278b4340..002a00d94e 100755 --- a/grade/edit/courseoutcomes/form.html +++ b/grade/edit/outcome/course_form.html @@ -3,7 +3,7 @@
- +
- +