diff --git a/sources/Application/UI/Base/Layout/ActivityPanel/CaseLogEntryForm/CaseLogEntryFormFactory.php b/sources/Application/UI/Base/Layout/ActivityPanel/CaseLogEntryForm/CaseLogEntryFormFactory.php index a00d425331..02ef6d2491 100644 --- a/sources/Application/UI/Base/Layout/ActivityPanel/CaseLogEntryForm/CaseLogEntryFormFactory.php +++ b/sources/Application/UI/Base/Layout/ActivityPanel/CaseLogEntryForm/CaseLogEntryFormFactory.php @@ -13,7 +13,6 @@ use Combodo\iTop\Application\UI\Base\Component\Button\ButtonUIBlockFactory; use Combodo\iTop\Application\UI\Base\Component\ButtonGroup\ButtonGroupUIBlockFactory; use Combodo\iTop\Application\UI\Base\Component\PopoverMenu\PopoverMenu; use Combodo\iTop\Application\UI\Base\Component\PopoverMenu\PopoverMenuItem\PopoverMenuItemFactory; -use Combodo\iTop\Application\UI\Base\Layout\ActivityPanel\CaseLogEntryForm\CaseLogEntryForm; use DBObject; use DBObjectSet; use Dict; @@ -39,7 +38,7 @@ class CaseLogEntryFormFactory ->AddMainActionButtons(static::PrepareCancelButton()); $oSaveButton = static::PrepareSaveButton(); - $oTransitionsMenu = static::PrepareTransitionsSelectionPopoverMenu($oObject, $sCaseLogAttCode); + $oTransitionsMenu = static::PrepareTransitionsSelectionPopoverMenu($oObject, $sCaseLogAttCode, $oCaseLogEntryForm->GetId()); // Prevent popover menu from landing behind caselog editor $oTransitionsMenu->SetContainer(PopoverMenu::ENUM_CONTAINER_BODY); if (true === $oTransitionsMenu->HasItems()) { @@ -71,7 +70,16 @@ class CaseLogEntryFormFactory return $oButton; } - protected static function PrepareTransitionsSelectionPopoverMenu(DBObject $oObject, string $sCaseLogAttCode): PopoverMenu + /** + * @param DBObject $oObject + * @param string $sCaseLogAttCode + * @param string $sCaseLogEntryFormId + * @since 3.2.3 Add mandatory $sCaseLogEntryFormId parameter + * @return PopoverMenu + * @throws \ArchivedObjectException + * @throws \CoreException + */ + protected static function PrepareTransitionsSelectionPopoverMenu(DBObject $oObject, string $sCaseLogAttCode, string $sCaseLogEntryFormId): PopoverMenu { $sObjClass = get_class($oObject); @@ -79,8 +87,6 @@ class CaseLogEntryFormFactory $sSectionId = 'send-actions'; $oMenu->AddSection($sSectionId); - $sCaseLogEntryFormDataRole = CaseLogEntryForm::BLOCK_CODE; - // Note: This code is inspired from cmdbAbstract::DisplayModifyForm(), it might be better to factorize it $aTransitions = $oObject->EnumTransitions(); if (!isset($aExtraParams['custom_operation']) && count($aTransitions)) { @@ -99,7 +105,7 @@ class CaseLogEntryFormFactory CaseLogEntryForm::BLOCK_CODE.'--add-action--'.$sCaseLogAttCode.'--stimulus--'.$sStimulusCode, Dict::Format('UI:Button:SendAnd', $aStimuli[$sStimulusCode]->GetLabel()), <<