mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 07:12:26 +02:00
N°2249 - Supportability - Updater module (Allow to run setup in case of failure)
This commit is contained in:
@@ -35,6 +35,7 @@ Dict::Add('EN US', 'English', 'English', array(
|
||||
'iTopUpdate:UI:Back' => 'Back',
|
||||
'iTopUpdate:UI:Cancel' => 'Cancel',
|
||||
'iTopUpdate:UI:Continue' => 'Continue',
|
||||
'iTopUpdate:UI:RunSetup' => 'Run Setup',
|
||||
'iTopUpdate:UI:WithDBBackup' => 'Database backup',
|
||||
'iTopUpdate:UI:WithFilesBackup' => 'Application files backup',
|
||||
'iTopUpdate:UI:WithoutBackup' => 'No backup is planned',
|
||||
|
||||
@@ -35,7 +35,8 @@ Dict::Add('FR FR', 'French', 'Français', array(
|
||||
'iTopUpdate:UI:Back' => 'Annuler',
|
||||
'iTopUpdate:UI:Cancel' => 'Annuler',
|
||||
'iTopUpdate:UI:Continue' => 'Continuer',
|
||||
'iTopUpdate:UI:WithDBBackup' => 'Sauvegarde de la base de données',
|
||||
'iTopUpdate:UI:RunSetup' => 'Lancer le Setup',
|
||||
'iTopUpdate:UI:WithDBBackup' => 'Sauvegarde de la base de données',
|
||||
'iTopUpdate:UI:WithFilesBackup' => 'Archive des fichiers de l\'application',
|
||||
'iTopUpdate:UI:WithoutBackup' => 'Pas de sauvegarde',
|
||||
'iTopUpdate:UI:Backup' => 'Sauvegarde effectuée avant la mise à jour',
|
||||
|
||||
@@ -79,6 +79,7 @@ class AjaxController extends Controller
|
||||
$aParams = array();
|
||||
try
|
||||
{
|
||||
SetupUtils::CheckSetupToken();
|
||||
SetupUtils::EnterReadOnlyMode(MetaModel::GetConfig());
|
||||
$iResponseCode = 200;
|
||||
} catch (Exception $e)
|
||||
@@ -95,6 +96,7 @@ class AjaxController extends Controller
|
||||
$aParams = array();
|
||||
try
|
||||
{
|
||||
SetupUtils::CheckSetupToken(true);
|
||||
SetupUtils::ExitReadOnlyMode();
|
||||
$iResponseCode = 200;
|
||||
} catch (Exception $e)
|
||||
@@ -111,6 +113,7 @@ class AjaxController extends Controller
|
||||
$aParams = array();
|
||||
try
|
||||
{
|
||||
SetupUtils::CheckSetupToken();
|
||||
CoreUpdater::Backup();
|
||||
$iResponseCode = 200;
|
||||
} catch (Exception $e)
|
||||
@@ -127,6 +130,7 @@ class AjaxController extends Controller
|
||||
$aParams = array();
|
||||
try
|
||||
{
|
||||
SetupUtils::CheckSetupToken();
|
||||
CoreUpdater::CreateItopArchive();
|
||||
$iResponseCode = 200;
|
||||
} catch (Exception $e)
|
||||
@@ -143,6 +147,7 @@ class AjaxController extends Controller
|
||||
$aParams = array();
|
||||
try
|
||||
{
|
||||
SetupUtils::CheckSetupToken();
|
||||
CoreUpdater::CopyCoreFiles();
|
||||
$iResponseCode = 200;
|
||||
} catch (Exception $e)
|
||||
@@ -160,6 +165,7 @@ class AjaxController extends Controller
|
||||
$aParams = array();
|
||||
try
|
||||
{
|
||||
SetupUtils::CheckSetupToken();
|
||||
CoreUpdater::CheckCompile();
|
||||
$iResponseCode = 200;
|
||||
}
|
||||
@@ -178,6 +184,7 @@ class AjaxController extends Controller
|
||||
$aParams = array();
|
||||
try
|
||||
{
|
||||
SetupUtils::CheckSetupToken();
|
||||
CoreUpdater::Compile();
|
||||
$iResponseCode = 200;
|
||||
}
|
||||
@@ -196,6 +203,7 @@ class AjaxController extends Controller
|
||||
$aParams = array();
|
||||
try
|
||||
{
|
||||
SetupUtils::CheckSetupToken();
|
||||
CoreUpdater::UpdateDatabase();
|
||||
$iResponseCode = 200;
|
||||
}
|
||||
|
||||
@@ -140,6 +140,15 @@ class UpdateController extends Controller
|
||||
$this->DisplayPage($aParams);
|
||||
}
|
||||
|
||||
public function OperationRunSetup()
|
||||
{
|
||||
SetupUtils::CheckSetupToken(true);
|
||||
$sConfigFile = APPCONF.'production/'.ITOP_CONFIG_FILE;
|
||||
@chmod($sConfigFile, 0770);
|
||||
$sRedirectURL = utils::GetAbsoluteUrlAppRoot().'setup/index.php';
|
||||
header("Location: $sRedirectURL");
|
||||
}
|
||||
|
||||
private function GetPreviousInstallations()
|
||||
{
|
||||
return DBToolsUtils::GetPreviousInstallations();
|
||||
|
||||
@@ -78,6 +78,11 @@
|
||||
<span>{{ 'iTopUpdate:UI:RestoreBackup'|dict_format(sBackupFile) }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
<form enctype="multipart/form-data" method="post">
|
||||
<input type="hidden" name="operation" value="RunSetup"/>
|
||||
<input type="hidden" name="authent" value="{{ sSetupToken }}">
|
||||
<p><input id="run_setup" type="submit" value="{{ 'iTopUpdate:UI:RunSetup'|dict_s }}" disabled/></p>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<form enctype="multipart/form-data" method="post">
|
||||
|
||||
@@ -91,7 +91,6 @@ function ExecNextStep() {
|
||||
setTimeout(ExecNextStep, 500);
|
||||
})
|
||||
.fail(function ( jqXHR) {
|
||||
$("#setup_continue").removeAttr("disabled");
|
||||
if (jqXHR && jqXHR.responseJSON) {
|
||||
$("#setup_error").html({{ 'iTopUpdate:Error:UpdateFailed'|dict_s|json_encode|raw }}+" "+jqXHR.responseJSON.sError);
|
||||
}
|
||||
@@ -101,6 +100,7 @@ function ExecNextStep() {
|
||||
}
|
||||
$('.progress').css("background-image", "none").css("background-color", "#fcc");
|
||||
$("#setup_error_outer").show();
|
||||
$("#setup_continue").hide();
|
||||
})
|
||||
;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user