FIX #11855
This commit is contained in:
parent
273443550e
commit
7fe8c7eab3
@ -1773,8 +1773,10 @@ else
|
||||
if ($action != 'editlogin' && $action != 'editthirdparty')
|
||||
{
|
||||
// Send
|
||||
if ($object->statut == 1) {
|
||||
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>';
|
||||
if (empty($user->socid)) {
|
||||
if ($object->statut == 1) {
|
||||
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>';
|
||||
}
|
||||
}
|
||||
|
||||
// Send card by email
|
||||
|
||||
@ -281,7 +281,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
if (empty($reshook))
|
||||
{
|
||||
// Send
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a>'."\n";
|
||||
if (empty($user->socid)) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a>'."\n";
|
||||
}
|
||||
|
||||
if ($user->rights->asset->write)
|
||||
{
|
||||
|
||||
@ -601,7 +601,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
if (empty($reshook))
|
||||
{
|
||||
// Send
|
||||
//print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle">' . $langs->trans('SendMail') . '</a>'."\n";
|
||||
//if (empty($user->socid)) {
|
||||
// print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle">' . $langs->trans('SendMail') . '</a>'."\n";
|
||||
//}
|
||||
|
||||
// Back to draft
|
||||
if ($object->status == $object::STATUS_VALIDATED)
|
||||
|
||||
@ -2498,11 +2498,13 @@ if ($action == 'create')
|
||||
}
|
||||
|
||||
// Send
|
||||
if ($object->statut == Propal::STATUS_VALIDATED || $object->statut == Propal::STATUS_SIGNED || !empty($conf->global->PROPOSAL_SENDBYEMAIL_FOR_ALL_STATUS)) {
|
||||
if ($usercansend) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a>';
|
||||
} else
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans('SendMail').'</a>';
|
||||
if (empty($user->socid)) {
|
||||
if ($object->statut == Propal::STATUS_VALIDATED || $object->statut == Propal::STATUS_SIGNED || !empty($conf->global->PROPOSAL_SENDBYEMAIL_FOR_ALL_STATUS)) {
|
||||
if ($usercansend) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a>';
|
||||
} else
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans('SendMail').'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
// Create a sale order
|
||||
|
||||
@ -2548,11 +2548,13 @@ if ($action == 'create' && $usercancreate)
|
||||
}
|
||||
|
||||
// Send
|
||||
if ($object->statut > Commande::STATUS_DRAFT || !empty($conf->global->COMMANDE_SENDBYEMAIL_FOR_ALL_STATUS)) {
|
||||
if ($usercansend) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a>';
|
||||
} else
|
||||
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans('SendMail').'</a>';
|
||||
if (empty($user->socid)) {
|
||||
if ($object->statut > Commande::STATUS_DRAFT || !empty($conf->global->COMMANDE_SENDBYEMAIL_FOR_ALL_STATUS)) {
|
||||
if ($usercansend) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a>';
|
||||
} else
|
||||
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans('SendMail').'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
// Valid
|
||||
|
||||
@ -5052,14 +5052,16 @@ elseif ($id > 0 || !empty($ref))
|
||||
}
|
||||
|
||||
// Send by mail
|
||||
if (($object->statut == Facture::STATUS_VALIDATED || $object->statut == Facture::STATUS_CLOSED) || !empty($conf->global->FACTURE_SENDBYEMAIL_FOR_ALL_STATUS)) {
|
||||
if ($objectidnext) {
|
||||
print '<span class="butActionRefused classfortooltip" title="'.$langs->trans("DisabledBecauseReplacedInvoice").'">'.$langs->trans('SendMail').'</span>';
|
||||
} else {
|
||||
if ($usercansend) {
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a>';
|
||||
} else
|
||||
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans('SendMail').'</a>';
|
||||
if (empty($user->socid)) {
|
||||
if (($object->statut == Facture::STATUS_VALIDATED || $object->statut == Facture::STATUS_CLOSED) || !empty($conf->global->FACTURE_SENDBYEMAIL_FOR_ALL_STATUS)) {
|
||||
if ($objectidnext) {
|
||||
print '<span class="butActionRefused classfortooltip" title="'.$langs->trans("DisabledBecauseReplacedInvoice").'">'.$langs->trans('SendMail').'</span>';
|
||||
} else {
|
||||
if ($usercansend) {
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a>';
|
||||
} else
|
||||
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans('SendMail').'</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1449,15 +1449,17 @@ else
|
||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook) && $action != 'presend')
|
||||
{
|
||||
if (!empty($object->email))
|
||||
{
|
||||
$langs->load("mails");
|
||||
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
|
||||
{
|
||||
$langs->load("mails");
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NoEMail")).'">'.$langs->trans('SendMail').'</a></div>';
|
||||
if (empty($user->socid)) {
|
||||
if (!empty($object->email))
|
||||
{
|
||||
$langs->load("mails");
|
||||
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
|
||||
{
|
||||
$langs->load("mails");
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NoEMail")).'">'.$langs->trans('SendMail').'</a></div>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($user->rights->societe->contact->creer)
|
||||
|
||||
@ -2106,11 +2106,13 @@ else
|
||||
if (empty($reshook))
|
||||
{
|
||||
// Send
|
||||
if ($object->statut == 1) {
|
||||
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->commande->order_advance->send)) {
|
||||
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
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">'.$langs->trans('SendMail').'</a></div>';
|
||||
if (empty($user->socid)) {
|
||||
if ($object->statut == 1) {
|
||||
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->commande->order_advance->send)) {
|
||||
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
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">'.$langs->trans('SendMail').'</a></div>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($object->statut == 0 && $nbofservices)
|
||||
|
||||
@ -2529,13 +2529,15 @@ elseif ($id || $ref)
|
||||
}
|
||||
|
||||
// Send
|
||||
if ($object->statut > 0)
|
||||
{
|
||||
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->expedition->shipping_advance->send)
|
||||
if (empty($user->socid)) {
|
||||
if ($object->statut > 0)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a>';
|
||||
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->expedition->shipping_advance->send)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a>';
|
||||
}
|
||||
else print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans('SendMail').'</a>';
|
||||
}
|
||||
else print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans('SendMail').'</a>';
|
||||
}
|
||||
|
||||
// Create bill
|
||||
|
||||
@ -2643,14 +2643,15 @@ if ($action != 'create' && $action != 'edit')
|
||||
$object->fetch($id, $ref);
|
||||
|
||||
// Send
|
||||
if ($object->fk_statut > ExpenseReport::STATUS_DRAFT) {
|
||||
//if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->expensereport->expensereport_advance->send)) {
|
||||
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
|
||||
// print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">' . $langs->trans('SendMail') . '</a></div>';
|
||||
if (empty($user->socid)) {
|
||||
if ($object->fk_statut > ExpenseReport::STATUS_DRAFT) {
|
||||
//if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->expensereport->expensereport_advance->send)) {
|
||||
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
|
||||
// print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">' . $langs->trans('SendMail') . '</a></div>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Si l'état est "Brouillon"
|
||||
* ET user à droit "creer/supprimer"
|
||||
* ET fk_user_author == user courant
|
||||
|
||||
@ -1628,13 +1628,15 @@ elseif ($id > 0 || !empty($ref))
|
||||
}
|
||||
|
||||
// Send
|
||||
if ($object->statut > Fichinter::STATUS_DRAFT)
|
||||
{
|
||||
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->ficheinter->ficheinter_advance->send)
|
||||
if (empty($user->socid)) {
|
||||
if ($object->statut > Fichinter::STATUS_DRAFT)
|
||||
{
|
||||
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>';
|
||||
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->ficheinter->ficheinter_advance->send)
|
||||
{
|
||||
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 print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">'.$langs->trans('SendMail').'</a></div>';
|
||||
}
|
||||
else print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">'.$langs->trans('SendMail').'</a></div>';
|
||||
}
|
||||
|
||||
// create intervention model
|
||||
|
||||
@ -2442,11 +2442,13 @@ elseif (!empty($object->id))
|
||||
}
|
||||
|
||||
// Send
|
||||
if (in_array($object->statut, array(CommandeFournisseur::STATUS_ACCEPTED, 3, 4, 5)) || !empty($conf->global->SUPPLIER_ORDER_SENDBYEMAIL_FOR_ALL_STATUS))
|
||||
{
|
||||
if ($user->rights->fournisseur->commande->commander)
|
||||
if (empty($user->socid)) {
|
||||
if (in_array($object->statut, array(CommandeFournisseur::STATUS_ACCEPTED, 3, 4, 5)) || !empty($conf->global->SUPPLIER_ORDER_SENDBYEMAIL_FOR_ALL_STATUS))
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a>';
|
||||
if ($user->rights->fournisseur->commande->commander)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -3134,13 +3134,15 @@ else
|
||||
}
|
||||
|
||||
// Send by mail
|
||||
if (($object->statut == FactureFournisseur::STATUS_VALIDATED || $object->statut == FactureFournisseur::STATUS_CLOSED))
|
||||
{
|
||||
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->fournisseur->supplier_invoice_advance->send)
|
||||
if (empty($user->socid)) {
|
||||
if (($object->statut == FactureFournisseur::STATUS_VALIDATED || $object->statut == FactureFournisseur::STATUS_CLOSED))
|
||||
{
|
||||
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>';
|
||||
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->fournisseur->supplier_invoice_advance->send)
|
||||
{
|
||||
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 print '<div class="inline-block divButAction"><span class="butActionRefused classfortooltip">'.$langs->trans('SendMail').'</a></div>';
|
||||
}
|
||||
else print '<div class="inline-block divButAction"><span class="butActionRefused classfortooltip">'.$langs->trans('SendMail').'</a></div>';
|
||||
}
|
||||
|
||||
// Make payments
|
||||
|
||||
@ -456,7 +456,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
if (empty($reshook))
|
||||
{
|
||||
// Send
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a>'."\n";
|
||||
if (empty($user->socid)) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a>'."\n";
|
||||
}
|
||||
|
||||
// Back to draft
|
||||
if ($object->status == $object::STATUS_VALIDATED)
|
||||
|
||||
@ -574,7 +574,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
if (empty($reshook))
|
||||
{
|
||||
// Send
|
||||
//print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle">' . $langs->trans('SendMail') . '</a>'."\n";
|
||||
//if (empty($user->socid)) {
|
||||
// print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle">' . $langs->trans('SendMail') . '</a>'."\n";
|
||||
//}
|
||||
|
||||
// Back to draft
|
||||
if ($object->status == $object::STATUS_VALIDATED)
|
||||
|
||||
@ -329,7 +329,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
if (empty($reshook))
|
||||
{
|
||||
// Send
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a>'."\n";
|
||||
if (empty($user->socid)) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a>'."\n";
|
||||
}
|
||||
|
||||
if ($permissiontoadd)
|
||||
{
|
||||
|
||||
@ -1191,9 +1191,11 @@ elseif ($object->id > 0)
|
||||
}*/
|
||||
|
||||
// Send
|
||||
if ($object->statut != 2)
|
||||
{
|
||||
print '<a class="butAction" href="card.php?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a>';
|
||||
if (empty($user->socid)) {
|
||||
if ($object->statut != 2)
|
||||
{
|
||||
print '<a class="butAction" href="card.php?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
// Modify
|
||||
|
||||
@ -2056,13 +2056,15 @@ elseif ($id || $ref)
|
||||
}
|
||||
|
||||
// Send
|
||||
if ($object->statut > 0)
|
||||
{
|
||||
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->reception->reception_advance->send)
|
||||
if (empty($user->socid)) {
|
||||
if ($object->statut > 0)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendByMail').'</a>';
|
||||
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->reception->reception_advance->send)
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendByMail').'</a>';
|
||||
}
|
||||
else print '<a class="butActionRefused" href="#">'.$langs->trans('SendByMail').'</a>';
|
||||
}
|
||||
else print '<a class="butActionRefused" href="#">'.$langs->trans('SendByMail').'</a>';
|
||||
}
|
||||
|
||||
// Create bill
|
||||
|
||||
@ -2714,16 +2714,18 @@ else
|
||||
}
|
||||
}
|
||||
|
||||
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>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("mails");
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NoEMail")).'">'.$langs->trans('SendMail').'</a>';
|
||||
}
|
||||
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>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("mails");
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NoEMail")).'">'.$langs->trans('SendMail').'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($user->rights->societe->creer)
|
||||
{
|
||||
|
||||
@ -1869,11 +1869,13 @@ if ($action == 'create')
|
||||
}
|
||||
|
||||
// Send
|
||||
if ($object->statut == SupplierProposal::STATUS_VALIDATED || $object->statut == SupplierProposal::STATUS_SIGNED) {
|
||||
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->supplier_proposal->send_advance) {
|
||||
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
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">'.$langs->trans('SendMail').'</a></div>';
|
||||
if (empty($user->socid)) {
|
||||
if ($object->statut == SupplierProposal::STATUS_VALIDATED || $object->statut == SupplierProposal::STATUS_SIGNED) {
|
||||
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->supplier_proposal->send_advance) {
|
||||
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
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">'.$langs->trans('SendMail').'</a></div>';
|
||||
}
|
||||
}
|
||||
|
||||
// Create an order
|
||||
|
||||
@ -1884,15 +1884,17 @@ else
|
||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook))
|
||||
{
|
||||
if (!empty($object->email))
|
||||
{
|
||||
$langs->load("mails");
|
||||
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
|
||||
{
|
||||
$langs->load("mails");
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NoEMail")).'">'.$langs->trans('SendMail').'</a></div>';
|
||||
if (empty($user->socid)) {
|
||||
if (!empty($object->email))
|
||||
{
|
||||
$langs->load("mails");
|
||||
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
|
||||
{
|
||||
$langs->load("mails");
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NoEMail")).'">'.$langs->trans('SendMail').'</a></div>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($caneditfield && (empty($conf->multicompany->enabled) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
|
||||
|
||||
@ -306,7 +306,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
if (empty($reshook))
|
||||
{
|
||||
// Send
|
||||
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>'."\n";
|
||||
if (empty($user->socid)) {
|
||||
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>'."\n";
|
||||
}
|
||||
|
||||
if ($user->rights->website->write)
|
||||
{
|
||||
|
||||
@ -334,9 +334,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
|
||||
if (empty($reshook))
|
||||
{
|
||||
// Send
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a>'."\n";
|
||||
|
||||
// Modify
|
||||
if ($user->rights->mymodule->write)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user