### Eclipse Workspace Patch 1.0 #P moodle20r Index: mod/label/db/install.php =================================================================== RCS file: mod/label/db/install.php diff -N mod/label/db/install.php --- mod/label/db/install.php 25 Jul 2010 11:06:52 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,41 +0,0 @@ -. - -/** - * Label module post install - * - * @package mod - * @subpackage label - * @copyright 2009 Petr Skoda {@link http://skodak.org} - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ - -defined('MOODLE_INTERNAL') || die; - -// This file replaces: -// * STATEMENTS section in db/install.xml -// * lib.php/modulename_install() post installation hook -// * partially defaults.php - -function xmldb_label_install() { - global $DB; - -/// Install logging support - update_log_display_entry('label', 'add', 'label', 'name'); - update_log_display_entry('label', 'update', 'label', 'name'); - -} Index: mod/feedback/version.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/feedback/version.php,v retrieving revision 1.33 diff -u -r1.33 version.php --- mod/feedback/version.php 16 May 2010 20:05:52 -0000 1.33 +++ mod/feedback/version.php 3 Aug 2010 09:42:54 -0000 @@ -9,8 +9,8 @@ */ - $module->version = 2010051601; // The current module version (Date: YYYYMMDDXX) - $module->requires = 2010050414; // Requires this Moodle version + $module->version = 2010080300; // The current module version (Date: YYYYMMDDXX) + $module->requires = 2010080300; // Requires this Moodle version $feedback_version_intern = 1; //this version is used for restore older backups $module->cron = 0; // Period for cron to check this module (secs) Index: mod/url/db/install.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/url/db/install.php,v retrieving revision 1.2 diff -u -r1.2 install.php --- mod/url/db/install.php 25 Jul 2010 11:20:24 -0000 1.2 +++ mod/url/db/install.php 3 Aug 2010 09:42:54 -0000 @@ -34,12 +34,6 @@ function xmldb_url_install() { global $CFG; - // Install logging support - update_log_display_entry('url', 'view', 'url', 'name'); - update_log_display_entry('url', 'view all', 'url', 'name'); - update_log_display_entry('url', 'update', 'url', 'name'); - update_log_display_entry('url', 'add', 'url', 'name'); - // migrate settings if present if (!empty($CFG->resource_secretphrase)) { set_config('secretphrase', $CFG->resource_secretphrase, 'url'); Index: mod/imscp/db/install.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/imscp/db/install.php,v retrieving revision 1.2 diff -u -r1.2 install.php --- mod/imscp/db/install.php 25 Jul 2010 11:16:08 -0000 1.2 +++ mod/imscp/db/install.php 3 Aug 2010 09:42:54 -0000 @@ -34,12 +34,6 @@ function xmldb_imscp_install() { global $CFG; - // Install logging support - update_log_display_entry('imscp', 'view', 'imscp', 'name'); - update_log_display_entry('imscp', 'view all', 'imscp', 'name'); - update_log_display_entry('imscp', 'update', 'imscp', 'name'); - update_log_display_entry('imscp', 'add', 'imscp', 'name'); - // Upgrade from old resource module type if needed require_once("$CFG->dirroot/mod/imscp/db/upgradelib.php"); imscp_20_migrate(); Index: mod/forum/db/install.php =================================================================== RCS file: mod/forum/db/install.php diff -N mod/forum/db/install.php --- mod/forum/db/install.php 28 Jan 2010 08:37:43 -0000 1.5 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,46 +0,0 @@ -. - -/** - * This file replaces: - * - STATEMENTS section in db/install.xml - * - lib.php/modulename_install() post installation hook - * - partially defaults.php - * - * @package mod-forum - * @copyright 2009 Petr Skoda (http://skodak.org) - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ - -function xmldb_forum_install() { - global $DB; - -/// Install logging support - update_log_display_entry('forum', 'add', 'forum', 'name'); - update_log_display_entry('forum', 'update', 'forum', 'name'); - update_log_display_entry('forum', 'add discussion', 'forum_discussions', 'name'); - update_log_display_entry('forum', 'add post', 'forum_posts', 'subject'); - update_log_display_entry('forum', 'update post', 'forum_posts', 'subject'); - update_log_display_entry('forum', 'user report', 'user', 'CONCAT(firstname,\' \',lastname)'); - update_log_display_entry('forum', 'move discussion', 'forum_discussions', 'name'); - update_log_display_entry('forum', 'view subscribers', 'forum', 'name'); - update_log_display_entry('forum', 'view discussion', 'forum_discussions', 'name'); - update_log_display_entry('forum', 'view forum', 'forum', 'name'); - update_log_display_entry('forum', 'subscribe', 'forum', 'name'); - update_log_display_entry('forum', 'unsubscribe', 'forum', 'name'); - -} Index: mod/url/version.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/url/version.php,v retrieving revision 1.2 diff -u -r1.2 version.php --- mod/url/version.php 25 Jul 2010 11:20:23 -0000 1.2 +++ mod/url/version.php 3 Aug 2010 09:42:54 -0000 @@ -26,7 +26,7 @@ defined('MOODLE_INTERNAL') || die; -$module->version = 2009080500; -$module->requires = 2009073101; // Requires this Moodle version +$module->version = 2010080300; +$module->requires = 2010080300; // Requires this Moodle version $module->cron = 0; Index: mod/workshop/db/install.php =================================================================== RCS file: mod/workshop/db/install.php diff -N mod/workshop/db/install.php --- mod/workshop/db/install.php 4 Jan 2010 17:53:33 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,38 +0,0 @@ -. - -/** - * This file replaces the legacy STATEMENTS section in db/install.xml, - * lib.php/modulename_install() post installation hook and partially defaults.php - * - * @package mod-workshop - * @copyright 2009 David Mudrak - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ - -/** - * Post installation procedure - */ -function xmldb_workshop_install() { - global $DB; - - // Install logging support todo - //update_log_display_entry('workshop', 'add', 'workshop', 'name'); - //update_log_display_entry('workshop', 'update', 'workshop', 'name'); - //update_log_display_entry('workshop', 'view', 'workshop', 'name'); - //update_log_display_entry('workshop', 'view all', 'workshop', 'name'); -} Index: mod/folder/version.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/folder/version.php,v retrieving revision 1.3 diff -u -r1.3 version.php --- mod/folder/version.php 25 Jul 2010 11:12:19 -0000 1.3 +++ mod/folder/version.php 3 Aug 2010 09:42:54 -0000 @@ -26,7 +26,7 @@ defined('MOODLE_INTERNAL') || die(); -$module->version = 2010072200; -$module->requires = 2009073101; // Requires this Moodle version +$module->version = 2010080300; +$module->requires = 2010080300; // Requires this Moodle version $module->cron = 0; Index: mod/wiki/version.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/wiki/version.php,v retrieving revision 1.36 diff -u -r1.36 version.php --- mod/wiki/version.php 2 Aug 2010 11:49:51 -0000 1.36 +++ mod/wiki/version.php 3 Aug 2010 09:42:54 -0000 @@ -32,5 +32,6 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -$module->version = 2010080201; // The current module version (Date: YYYYMMDDXX) -$module->cron = 0; // Period for cron to check this module (secs) +$module->version = 2010080300; // The current module version (Date: YYYYMMDDXX) +$module->requires = 2010080300; +$module->cron = 0; // Period for cron to check this module (secs) Index: mod/assignment/version.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/assignment/version.php,v retrieving revision 1.64 diff -u -r1.64 version.php --- mod/assignment/version.php 1 Nov 2009 13:21:57 -0000 1.64 +++ mod/assignment/version.php 3 Aug 2010 09:42:54 -0000 @@ -5,8 +5,8 @@ // This fragment is called by /admin/index.php //////////////////////////////////////////////////////////////////////////////// -$module->version = 2009062500; -$module->requires = 2009041700; // Requires this Moodle version +$module->version = 2010080300; +$module->requires = 2010080300; // Requires this Moodle version $module->cron = 60; Index: mod/choice/version.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/choice/version.php,v retrieving revision 1.39 diff -u -r1.39 version.php --- mod/choice/version.php 1 Nov 2009 14:55:15 -0000 1.39 +++ mod/choice/version.php 3 Aug 2010 09:42:54 -0000 @@ -5,8 +5,8 @@ // This fragment is called by /admin/index.php //////////////////////////////////////////////////////////////////////////////// -$module->version = 2009042001; -$module->requires = 2009041700; // Requires this Moodle version +$module->version = 2010080300; +$module->requires = 2010080300; // Requires this Moodle version $module->cron = 0; Index: mod/scorm/db/install.php =================================================================== RCS file: mod/scorm/db/install.php diff -N mod/scorm/db/install.php --- mod/scorm/db/install.php 1 Nov 2009 15:24:59 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,17 +0,0 @@ -version = 2009042002; -$module->requires = 2009041700; // Requires this Moodle version +$module->version = 2010080300; +$module->requires = 2010080300; // Requires this Moodle version $module->cron = 0; Index: lib/db/install.xml =================================================================== RCS file: /cvsroot/moodle/moodle/lib/db/install.xml,v retrieving revision 1.272 diff -u -r1.272 install.xml --- lib/db/install.xml 27 Jul 2010 15:16:32 -0000 1.272 +++ lib/db/install.xml 3 Aug 2010 09:42:49 -0000 @@ -1,5 +1,5 @@ - @@ -560,7 +560,8 @@ - + + Index: lib/db/install.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/db/install.php,v retrieving revision 1.28 diff -u -r1.28 install.php --- lib/db/install.php 3 Aug 2010 08:07:49 -0000 1.28 +++ lib/db/install.php 3 Aug 2010 09:42:44 -0000 @@ -141,28 +141,6 @@ $mnetallhosts->id = $DB->insert_record('mnet_host', $mnetallhosts, true); set_config('mnet_all_hosts_id', $mnetallhosts->id); - /// insert log entries - replaces statements section in install.xml - update_log_display_entry('user', 'view', 'user', $DB->sql_concat('firstname', "' '" , 'lastname')); - update_log_display_entry('course', 'user report', 'user', $DB->sql_concat('firstname', "' '" , 'lastname')); - update_log_display_entry('course', 'view', 'course', 'fullname'); - update_log_display_entry('course', 'update', 'course', 'fullname'); - update_log_display_entry('course', 'enrol', 'user', 'course', 'fullname'); // there should be some way to store user id of the enrolled user! - update_log_display_entry('course', 'unenrol', 'user', 'course', 'fullname'); // there should be some way to store user id of the enrolled user! - update_log_display_entry('course', 'report log', 'course', 'fullname'); - update_log_display_entry('course', 'report live', 'course', 'fullname'); - update_log_display_entry('course', 'report outline', 'course', 'fullname'); - update_log_display_entry('course', 'report participation', 'course', 'fullname'); - update_log_display_entry('course', 'report stats', 'course', 'fullname'); - update_log_display_entry('message', 'write', 'user', $DB->sql_concat('firstname', "' '" , 'lastname')); - update_log_display_entry('message', 'read', 'user', $DB->sql_concat('firstname', "' '" , 'lastname')); - update_log_display_entry('message', 'add contact', 'user', $DB->sql_concat('firstname', "' '" , 'lastname')); - update_log_display_entry('message', 'remove contact', 'user', $DB->sql_concat('firstname', "' '" , 'lastname')); - update_log_display_entry('message', 'block contact', 'user', $DB->sql_concat('firstname', "' '" , 'lastname')); - update_log_display_entry('message', 'unblock contact', 'user', $DB->sql_concat('firstname', "' '" , 'lastname')); - update_log_display_entry('group', 'view', 'groups', 'name'); - update_log_display_entry('tag', 'update', 'tag', 'name'); - - /// Create guest record - do not assign any role, guest user get's the default guest role automatically on the fly $guest = new object(); $guest->auth = 'manual'; @@ -210,7 +188,6 @@ /// Now is the correct moment to install capabilities - after creation of legacy roles, but before assigning of roles update_capabilities('moodle'); - external_update_descriptions('moodle'); /// Default allow assign $defaultallowassigns = array( Index: lib/db/upgrade.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/db/upgrade.php,v retrieving revision 1.474 diff -u -r1.474 upgrade.php --- lib/db/upgrade.php 3 Aug 2010 08:07:49 -0000 1.474 +++ lib/db/upgrade.php 3 Aug 2010 09:42:54 -0000 @@ -4910,22 +4910,6 @@ upgrade_main_savepoint(true, 2010072700); } - if ($oldversion < 2010080300) { - - // We need to fix the use of hard coded CONCAT statements that won't work - // in some databases. - update_log_display_entry('user', 'view', 'user', $DB->sql_concat('firstname', "' '" , 'lastname')); - update_log_display_entry('course', 'user report', 'user', $DB->sql_concat('firstname', "' '" , 'lastname')); - update_log_display_entry('message', 'write', 'user', $DB->sql_concat('firstname', "' '" , 'lastname')); - update_log_display_entry('message', 'read', 'user', $DB->sql_concat('firstname', "' '" , 'lastname')); - update_log_display_entry('message', 'add contact', 'user', $DB->sql_concat('firstname', "' '" , 'lastname')); - update_log_display_entry('message', 'remove contact', 'user', $DB->sql_concat('firstname', "' '" , 'lastname')); - update_log_display_entry('message', 'block contact', 'user', $DB->sql_concat('firstname', "' '" , 'lastname')); - update_log_display_entry('message', 'unblock contact', 'user', $DB->sql_concat('firstname', "' '" , 'lastname')); - - upgrade_main_savepoint(true, 2010080300); - } - if ($oldversion < 2010080303) { $rs = $DB->get_recordset_sql('SELECT i.id, i.name, r.type FROM {repository_instances} i, {repository} r WHERE i.typeid = r.id'); foreach ($rs as $record) { @@ -4940,6 +4924,24 @@ upgrade_main_savepoint(true, 2010080303); } + if ($oldversion < 2010080305) { + // first drop all log disaply actions, we will rectreate them automatically later + $DB->delete_records('log_display', array()); + + // Define field component to be added to log_display + $table = new xmldb_table('log_display'); + $field = new xmldb_field('component', XMLDB_TYPE_CHAR, '100', null, XMLDB_NOTNULL, null, null, 'field'); + + // Launch add field component + if (!$dbman->field_exists($table, $field)) { + $dbman->add_field($table, $field); + } + + // Main savepoint reached + upgrade_main_savepoint(true, 2010080305); + } + + return true; } Index: mod/choice/db/install.php =================================================================== RCS file: mod/choice/db/install.php diff -N mod/choice/db/install.php --- mod/choice/db/install.php 1 Nov 2009 14:55:15 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,19 +0,0 @@ -get_record('log_display', array('module'=>$module, 'action'=>$action))) { - $type->mtable = $mtable; - $type->field = $field; - $DB->update_record('log_display', $type); - - } else { - $type = new object(); - $type->module = $module; - $type->action = $action; - $type->mtable = $mtable; - $type->field = $field; - - $DB->insert_record('log_display', $type, false); - } -} - -/** * Upgrade savepoint, marks end of each upgrade block. * It stores new main version, resets upgrade timeout * and abort upgrade if user cancels page loading. @@ -334,6 +303,7 @@ $recover_install_function(); unset_config('installrunning', 'block_'.$plugin->fullname); update_capabilities($component); + log_update_descriptions($component); external_update_descriptions($component); events_update_definition($component); message_update_providers($component); @@ -366,6 +336,7 @@ /// Install various components update_capabilities($component); + log_update_descriptions($component); external_update_descriptions($component); events_update_definition($component); message_update_providers($component); @@ -395,6 +366,7 @@ /// Upgrade various components update_capabilities($component); + log_update_descriptions($component); external_update_descriptions($component); events_update_definition($component); message_update_providers($component); @@ -464,6 +436,7 @@ unset_config('installrunning', $module->name); // Install various components too update_capabilities($component); + log_update_descriptions($component); external_update_descriptions($component); events_update_definition($component); message_update_providers($component); @@ -494,6 +467,7 @@ /// Install various components update_capabilities($component); + log_update_descriptions($component); external_update_descriptions($component); events_update_definition($component); message_update_providers($component); @@ -522,6 +496,7 @@ /// Upgrade various components update_capabilities($component); + log_update_descriptions($component); external_update_descriptions($component); events_update_definition($component); message_update_providers($component); @@ -616,6 +591,7 @@ unset_config('installrunning', 'block_'.$blockname); // Install various components update_capabilities($component); + log_update_descriptions($component); external_update_descriptions($component); events_update_definition($component); message_update_providers($component); @@ -654,6 +630,7 @@ // Install various components update_capabilities($component); + log_update_descriptions($component); external_update_descriptions($component); events_update_definition($component); message_update_providers($component); @@ -687,6 +664,7 @@ // Upgrade various components update_capabilities($component); + log_update_descriptions($component); external_update_descriptions($component); events_update_definition($component); message_update_providers($component); @@ -714,6 +692,65 @@ } } + +/** + * Log_display description function used during install and upgrade. + * + * @param string $component name of component (moodle, mod_assignment, etc.) + * @return void + */ +function log_update_descriptions($component) { + global $DB; + + $defpath = get_component_directory($component).'/db/log.php'; + + if (!file_exists($defpath)) { + $DB->delete_records('log_display', array('component'=>$component)); + return; + } + + // load new info + $logs = array(); + include($defpath); + $newlogs = array(); + foreach ($logs as $log) { + $newlogs[$log['module'].'-'.$log['action']] = $log; // kind of unique name + } + unset($logs); + $logs = $newlogs; + + $fields = array('module', 'action', 'mtable', 'field'); + // update all log fist + $dblogs = $DB->get_records('log_display', array('component'=>$component)); + foreach ($dblogs as $dblog) { + $name = $dblog->module.'-'.$dblog->action; + + if (empty($logs[$name])) { + $DB->delete_records('log_display', array('id'=>$dblog->id)); + continue; + } + + $log = $logs[$name]; + unset($logs[$name]); + + $update = false; + foreach ($fields as $field) { + if ($dblog->$field != $log[$field]) { + $dblog->$field = $log[$field]; + $update = true; + } + } + if ($update) { + $DB->update_record('log_display', $dblog); + } + } + foreach ($logs as $log) { + $dblog = (object)$log; + $dblog->component = $component; + $DB->insert_record('log_display', $dblog); + } +} + /** * Web service discovery function used during install and upgrade. * @param string $component name of component (moodle, mod_assignment, etc.) @@ -741,6 +778,8 @@ $DB->delete_records('external_functions', array('id'=>$dbfunction->id)); // do not delete functions from external_services_functions, beacuse // we want to notify admins when functions used in custom services disappear + + //TODO: this looks wrong, we have to delete it eventually (skodak) continue; } @@ -1199,12 +1238,14 @@ // set all core default records and default settings require_once("$CFG->libdir/db/install.php"); - xmldb_main_install(); + xmldb_main_install(); // installs the capabilities too // store version upgrade_main_savepoint(true, $version, false); // Continue with the installation + log_update_descriptions('moodle'); + external_update_descriptions('moodle'); events_update_definition('moodle'); message_update_providers('moodle'); @@ -1260,6 +1301,7 @@ // perform all other component upgrade routines update_capabilities('moodle'); + log_update_descriptions('moodle'); external_update_descriptions('moodle'); events_update_definition('moodle'); message_update_providers('moodle'); Index: lib/adminlib.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/adminlib.php,v retrieving revision 1.489 diff -u -r1.489 adminlib.php --- lib/adminlib.php 30 Jul 2010 07:43:14 -0000 1.489 +++ lib/adminlib.php 3 Aug 2010 09:42:40 -0000 @@ -256,7 +256,7 @@ $DB->delete_records('log', array('module' => $pluginname)); // delete log_display information - $DB->delete_records('log_display', array('module' => $pluginname)); + $DB->delete_records('log_display', array('component' => $component)); // delete the module configuration records unset_all_config_for_plugin($pluginname); Index: lib/deprecatedlib.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/deprecatedlib.php,v retrieving revision 1.240 diff -u -r1.240 deprecatedlib.php --- lib/deprecatedlib.php 30 Jul 2010 20:51:02 -0000 1.240 +++ lib/deprecatedlib.php 3 Aug 2010 09:42:43 -0000 @@ -32,6 +32,24 @@ /** + * Insert or update log display entry. Entry may already exist. + * $module, $action must be unique + * @deprecated + * + * @param string $module + * @param string $action + * @param string $mtable + * @param string $field + * @return void + * + */ +function update_log_display_entry($module, $action, $mtable, $field) { + global $DB; + + debugging('The update_log_display_entry() is deprecated, please use db/log.php description file instead.'); +} + +/** * Given some text in HTML format, this function will pass it * through any filters that have been configured for this context. * Index: mod/survey/db/install.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/survey/db/install.php,v retrieving revision 1.3 diff -u -r1.3 install.php --- mod/survey/db/install.php 1 Nov 2009 15:25:19 -0000 1.3 +++ mod/survey/db/install.php 3 Aug 2010 09:42:54 -0000 @@ -8,16 +8,6 @@ function xmldb_survey_install() { global $DB; -/// Install logging support - update_log_display_entry('survey', 'add', 'survey', 'name'); - update_log_display_entry('survey', 'update', 'survey', 'name'); - update_log_display_entry('survey', 'download', 'survey', 'name'); - update_log_display_entry('survey', 'view form', 'survey', 'name'); - update_log_display_entry('survey', 'view graph', 'survey', 'name'); - update_log_display_entry('survey', 'view report', 'survey', 'name'); - update_log_display_entry('survey', 'submit', 'survey', 'name'); - - /// insert survey data $records = array( array_combine(array('course', 'template', 'days', 'timecreated', 'timemodified', 'name', 'intro', 'questions'), array(0, 0, 0, 985017600, 985017600, 'collesaname', 'collesaintro', '25,26,27,28,29,30,43,44')), Index: mod/workshop/version.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/workshop/version.php,v retrieving revision 1.65 diff -u -r1.65 version.php --- mod/workshop/version.php 23 Jul 2010 16:15:12 -0000 1.65 +++ mod/workshop/version.php 3 Aug 2010 09:42:54 -0000 @@ -28,6 +28,6 @@ defined('MOODLE_INTERNAL') || die(); -$module->version = 2010072300; -$module->requires = 2010070604; // Requires this Moodle version +$module->version = 2010080300; +$module->requires = 2010080300; // Requires this Moodle version //$module->cron = 60; Index: mod/label/version.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/label/version.php,v retrieving revision 1.23 diff -u -r1.23 version.php --- mod/label/version.php 25 Jul 2010 11:06:52 -0000 1.23 +++ mod/label/version.php 3 Aug 2010 09:42:54 -0000 @@ -26,8 +26,8 @@ defined('MOODLE_INTERNAL') || die; -$module->version = 2009080400; // The current module version (Date: YYYYMMDDXX) -$module->requires = 2009041700; // Requires this Moodle version +$module->version = 2010080300; // The current module version (Date: YYYYMMDDXX) +$module->requires = 2010080300; // Requires this Moodle version $module->cron = 0; // Period for cron to check this module (secs) Index: mod/lesson/version.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/lesson/version.php,v retrieving revision 1.51 diff -u -r1.51 version.php --- mod/lesson/version.php 25 Jul 2010 10:54:39 -0000 1.51 +++ mod/lesson/version.php 3 Aug 2010 09:42:54 -0000 @@ -27,8 +27,8 @@ defined('MOODLE_INTERNAL') || die(); -$module->version = 2010072003; // The current module version (Date: YYYYMMDDXX) -$module->requires = 2010071800; // Requires this Moodle version +$module->version = 2010080300; // The current module version (Date: YYYYMMDDXX) +$module->requires = 2010080300; // Requires this Moodle version $module->cron = 0; // Period for cron to check this module (secs) Index: mod/scorm/version.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/scorm/version.php,v retrieving revision 1.67 diff -u -r1.67 version.php --- mod/scorm/version.php 8 Jul 2010 10:40:47 -0000 1.67 +++ mod/scorm/version.php 3 Aug 2010 09:42:54 -0000 @@ -6,7 +6,7 @@ ///////////////////////////////////////////////////////////////////////////////// -$module->version = 2010070800; // The (date) version of this module -$module->requires = 2009041700; // The version of Moodle that is required +$module->version = 2010080300; // The (date) version of this module +$module->requires = 2010080300; // The version of Moodle that is required $module->cron = 300; // How often should cron check this module (seconds)? Index: mod/quiz/db/upgrade.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/quiz/db/upgrade.php,v retrieving revision 1.39 diff -u -r1.39 upgrade.php --- mod/quiz/db/upgrade.php 16 Jul 2010 09:22:57 -0000 1.39 +++ mod/quiz/db/upgrade.php 3 Aug 2010 09:42:54 -0000 @@ -297,10 +297,6 @@ } if ($oldversion < 2010030501) { - /// fix log actions - update_log_display_entry('quiz', 'edit override', 'quiz', 'name'); - update_log_display_entry('quiz', 'delete override', 'quiz', 'name'); - /// Define table quiz_overrides to be created $table = new xmldb_table('quiz_overrides'); Index: mod/quiz/db/install.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/quiz/db/install.php,v retrieving revision 1.4 diff -u -r1.4 install.php --- mod/quiz/db/install.php 8 Mar 2010 16:01:40 -0000 1.4 +++ mod/quiz/db/install.php 3 Aug 2010 09:42:54 -0000 @@ -8,22 +8,6 @@ function xmldb_quiz_install() { global $DB; -/// Install logging support - update_log_display_entry('quiz', 'add', 'quiz', 'name'); - update_log_display_entry('quiz', 'update', 'quiz', 'name'); - update_log_display_entry('quiz', 'view', 'quiz', 'name'); - update_log_display_entry('quiz', 'report', 'quiz', 'name'); - update_log_display_entry('quiz', 'attempt', 'quiz', 'name'); - update_log_display_entry('quiz', 'submit', 'quiz', 'name'); - update_log_display_entry('quiz', 'review', 'quiz', 'name'); - update_log_display_entry('quiz', 'editquestions', 'quiz', 'name'); - update_log_display_entry('quiz', 'preview', 'quiz', 'name'); - update_log_display_entry('quiz', 'start attempt', 'quiz', 'name'); - update_log_display_entry('quiz', 'close attempt', 'quiz', 'name'); - update_log_display_entry('quiz', 'continue attempt', 'quiz', 'name'); - update_log_display_entry('quiz', 'edit override', 'quiz', 'name'); - update_log_display_entry('quiz', 'delete override', 'quiz', 'name'); - $record = new object(); $record->name = 'overview'; $record->displayorder = '10000'; Index: mod/resource/version.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/resource/version.php,v retrieving revision 1.42 diff -u -r1.42 version.php --- mod/resource/version.php 25 Jul 2010 11:25:02 -0000 1.42 +++ mod/resource/version.php 3 Aug 2010 09:42:54 -0000 @@ -26,7 +26,7 @@ defined('MOODLE_INTERNAL') || die; -$module->version = 2009080501; -$module->requires = 2009073101; // Requires this Moodle version +$module->version = 2010080300; +$module->requires = 2010080300; // Requires this Moodle version $module->cron = 0; Index: mod/glossary/db/install.php =================================================================== RCS file: mod/glossary/db/install.php diff -N mod/glossary/db/install.php --- mod/glossary/db/install.php 8 Nov 2009 14:12:12 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,24 +0,0 @@ -count_records('resource'); $old_count = $DB->count_records('resource_old', array('migrated'=>0)); Index: mod/resource/db/install.php =================================================================== RCS file: mod/resource/db/install.php diff -N mod/resource/db/install.php --- mod/resource/db/install.php 25 Jul 2010 11:25:02 -0000 1.5 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,43 +0,0 @@ -. - -/** - * Resource module post install function - * - * This file replaces: - * - STATEMENTS section in db/install.xml - * - lib.php/modulename_install() post installation hook - * - partially defaults.php - * - * @package mod - * @subpackage resource - * @copyright 2009 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_resource_install() { - global $DB; - - // Install logging support - update_log_display_entry('resource', 'view', 'resource', 'name'); - update_log_display_entry('resource', 'view all', 'resource', 'name'); - update_log_display_entry('resource', 'update', 'resource', 'name'); - update_log_display_entry('resource', 'add', 'resource', 'name'); - -} Index: mod/chat/version.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/chat/version.php,v retrieving revision 1.36 diff -u -r1.36 version.php --- mod/chat/version.php 4 May 2010 05:09:30 -0000 1.36 +++ mod/chat/version.php 3 Aug 2010 09:42:54 -0000 @@ -5,8 +5,8 @@ /// This fragment is called by moodle_needs_upgrading() and /admin/index.php ///////////////////////////////////////////////////////////////////////////////// -$module->version = 2010050102; // The (date) version of this module -$module->requires = 2009041700; // Requires this Moodle version +$module->version = 2010080300; // The (date) version of this module +$module->requires = 2010080300; // Requires this Moodle version $module->cron = 300; // How often should cron check this module (seconds)? Index: mod/assignment/db/install.php =================================================================== RCS file: mod/assignment/db/install.php diff -N mod/assignment/db/install.php --- mod/assignment/db/install.php 1 Nov 2009 13:21:57 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,18 +0,0 @@ -version = 2010042800; -$module->requires = 2010042800; // Requires this Moodle version +$module->version = 2010080300; +$module->requires = 2010080300; // Requires this Moodle version $module->cron = 60; Index: mod/glossary/version.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/glossary/version.php,v retrieving revision 1.73 diff -u -r1.73 version.php --- mod/glossary/version.php 28 Apr 2010 03:12:49 -0000 1.73 +++ mod/glossary/version.php 3 Aug 2010 09:42:54 -0000 @@ -5,8 +5,8 @@ /// This fragment is called by moodle_needs_upgrading() and /admin/index.php ///////////////////////////////////////////////////////////////////////////////// -$module->version = 2010042800; -$module->requires = 2010042800; // Requires this Moodle version +$module->version = 2010080300; +$module->requires = 2010080300; // Requires this Moodle version $module->cron = 0; // Period for cron to check this module (secs) Index: mod/feedback/db/install.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/feedback/db/install.php,v retrieving revision 1.5 diff -u -r1.5 install.php --- mod/feedback/db/install.php 16 May 2010 16:05:20 -0000 1.5 +++ mod/feedback/db/install.php 3 Aug 2010 09:42:54 -0000 @@ -6,11 +6,4 @@ /// Disable this module by default (because it's not technically part of Moodle 2.0) $DB->set_field('modules', 'visible', 0, array('name'=>'feedback')); -/// Install logging support - update_log_display_entry('feedback', 'startcomplete', 'feedback', 'name'); - update_log_display_entry('feedback', 'submit', 'feedback', 'name'); - update_log_display_entry('feedback', 'delete', 'feedback', 'name'); - update_log_display_entry('feedback', 'view', 'feedback', 'name'); - update_log_display_entry('feedback', 'view all', 'course', 'shortname'); - } Index: mod/forum/version.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/forum/version.php,v retrieving revision 1.93 diff -u -r1.93 version.php --- mod/forum/version.php 8 Jul 2010 08:09:51 -0000 1.93 +++ mod/forum/version.php 3 Aug 2010 09:42:54 -0000 @@ -24,8 +24,8 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -$module->version = 2010070800; -$module->requires = 2010070800; // Requires this Moodle version +$module->version = 2010080300; +$module->requires = 2010080300; // Requires this Moodle version $module->cron = 60; Index: mod/imscp/version.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/imscp/version.php,v retrieving revision 1.2 diff -u -r1.2 version.php --- mod/imscp/version.php 25 Jul 2010 11:16:08 -0000 1.2 +++ mod/imscp/version.php 3 Aug 2010 09:42:54 -0000 @@ -26,7 +26,7 @@ defined('MOODLE_INTERNAL') || die(); -$module->version = 2009080500; -$module->requires = 2009073101; // Requires this Moodle version +$module->version = 2010080300; +$module->requires = 2010080300; // Requires this Moodle version $module->cron = 0; Index: mod/chat/db/install.php =================================================================== RCS file: mod/chat/db/install.php diff -N mod/chat/db/install.php --- mod/chat/db/install.php 1 Nov 2009 13:25:10 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,17 +0,0 @@ -dirroot/mod/page/db/upgradelib.php"); page_20_migrate(); Index: mod/quiz/version.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/quiz/version.php,v retrieving revision 1.147 diff -u -r1.147 version.php --- mod/quiz/version.php 21 May 2010 03:22:51 -0000 1.147 +++ mod/quiz/version.php 3 Aug 2010 09:42:54 -0000 @@ -5,8 +5,8 @@ // This fragment is called by moodle_needs_upgrading() and /admin/index.php //////////////////////////////////////////////////////////////////////////////// -$module->version = 2010051800; // The (date) version of this module -$module->requires = 2009041700; // Requires this Moodle version +$module->version = 2010051801; // The (date) version of this module +$module->requires = 2010080300; // Requires this Moodle version $module->cron = 0; // How often should cron check this module (seconds)? Index: version.php =================================================================== RCS file: /cvsroot/moodle/moodle/version.php,v retrieving revision 1.1698 diff -u -r1.1698 version.php --- version.php 3 Aug 2010 07:59:00 -0000 1.1698 +++ version.php 3 Aug 2010 09:42:37 -0000 @@ -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 = 2010080303; // YYYYMMDD = date of the last version bump + $version = 2010080307; // YYYYMMDD = date of the last version bump // XX = daily increments $release = '2.0 Preview 4+ (Build: 20100803)'; // Human-friendly version name Index: mod/page/version.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/page/version.php,v retrieving revision 1.2 diff -u -r1.2 version.php --- mod/page/version.php 15 Jul 2010 15:45:20 -0000 1.2 +++ mod/page/version.php 3 Aug 2010 09:42:54 -0000 @@ -26,7 +26,7 @@ defined('MOODLE_INTERNAL') || die; -$module->version = 2009080500; -$module->requires = 2009073101; // Requires this Moodle version +$module->version = 2010080300; +$module->requires = 2010080300; // Requires this Moodle version $module->cron = 0; Index: mod/lesson/db/install.php =================================================================== RCS file: mod/lesson/db/install.php diff -N mod/lesson/db/install.php --- mod/lesson/db/install.php 25 Jul 2010 10:54:41 -0000 1.6 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,40 +0,0 @@ -. - -/** - * This file replaces: - * * STATEMENTS section in db/install.xml - * * lib.php/modulename_install() post installation hook - * * partially defaults.php - * - * @package mod - * @subpackage lesson - * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 o - */ - -defined('MOODLE_INTERNAL') || die(); - -function xmldb_lesson_install() { - global $DB; - -/// Install logging support - update_log_display_entry('lesson', 'start', 'lesson', 'name'); - update_log_display_entry('lesson', 'end', 'lesson', 'name'); - update_log_display_entry('lesson', 'view', 'lesson_pages', 'title'); - -} Index: mod/folder/db/install.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/folder/db/install.php,v retrieving revision 1.2 diff -u -r1.2 install.php --- mod/folder/db/install.php 25 Jul 2010 11:12:20 -0000 1.2 +++ mod/folder/db/install.php 3 Aug 2010 09:42:54 -0000 @@ -34,12 +34,6 @@ function xmldb_folder_install() { global $CFG; - // Install logging support - update_log_display_entry('folder', 'view', 'folder', 'name'); - update_log_display_entry('folder', 'view all', 'folder', 'name'); - update_log_display_entry('folder', 'update', 'folder', 'name'); - update_log_display_entry('folder', 'add', 'folder', 'name'); - // Upgrade from old resource module type if needed require_once("$CFG->dirroot/mod/folder/db/upgradelib.php"); folder_20_migrate(); Index: mod/assignment/db/log.php =================================================================== RCS file: mod/assignment/db/log.php diff -N mod/assignment/db/log.php --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ mod/assignment/db/log.php 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,35 @@ +. + +/** + * Definition of log events + * + * @package mod + * @subpackage assignment + * @copyright 2010 Petr Skoda (http://skodak.org) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$logs = array( + array('module'=>'assignment', 'action'=>'view', 'mtable'=>'assignment', 'field'=>'name'), + array('module'=>'assignment', 'action'=>'add', 'mtable'=>'assignment', 'field'=>'name'), + array('module'=>'assignment', 'action'=>'update', 'mtable'=>'assignment', 'field'=>'name'), + array('module'=>'assignment', 'action'=>'view submission', 'mtable'=>'assignment', 'field'=>'name'), + array('module'=>'assignment', 'action'=>'upload', 'mtable'=>'assignment', 'field'=>'name'), +); \ No newline at end of file Index: mod/url/db/log.php =================================================================== RCS file: mod/url/db/log.php diff -N mod/url/db/log.php --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ mod/url/db/log.php 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,34 @@ +. + +/** + * Definition of log events + * + * @package mod + * @subpackage url + * @copyright 2010 Petr Skoda (http://skodak.org) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$logs = array( + array('module'=>'url', 'action'=>'view', 'mtable'=>'url', 'field'=>'name'), + array('module'=>'url', 'action'=>'view all', 'mtable'=>'url', 'field'=>'name'), + array('module'=>'url', 'action'=>'update', 'mtable'=>'url', 'field'=>'name'), + array('module'=>'url', 'action'=>'add', 'mtable'=>'url', 'field'=>'name'), +); \ No newline at end of file Index: mod/glossary/db/log.php =================================================================== RCS file: mod/glossary/db/log.php diff -N mod/glossary/db/log.php --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ mod/glossary/db/log.php 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,41 @@ +. + +/** + * Definition of log events + * + * @package mod + * @subpackage glossary + * @copyright 2010 Petr Skoda (http://skodak.org) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$logs = array( + array('module'=>'glossary', 'action'=>'add', 'mtable'=>'glossary', 'field'=>'name'), + array('module'=>'glossary', 'action'=>'update', 'mtable'=>'glossary', 'field'=>'name'), + array('module'=>'glossary', 'action'=>'view', 'mtable'=>'glossary', 'field'=>'name'), + array('module'=>'glossary', 'action'=>'view all', 'mtable'=>'glossary', 'field'=>'name'), + array('module'=>'glossary', 'action'=>'add entry', 'mtable'=>'glossary', 'field'=>'name'), + array('module'=>'glossary', 'action'=>'update entry', 'mtable'=>'glossary', 'field'=>'name'), + array('module'=>'glossary', 'action'=>'add category', 'mtable'=>'glossary', 'field'=>'name'), + array('module'=>'glossary', 'action'=>'update category', 'mtable'=>'glossary', 'field'=>'name'), + array('module'=>'glossary', 'action'=>'delete category', 'mtable'=>'glossary', 'field'=>'name'), + array('module'=>'glossary', 'action'=>'approve entry', 'mtable'=>'glossary', 'field'=>'name'), + array('module'=>'glossary', 'action'=>'view entry', 'mtable'=>'glossary_entries', 'field'=>'concept'), +); \ No newline at end of file Index: mod/survey/db/log.php =================================================================== RCS file: mod/survey/db/log.php diff -N mod/survey/db/log.php --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ mod/survey/db/log.php 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,37 @@ +. + +/** + * Definition of log events + * + * @package mod + * @subpackage survey + * @copyright 2010 Petr Skoda (http://skodak.org) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$logs = array( + array('module'=>'survey', 'action'=>'add', 'mtable'=>'survey', 'field'=>'name'), + array('module'=>'survey', 'action'=>'update', 'mtable'=>'survey', 'field'=>'name'), + array('module'=>'survey', 'action'=>'download', 'mtable'=>'survey', 'field'=>'name'), + array('module'=>'survey', 'action'=>'view form', 'mtable'=>'survey', 'field'=>'name'), + array('module'=>'survey', 'action'=>'view graph', 'mtable'=>'survey', 'field'=>'name'), + array('module'=>'survey', 'action'=>'view report', 'mtable'=>'survey', 'field'=>'name'), + array('module'=>'survey', 'action'=>'submit', 'mtable'=>'survey', 'field'=>'name'), +); \ No newline at end of file Index: mod/workshop/db/log.php =================================================================== RCS file: mod/workshop/db/log.php diff -N mod/workshop/db/log.php --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ mod/workshop/db/log.php 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,35 @@ +. + +/** + * Definition of log events + * + * @package mod + * @subpackage workshop + * @copyright 2010 Petr Skoda (http://skodak.org) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$logs = array( + //TODO copied from old install.php + //array('module'=>'workshop', 'action'=>'add', 'mtable'=>'workshop', 'field'=>'name'), + //array('module'=>'workshop', 'action'=>'update', 'mtable'=>'workshop', 'field'=>'name'), + //array('module'=>'workshop', 'action'=>'view', 'mtable'=>'workshop', 'field'=>'name'), + //array('module'=>'workshop', 'action'=>'view all', 'mtable'=>'workshop', 'field'=>'name'), +); \ No newline at end of file Index: mod/chat/db/log.php =================================================================== RCS file: mod/chat/db/log.php diff -N mod/chat/db/log.php --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ mod/chat/db/log.php 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,35 @@ +. + +/** + * Definition of log events + * + * @package mod + * @subpackage chat + * @copyright 2010 Petr Skoda (http://skodak.org) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$logs = array( + array('module'=>'chat', 'action'=>'view', 'mtable'=>'chat', 'field'=>'name'), + array('module'=>'chat', 'action'=>'add', 'mtable'=>'chat', 'field'=>'name'), + array('module'=>'chat', 'action'=>'update', 'mtable'=>'chat', 'field'=>'name'), + array('module'=>'chat', 'action'=>'report', 'mtable'=>'chat', 'field'=>'name'), + array('module'=>'chat', 'action'=>'talk', 'mtable'=>'chat', 'field'=>'name'), +); \ No newline at end of file Index: mod/page/db/log.php =================================================================== RCS file: mod/page/db/log.php diff -N mod/page/db/log.php --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ mod/page/db/log.php 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,34 @@ +. + +/** + * Definition of log events + * + * @package mod + * @subpackage page + * @copyright 2010 Petr Skoda (http://skodak.org) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$logs = array( + array('module'=>'page', 'action'=>'view', 'mtable'=>'page', 'field'=>'name'), + array('module'=>'page', 'action'=>'view all', 'mtable'=>'page', 'field'=>'name'), + array('module'=>'page', 'action'=>'update', 'mtable'=>'page', 'field'=>'name'), + array('module'=>'page', 'action'=>'add', 'mtable'=>'page', 'field'=>'name'), +); \ No newline at end of file Index: mod/imscp/db/log.php =================================================================== RCS file: mod/imscp/db/log.php diff -N mod/imscp/db/log.php --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ mod/imscp/db/log.php 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,34 @@ +. + +/** + * Definition of log events + * + * @package mod + * @subpackage imscp + * @copyright 2010 Petr Skoda (http://skodak.org) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$logs = array( + array('module'=>'imscp', 'action'=>'view', 'mtable'=>'imscp', 'field'=>'name'), + array('module'=>'imscp', 'action'=>'view all', 'mtable'=>'imscp', 'field'=>'name'), + array('module'=>'imscp', 'action'=>'update', 'mtable'=>'imscp', 'field'=>'name'), + array('module'=>'imscp', 'action'=>'add', 'mtable'=>'imscp', 'field'=>'name'), +); \ No newline at end of file Index: mod/forum/db/log.php =================================================================== RCS file: mod/forum/db/log.php diff -N mod/forum/db/log.php --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ mod/forum/db/log.php 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,42 @@ +. + +/** + * Definition of log events + * + * @package mod + * @subpackage forum + * @copyright 2010 Petr Skoda (http://skodak.org) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$logs = array( + array('module'=>'forum', 'action'=>'add', 'mtable'=>'forum', 'field'=>'name'), + array('module'=>'forum', 'action'=>'update', 'mtable'=>'forum', 'field'=>'name'), + array('module'=>'forum', 'action'=>'add discussion', 'mtable'=>'forum_discussions', 'field'=>'name'), + array('module'=>'forum', 'action'=>'add post', 'mtable'=>'forum_posts', 'field'=>'subject'), + array('module'=>'forum', 'action'=>'update post', 'mtable'=>'forum_posts', 'field'=>'subject'), + array('module'=>'forum', 'action'=>'user report', 'mtable'=>'user', 'field'=>'CONCAT(firstname,\' \',lastname)'), + array('module'=>'forum', 'action'=>'move discussion', 'mtable'=>'forum_discussions', 'field'=>'name'), + array('module'=>'forum', 'action'=>'view subscribers', 'mtable'=>'forum', 'field'=>'name'), + array('module'=>'forum', 'action'=>'view discussion', 'mtable'=>'forum_discussions', 'field'=>'name'), + array('module'=>'forum', 'action'=>'view forum', 'mtable'=>'forum', 'field'=>'name'), + array('module'=>'forum', 'action'=>'subscribe', 'mtable'=>'forum', 'field'=>'name'), + array('module'=>'forum', 'action'=>'unsubscribe', 'mtable'=>'forum', 'field'=>'name'), +); \ No newline at end of file Index: mod/resource/db/log.php =================================================================== RCS file: mod/resource/db/log.php diff -N mod/resource/db/log.php --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ mod/resource/db/log.php 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,34 @@ +. + +/** + * Definition of log events + * + * @package mod + * @subpackage resource + * @copyright 2010 Petr Skoda (http://skodak.org) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$logs = array( + array('module'=>'resource', 'action'=>'view', 'mtable'=>'resource', 'field'=>'name'), + array('module'=>'resource', 'action'=>'view all', 'mtable'=>'resource', 'field'=>'name'), + array('module'=>'resource', 'action'=>'update', 'mtable'=>'resource', 'field'=>'name'), + array('module'=>'resource', 'action'=>'add', 'mtable'=>'resource', 'field'=>'name'), +); \ No newline at end of file Index: mod/choice/db/log.php =================================================================== RCS file: mod/choice/db/log.php diff -N mod/choice/db/log.php --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ mod/choice/db/log.php 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,36 @@ +. + +/** + * Definition of log events + * + * @package mod + * @subpackage choice + * @copyright 2010 Petr Skoda (http://skodak.org) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$logs = array( + array('module'=>'choice', 'action'=>'view', 'mtable'=>'choice', 'field'=>'name'), + array('module'=>'choice', 'action'=>'update', 'mtable'=>'choice', 'field'=>'name'), + array('module'=>'choice', 'action'=>'add', 'mtable'=>'choice', 'field'=>'name'), + array('module'=>'choice', 'action'=>'report', 'mtable'=>'choice', 'field'=>'name'), + array('module'=>'choice', 'action'=>'choose', 'mtable'=>'choice', 'field'=>'name'), + array('module'=>'choice', 'action'=>'choose again', 'mtable'=>'choice', 'field'=>'name'), +); \ No newline at end of file Index: mod/label/db/log.php =================================================================== RCS file: mod/label/db/log.php diff -N mod/label/db/log.php --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ mod/label/db/log.php 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,32 @@ +. + +/** + * Definition of log events + * + * @package mod + * @subpackage label + * @copyright 2010 Petr Skoda (http://skodak.org) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$logs = array( + array('module'=>'label', 'action'=>'add', 'mtable'=>'label', 'field'=>'name'), + array('module'=>'label', 'action'=>'update', 'mtable'=>'label', 'field'=>'name'), +); \ No newline at end of file Index: mod/data/db/log.php =================================================================== RCS file: mod/data/db/log.php diff -N mod/data/db/log.php --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ mod/data/db/log.php 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,38 @@ +. + +/** + * Definition of log events + * + * @package mod + * @subpackage data + * @copyright 2010 Petr Skoda (http://skodak.org) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$logs = array( + array('module'=>'data', 'action'=>'view', 'mtable'=>'data', 'field'=>'name'), + array('module'=>'data', 'action'=>'add', 'mtable'=>'data', 'field'=>'name'), + array('module'=>'data', 'action'=>'update', 'mtable'=>'data', 'field'=>'name'), + array('module'=>'data', 'action'=>'record delete', 'mtable'=>'data', 'field'=>'name'), + array('module'=>'data', 'action'=>'fields add', 'mtable'=>'data_fields', 'field'=>'name'), + array('module'=>'data', 'action'=>'fields update', 'mtable'=>'data_fields', 'field'=>'name'), + array('module'=>'data', 'action'=>'templates saved', 'mtable'=>'data', 'field'=>'name'), + array('module'=>'data', 'action'=>'templates def', 'mtable'=>'data', 'field'=>'name'), +); \ No newline at end of file Index: mod/scorm/db/log.php =================================================================== RCS file: mod/scorm/db/log.php diff -N mod/scorm/db/log.php --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ mod/scorm/db/log.php 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,34 @@ +. + +/** + * Definition of log events + * + * @package mod + * @subpackage scorm + * @copyright 2010 Petr Skoda (http://skodak.org) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$logs = array( + array('module'=>'scorm', 'action'=>'view', 'mtable'=>'scorm', 'field'=>'name'), + array('module'=>'scorm', 'action'=>'review', 'mtable'=>'scorm', 'field'=>'name'), + array('module'=>'scorm', 'action'=>'update', 'mtable'=>'scorm', 'field'=>'name'), + array('module'=>'scorm', 'action'=>'add', 'mtable'=>'scorm', 'field'=>'name'), +); \ No newline at end of file Index: mod/quiz/db/log.php =================================================================== RCS file: mod/quiz/db/log.php diff -N mod/quiz/db/log.php --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ mod/quiz/db/log.php 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,44 @@ +. + +/** + * Definition of log events + * + * @package mod + * @subpackage quiz + * @copyright 2010 Petr Skoda (http://skodak.org) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$logs = array( + array('module'=>'quiz', 'action'=>'add', 'mtable'=>'quiz', 'field'=>'name'), + array('module'=>'quiz', 'action'=>'update', 'mtable'=>'quiz', 'field'=>'name'), + array('module'=>'quiz', 'action'=>'view', 'mtable'=>'quiz', 'field'=>'name'), + array('module'=>'quiz', 'action'=>'report', 'mtable'=>'quiz', 'field'=>'name'), + array('module'=>'quiz', 'action'=>'attempt', 'mtable'=>'quiz', 'field'=>'name'), + array('module'=>'quiz', 'action'=>'submit', 'mtable'=>'quiz', 'field'=>'name'), + array('module'=>'quiz', 'action'=>'review', 'mtable'=>'quiz', 'field'=>'name'), + array('module'=>'quiz', 'action'=>'editquestions', 'mtable'=>'quiz', 'field'=>'name'), + array('module'=>'quiz', 'action'=>'preview', 'mtable'=>'quiz', 'field'=>'name'), + array('module'=>'quiz', 'action'=>'start attempt', 'mtable'=>'quiz', 'field'=>'name'), + array('module'=>'quiz', 'action'=>'close attempt', 'mtable'=>'quiz', 'field'=>'name'), + array('module'=>'quiz', 'action'=>'continue attempt', 'mtable'=>'quiz', 'field'=>'name'), + array('module'=>'quiz', 'action'=>'edit override', 'mtable'=>'quiz', 'field'=>'name'), + array('module'=>'quiz', 'action'=>'delete override', 'mtable'=>'quiz', 'field'=>'name'), +); \ No newline at end of file Index: mod/lesson/db/log.php =================================================================== RCS file: mod/lesson/db/log.php diff -N mod/lesson/db/log.php --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ mod/lesson/db/log.php 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,33 @@ +. + +/** + * Definition of log events + * + * @package mod + * @subpackage lesson + * @copyright 2010 Petr Skoda (http://skodak.org) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$logs = array( + array('module'=>'lesson', 'action'=>'start', 'mtable'=>'lesson', 'field'=>'name'), + array('module'=>'lesson', 'action'=>'end', 'mtable'=>'lesson', 'field'=>'name'), + array('module'=>'lesson', 'action'=>'view', 'mtable'=>'lesson_pages', 'field'=>'title'), +); \ No newline at end of file Index: mod/folder/db/log.php =================================================================== RCS file: mod/folder/db/log.php diff -N mod/folder/db/log.php --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ mod/folder/db/log.php 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,34 @@ +. + +/** + * Definition of log events + * + * @package mod + * @subpackage folder + * @copyright 2010 Petr Skoda (http://skodak.org) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$logs = array( + array('module'=>'folder', 'action'=>'view', 'mtable'=>'folder', 'field'=>'name'), + array('module'=>'folder', 'action'=>'view all', 'mtable'=>'folder', 'field'=>'name'), + array('module'=>'folder', 'action'=>'update', 'mtable'=>'folder', 'field'=>'name'), + array('module'=>'folder', 'action'=>'add', 'mtable'=>'folder', 'field'=>'name'), +); \ No newline at end of file Index: mod/feedback/db/log.php =================================================================== RCS file: mod/feedback/db/log.php diff -N mod/feedback/db/log.php --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ mod/feedback/db/log.php 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,35 @@ +. + +/** + * Definition of log events + * + * @package mod + * @subpackage feedback + * @copyright 2010 Petr Skoda (http://skodak.org) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$logs = array( + array('module'=>'feedback', 'action'=>'startcomplete', 'mtable'=>'feedback', 'field'=>'name'), + array('module'=>'feedback', 'action'=>'submit', 'mtable'=>'feedback', 'field'=>'name'), + array('module'=>'feedback', 'action'=>'delete', 'mtable'=>'feedback', 'field'=>'name'), + array('module'=>'feedback', 'action'=>'view', 'mtable'=>'feedback', 'field'=>'name'), + array('module'=>'feedback', 'action'=>'view all', 'mtable'=>'course', 'field'=>'shortname'), +); \ No newline at end of file Index: lib/db/log.php =================================================================== RCS file: lib/db/log.php diff -N lib/db/log.php --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lib/db/log.php 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,51 @@ +. + +/** + * Definition of log events + * + * @package core + * @subpackage admin + * @copyright 2010 Petr Skoda (http://skodak.org) + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +global $DB; // TODO: this is a hack, we should really do something with the SQL in SQL tables + +$logs = array( + array('module'=>'user', 'action'=>'view', 'mtable'=>'user', 'field'=>$DB->sql_concat('firstname', "' '" , 'lastname')), + array('module'=>'course', 'action'=>'user report', 'mtable'=>'user', 'field'=>$DB->sql_concat('firstname', "' '" , 'lastname')), + array('module'=>'course', 'action'=>'view', 'mtable'=>'course', 'field'=>'fullname'), + array('module'=>'course', 'action'=>'update', 'mtable'=>'course', 'field'=>'fullname'), + array('module'=>'course', 'action'=>'enrol', 'mtable'=>'course', 'field'=>'fullname'), // there should be some way to store user id of the enrolled user! + array('module'=>'course', 'action'=>'unenrol', 'mtable'=>'course', 'field'=>'fullname'), // there should be some way to store user id of the enrolled user! + array('module'=>'course', 'action'=>'report log', 'mtable'=>'course', 'field'=>'fullname'), + array('module'=>'course', 'action'=>'report live', 'mtable'=>'course', 'field'=>'fullname'), + array('module'=>'course', 'action'=>'report outline', 'mtable'=>'course', 'field'=>'fullname'), + array('module'=>'course', 'action'=>'report participation', 'mtable'=>'course', 'field'=>'fullname'), + array('module'=>'course', 'action'=>'report stats', 'mtable'=>'course', 'field'=>'fullname'), + array('module'=>'message', 'action'=>'write', 'mtable'=>'user', 'field'=>$DB->sql_concat('firstname', "' '" , 'lastname')), + array('module'=>'message', 'action'=>'read', 'mtable'=>'user', 'field'=>$DB->sql_concat('firstname', "' '" , 'lastname')), + array('module'=>'message', 'action'=>'add contact', 'mtable'=>'user', 'field'=>$DB->sql_concat('firstname', "' '" , 'lastname')), + array('module'=>'message', 'action'=>'remove contact', 'mtable'=>'user', 'field'=>$DB->sql_concat('firstname', "' '" , 'lastname')), + array('module'=>'message', 'action'=>'block contact', 'mtable'=>'user', 'field'=>$DB->sql_concat('firstname', "' '" , 'lastname')), + array('module'=>'message', 'action'=>'unblock contact', 'mtable'=>'user', 'field'=>$DB->sql_concat('firstname', "' '" , 'lastname')), + array('module'=>'group', 'action'=>'view', 'mtable'=>'groups', 'field'=>'name'), + array('module'=>'tag', 'action'=>'update', 'mtable'=>'tag', 'field'=>'name'), +);