MDL-32709 book: Fix logs handling
This commit is contained in:
@@ -96,10 +96,17 @@ class restore_book_activity_task extends restore_activity_task {
|
||||
static public function define_restore_log_rules() {
|
||||
$rules = array();
|
||||
|
||||
$rules[] = new restore_log_rule('book', 'add', 'view.php?id={course_module}', '{book}');
|
||||
$rules[] = new restore_log_rule('book', 'update', 'view.php?id={course_module}&chapterid={book_chapter}', '{book}');
|
||||
$rules[] = new restore_log_rule('book', 'update', 'view.php?id={course_module}', '{book}');
|
||||
$rules[] = new restore_log_rule('book', 'view', 'view.php?id={course_module}&chapterid={book_chapter}', '{book}');
|
||||
$rules[] = new restore_log_rule('book', 'view', 'view.php?id={course_module}', '{book}');
|
||||
$rules[] = new restore_log_rule('book', 'view all', 'view.php?id={course_module}', '{book}');
|
||||
$rules[] = new restore_log_rule('book', 'print', 'view.php?id={course_module}', '{book}');
|
||||
$rules[] = new restore_log_rule('book', 'print', 'tool/print/index.php?id={course_module}&chapterid={book_chapter}', '{book}');
|
||||
$rules[] = new restore_log_rule('book', 'print', 'tool/print/index.php?id={course_module}', '{book}');
|
||||
$rules[] = new restore_log_rule('book', 'exportimscp', 'tool/exportimscp/index.php?id={course_module}', '{book}');
|
||||
// To convert old 'generateimscp' log entries
|
||||
$rules[] = new restore_log_rule('book', 'generateimscp', 'tool/generateimscp/index.php?id={course_module}', '{book}',
|
||||
'book', 'exportimscp', 'tool/exportimscp/index.php?id={course_module}', '{book}');
|
||||
|
||||
return $rules;
|
||||
}
|
||||
@@ -119,6 +126,8 @@ class restore_book_activity_task extends restore_activity_task {
|
||||
static public function define_restore_log_rules_for_course() {
|
||||
$rules = array();
|
||||
|
||||
$rules[] = new restore_log_rule('book', 'view all', 'index.php?id={course}', null);
|
||||
|
||||
return $rules;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -25,7 +25,7 @@
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$logs = array(
|
||||
array('module'=>'book', 'action'=>'add', 'mtable'=>'book', 'field'=>'name'),
|
||||
array('module'=>'book', 'action'=>'update', 'mtable'=>'book', 'field'=>'name'),
|
||||
array('module'=>'book', 'action'=>'view', 'mtable'=>'book', 'field'=>'name'),
|
||||
array('module'=>'book', 'action'=>'view all', 'mtable'=>'book', 'field'=>'name'),
|
||||
array('module'=>'book', 'action'=>'view', 'mtable'=>'book', 'field'=>'name')
|
||||
);
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
// This file is part of Book module for 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/>.
|
||||
|
||||
/**
|
||||
* Export to IMSCP booktool log events definition
|
||||
*
|
||||
* @package booktool_exportimscp
|
||||
* @copyright 2012 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$logs = array(
|
||||
array('module'=>'book', 'action'=>'exportimscp', 'mtable'=>'book', 'field'=>'name')
|
||||
);
|
||||
@@ -48,7 +48,7 @@ $strbooks = get_string('modulenameplural', 'book');
|
||||
$strbook = get_string('modulename', 'book');
|
||||
$strtop = get_string('top', 'book');
|
||||
|
||||
add_to_log($course->id, 'book', 'generateimscp', 'tool/generateimscp/index.php?id='.$cm->id, $book->id, $cm->id);
|
||||
add_to_log($course->id, 'book', 'exportimscp', 'tool/exportimscp/index.php?id='.$cm->id, $book->id, $cm->id);
|
||||
|
||||
$file = booktool_exportimscp_build_package($book, $context);
|
||||
|
||||
|
||||
@@ -24,5 +24,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
|
||||
$plugin->version = 2011101400; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->component = 'booktool_exportimscp'; // Full name of the plugin (used for diagnostics)
|
||||
$plugin->version = 2012052100; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2012051900; // Requires this Moodle version
|
||||
|
||||
@@ -24,5 +24,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
|
||||
$plugin->version = 2011101400; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->component = 'booktool_importhtml'; // Full name of the plugin (used for diagnostics)
|
||||
$plugin->version = 2012052100; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2012051900; // Requires this Moodle version
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
// This file is part of Book module for 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/>.
|
||||
|
||||
/**
|
||||
* Print booktool log events definition
|
||||
*
|
||||
* @package booktool_print
|
||||
* @copyright 2012 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$logs = array(
|
||||
array('module'=>'book', 'action'=>'print', 'mtable'=>'book', 'field'=>'name')
|
||||
);
|
||||
@@ -24,5 +24,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
|
||||
$plugin->version = 2011101400; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->component = 'booktool_print'; // Full name of the plugin (used for diagnostics)
|
||||
$plugin->version = 2012052100; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2012051900; // Requires this Moodle version
|
||||
|
||||
@@ -25,6 +25,6 @@
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
|
||||
$module->component = 'mod_book'; // Full name of the plugin (used for diagnostics)
|
||||
$module->version = 2012051500; // The current module version (Date: YYYYMMDDXX)
|
||||
$module->requires = 2012051100; // Requires this Moodle version
|
||||
$module->version = 2012052100; // The current module version (Date: YYYYMMDDXX)
|
||||
$module->requires = 2012051900; // Requires this Moodle version
|
||||
$module->cron = 0; // Period for cron to check this module (secs)
|
||||
|
||||
Reference in New Issue
Block a user