diff --git a/setup/upgrade/resources/graphics/loading.gif b/setup/upgrade/resources/graphics/loading.gif new file mode 100644 index 0000000..d42f72c --- /dev/null +++ b/setup/upgrade/resources/graphics/loading.gif diff --git a/setup/upgrade/steps/upgradeBackup.php b/setup/upgrade/steps/upgradeBackup.php index c684bb4..9446d80 100644 --- a/setup/upgrade/steps/upgradeBackup.php +++ b/setup/upgrade/steps/upgradeBackup.php @@ -57,7 +57,8 @@ class upgradeBackup extends Step { protected $temp_variables = array(); public function __construct() { - $this->temp_variables = array("step_name"=>"backup", "silent"=>$this->silent); + $this->temp_variables = array("step_name"=>"backup", "silent"=>$this->silent, + "loadingText"=>"Your backup is under way. Please wait until it completes"); $this->_dbhandler = new UpgradedbUtil(); $this->util = new UpgradeUtil(); } diff --git a/setup/upgrade/steps/upgradeDatabase.php b/setup/upgrade/steps/upgradeDatabase.php index 2152471..c8d5e52 100644 --- a/setup/upgrade/steps/upgradeDatabase.php +++ b/setup/upgrade/steps/upgradeDatabase.php @@ -121,7 +121,8 @@ class upgradeDatabase extends Step * @param none */ public function __construct() { - $this->temp_variables = array("step_name"=>"database", "silent"=>$this->silent); + $this->temp_variables = array("step_name"=>"database", "silent"=>$this->silent, + "loadingText"=>"The database upgrade is under way. Please wait until it completes"); $this->_dbhandler = new UpgradedbUtil(); $this->_util = new UpgradeUtil(); if(WINDOWS_OS) @@ -195,8 +196,10 @@ class upgradeDatabase extends Step else if ($action == 'runUpgrade') { $this->temp_variables['title'] = 'Upgrade In Progress'; if (!$this->upgradeDatabase()) { + $this->temp_variables['backupSuccessful'] = false; return false; } + $this->temp_variables['backupSuccessful'] = true; } return true; @@ -221,7 +224,7 @@ class upgradeDatabase extends Step $ret .= "
The table below describes the upgrades that have occurred to
upgrade your KnowledgeTree installation to ' . $default->systemVersion . '';
$pre_res = $this->performPreUpgradeActions();
if (PEAR::isError($pre_res)) {
+ $errors = true;
$this->temp_variables['preUpgrade'] = 'Pre-Upgrade actions failed.';
}
else {
@@ -313,7 +319,8 @@ class upgradeDatabase extends Step
$res = $this->performAllUpgrades();
if (PEAR::isError($res) || PEAR::isError($pres)) {
- // TODO instantiate error details hideable section
+ $errors = true;
+ // TODO instantiate error details hideable section?
$this->temp_variables['upgradeStatus'] = 'Database upgrade failed
Please restore from your backup and ensure that the database does not contain
@@ -327,11 +334,14 @@ class upgradeDatabase extends Step
$post_pres = $this->performPostUpgradeActions();
if (PEAR::isError($post_res)) {
+ $errors = true;
$this->temp_variables['postUpgrade'] = 'Post-Upgrade actions failed.';
}
else {
$this->temp_variables['postUpgrade'] = 'Post-Upgrade actions succeeded.';
}
+
+ return !$errors;
}
private function performPreUpgradeActions() {
@@ -404,7 +414,7 @@ class upgradeDatabase extends Step
++$row;
$res = $upgrade->performUpgrade();
$this->temp_variables['upgradeTable'] .= sprintf('