]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-17463 chnging progress report cap to new standard
authorskodak <skodak>
Sat, 29 Nov 2008 16:41:20 +0000 (16:41 +0000)
committerskodak <skodak>
Sat, 29 Nov 2008 16:41:20 +0000 (16:41 +0000)
course/report/progress/db/access.php [new file with mode: 0644]
course/report/progress/index.php
course/report/progress/mod.php
course/report/progress/version.php [new file with mode: 0644]
lang/en_utf8/coursereport_progress.php [new file with mode: 0644]
lib/db/access.php
version.php

diff --git a/course/report/progress/db/access.php b/course/report/progress/db/access.php
new file mode 100644 (file)
index 0000000..da27d3f
--- /dev/null
@@ -0,0 +1,42 @@
+<?php  // $Id$
+
+///////////////////////////////////////////////////////////////////////////
+//                                                                       //
+// NOTICE OF COPYRIGHT                                                   //
+//                                                                       //
+// Moodle - Modular Object-Oriented Dynamic Learning Environment         //
+//          http://moodle.com                                            //
+//                                                                       //
+// Copyright (C) 1999 onwards  Martin Dougiamas  http://moodle.com       //
+//                                                                       //
+// This program is free software; you can redistribute it and/or modify  //
+// it under the terms of the GNU General Public License as published by  //
+// the Free Software Foundation; either version 2 of the License, or     //
+// (at your option) any later version.                                   //
+//                                                                       //
+// This program is distributed in the hope that it will be useful,       //
+// but WITHOUT ANY WARRANTY; without even the implied warranty of        //
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         //
+// GNU General Public License for more details:                          //
+//                                                                       //
+//          http://www.gnu.org/copyleft/gpl.html                         //
+//                                                                       //
+///////////////////////////////////////////////////////////////////////////
+
+$coursereport_progress_capabilities = array(
+
+    'coursereport/progress:view' => array(
+        'riskbitmask' => RISK_PERSONAL,
+        'captype' => 'read',
+        'contextlevel' => CONTEXT_COURSE,
+        'legacy' => array(
+            'teacher' => CAP_ALLOW,
+            'editingteacher' => CAP_ALLOW,
+            'admin' => CAP_ALLOW
+        ),
+
+        'clonepermissionsfrom' => 'moodle/site:viewreports',
+    )
+);
+
+?>
index 4d03f5ab2a290afc03dfe313e4fcb3d4804fefeb..f91fcb8be78dedfd565bd16cd33595fd770c9072 100644 (file)
@@ -41,7 +41,7 @@ require_login($course);
 
 // Check basic permission
 $context=get_context_instance(CONTEXT_COURSE,$course->id);
-require_capability('moodle/course:viewprogress',$context);
+require_capability('coursereport/progress:view',$context);
 
 // Get group mode
 $group=groups_get_course_group($course,true); // Supposed to verify group
index b6418bff30918272c73514358b4690c92c9c3ccc..a2428a2bd1dc7fc4be0b2a6d9b45ec96c693aa5a 100644 (file)
@@ -4,9 +4,9 @@
         die('Direct access to this script is forbidden.'); // It must be included from a Moodle page
     }
 
-    if (has_capability('moodle/course:viewprogress', $context)) {
+    if (has_capability('coursereport/progress:view', $context)) {
         $completion = new completion_info($course);
-        if ($completion->is_enabled() && has_capability('moodle/course:viewprogress', $context)) {
+        if ($completion->is_enabled()) {
             echo '<p>';
             echo '<a href="'.$CFG->wwwroot.'/course/report/progress/?course='.$course->id.'">'.get_string('completionreport','completion').'</a>';
             echo '</p>';
diff --git a/course/report/progress/version.php b/course/report/progress/version.php
new file mode 100644 (file)
index 0000000..c62920f
--- /dev/null
@@ -0,0 +1,29 @@
+<?PHP // $Id$
+
+///////////////////////////////////////////////////////////////////////////
+//                                                                       //
+// NOTICE OF COPYRIGHT                                                   //
+//                                                                       //
+// Moodle - Modular Object-Oriented Dynamic Learning Environment         //
+//          http://moodle.com                                            //
+//                                                                       //
+// Copyright (C) 1999 onwards  Martin Dougiamas  http://moodle.com       //
+//                                                                       //
+// This program is free software; you can redistribute it and/or modify  //
+// it under the terms of the GNU General Public License as published by  //
+// the Free Software Foundation; either version 2 of the License, or     //
+// (at your option) any later version.                                   //
+//                                                                       //
+// This program is distributed in the hope that it will be useful,       //
+// but WITHOUT ANY WARRANTY; without even the implied warranty of        //
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         //
+// GNU General Public License for more details:                          //
+//                                                                       //
+//          http://www.gnu.org/copyleft/gpl.html                         //
+//                                                                       //
+///////////////////////////////////////////////////////////////////////////
+
+$plugin->version  = 2007101500;
+$plugin->requires = 2007101532;
+
+?>
diff --git a/lang/en_utf8/coursereport_progress.php b/lang/en_utf8/coursereport_progress.php
new file mode 100644 (file)
index 0000000..11c3ed6
--- /dev/null
@@ -0,0 +1,5 @@
+<?PHP // $Id$
+
+$string['progress:view'] = 'View course progress report';
+
+?>
index b0c2864b6d438dd7fca07d9e1d57b196dcd7029d..b4a7d2a8a3a378c9cb79a92714c34b49cc0e5d9f 100644 (file)
@@ -567,19 +567,6 @@ $moodle_capabilities = array(
         )
     ),
 
-    'moodle/course:viewprogress' => array(
-
-        'riskbitmask' => RISK_PERSONAL,
-
-        'captype' => 'read',
-        'contextlevel' => CONTEXT_COURSE,
-        'legacy' => array(
-            'teacher' => CAP_ALLOW,
-            'editingteacher' => CAP_ALLOW,
-            'admin' => CAP_ALLOW
-        )
-    ),
-
     'moodle/course:viewhiddencourses' => array(
 
         'captype' => 'read',
index 9add45692ad50c8cf2b0c4dee99003a4aafdd6e8..94307950913b8eec1848cec8551e39a170d3ae60 100644 (file)
@@ -6,7 +6,7 @@
 // This is compared against the values stored in the database to determine
 // whether upgrades should be performed (see lib/db/*.php)
 
-    $version = 2008112901;  // YYYYMMDD   = date of the last version bump
+    $version = 2008112902;  // YYYYMMDD   = date of the last version bump
                             //         XX = daily increments
 
     $release = '2.0 dev (Build: 20081128)';  // Human-friendly version name