fix retour

This commit is contained in:
GregM 2022-02-23 15:34:17 +01:00
parent b954608443
commit 74bfdb0842

View File

@ -2917,19 +2917,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
} }
if (empty($user->socid)) { if (empty($user->socid)) {
if (!empty($object->email) || $at_least_one_email_contact) { $langs->load("mails");
$langs->load("mails"); $title = '';
$params = array( if (empty($object->email) && !$at_least_one_email_contact) { $title = $langs->trans('NoEMail'); }
'attr' => array( print dolGetButtonAction($title, $langs->trans('SendMail'), 'default', $_SERVER['PHP_SELF'].'?socid='.$object->id.'&action=presend&mode=init#formmailbeforetitle', 'btn-send-mail', !empty($object->email) || $at_least_one_email_contact);
'title' => ''
)
);
print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER['PHP_SELF'].'?socid='.$object->id.'&action=presend&mode=init#formmailbeforetitle', '', true, $params);
} else {
$langs->load("mails");
$params['attr']['title'] = $langs->trans('NoEMail');
print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER['PHP_SELF'].'?socid='.$object->id.'&action=presend&mode=init#formmailbeforetitle'.newToken(), '', false, $params);
}
} }
print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd);
@ -2945,11 +2936,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print dolGetButtonAction($langs->trans('MergeThirdparties'), $langs->trans('Merge'), 'danger', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=merge&token='.newToken(), '', $permissiontodelete); print dolGetButtonAction($langs->trans('MergeThirdparties'), $langs->trans('Merge'), 'danger', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=merge&token='.newToken(), '', $permissiontodelete);
if ($user->rights->societe->supprimer) { if ($user->rights->societe->supprimer) {
$deleteUrl = $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=delete&token='.newToken();
$buttonId = 'action-delete-no-ajax';
if ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile)) { // We can't use preloaded confirm form with jmobile if ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile)) { // We can't use preloaded confirm form with jmobile
print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=delete&token='.newToken(), 'action-delete', $permissiontodelete); $deleteUrl = '';
} else { $buttonId = 'action-delete';
print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete);
} }
print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $deleteUrl, $buttonId, $permissiontodelete);
} }
} }