From 1c38d989e485ebb91ec9770144c4896a6f2bc2a4 Mon Sep 17 00:00:00 2001 From: Stephen Abello Date: Mon, 18 May 2026 17:28:46 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B09603=20-=20Fix=20transitions=20applied?= =?UTF-8?q?=20when=20editing=20only=20caselog=20are=20not=20working=20(#90?= =?UTF-8?q?8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * N°9603 - Fix transitions applied when editing only caselog are not working * Remove unused variable --- .../CaseLogEntryFormFactory.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) 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()), <<