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
|
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
if (empty($reshook)) {
|
if (empty($reshook)) {
|
||||||
if (empty($user->socid)) {
|
if (empty($user->socid)) {
|
||||||
|
$canSendMail = false;
|
||||||
|
$params = array(
|
||||||
|
'attr' => array(
|
||||||
|
'title' => $langs->trans('SendMail'),
|
||||||
|
'class' => 'classfortooltip'
|
||||||
|
)
|
||||||
|
);
|
||||||
if (!empty($object->email)) {
|
if (!empty($object->email)) {
|
||||||
$langs->load("mails");
|
$langs->load("mails");
|
||||||
// TODO Replace div with dolGetButtonAction
|
$canSendMail = true;
|
||||||
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>';
|
|
||||||
} else {
|
} else {
|
||||||
$langs->load("mails");
|
$langs->load("mails");
|
||||||
// TODO Replace div with dolGetButtonAction
|
$params['attr']['title'] = $langs->trans('NoEMail');
|
||||||
//$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>';
|
|
||||||
}
|
}
|
||||||
|
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))) {
|
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