From 1152b2f401f76e946468bf139a4dfcab7c63044a Mon Sep 17 00:00:00 2001 From: Stephen Abello Date: Tue, 24 Jan 2023 11:19:24 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B05904=20Hide=20transitions=20in=20modals?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/cmdbabstract.class.inc.php | 4 ++-- sources/Controller/Base/Layout/ObjectController.php | 1 + sources/Controller/Links/LinksetController.php | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php index ac4698cfe..b31f566e9 100644 --- a/application/cmdbabstract.class.inc.php +++ b/application/cmdbabstract.class.inc.php @@ -2844,9 +2844,9 @@ JS $oApplyButton = ButtonUIBlockFactory::MakeForPrimaryAction($sApplyButton, null, null, true); $oApplyButton->AddCSSClass('action'); $oToolbarButtons->AddSubBlock($oApplyButton); - + $bAreTransitionsHidden = isset($aExtraParams['hide_transitions']) && $aExtraParams['hide_transitions'] === true; $aTransitions = $this->EnumTransitions(); - if (!isset($aExtraParams['custom_operation']) && count($aTransitions)) { + if (!isset($aExtraParams['custom_operation']) && !$bAreTransitionsHidden && count($aTransitions)) { // Transitions are displayed only for the standard new/modify actions, not for modify_all or any other case... $oSetToCheckRights = DBObjectSet::FromObject($this); diff --git a/sources/Controller/Base/Layout/ObjectController.php b/sources/Controller/Base/Layout/ObjectController.php index 70db72788..702d57ff7 100644 --- a/sources/Controller/Base/Layout/ObjectController.php +++ b/sources/Controller/Base/Layout/ObjectController.php @@ -77,6 +77,7 @@ class ObjectController extends AbstractController $oPage = new AjaxPage(''); $aFormExtraParams['js_handlers'] = []; $aFormExtraParams['noRelations'] = true; + $aFormExtraParams['hide_transitions'] = true; // We display this form in a modal, once we submit (in ajax) we probably want to only close the modal $aFormExtraParams['js_handlers']['form_on_submit'] = <<IsHandlingXmlHttpRequest()) { throw new CoreException('LinksetController can only be called in ajax.'); @@ -192,6 +192,7 @@ JS ; $aExtraParams = [ 'noRelations' => true, + 'hide_transitions' => true, 'fieldsFlags' => $aFieldFlags, 'js_handlers' => [ 'form_on_submit' => $sFormOnSubmitJsCode,