Skip to content

Commit

Permalink
MDL-29030 convert participation report to new report type
Browse files Browse the repository at this point in the history
AMOS BEGIN
 MOV [participation:view,coursereport_participation],[participation:view,report_participation]
 MOV [pluginpagetype,coursereport_participation],[pluginpagetype,report_participation]
 MOV [pluginname,coursereport_participation],[pluginname,report_participation]
AMOS END
  • Loading branch information
skodak committed Nov 6, 2011
1 parent 8619857 commit 3afce1a
Show file tree
Hide file tree
Showing 17 changed files with 184 additions and 139 deletions.
14 changes: 0 additions & 14 deletions course/report/participation/mod.php

This file was deleted.

29 changes: 0 additions & 29 deletions course/report/participation/version.php

This file was deleted.

4 changes: 2 additions & 2 deletions lib/pluginlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ public static function standard_plugins_list($type) {
),

'coursereport' => array(
'log', 'participation', 'stats'
'log', 'stats'
),

'datafield' => array(
Expand Down Expand Up @@ -407,7 +407,7 @@ public static function standard_plugins_list($type) {

'report' => array(
'backups', 'completion', 'configlog', 'courseoverview',
'log', 'outline', 'progress', 'questioninstances', 'security', 'stats'
'log', 'outline', 'participation', 'progress', 'questioninstances', 'security', 'stats'
),

'repository' => array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

$capabilities = array(

'coursereport/participation:view' => array(
'report/participation:view' => array(
'riskbitmask' => RISK_PERSONAL,
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
Expand All @@ -35,7 +35,7 @@
'manager' => CAP_ALLOW
),

'clonepermissionsfrom' => 'moodle/site:viewreports',
'clonepermissionsfrom' => 'coursereport/participation:view',
)
);

Expand Down
33 changes: 33 additions & 0 deletions report/participation/db/install.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle 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 3 of the License, or
// (at your option) any later version.
//
// Moodle 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.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Post installation and migration code.
*
* @package report
* @subpackage participation
* @copyright 2011 Petr Skoda {@link http://skodak.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die;

function xmldb_report_participation_install() {
// this is a hack which is needed for cleanup of original coursereport_participation stuff
unset_all_config_for_plugin('coursereport_participation');
capabilities_cleanup('coursereport_participation');
}

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require_once('../../../config.php');
require_once('../../config.php');
require_once($CFG->dirroot.'/lib/tablelib.php');

define('DEFAULT_PAGE_SIZE', 20);
Expand All @@ -14,7 +14,7 @@
$page = optional_param('page', 0, PARAM_INT); // which page to show
$perpage = optional_param('perpage', DEFAULT_PAGE_SIZE, PARAM_INT); // how many per page

$url = new moodle_url('/course/report/participation/index.php', array('id'=>$id));
$url = new moodle_url('/report/participation/index.php', array('id'=>$id));
if ($roleid !== 0) $url->param('roleid');
if ($instanceid !== 0) $url->param('instanceid');
if ($timefrom !== 0) $url->param('timefrom');
Expand All @@ -38,7 +38,7 @@

require_login($course);
$context = get_context_instance(CONTEXT_COURSE, $course->id);
require_capability('coursereport/participation:view', $context);
require_capability('report/participation:view', $context);

add_to_log($course->id, "course", "report participation", "report/participation/index.php?id=$course->id", $course->id);

Expand Down Expand Up @@ -141,7 +141,7 @@
echo html_writer::select($actionoptions,'action',$action,false);
echo '<input type="submit" value="'.get_string('go').'" />'."\n</div></form>\n";

$baseurl = $CFG->wwwroot.'/course/report/participation/index.php?id='.$course->id.'&amp;roleid='
$baseurl = $CFG->wwwroot.'/report/participation/index.php?id='.$course->id.'&amp;roleid='
.$roleid.'&amp;instanceid='.$instanceid.'&amp;timefrom='.$timefrom.'&amp;action='.$action.'&amp;perpage='.$perpage;

if (!empty($instanceid) && !empty($roleid)) {
Expand Down Expand Up @@ -296,7 +296,7 @@
echo '</form>'."\n";
echo '</div>'."\n";

$PAGE->requires->js_init_call('M.coursereport_participation.init');
$PAGE->requires->js_init_call('M.report_participation.init');
}

echo $OUTPUT->footer();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
Expand All @@ -18,10 +17,10 @@
/**
* This file contains functions used by the participation report
*
* @since 2.0
* @package course-report
* @copyright 2009 Sam Hemelryk
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package report
* @subpackage participation
* @copyright 2009 Sam Hemelryk
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

/**
Expand All @@ -31,11 +30,11 @@
* @param stdClass $course The course to object for the report
* @param stdClass $context The context of the course
*/
function participation_report_extend_navigation($navigation, $course, $context) {
function report_participation_extend_navigation_course($navigation, $course, $context) {
global $CFG, $OUTPUT;
if (has_capability('coursereport/participation:view', $context)) {
$url = new moodle_url('/course/report/participation/index.php', array('id'=>$course->id));
$navigation->add(get_string('participationreport'), $url, navigation_node::TYPE_SETTING, null, null, new pix_icon('i/report', ''));
if (has_capability('report/participation:view', $context)) {
$url = new moodle_url('/report/participation/index.php', array('id'=>$course->id));
$navigation->add(get_string('pluginname', 'report_participation'), $url, navigation_node::TYPE_SETTING, null, null, new pix_icon('i/report', ''));
}
}

Expand All @@ -44,8 +43,9 @@ function participation_report_extend_navigation($navigation, $course, $context)
* @param string $pagetype current page type
* @param stdClass $parentcontext Block's parent context
* @param stdClass $currentcontext Current context of block
* @return array
*/
function participation_page_type_list($pagetype, $parentcontext, $currentcontext) {
function report_participation_page_type_list($pagetype, $parentcontext, $currentcontext) {
$array = array(
'*' => get_string('page-x', 'pagetype'),
'course-report-*' => get_string('page-course-report-x', 'pagetype'),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

M.coursereport_participation = {};
M.report_participation = {};

M.coursereport_participation.init = function(Y) {
M.report_participation.init = function(Y) {

Y.on('submit', function(e) {
Y.one('#formactionselect').get('options').each(function() {
Expand Down
30 changes: 30 additions & 0 deletions report/participation/version.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle 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 3 of the License, or
// (at your option) any later version.
//
// Moodle 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.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Version info
*
* @package report
* @subpackage participation
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die;

$plugin->version = 2011110200; // The current plugin version (Date: YYYYMMDDXX)
$plugin->requires = 2011102700.01; // Requires this Moodle version
$plugin->component = 'report_participation'; // Full name of the plugin (used for diagnostics)
44 changes: 22 additions & 22 deletions report/progress/db/access.php
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle 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 3 of the License, or
// (at your option) any later version.
//
// Moodle 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.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

///////////////////////////////////////////////////////////////////////////
// //
// 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 //
// //
///////////////////////////////////////////////////////////////////////////
/**
* Capabilities
*
* @package report
* @subpackage progress
* @copyright 2008 Sam Marshall
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

$capabilities = array(

Expand Down
2 changes: 1 addition & 1 deletion report/progress/db/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* Post installation and migration code.
*
* @package report
* @subpackage completion
* @subpackage progress
* @copyright 2011 Petr Skoda {@link http://skodak.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
Expand Down
Loading

0 comments on commit 3afce1a

Please sign in to comment.