Popover menu: Refactor to remove the necessity of coupling JS and PHP code to instantiate it correctly

This commit is contained in:
Molkobain
2021-03-22 13:21:31 +01:00
parent e8656e8504
commit 65ed5b3fce
14 changed files with 409 additions and 137 deletions

View File

@@ -299,18 +299,18 @@ class CaseLogEntryForm extends UIContentBlock
$aSubBlocks = [];
$aSubBlocks[$this->GetTextInput()->GetId()] = $this->GetTextInput();
foreach ($this->GetExtraActionButtons() as $oExtraActionButton)
{
foreach ($this->GetExtraActionButtons() as $oExtraActionButton) {
$aSubBlocks[$oExtraActionButton->GetId()] = $oExtraActionButton;
}
foreach ($this->GetMainActionButtons() as $oMainActionButton)
{
foreach ($this->GetMainActionButtons() as $oMainActionButton) {
$aSubBlocks[$oMainActionButton->GetId()] = $oMainActionButton;
}
$aSubBlocks[$this->GetSendButtonPopoverMenu()->GetId()] = $this->GetSendButtonPopoverMenu();
if ($this->HasSendButtonPopoverMenu()) {
$aSubBlocks[$this->GetSendButtonPopoverMenu()->GetId()] = $this->GetSendButtonPopoverMenu();
}
return $aSubBlocks;
}

View File

@@ -37,8 +37,10 @@ class CaseLogEntryFormFactory
$oCaseLogEntryForm = new CaseLogEntryForm($oObject, $sCaseLogAttCode);
$oCaseLogEntryForm->SetSubmitModeFromHostObjectMode($sObjectMode)
->AddMainActionButtons(static::PrepareCancelButton())
->AddMainActionButtons(static::PrepareSaveButton())
->SetSendButtonPopoverMenu(static::PrepareSendActionSelectionPopoverMenu($oObject, $sCaseLogAttCode));
->AddMainActionButtons(static::PrepareSaveButton());
// TODO 3.0.0: Will be fixed by N°3649
// ->SetSendButtonPopoverMenu(static::PrepareSendActionSelectionPopoverMenu($oObject, $sCaseLogAttCode));
return $oCaseLogEntryForm;
}