Merge pull request #20157 from atm-GregM/updateButtonsGregM

FIX: replace button with dolGetButtonAction on Societe card
This commit is contained in:
Laurent Destailleur 2022-04-14 22:37:59 +02:00 committed by GitHub
commit 1438da022d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2926,18 +2926,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
if (empty($user->socid)) {
if (!empty($object->email) || $at_least_one_email_contact) {
$langs->load("mails");
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?socid='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a>'."\n";
} else {
$langs->load("mails");
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NoEMail")).'">'.$langs->trans('SendMail').'</a>'."\n";
}
$langs->load("mails");
$title = '';
if (empty($object->email) && !$at_least_one_email_contact) { $title = $langs->trans('NoEMail'); }
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);
}
if ($user->rights->societe->creer) {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>'."\n";
}
print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd);
if (!empty($conf->adherent->enabled)) {
$adh = new Adherent($db);
@ -2947,16 +2942,16 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
}
if ($user->rights->societe->supprimer) {
print '<a class="butActionDelete" href="card.php?action=merge&socid='.$object->id.'" title="'.dol_escape_htmltag($langs->trans("MergeThirdparties")).'">'.$langs->trans('Merge').'</a>'."\n";
}
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) {
$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
print '<span id="action-delete" class="butActionDelete">'.$langs->trans('Delete').'</span>'."\n";
} else {
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').'</a>'."\n";
$deleteUrl = '';
$buttonId = 'action-delete';
}
print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $deleteUrl, $buttonId, $permissiontodelete);
}
}