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 .= "CodeDescriptionApplied\n"; $i=0; foreach ($upgrades as $upgrade) { - $color=((($i++)%2)==0)?'white':'lightgrey'; + $color = ((($i++)%2)==0) ? 'white' : 'lightgrey'; $ret .= sprintf("%s%s%s\n", htmlspecialchars($upgrade->getDescriptor()), htmlspecialchars($upgrade->getDescription()), @@ -299,11 +302,14 @@ class upgradeDatabase extends Step { global $default; + $errors = false; + $this->temp_variables['detail'] = '

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('

%s
', $this->showResult($res)); - $this->temp_variables['upgradeTable'] .= '
' . "\n"; + $this->temp_variables['upgradeTable'] .= '
' . "\n"; $this->temp_variables['upgradeTable'] .= "\n"; if (PEAR::isError($res)) { if (!is_a($res, 'Upgrade_Already_Applied')) { diff --git a/setup/upgrade/steps/upgradeRestore.php b/setup/upgrade/steps/upgradeRestore.php index 5b26336..647695d 100644 --- a/setup/upgrade/steps/upgradeRestore.php +++ b/setup/upgrade/steps/upgradeRestore.php @@ -58,7 +58,8 @@ class upgradeRestore extends Step { protected $util = null; public function __construct() { - $this->temp_variables = array("step_name"=>"restore", "silent"=>$this->silent); + $this->temp_variables = array("step_name"=>"restore", "silent"=>$this->silent, + "loadingText"=>"The database restore is under way. Please wait until it completes"); $this->_dbhandler = new UpgradedbUtil(); $this->util = new UpgradeUtil(); } diff --git a/setup/upgrade/templates/backup.tpl b/setup/upgrade/templates/backup.tpl index 28bc28e..e807f49 100644 --- a/setup/upgrade/templates/backup.tpl +++ b/setup/upgrade/templates/backup.tpl @@ -1,16 +1,16 @@ -
-

+ +

- ' - . '' - . 'Click Here for help on overcoming backup issues
'; - } - ?> -
-

-
+ ' + . '' + . 'Click Here for help on overcoming backup issues

'; + } + ?> +
+

+

-

-
+
+ + +
+ - +
\ No newline at end of file diff --git a/setup/upgrade/templates/database.tpl b/setup/upgrade/templates/database.tpl index 2d708dc..46b3aec 100644 --- a/setup/upgrade/templates/database.tpl +++ b/setup/upgrade/templates/database.tpl @@ -1,4 +1,4 @@ -
+

@@ -23,30 +23,42 @@
'; + */ echo $upgradeTable; echo '

'; - echo $postUpgrade; + // hiding pre-upgrade notification + /* + echo $postUpgrade; echo '

'; + */ echo $upgradeStatus; echo '

'; } ?>
+ +
- - + + - - + + - - + + +
\ No newline at end of file diff --git a/setup/upgrade/templates/loading.tpl b/setup/upgrade/templates/loading.tpl new file mode 100644 index 0000000..35f4f9d --- /dev/null +++ b/setup/upgrade/templates/loading.tpl @@ -0,0 +1,19 @@ + + \ No newline at end of file diff --git a/setup/upgrade/templates/restore.tpl b/setup/upgrade/templates/restore.tpl index e13f8e0..7c06b9b 100644 --- a/setup/upgrade/templates/restore.tpl +++ b/setup/upgrade/templates/restore.tpl @@ -1,4 +1,4 @@ -
+

Next to attempt the command(s) above. ?> + +
- + +
\ No newline at end of file