diff --git a/datamodels/2.x/itop-config/config.php b/datamodels/2.x/itop-config/config.php index 1b6d679f1..ce2f27a43 100644 --- a/datamodels/2.x/itop-config/config.php +++ b/datamodels/2.x/itop-config/config.php @@ -1,26 +1,6 @@ - - -/** - * Monitor the backup - * - * @copyright Copyright (C) 2021 Combodo SARL +/* + * @copyright Copyright (C) 2010-2021 Combodo SARL * @license http://opensource.org/licenses/AGPL-3.0 */ @@ -90,7 +70,9 @@ $oP->add_linked_script(utils::GetAbsoluteUrlAppRoot().'/js/ace/ext-searchbox.js' try { $sOperation = utils::ReadParam('operation', ''); $iEditorTopMargin = 2; - + if (UserRights::IsAdministrator() && ExecutionKPI::IsEnabled()) { + $iEditorTopMargin += 6; + } $oP->AddUiBlock(TitleUIBlockFactory::MakeForPage(Dict::S('config-edit-title'))); if (MetaModel::GetConfig()->Get('demo_mode')) { @@ -114,16 +96,19 @@ try { } if ($sOperation == 'revert') { + $iEditorTopMargin += 5; $oAlert = AlertUIBlockFactory::MakeForWarning('', Dict::S('config-reverted')); $oP->AddUiBlock($oAlert); } if ($sOperation == 'save') { $sTransactionId = utils::ReadParam('transaction_id', '', false, 'transaction_id'); if (!utils::IsTransactionValid($sTransactionId, true)) { + $iEditorTopMargin += 5; $oAlert = AlertUIBlockFactory::MakeForFailure('', 'Error: invalid Transaction ID. The configuration was NOT modified.'); $oP->AddUiBlock($oAlert); } else { if ($sConfig == $sOriginalConfig) { + $iEditorTopMargin += 5; $oAlert = AlertUIBlockFactory::MakeForInformation('', Dict::S('config-no-change')); $oP->AddUiBlock($oAlert); } else { @@ -151,13 +136,16 @@ try { if (DBPasswordInNewConfigIsOk($sConfig)) { $oAlert = AlertUIBlockFactory::MakeForSuccess('', Dict::S('config-saved')); + $iEditorTopMargin += 5; } else { $oAlert = AlertUIBlockFactory::MakeForInformation('', Dict::S('config-saved-warning-db-password')); + $iEditorTopMargin += 5; } $oP->AddUiBlock($oAlert); $sOriginalConfig = str_replace("\r\n", "\n", file_get_contents($sConfigFile)); } catch (Exception $e) { $oAlert = AlertUIBlockFactory::MakeForDanger('', $e->getMessage()); + $iEditorTopMargin += 5; $oP->AddUiBlock($oAlert); } }