]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-10207 Tabs added to category admin page and grader report page. I also changed...
authornicolasconnault <nicolasconnault>
Fri, 22 Jun 2007 17:34:14 +0000 (17:34 +0000)
committernicolasconnault <nicolasconnault>
Fri, 22 Jun 2007 17:34:14 +0000 (17:34 +0000)
grade/report.php
grade/report/admin/index.php
grade/report/grader/index.php
grade/report/user/index.php
lang/en_utf8/gradereport_admin.php [new file with mode: 0644]

index 68322bb136242d8c08d3ea790a9eee7dc105e685..1a3909370d49f299113f22d03c255af3048a1c15 100644 (file)
     require_once("../config.php");
     require_once("../lib/gradelib.php");
 
-    $id       = required_param('id');              // course id
+    $courseid = required_param('courseid');              // course id
     $report   = optional_param('report', 'user', PARAM_FILE);              // course id
 
 
 /// Make sure they can even access this course
 
-    if (!$course = get_record('course', 'id', $id)) {
+    if (!$course = get_record('course', 'id', $courseid)) {
         print_error('nocourseid');
     }
 
@@ -93,7 +93,7 @@
 /// Print the report selector at the top if there is more than one report
 
     if ($reportnames) {
-        popup_form($CFG->wwwroot.'/grade/report.php?id='.$course->id.'&amp;report=', $reportnames, 
+        popup_form($CFG->wwwroot.'/grade/report.php?courseid='.$course->id.'&amp;report=', $reportnames, 
                    'choosegradereport', $report, '', '', '', false, 'self', get_string('gradereports', 'grades').':');
     }
 
index 947514a27325468c68e32d6c3005ae9761d9e83a..ded339416feb86075200264c73b4a23227a2e543 100644 (file)
@@ -42,6 +42,8 @@ $param->categories    = optional_param('categories', 0, PARAM_INT);
 $param->element_type  = optional_param('element_type', 0, PARAM_ALPHA);
 $param->category_name = optional_param('category_name', 0, PARAM_ALPHA);
 
+$report = optional_param('report', 0, PARAM_ALPHANUM);
+
 print_object($param);
 
 $tree = new grade_tree($param->courseid);
@@ -178,5 +180,20 @@ if (!empty($param->action) && !empty($param->source) && confirm_sesskey()) {
     }
 }
 print_heading(get_string('graderreport', 'grades'));
+
+// Add tabs
+if (empty($report)) {
+    $report = 'admin';
+}
+
+$tabs = $row = array();
+$row[] = new tabobject('grader', 'report.php?courseid='.$course->id.'&amp;report=grader',
+                       get_string('viewgrades', 'grades'));
+$row[] = new tabobject('admin', 'report.php?courseid='.$course->id.'&amp;report=admin',
+                       get_string('categories', 'grades'));
+$tabs[] = $row;
+
+print_tabs($tabs, $report);
+
 echo $tree->get_edit_tree(1, null, $param->source, $param->action, $param->type);
 ?>
index 672fc9bbb8107f723c341f7f891ae746f75f6dbb..f1767db0a5eb361b28a8dfaf8a47f3da220e2023 100644 (file)
@@ -6,10 +6,11 @@ require_once($CFG->libdir.'/tablelib.php');
 include_once($CFG->libdir.'/gradelib.php');
 
 // get the params
-$courseid = required_param('id', PARAM_INT);
+$courseid = required_param('courseid', PARAM_INT);
 $context = get_context_instance(CONTEXT_COURSE, $courseid);
 $page = optional_param('page', 0, PARAM_INT);
 $sortitemid = optional_param('sortitemid', 0, PARAM_ALPHANUM); // sort by which grade item
+$report = optional_param('report', 0, PARAM_ALPHANUM);
 
 // setting the sort order, this depends on last state
 // all this should be in the new table class that we might need to use
@@ -108,10 +109,24 @@ if ($grades = get_records_sql($sql)) {
 
 print_heading('Grader Report');
 
+// Add tabs
+if (empty($report)) {
+    $report = 'grader';
+}
+
+$tabs = $row = array();
+$row[] = new tabobject('grader', 'report.php?courseid='.$course->id.'&amp;report=grader',
+                       get_string('viewgrades', 'grades'));
+$row[] = new tabobject('categories', 'report.php?courseid='.$course->id.'&amp;report=admin',
+                       get_string('categories', 'grades'));
+$tabs[] = $row;
+
+print_tabs($tabs, $report);
+
 // base url for sorting by first/last name
-$baseurl = 'report.php?id='.$courseid.'&amp;report=grader&amp;page='.$page;
+$baseurl = 'report.php?courseid='.$courseid.'&amp;report=grader&amp;page='.$page;
 // base url for paging
-$pbarurl = 'report.php?id='.$courseid.'&amp;report=grader&amp;';
+$pbarurl = 'report.php?courseid='.$courseid.'&amp;report=grader&amp;';
 
 print_paging_bar($numusers, $page, $perpage, $pbarurl);
 
@@ -229,4 +244,4 @@ if ($gtree = new grade_tree($courseid, false)) {
     echo $reporthtml;
 }
 
-?>
\ No newline at end of file
+?>
index 07e042856c17583a8cec8d5b03b717b7e407f6bb..19dd9226a8289711b380314da83db4219508afd1 100644 (file)
@@ -6,7 +6,7 @@ require_once($CFG->libdir.'/tablelib.php');
 include_once($CFG->libdir.'/gradelib.php');
 
 // get the params
-$courseid = required_param('id', PARAM_INT);
+$courseid = required_param('courseid', PARAM_INT);
 if (!$userid = optional_param('user', 0, PARAM_INT)) {
     // current user
     $userid = $USER->id;  
@@ -22,7 +22,7 @@ if ($gradetree = new grade_tree($courseid)) {
     * Table has 6 columns 
     *| pic  | itemname/description | grade (grade_final) | percentage | rank | feedback |
     */
-    $baseurl = $CFG->wwwroot.'/grade/report?id='.$id.'&amp;userid='.$userid;
+    $baseurl = $CFG->wwwroot.'/grade/report?courseid='.$id.'&amp;userid='.$userid;
  
     // setting up table headers
     $tablecolumns = array('itempic', 'itemname', 'grade', 'percentage', 'rank', 'feedback');
diff --git a/lang/en_utf8/gradereport_admin.php b/lang/en_utf8/gradereport_admin.php
new file mode 100644 (file)
index 0000000..89d8652
--- /dev/null
@@ -0,0 +1,6 @@
+<?PHP // $Id$ 
+
+$string['modulename'] = 'Categories';
+$string['admin:manage'] = 'Edit Grade Categories';
+
+?>