Fix handling disableOnSuccessMsg parameter on LSobject customActions

This commit is contained in:
Benjamin Renard 2021-10-08 12:17:51 +02:00
parent 28d08aaae8
commit d89d75f72b

View file

@ -1384,16 +1384,18 @@ function handle_LSobject_customAction($request) {
if (isset($_GET['valid']) || LSconfig :: get('noConfirmation', false, 'bool', $config)) { if (isset($_GET['valid']) || LSconfig :: get('noConfirmation', false, 'bool', $config)) {
LStemplate :: assign('pagetitle', $title.' : '.$objectname); LStemplate :: assign('pagetitle', $title.' : '.$objectname);
if (call_user_func_array($function, array(&$object))) { if (call_user_func_array($function, array(&$object))) {
$msg_format = LSconfig :: get('onSuccessMsgFormat', null, 'string', $config); if (!LSconfig :: get('disableOnSuccessMsg', false, 'bool', $config)) {
if ($msg_format) { $msg_format = LSconfig :: get('onSuccessMsgFormat', null, 'string', $config);
$msg = getFData(__($msg_format), $objectname); if ($msg_format) {
} else { $msg = getFData(__($msg_format), $objectname);
$msg = getFData( } else {
_('The custom action %{customAction} have been successfully execute on %{objectname}.'), $msg = getFData(
array('objectname' => $objectname, 'customAction' => $customAction) _('The custom action %{customAction} have been successfully execute on %{objectname}.'),
); array('objectname' => $objectname, 'customAction' => $customAction)
);
}
LSsession :: addInfo($msg);
} }
LSsession :: addInfo($msg);
if (LSconfig :: get('redirectToObjectList', false, 'bool', $config)) { if (LSconfig :: get('redirectToObjectList', false, 'bool', $config)) {
LSurl :: redirect("object/$LSobject?refresh"); LSurl :: redirect("object/$LSobject?refresh");