/// return to original debugging level
$CFG->debug = $origdebug;
error_reporting($CFG->debug);
- upgrade_log_start();
+ upgrade_started();
/// Both old .sql files and new install.xml are supported
/// But we prioritise install.xml (XMLDB) if present
/// return to original debugging level
$CFG->debug = $origdebug;
error_reporting($CFG->debug);
- upgrade_log_start();
+ upgrade_started();
/// Upgrade current language pack if we can
upgrade_language_pack();
/// just make sure upgrade logging is properly terminated
- upgrade_log_finish();
+ upgrade_finished();
/// Set up the site
if (! $site = get_site()) {
}
}
- upgrade_log_start(true); // does not store ugprade runnign flag
+ upgrade_started(true); // does not store ugprade runnign flag
print_heading('coresystem');
$DB->get_manager()->install_from_xmldb_file("$CFG->libdir/db/install.xml");
- upgrade_log_start(); // we want the flag to be stored in config table ;-)
+ upgrade_started(); // we want the flag to be stored in config table ;-)
/// set all core default records and default settings
require_once("$CFG->libdir/db/install.php");
/// return to original debugging level
$CFG->debug = $origdebug;
error_reporting($CFG->debug);
- upgrade_log_start();
+ upgrade_started();
/// Upgrade current language pack if we can
if (empty($CFG->skiplangupgrade)) {
$sessionstarted = optional_param('sessionstarted', 0, PARAM_BOOL);
if (!$sessionstarted) {
// we neeed this redirect to setup proper session
- upgrade_log_finish("index.php?sessionstarted=1&lang=$CFG->lang");
+ upgrade_finished("index.php?sessionstarted=1&lang=$CFG->lang");
}
$adminuser = create_admin_user();
$adminuser->newadminuser = 1;
} else {
/// just make sure upgrade logging is properly terminated
- upgrade_log_finish('upgradesettings.php');
+ upgrade_finished('upgradesettings.php');
}
// Turn xmlstrictheaders back on now.
upgrade_local_db($return_url); // Return here afterwards
/// just make sure upgrade logging is properly terminated
- upgrade_log_finish();
+ upgrade_finished();
/// make sure admin user is created - this is the last step because we need
/// session to be working properly in order to edit admin account
* @return void
*
*/
-function upgrade_log_display_entry($module, $action, $mtable, $field) {
+function update_log_display_entry($module, $action, $mtable, $field) {
global $DB;
if ($type = $DB->get_record('log_display', array('module'=>$module, 'action'=>$action))) {
$info->pluginversion = $plugin->version;
$info->currentmoodle = $CFG->version;
$info->requiremoodle = $plugin->requires;
- upgrade_log_start();
+ upgrade_started();
notify(get_string('pluginrequirementsnotmet', 'error', $info));
$updated_plugins = true;
continue;
// do nothing
} else if ($installedversion < $plugin->version) {
$updated_plugins = true;
- upgrade_log_start();
+ upgrade_started();
print_heading($dir.'/'. $plugin->name .' plugin needs upgrading');
@set_time_limit(0); // To allow slow databases to complete the long SQL
$info->moduleversion = $module->version;
$info->currentmoodle = $CFG->version;
$info->requiremoodle = $module->requires;
- upgrade_log_start();
+ upgrade_started();
notify(get_string('modulerequirementsnotmet', 'error', $info));
continue;
}
notify('Upgrade file ' . $mod . ': ' . $fullmod . '/db/upgrade.php is not readable');
continue;
}
- upgrade_log_start();
+ upgrade_started();
print_heading($module->name .' module needs upgrading');
}
} else { // module not installed yet, so install it
- upgrade_log_start();
+ upgrade_started();
print_heading($module->name);
/// Execute install.xml (XMLDB) - must be present
* Marks start of upgrade, blocks any other access to site.
* The upgrade is finished at the end of script or after timeout.
*/
-function upgrade_log_start($preinstall=false) {
+function upgrade_started($preinstall=false) {
global $CFG, $DB;
static $started = false;
* Internal function - executed if upgrade interruped.
*/
function upgrade_finished_handler() {
- upgrade_log_finish();
+ upgrade_finished();
}
/**
*
* This function may be called repeatedly.
*/
-function upgrade_log_finish($continueurl=null) {
+function upgrade_finished($continueurl=null) {
global $CFG, $DB;
if (!empty($CFG->upgraderunning)) {
// do nothing
} else if ($currblock->version < $block->version) {
$updated_blocks = true;
- upgrade_log_start();
+ upgrade_started();
print_heading('New version of '.$blocktitle.' ('.$block->name.') exists');
@set_time_limit(0); // To allow slow databases to complete the long SQL
print_error('blocknameconflict', '', '', (object)array('name'=>$block->name, 'conflict'=>$conflictblock));
}
$updated_blocks = true;
- upgrade_log_start();
+ upgrade_started();
print_heading($block->name);
@set_time_limit(0); // To allow slow databases to complete the long SQL
$DB->insert_record('mnet_application', $mnet_app);
/// insert log entries - replaces statements section in install.xml
- upgrade_log_display_entry('user', 'view', 'user', 'CONCAT(firstname,\' \',lastname)');
- upgrade_log_display_entry('course', 'user report', 'user', 'CONCAT(firstname,\' \',lastname)');
- upgrade_log_display_entry('course', 'view', 'course', 'fullname');
- upgrade_log_display_entry('course', 'update', 'course', 'fullname');
- upgrade_log_display_entry('course', 'enrol', 'course', 'fullname');
- upgrade_log_display_entry('course', 'unenrol', 'course', 'fullname');
- upgrade_log_display_entry('course', 'report log', 'course', 'fullname');
- upgrade_log_display_entry('course', 'report live', 'course', 'fullname');
- upgrade_log_display_entry('course', 'report outline', 'course', 'fullname');
- upgrade_log_display_entry('course', 'report participation', 'course', 'fullname');
- upgrade_log_display_entry('course', 'report stats', 'course', 'fullname');
- upgrade_log_display_entry('message', 'write', 'user', 'CONCAT(firstname,\' \',lastname)');
- upgrade_log_display_entry('message', 'read', 'user', 'CONCAT(firstname,\' \',lastname)');
- upgrade_log_display_entry('message', 'add contact', 'user', 'CONCAT(firstname,\' \',lastname)');
- upgrade_log_display_entry('message', 'remove contact', 'user', 'CONCAT(firstname,\' \',lastname)');
- upgrade_log_display_entry('message', 'block contact', 'user', 'CONCAT(firstname,\' \',lastname)');
- upgrade_log_display_entry('message', 'unblock contact', 'user', 'CONCAT(firstname,\' \',lastname)');
- upgrade_log_display_entry('group', 'view', 'groups', 'name');
+ update_log_display_entry('user', 'view', 'user', 'CONCAT(firstname,\' \',lastname)');
+ update_log_display_entry('course', 'user report', 'user', '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', 'course', 'fullname');
+ update_log_display_entry('course', 'unenrol', 'course', 'fullname');
+ 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', 'CONCAT(firstname,\' \',lastname)');
+ update_log_display_entry('message', 'read', 'user', 'CONCAT(firstname,\' \',lastname)');
+ update_log_display_entry('message', 'add contact', 'user', 'CONCAT(firstname,\' \',lastname)');
+ update_log_display_entry('message', 'remove contact', 'user', 'CONCAT(firstname,\' \',lastname)');
+ update_log_display_entry('message', 'block contact', 'user', 'CONCAT(firstname,\' \',lastname)');
+ update_log_display_entry('message', 'unblock contact', 'user', 'CONCAT(firstname,\' \',lastname)');
+ update_log_display_entry('group', 'view', 'groups', 'name');
/// Create guest record
require($CFG->dirroot.'/local/version.php'); // Get code versions
if (empty($CFG->local_version)) { // install
- upgrade_log_start();
+ upgrade_started();
if (file_exists($CFG->dirroot.'/local/db/install.php')) {
require_once($CFG->dirroot.'/local/db/install.php');
xmldb_local_install();
return true;
} else if ($local_version > $CFG->local_version) { // upgrade!
- upgrade_log_start();
+ upgrade_started();
if (file_exists($CFG->dirroot.'/local/db/upgrade.php')) {
require_once($CFG->dirroot.'/local/db/upgrade.php');
xmldb_local_upgrade($CFG->local_version);
global $DB;
/// Install logging support
- upgrade_log_display_entry('assignment', 'view', 'assignment', 'name');
- upgrade_log_display_entry('assignment', 'add', 'assignment', 'name');
- upgrade_log_display_entry('assignment', 'update', 'assignment', 'name');
- upgrade_log_display_entry('assignment', 'view submission', 'assignment', 'name');
- upgrade_log_display_entry('assignment', 'upload', 'assignment', 'name');
+ update_log_display_entry('assignment', 'view', 'assignment', 'name');
+ update_log_display_entry('assignment', 'add', 'assignment', 'name');
+ update_log_display_entry('assignment', 'update', 'assignment', 'name');
+ update_log_display_entry('assignment', 'view submission', 'assignment', 'name');
+ update_log_display_entry('assignment', 'upload', 'assignment', 'name');
}
global $DB;
/// Install logging support
- upgrade_log_display_entry('chat', 'view', 'chat', 'name');
- upgrade_log_display_entry('chat', 'add', 'chat', 'name');
- upgrade_log_display_entry('chat', 'update', 'chat', 'name');
- upgrade_log_display_entry('chat', 'report', 'chat', 'name');
- upgrade_log_display_entry('chat', 'talk', 'chat', 'name');
+ update_log_display_entry('chat', 'view', 'chat', 'name');
+ update_log_display_entry('chat', 'add', 'chat', 'name');
+ update_log_display_entry('chat', 'update', 'chat', 'name');
+ update_log_display_entry('chat', 'report', 'chat', 'name');
+ update_log_display_entry('chat', 'talk', 'chat', 'name');
}
global $DB;
/// Install logging support
- upgrade_log_display_entry('choice', 'view', 'choice', 'name');
- upgrade_log_display_entry('choice', 'update', 'choice', 'name');
- upgrade_log_display_entry('choice', 'add', 'choice', 'name');
- upgrade_log_display_entry('choice', 'report', 'choice', 'name');
- upgrade_log_display_entry('choice', 'choose', 'choice', 'name');
- upgrade_log_display_entry('choice', 'choose again', 'choice', 'name');
+ update_log_display_entry('choice', 'view', 'choice', 'name');
+ update_log_display_entry('choice', 'update', 'choice', 'name');
+ update_log_display_entry('choice', 'add', 'choice', 'name');
+ update_log_display_entry('choice', 'report', 'choice', 'name');
+ update_log_display_entry('choice', 'choose', 'choice', 'name');
+ update_log_display_entry('choice', 'choose again', 'choice', 'name');
}
global $DB;
/// Install logging support
- upgrade_log_display_entry('data', 'view', 'data', 'name');
- upgrade_log_display_entry('data', 'add', 'data', 'name');
- upgrade_log_display_entry('data', 'update', 'data', 'name');
- upgrade_log_display_entry('data', 'record delete', 'data', 'name');
- upgrade_log_display_entry('data', 'fields add', 'data_fields', 'name');
- upgrade_log_display_entry('data', 'fields update', 'data_fields', 'name');
- upgrade_log_display_entry('data', 'templates saved', 'data', 'name');
- upgrade_log_display_entry('data', 'templates def', 'data', 'name');
+ update_log_display_entry('data', 'view', 'data', 'name');
+ update_log_display_entry('data', 'add', 'data', 'name');
+ update_log_display_entry('data', 'update', 'data', 'name');
+ update_log_display_entry('data', 'record delete', 'data', 'name');
+ update_log_display_entry('data', 'fields add', 'data_fields', 'name');
+ update_log_display_entry('data', 'fields update', 'data_fields', 'name');
+ update_log_display_entry('data', 'templates saved', 'data', 'name');
+ update_log_display_entry('data', 'templates def', 'data', 'name');
}
global $DB;
/// Install logging support
- upgrade_log_display_entry('feedback', 'startcomplete', 'feedback', 'name');
- upgrade_log_display_entry('feedback', 'submit', 'feedback', 'name');
- upgrade_log_display_entry('feedback', 'delete', 'feedback', 'name');
- upgrade_log_display_entry('feedback', 'view', 'feedback', 'name');
- upgrade_log_display_entry('feedback', 'view all', 'course', 'shortname');
+ 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');
}
global $DB;
/// Install logging support
- upgrade_log_display_entry('forum', 'add', 'forum', 'name');
- upgrade_log_display_entry('forum', 'update', 'forum', 'name');
- upgrade_log_display_entry('forum', 'add discussion', 'forum_discussions', 'name');
- upgrade_log_display_entry('forum', 'add post', 'forum_posts', 'subject');
- upgrade_log_display_entry('forum', 'update post', 'forum_posts', 'subject');
- upgrade_log_display_entry('forum', 'user report', 'user', 'CONCAT(firstname," ",lastname)');
- upgrade_log_display_entry('forum', 'move discussion', 'forum_discussions', 'name');
- upgrade_log_display_entry('forum', 'view subscribers', 'forum', 'name');
- upgrade_log_display_entry('forum', 'view discussion', 'forum_discussions', 'name');
- upgrade_log_display_entry('forum', 'view forum', 'forum', 'name');
- upgrade_log_display_entry('forum', 'subscribe', 'forum', 'name');
- upgrade_log_display_entry('forum', 'unsubscribe', 'forum', 'name');
+ 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');
}
global $DB;
/// Install logging support
- upgrade_log_display_entry('glossary', 'add', 'glossary', 'name');
- upgrade_log_display_entry('glossary', 'update', 'glossary', 'name');
- upgrade_log_display_entry('glossary', 'view', 'glossary', 'name');
- upgrade_log_display_entry('glossary', 'view all', 'glossary', 'name');
- upgrade_log_display_entry('glossary', 'add entry', 'glossary', 'name');
- upgrade_log_display_entry('glossary', 'update entry', 'glossary', 'name');
- upgrade_log_display_entry('glossary', 'add category', 'glossary', 'name');
- upgrade_log_display_entry('glossary', 'update category', 'glossary', 'name');
- upgrade_log_display_entry('glossary', 'delete category', 'glossary', 'name');
- upgrade_log_display_entry('glossary', 'add comment', 'glossary', 'name');
- upgrade_log_display_entry('glossary', 'update comment', 'glossary', 'name');
- upgrade_log_display_entry('glossary', 'delete comment', 'glossary', 'name');
- upgrade_log_display_entry('glossary', 'approve entry', 'glossary', 'name');
- upgrade_log_display_entry('glossary', 'view entry', 'glossary_entries', 'concept');
+ update_log_display_entry('glossary', 'add', 'glossary', 'name');
+ update_log_display_entry('glossary', 'update', 'glossary', 'name');
+ update_log_display_entry('glossary', 'view', 'glossary', 'name');
+ update_log_display_entry('glossary', 'view all', 'glossary', 'name');
+ update_log_display_entry('glossary', 'add entry', 'glossary', 'name');
+ update_log_display_entry('glossary', 'update entry', 'glossary', 'name');
+ update_log_display_entry('glossary', 'add category', 'glossary', 'name');
+ update_log_display_entry('glossary', 'update category', 'glossary', 'name');
+ update_log_display_entry('glossary', 'delete category', 'glossary', 'name');
+ update_log_display_entry('glossary', 'add comment', 'glossary', 'name');
+ update_log_display_entry('glossary', 'update comment', 'glossary', 'name');
+ update_log_display_entry('glossary', 'delete comment', 'glossary', 'name');
+ update_log_display_entry('glossary', 'approve entry', 'glossary', 'name');
+ update_log_display_entry('glossary', 'view entry', 'glossary_entries', 'concept');
}
global $DB;
/// Install logging support
- upgrade_log_display_entry('label', 'add', 'label', 'name');
- upgrade_log_display_entry('label', 'update', 'label', 'name');
+ update_log_display_entry('label', 'add', 'label', 'name');
+ update_log_display_entry('label', 'update', 'label', 'name');
}
global $DB;
/// Install logging support
- upgrade_log_display_entry('lesson', 'start', 'lesson', 'name');
- upgrade_log_display_entry('lesson', 'end', 'lesson', 'name');
- upgrade_log_display_entry('lesson', 'view', 'lesson_pages', 'title');
+ 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');
}
global $DB;
/// Install logging support
- upgrade_log_display_entry('quiz', 'add', 'quiz', 'name');
- upgrade_log_display_entry('quiz', 'update', 'quiz', 'name');
- upgrade_log_display_entry('quiz', 'view', 'quiz', 'name');
- upgrade_log_display_entry('quiz', 'report', 'quiz', 'name');
- upgrade_log_display_entry('quiz', 'attempt', 'quiz', 'name');
- upgrade_log_display_entry('quiz', 'submit', 'quiz', 'name');
- upgrade_log_display_entry('quiz', 'review', 'quiz', 'name');
- upgrade_log_display_entry('quiz', 'editquestions', 'quiz', 'name');
- upgrade_log_display_entry('quiz', 'preview', 'quiz', 'name');
- upgrade_log_display_entry('quiz', 'start attempt', 'quiz', 'name');
- upgrade_log_display_entry('quiz', 'close attempt', 'quiz', 'name');
- upgrade_log_display_entry('quiz', 'continue attempt', 'quiz', 'name');
+ 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');
$record = new object();
$record->name = 'overview';
/// Install logging support
- upgrade_log_display_entry('resource', 'view', 'resource', 'name');
- upgrade_log_display_entry('resource', 'update', 'resource', 'name');
- upgrade_log_display_entry('resource', 'add', 'resource', 'name');
+ update_log_display_entry('resource', 'view', 'resource', 'name');
+ update_log_display_entry('resource', 'update', 'resource', 'name');
+ update_log_display_entry('resource', 'add', 'resource', 'name');
}
global $DB;
/// Install logging support
- upgrade_log_display_entry('scorm', 'view', 'scorm', 'name');
- upgrade_log_display_entry('scorm', 'review', 'scorm', 'name');
- upgrade_log_display_entry('scorm', 'update', 'scorm', 'name');
- upgrade_log_display_entry('scorm', 'add', 'scorm', 'name');
+ update_log_display_entry('scorm', 'view', 'scorm', 'name');
+ update_log_display_entry('scorm', 'review', 'scorm', 'name');
+ update_log_display_entry('scorm', 'update', 'scorm', 'name');
+ update_log_display_entry('scorm', 'add', 'scorm', 'name');
}
global $DB;
/// Install logging support
- upgrade_log_display_entry('survey', 'add', 'survey', 'name');
- upgrade_log_display_entry('survey', 'update', 'survey', 'name');
- upgrade_log_display_entry('survey', 'download', 'survey', 'name');
- upgrade_log_display_entry('survey', 'view form', 'survey', 'name');
- upgrade_log_display_entry('survey', 'view graph', 'survey', 'name');
- upgrade_log_display_entry('survey', 'view report', 'survey', 'name');
- upgrade_log_display_entry('survey', 'submit', 'survey', 'name');
+ 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