--- /dev/null
+<?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',
+ )
+);
+
+?>
// 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
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>';
--- /dev/null
+<?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;
+
+?>
--- /dev/null
+<?PHP // $Id$
+
+$string['progress:view'] = 'View course progress report';
+
+?>
)
),
- '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',
// 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