Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
moodle
moodle
Commits
a87aa28d
Commit
a87aa28d
authored
May 21, 2012
by
Eloy Lafuente
Browse files
MDL-32709 book: Fix logs handling
parent
b9a36354
Changes
9
Hide whitespace changes
Inline
Side-by-side
mod/book/backup/moodle2/restore_book_activity_task.class.php
View file @
a87aa28d
...
...
@@ -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
;
}
}
mod/book/db/log.php
View file @
a87aa28d
...
...
@@ -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'
)
);
mod/book/tool/exportimscp/db/log.php
0 → 100644
View file @
a87aa28d
<?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'
)
);
mod/book/tool/exportimscp/index.php
View file @
a87aa28d
...
...
@@ -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'
,
'
generate
imscp'
,
'tool/
generate
imscp/index.php?id='
.
$cm
->
id
,
$book
->
id
,
$cm
->
id
);
add_to_log
(
$course
->
id
,
'book'
,
'
export
imscp'
,
'tool/
export
imscp/index.php?id='
.
$cm
->
id
,
$book
->
id
,
$cm
->
id
);
$file
=
booktool_exportimscp_build_package
(
$book
,
$context
);
...
...
mod/book/tool/exportimscp/version.php
View file @
a87aa28d
...
...
@@ -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
mod/book/tool/importhtml/version.php
View file @
a87aa28d
...
...
@@ -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
mod/book/tool/print/db/log.php
0 → 100644
View file @
a87aa28d
<?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'
)
);
mod/book/tool/print/version.php
View file @
a87aa28d
...
...
@@ -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
mod/book/version.php
View file @
a87aa28d
...
...
@@ -25,6 +25,6 @@
defined
(
'MOODLE_INTERNAL'
)
||
die
;
$module
->
component
=
'mod_book'
;
// Full name of the plugin (used for diagnostics)
$module
->
version
=
2012051
5
00
;
// The current module version (Date: YYYYMMDDXX)
$module
->
requires
=
2012051
1
00
;
// Requires this Moodle version
$module
->
version
=
201205
2
100
;
// The current module version (Date: YYYYMMDDXX)
$module
->
requires
=
2012051
9
00
;
// Requires this Moodle version
$module
->
cron
=
0
;
// Period for cron to check this module (secs)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment