MDL-24089 confirm upgrade of plugins + replaced continue button with 'Upgrade' - this should tell admins when is the upgrade going to really start

This commit is contained in:
Petr Skoda 2010-09-05 19:41:00 +00:00
parent deba811a9c
commit 575f245fbc
3 changed files with 31 additions and 4 deletions

View File

@ -240,7 +240,9 @@ if ($version > $CFG->version) { // upgrade
echo $OUTPUT->box_end();
print_plugin_tables();
print_upgrade_reload('index.php?confirmupgrade=1&confirmrelease=1');
echo $OUTPUT->continue_button('index.php?confirmupgrade=1&confirmrelease=1&confirmplugincheck=1');
$button = new single_button(new moodle_url('index.php', array('confirmupgrade'=>1, 'confirmrelease'=>1, 'confirmplugincheck'=>1)), get_string('upgradestart', 'admin'), 'get');
$button->class = 'continuebutton';
echo $OUTPUT->render($button);
echo $OUTPUT->footer();
die();
@ -258,8 +260,32 @@ if ($release <> $CFG->release) { // Update the release version
set_config('release', $release);
}
// upgrade all plugins and other parts
upgrade_noncore(true);
if (moodle_needs_upgrading()) {
if (!$PAGE->headerprinted) {
$PAGE->set_pagelayout('maintenance');
if (!$confirmplugins) {
$strplugincheck = get_string('plugincheck');
$PAGE->navbar->add($strplugincheck);
$PAGE->set_title($strplugincheck);
$PAGE->set_heading($strplugincheck);
$PAGE->set_cacheable(false);
echo $OUTPUT->header();
echo $OUTPUT->heading($strplugincheck);
echo $OUTPUT->box_start('generalbox', 'notice');
print_string('pluginchecknotice');
echo $OUTPUT->box_end();
print_plugin_tables();
print_upgrade_reload('index.php');
$button = new single_button(new moodle_url('index.php', array('confirmplugincheck'=>1)), get_string('upgradestart', 'admin'), 'get');
$button->class = 'continuebutton';
echo $OUTPUT->render($button);
echo $OUTPUT->footer();
die();
}
}
// install/upgrade all plugins and other parts
upgrade_noncore(true);
}
// If this is the first install, indicate that this site is fully configured
// except the admin password

View File

@ -941,6 +941,7 @@ $string['updateaccounts'] = 'Update existing accounts';
$string['updatecomponent'] = 'Update Component';
$string['updatelangs'] = 'Update all installed language packs';
$string['updatetimezones'] = 'Update timezones';
$string['upgradestart'] = 'Upgrade';
$string['upgradeerror'] = 'Unknown error upgrading {$a->plugin} to version {$a->version}, can not continue.';
$string['upgradeforumread'] = 'A new feature has been added in Moodle 1.5 to track read/unread forum posts.<br />To use this functionality you need to <a href="{$a}">update your tables</a>.';
$string['upgradeforumreadinfo'] = 'A new feature has been added in Moodle 1.5 to track read/unread forum posts. To use this functionality you need to update your tables with all the tracking information for existing posts. Depending on the size of your site this can take a long time (hours) and can be quite taxing on the database, so it\'s best to do it during a quiet period. However, your site will continue functioning during this upgrade and users won\'t be affected. Once you start this process you should let it finish (keep your browser window open). However, if you stop the process by closing the window: don\'t worry, you can start over.<br /><br />Do you want to start the upgrading process now?';

View File

@ -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 = 2010090500; // YYYYMMDD = date of the last version bump
$version = 2010090501; // YYYYMMDD = date of the last version bump
// XX = daily increments
$release = '2.0 Preview 4+ (Build: 20100905)'; // Human-friendly version name