Ajout possibilit de demander un accus de rception sur l'envoi de document
This commit is contained in:
parent
5381cf199b
commit
df857cedde
@ -319,6 +319,7 @@ if ($_POST['action'] == 'send')
|
||||
$replyto = $_POST['replytoname']. ' <' . $_POST['replytomail'].'>';
|
||||
$message = $_POST['message'];
|
||||
$sendtocc = $_POST['sendtocc'];
|
||||
$deliveryreceipt = $_POST['deliveryreceipt'];
|
||||
|
||||
if ($_POST['action'] == 'send')
|
||||
{
|
||||
@ -351,7 +352,7 @@ if ($_POST['action'] == 'send')
|
||||
$mimetype[1] = $_FILES['addedfile']['type'];
|
||||
}
|
||||
// Envoi de la propal
|
||||
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc);
|
||||
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,'',$deliveryreceipt);
|
||||
if ($mailfile->sendfile())
|
||||
{
|
||||
$msg='<div class="ok">'.$langs->trans('MailSuccessfulySent',$from,$sendto).'.</div>';
|
||||
@ -1585,6 +1586,7 @@ if ($_GET['propalid'] > 0)
|
||||
$formmail->withtopic=$langs->trans('SendPropalRef','__PROPREF__');
|
||||
$formmail->withfile=1;
|
||||
$formmail->withbody=1;
|
||||
$formmail->withdeliveryreceipt=1;
|
||||
// Tableau des substitutions
|
||||
$formmail->substit['__PROPREF__']=$propal->ref;
|
||||
// Tableau des paramètres complémentaires
|
||||
|
||||
@ -475,6 +475,7 @@ if ($_POST['action'] == 'send')
|
||||
$replyto = $_POST['replytoname']. ' <' . $_POST['replytomail'].'>';
|
||||
$message = $_POST['message'];
|
||||
$sendtocc = $_POST['sendtocc'];
|
||||
$deliveryreceipt = $_POST['deliveryreceipt'];
|
||||
|
||||
if ($_POST['action'] == 'send')
|
||||
{
|
||||
@ -507,7 +508,7 @@ if ($_POST['action'] == 'send')
|
||||
$mimetype[1] = $_FILES['addedfile']['type'];
|
||||
}
|
||||
// Envoi de la commande
|
||||
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc);
|
||||
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,'',$deliveryreceipt);
|
||||
if ($mailfile->sendfile())
|
||||
{
|
||||
$msg='<div class="ok">'.$langs->trans('MailSuccessfulySent',$from,$sendto).'.</div>';
|
||||
@ -1761,6 +1762,7 @@ else
|
||||
$formmail->withtopic=$langs->trans('SendOrderRef','__ORDERREF__');
|
||||
$formmail->withfile=1;
|
||||
$formmail->withbody=1;
|
||||
$formmail->withdeliveryreceipt=1;
|
||||
// Tableau des substitutions
|
||||
$formmail->substit['__ORDERREF__']=$commande->ref;
|
||||
// Tableau des paramètres complémentaires
|
||||
|
||||
@ -576,6 +576,7 @@ if ($_POST['action'] == 'send' || $_POST['action'] == 'relance')
|
||||
$replyto = $_POST['replytoname']. ' <' . $_POST['replytomail'].'>';
|
||||
$message = $_POST['message'];
|
||||
$sendtocc = $_POST['sendtocc'];
|
||||
$deliveryreceipt = $_POST['deliveryreceipt'];
|
||||
|
||||
if ($_POST['action'] == 'send')
|
||||
{
|
||||
@ -619,7 +620,7 @@ if ($_POST['action'] == 'send' || $_POST['action'] == 'relance')
|
||||
$mimetype[1] = $_FILES['addedfile']['type'];
|
||||
|
||||
// Envoi de la facture
|
||||
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc);
|
||||
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,'',$deliveryreceipt);
|
||||
|
||||
if ($mailfile->sendfile())
|
||||
{
|
||||
@ -2343,6 +2344,7 @@ else
|
||||
$formmail->withtopic=$langs->trans('SendBillRef','__FACREF__');
|
||||
$formmail->withfile=1;
|
||||
$formmail->withbody=1;
|
||||
$formmail->withdeliveryreceipt=1;
|
||||
// Tableau des substitutions
|
||||
$formmail->substit['__FACREF__']=$fac->ref;
|
||||
// Tableau des paramètres complémentaires du post
|
||||
@ -2397,6 +2399,7 @@ else
|
||||
$formmail->withtopic=$langs->trans('SendReminderBillRef','__FACREF__');
|
||||
$formmail->withfile=1;
|
||||
$formmail->withbody=1;
|
||||
$formmail->withdeliveryreceipt=1;
|
||||
// Tableau des substitutions
|
||||
$formmail->substit['__FACREF__']=$fac->ref;
|
||||
// Tableau des paramètres complémentaires
|
||||
|
||||
@ -1063,11 +1063,11 @@ class Form
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Retourne la liste des types de paiements possibles
|
||||
* \param selected Id du type de paiement présélectionné
|
||||
* \brief Selection oui ou non
|
||||
* \param selected Id présélectionné
|
||||
* \param htmlname Nom de la zone select
|
||||
*/
|
||||
function select_assujetti_tva($selected='',$htmlname='')
|
||||
function select_YesNo($selected='',$htmlname='')
|
||||
{
|
||||
global $langs;
|
||||
print '<select class="flat" name="'.$htmlname.'">';
|
||||
|
||||
@ -58,6 +58,7 @@ class FormMail
|
||||
var $withtoreadonly;
|
||||
var $withtoccreadonly;
|
||||
var $withtopicreadonly;
|
||||
var $withdeliveryreceipt;
|
||||
|
||||
var $substit=array();
|
||||
var $param=array();
|
||||
@ -85,6 +86,7 @@ class FormMail
|
||||
$this->withtoccreadonly=0;
|
||||
$this->withtopicreadonly=0;
|
||||
$this->withbodyreadonly=0;
|
||||
$this->withdeliveryreceiptreadonly=0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -176,6 +178,22 @@ class FormMail
|
||||
}
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
|
||||
// Accusé réception
|
||||
if ($this->withdeliveryreceipt)
|
||||
{
|
||||
print '<tr><td width="180">'.$langs->trans("DeliveryReceipt").'</td><td>';
|
||||
|
||||
if ($this->withdeliveryreceiptreadonly) {
|
||||
print yn($this->withdeliveryreceipt);
|
||||
}
|
||||
else
|
||||
{
|
||||
print $form->select_YesNo(0,'deliveryreceipt');
|
||||
}
|
||||
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
|
||||
// Topic
|
||||
if ($this->withtopic)
|
||||
|
||||
@ -57,6 +57,7 @@ class CMailFile
|
||||
var $mime_headers;
|
||||
var $mime_boundary;
|
||||
var $smtp_headers;
|
||||
var $deliveryreceipt;
|
||||
|
||||
/**
|
||||
\brief CMailFile
|
||||
@ -72,7 +73,7 @@ class CMailFile
|
||||
*/
|
||||
function CMailFile($subject,$to,$from,$msg,
|
||||
$filename_list=array(),$mimetype_list=array(),$mimefilename_list=array(),
|
||||
$addr_cc="",$addr_bcc="")
|
||||
$addr_cc="",$addr_bcc="",$deliveryreceipt=0)
|
||||
{
|
||||
dolibarr_syslog("CMailFile::CMailfile: from=$from, to=$to, filename_list[0]=$filename_list[0], mimetype_list[0]=$mimetype_list[0] mimefilename_list[0]=$mimefilename_list[0]");
|
||||
|
||||
@ -92,6 +93,7 @@ class CMailFile
|
||||
$this->addr_to = $to;
|
||||
$this->addr_cc = $addr_cc;
|
||||
$this->addr_bcc = $addr_bcc;
|
||||
$this->deliveryreceipt = $deliveryreceipt;
|
||||
$this->smtp_headers = $this->write_smtpheaders();
|
||||
$this->text_body = $this->write_body($msg, $filename_list);
|
||||
if (count($filename_list))
|
||||
@ -266,6 +268,10 @@ class CMailFile
|
||||
if (isset($this->addr_cc) && $this->addr_cc) $out .= "Cc: ".$this->addr_cc."\n";
|
||||
if (isset($this->addr_bcc) && $this->addr_bcc) $out .= "Bcc: ".$this->addr_bcc."\n";
|
||||
if (isset($this->reply_to) && $this->reply_to) $out .= "Reply-To: ".$this->reply_to."\n";
|
||||
|
||||
//accusé réception
|
||||
if (isset($this->deliveryreceipt) && $this->deliveryreceipt == 1) $out .= "Disposition-Notification-To: ".$this->addr_from_email."\n";
|
||||
|
||||
// if($this->errors_to != "")
|
||||
//$out = $out . "Errors-to: ".$this->errors_to."\n";
|
||||
|
||||
|
||||
@ -408,7 +408,7 @@ if ($_POST["getcustomercode"] || $_POST["getsuppliercode"] ||
|
||||
// Assujeti TVA
|
||||
$html = new Form($db);
|
||||
print '<tr><td>'.$langs->trans('VATIsUsed').'</td><td colspan="3">';
|
||||
$html->select_assujetti_tva("1",'assujtva_value'); // Assujeti par défaut
|
||||
$html->select_YesNo("1",'assujtva_value'); // Assujeti par défaut
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
|
||||
@ -607,7 +607,7 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit')
|
||||
|
||||
// Assujeti TVA
|
||||
print '<tr><td>'.$langs->trans('VATIsUsed').'</td><td>';
|
||||
$form->select_assujetti_tva($soc->tva_assuj,'assujtva_value');
|
||||
$form->select_YesNo($soc->tva_assuj,'assujtva_value');
|
||||
print '</td>';
|
||||
|
||||
print '<td nowrap="nowrap">'.$langs->trans('VATIntraShort').'</td><td>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user