diff --git a/installwizard.php b/installwizard.php
index b59c6e9a7..760b37d3a 100755
--- a/installwizard.php
+++ b/installwizard.php
@@ -401,7 +401,7 @@
If you choose to use the existing OpenCATS installation, you can always run
the installer again later and choose a different option.
-
+
Loading Data - Restore from Backup
diff --git a/js/install.js b/js/install.js
index 1cbd2cf02..035e819de 100755
--- a/js/install.js
+++ b/js/install.js
@@ -28,6 +28,7 @@
var response;
var maxSteps;
+var installMaintNextAction = "a=reindexResumes";
function setActiveStep(step)
@@ -120,8 +121,12 @@ function Installpage_maint()
response = http.responseText;
if (response.indexOf("setProgressUpdating") == -1)
- {
- Installpage_populate("a=reindexResumes");
+ {
+ if (http.status == 200)
+ {
+ Installpage_populate(installMaintNextAction);
+ installMaintNextAction = "a=reindexResumes";
+ }
}
else
{
@@ -141,6 +146,18 @@ function Installpage_maint()
);
}
+function Installpage_upgradeExisting()
+{
+ Installpage_populate("a=upgradeExisting");
+}
+
+function Installpage_upgradeExistingMaint()
+{
+ /* Existing installations must run schema maintenance before later installer questions. */
+ installMaintNextAction = "a=upgradeExistingMaintComplete";
+ Installpage_maint();
+}
+
function Installpage_append(postData, message)
{
var htmlObjectID = "subFormBlock";
diff --git a/modules/install/ajax/ui.php b/modules/install/ajax/ui.php
index cc601d92f..737b03fbd 100755
--- a/modules/install/ajax/ui.php
+++ b/modules/install/ajax/ui.php
@@ -679,6 +679,12 @@
break;
case 'resetDatabase':
+ @session_name(CATS_SESSION_NAME);
+ session_start();
+
+ unset($_SESSION['existingUpgradeMaintStarted']);
+ unset($_SESSION['existingUpgradeMaintComplete']);
+
MySQLConnect();
foreach ($tables as $table => $data)
@@ -971,6 +977,15 @@
@session_name(CATS_SESSION_NAME);
session_start();
+ if (isset($_SESSION['existingUpgradeMaintComplete']))
+ {
+ unset($_SESSION['existingUpgradeMaintStarted']);
+ unset($_SESSION['existingUpgradeMaintComplete']);
+
+ echo '';
+ break;
+ }
+
if (isset($_SESSION['CATS']))
{
unset($_SESSION['CATS']);
@@ -987,6 +1002,42 @@
';
break;
+ case 'upgradeExisting':
+ @session_name(CATS_SESSION_NAME);
+ session_start();
+
+ $_SESSION['existingUpgradeMaintStarted'] = true;
+ unset($_SESSION['existingUpgradeMaintComplete']);
+
+ if (isset($_SESSION['CATS']))
+ {
+ unset($_SESSION['CATS']);
+ }
+
+ if (isset($_SESSION['modules']))
+ {
+ unset($_SESSION['modules']);
+ }
+
+ echo '';
+ break;
+
+ case 'upgradeExistingMaintComplete':
+ @session_name(CATS_SESSION_NAME);
+ session_start();
+
+ if (isset($_SESSION['existingUpgradeMaintStarted']))
+ {
+ $_SESSION['existingUpgradeMaintComplete'] = true;
+ unset($_SESSION['existingUpgradeMaintStarted']);
+ }
+
+ echo '';
+ break;
+
case 'reindexResumes':
echo '