mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
feat: dolGetButtonAction for sendmail
This commit is contained in:
parent
0e3ec05028
commit
c78ec56c8f
|
|
@ -1825,23 +1825,21 @@ if ($action == 'create' || $action == 'adduserldap') {
|
|||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook)) {
|
||||
if (empty($user->socid)) {
|
||||
$canSendMail = false;
|
||||
$params = array(
|
||||
'attr' => array(
|
||||
'title' => $langs->trans('SendMail'),
|
||||
'class' => 'classfortooltip'
|
||||
)
|
||||
);
|
||||
if (!empty($object->email)) {
|
||||
$langs->load("mails");
|
||||
// TODO Replace div with dolGetButtonAction
|
||||
print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle', '');
|
||||
//print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a></div>';
|
||||
$canSendMail = true;
|
||||
} else {
|
||||
$langs->load("mails");
|
||||
// TODO Replace div with dolGetButtonAction
|
||||
//$params = array(
|
||||
// 'attr' => array(
|
||||
// 'title' => $langs->trans('ImpersonateButtonDescription'),
|
||||
// 'class' => 'classfortooltip'
|
||||
// )
|
||||
//);
|
||||
print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle', '');
|
||||
//print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NoEMail")).'">'.$langs->trans('SendMail').'</a></div>';
|
||||
$params['attr']['title'] = $langs->trans('NoEMail');
|
||||
}
|
||||
print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle', '', $canSendMail, $params);
|
||||
}
|
||||
|
||||
if ($caneditfield && (empty($conf->multicompany->enabled) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user