mirror of
https://github.com/Combodo/iTop.git
synced 2026-08-22 14:18:18 +02:00
Remove Fast Setup button from "Application Update" screen
This commit is contained in:
@@ -14,13 +14,11 @@ use Combodo\iTop\CoreUpdate\Service\CoreUpdater;
|
||||
use Combodo\iTop\DBTools\Service\DBToolsUtils;
|
||||
use Combodo\iTop\FilesInformation\Service\FileNotExistException;
|
||||
use Combodo\iTop\FilesInformation\Service\FilesInformation;
|
||||
use Config;
|
||||
use ContextTag;
|
||||
use Dict;
|
||||
use Exception;
|
||||
use IssueLog;
|
||||
use MetaModel;
|
||||
use RunTimeEnvironment;
|
||||
use SecurityException;
|
||||
use SetupUtils;
|
||||
use utils;
|
||||
@@ -232,29 +230,6 @@ class AjaxController extends Controller
|
||||
$this->DisplayJSONPage($aParams, $iResponseCode);
|
||||
}
|
||||
|
||||
public function OperationRebuildToolkitEnvironment()
|
||||
{
|
||||
$sTransactionId = utils::GetNewTransactionId();
|
||||
$aParams = [];
|
||||
$aParams['sTransactionId'] = $sTransactionId;
|
||||
$aParams['bStatus'] = true;
|
||||
|
||||
$iResponseCode = 200;
|
||||
try {
|
||||
$aParams['sAjaxURL'] = utils::GetAbsoluteUrlAppRoot().'/pages/UI.php';
|
||||
$oConfig = new Config(APPCONF.ITOP_DEFAULT_ENV.'/'.ITOP_CONFIG_FILE);
|
||||
$oEnvironment = new RunTimeEnvironment(ITOP_DEFAULT_ENV);
|
||||
$oEnvironment->WriteConfigFileSafe($oConfig);
|
||||
$oEnvironment->CompileFrom(ITOP_DEFAULT_ENV);
|
||||
} catch (Exception $e) {
|
||||
IssueLog::Error('RebuildToolkitEnvironment: '.$e->getMessage());
|
||||
$aParams['sError'] = $e->getMessage();
|
||||
$iResponseCode = 500;
|
||||
$aParams['bStatus'] = false;
|
||||
}
|
||||
$this->DisplayJSONPage($aParams, $iResponseCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \SecurityException if CSRF token invalid
|
||||
*
|
||||
|
||||
@@ -90,13 +90,6 @@
|
||||
{% UIForm Standard {'sId':'launch-setup-form', Action:sLaunchSetupUrl} %}
|
||||
{% UIButton ForDestructiveAction {'sLabel':'iTopUpdate:UI:SetupLaunch'|dict_s, 'sName':'launch-setup', 'sValue':'launch-setup', 'bIsSubmit':true, 'sId':'launch-setup'} %}
|
||||
{% EndUIForm %}
|
||||
{% UIAlert ForInformation {sId:'fast-setup-alert', AddCSSClass:'ibo-is-hidden'} %}
|
||||
{% UIContentBlock Standard {sId:'fast-setup-content', aContainerClasses:['ibo-fast-setup-content']} %}
|
||||
{{ 'iTopUpdate:UI:SetupMessage:Compile'|dict_s }}
|
||||
{% EndUIContentBlock %}
|
||||
{% EndUIAlert %}
|
||||
{% UIButton ForDestructiveAction {sLabel:'iTopUpdate:UI:FastSetupLaunch'|dict_s, sName:'launch-fast-setup', sValue:'launch-fast-setup', sId:'launch-fast-setup'} %}
|
||||
{% UISpinner Standard {sId:'fast-setup-wait', IsHidden:true} %}
|
||||
{% EndUIFieldSet %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
@@ -116,51 +116,4 @@ $("#launch-setup-form").on("submit", function () {
|
||||
return window.confirm("{{ 'iTopUpdate:UI:SetupLaunchConfirm'|dict_s }}");
|
||||
});
|
||||
|
||||
$("#launch-fast-setup").on("click", function(e) {
|
||||
var oMessage = $("#fast-setup-alert");
|
||||
var oContent = $("#fast-setup-content");
|
||||
oMessage.removeClass("ibo-is-hidden");
|
||||
oMessage.removeClass("ibo-is-failure");
|
||||
oMessage.removeClass("ibo-is-success");
|
||||
oMessage.addClass("ibo-is-information");
|
||||
oContent.html("{{ 'iTopUpdate:UI:SetupMessage:Compile'|dict_s }}");
|
||||
|
||||
let fast_setup_wait = $("#fast-setup-wait");
|
||||
fast_setup_wait.removeClass("ibo-is-hidden");
|
||||
$(this).prop("disabled", true);
|
||||
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: "{{ sAjaxURL|raw }}",
|
||||
data: {
|
||||
route: "core_update_ajax.rebuild_toolkit_environment"
|
||||
},
|
||||
dataType: "json",
|
||||
complete: function(jqXHR, textStatus) {
|
||||
$("#fast-setup-wait").addClass("ibo-is-hidden");
|
||||
$("#launch-fast-setup").prop("disabled", false);
|
||||
fast_setup_wait.addClass("ibo-is-hidden");
|
||||
},
|
||||
success: function (data) {
|
||||
oMessage.removeClass("ibo-is-information");
|
||||
|
||||
if (data.bStatus) {
|
||||
oMessage.removeClass("ibo-is-failure");
|
||||
oMessage.addClass("ibo-is-success");
|
||||
oContent.html("{{ 'iTopUpdate:UI:SetupMessage:UpdateDone'|dict_s }}");
|
||||
} else {
|
||||
oMessage.removeClass("ibo-is-success");
|
||||
oMessage.addClass("ibo-is-failure");
|
||||
oContent.html(data.sError);
|
||||
}
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
oMessage.removeClass("ibo-is-information");
|
||||
oMessage.removeClass("ibo-is-success");
|
||||
oMessage.addClass("ibo-is-failure");
|
||||
oContent.html(textStatus + ' ' + errorThrown);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
@@ -128,8 +128,6 @@ HTML
|
||||
<input type="hidden" name="_class" value="WizStepLandingBeforeAudit"/>
|
||||
<input type="hidden" name="operation" value="next"/>
|
||||
<input type="hidden" name="_params[skip_wizard]" value="1"/>
|
||||
<input type="hidden" name="authent" value="{$this->sUID}"/>
|
||||
<input type="hidden" name="_params[authent]" value="{$this->sUID}"/>
|
||||
<table style="width:100%;" class="ibo-setup--wizard--buttons-container">
|
||||
<tr>
|
||||
<td style="text-align: right"><button type="submit" class="ibo-button ibo-is-regular ibo-is-secondary">Keep current choices</button></td>
|
||||
|
||||
Reference in New Issue
Block a user