N°2847 Finish UX/UI for new caselog entry

This commit is contained in:
Stephen Abello
2020-10-02 10:53:47 +02:00
parent c2fe1bc5cb
commit b3bb77c8ee
12 changed files with 217 additions and 36 deletions

View File

@@ -243,4 +243,29 @@ class PopoverMenuFactory
return $oMenu;
}
public static function MakeMenuForActivityNewEntryFormSubmit(array $aCaseLogs): PopoverMenu
{
$oMenu = new PopoverMenu();
$sMenuId = $oMenu->GetId();
$aItems = [];
foreach ($aCaseLogs as $sCaseLogAttCode => $sCaseLogLabel) {
// JS
$aItems[] = PopoverMenuItemFactory::MakeFromApplicationPopupMenuItem(
new JSPopupMenuItem(
$sCaseLogAttCode,
$sCaseLogLabel,
<<<JS
$('#$sMenuId').hide();
$(this).parents('[data-role="ibo-activity-new-entry-form--action-buttons--right-actions"]').trigger('submit', ['caselog', '$sCaseLogAttCode']);
JS
));
}
$oMenu->AddSection('ibo-activity-new-entry-new-entry--submit--caselogs')
->SetItems('ibo-activity-new-entry-new-entry--submit--caselogs', $aItems);
return $oMenu;
}
}