N°5904 Hide transitions in modals

This commit is contained in:
Stephen Abello
2023-01-24 11:19:24 +01:00
parent 8f7003c694
commit 1152b2f401
3 changed files with 5 additions and 3 deletions

View File

@@ -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);

View File

@@ -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'] =
<<<JS

View File

@@ -124,7 +124,7 @@ class LinkSetController extends AbstractController
* @throws \CoreException
* @throws \SecurityException
*/
public function OperationCreateLinkedObject()
public function OperationCreateLinkedObject(): AjaxPage
{
if (!$this->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,