Ajout possibilité de demander un accusé de réception 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'].'>';
|
$replyto = $_POST['replytoname']. ' <' . $_POST['replytomail'].'>';
|
||||||
$message = $_POST['message'];
|
$message = $_POST['message'];
|
||||||
$sendtocc = $_POST['sendtocc'];
|
$sendtocc = $_POST['sendtocc'];
|
||||||
|
$deliveryreceipt = $_POST['deliveryreceipt'];
|
||||||
|
|
||||||
if ($_POST['action'] == 'send')
|
if ($_POST['action'] == 'send')
|
||||||
{
|
{
|
||||||
@ -351,7 +352,7 @@ if ($_POST['action'] == 'send')
|
|||||||
$mimetype[1] = $_FILES['addedfile']['type'];
|
$mimetype[1] = $_FILES['addedfile']['type'];
|
||||||
}
|
}
|
||||||
// Envoi de la propal
|
// 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())
|
if ($mailfile->sendfile())
|
||||||
{
|
{
|
||||||
$msg='<div class="ok">'.$langs->trans('MailSuccessfulySent',$from,$sendto).'.</div>';
|
$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->withtopic=$langs->trans('SendPropalRef','__PROPREF__');
|
||||||
$formmail->withfile=1;
|
$formmail->withfile=1;
|
||||||
$formmail->withbody=1;
|
$formmail->withbody=1;
|
||||||
|
$formmail->withdeliveryreceipt=1;
|
||||||
// Tableau des substitutions
|
// Tableau des substitutions
|
||||||
$formmail->substit['__PROPREF__']=$propal->ref;
|
$formmail->substit['__PROPREF__']=$propal->ref;
|
||||||
// Tableau des paramètres complémentaires
|
// Tableau des paramètres complémentaires
|
||||||
|
|||||||
@ -475,6 +475,7 @@ if ($_POST['action'] == 'send')
|
|||||||
$replyto = $_POST['replytoname']. ' <' . $_POST['replytomail'].'>';
|
$replyto = $_POST['replytoname']. ' <' . $_POST['replytomail'].'>';
|
||||||
$message = $_POST['message'];
|
$message = $_POST['message'];
|
||||||
$sendtocc = $_POST['sendtocc'];
|
$sendtocc = $_POST['sendtocc'];
|
||||||
|
$deliveryreceipt = $_POST['deliveryreceipt'];
|
||||||
|
|
||||||
if ($_POST['action'] == 'send')
|
if ($_POST['action'] == 'send')
|
||||||
{
|
{
|
||||||
@ -507,7 +508,7 @@ if ($_POST['action'] == 'send')
|
|||||||
$mimetype[1] = $_FILES['addedfile']['type'];
|
$mimetype[1] = $_FILES['addedfile']['type'];
|
||||||
}
|
}
|
||||||
// Envoi de la commande
|
// 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())
|
if ($mailfile->sendfile())
|
||||||
{
|
{
|
||||||
$msg='<div class="ok">'.$langs->trans('MailSuccessfulySent',$from,$sendto).'.</div>';
|
$msg='<div class="ok">'.$langs->trans('MailSuccessfulySent',$from,$sendto).'.</div>';
|
||||||
@ -1761,6 +1762,7 @@ else
|
|||||||
$formmail->withtopic=$langs->trans('SendOrderRef','__ORDERREF__');
|
$formmail->withtopic=$langs->trans('SendOrderRef','__ORDERREF__');
|
||||||
$formmail->withfile=1;
|
$formmail->withfile=1;
|
||||||
$formmail->withbody=1;
|
$formmail->withbody=1;
|
||||||
|
$formmail->withdeliveryreceipt=1;
|
||||||
// Tableau des substitutions
|
// Tableau des substitutions
|
||||||
$formmail->substit['__ORDERREF__']=$commande->ref;
|
$formmail->substit['__ORDERREF__']=$commande->ref;
|
||||||
// Tableau des paramètres complémentaires
|
// Tableau des paramètres complémentaires
|
||||||
|
|||||||
@ -576,6 +576,7 @@ if ($_POST['action'] == 'send' || $_POST['action'] == 'relance')
|
|||||||
$replyto = $_POST['replytoname']. ' <' . $_POST['replytomail'].'>';
|
$replyto = $_POST['replytoname']. ' <' . $_POST['replytomail'].'>';
|
||||||
$message = $_POST['message'];
|
$message = $_POST['message'];
|
||||||
$sendtocc = $_POST['sendtocc'];
|
$sendtocc = $_POST['sendtocc'];
|
||||||
|
$deliveryreceipt = $_POST['deliveryreceipt'];
|
||||||
|
|
||||||
if ($_POST['action'] == 'send')
|
if ($_POST['action'] == 'send')
|
||||||
{
|
{
|
||||||
@ -619,7 +620,7 @@ if ($_POST['action'] == 'send' || $_POST['action'] == 'relance')
|
|||||||
$mimetype[1] = $_FILES['addedfile']['type'];
|
$mimetype[1] = $_FILES['addedfile']['type'];
|
||||||
|
|
||||||
// Envoi de la facture
|
// 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())
|
if ($mailfile->sendfile())
|
||||||
{
|
{
|
||||||
@ -2343,6 +2344,7 @@ else
|
|||||||
$formmail->withtopic=$langs->trans('SendBillRef','__FACREF__');
|
$formmail->withtopic=$langs->trans('SendBillRef','__FACREF__');
|
||||||
$formmail->withfile=1;
|
$formmail->withfile=1;
|
||||||
$formmail->withbody=1;
|
$formmail->withbody=1;
|
||||||
|
$formmail->withdeliveryreceipt=1;
|
||||||
// Tableau des substitutions
|
// Tableau des substitutions
|
||||||
$formmail->substit['__FACREF__']=$fac->ref;
|
$formmail->substit['__FACREF__']=$fac->ref;
|
||||||
// Tableau des paramètres complémentaires du post
|
// Tableau des paramètres complémentaires du post
|
||||||
@ -2397,6 +2399,7 @@ else
|
|||||||
$formmail->withtopic=$langs->trans('SendReminderBillRef','__FACREF__');
|
$formmail->withtopic=$langs->trans('SendReminderBillRef','__FACREF__');
|
||||||
$formmail->withfile=1;
|
$formmail->withfile=1;
|
||||||
$formmail->withbody=1;
|
$formmail->withbody=1;
|
||||||
|
$formmail->withdeliveryreceipt=1;
|
||||||
// Tableau des substitutions
|
// Tableau des substitutions
|
||||||
$formmail->substit['__FACREF__']=$fac->ref;
|
$formmail->substit['__FACREF__']=$fac->ref;
|
||||||
// Tableau des paramètres complémentaires
|
// Tableau des paramètres complémentaires
|
||||||
|
|||||||
@ -1063,11 +1063,11 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Retourne la liste des types de paiements possibles
|
* \brief Selection oui ou non
|
||||||
* \param selected Id du type de paiement présélectionné
|
* \param selected Id présélectionné
|
||||||
* \param htmlname Nom de la zone select
|
* \param htmlname Nom de la zone select
|
||||||
*/
|
*/
|
||||||
function select_assujetti_tva($selected='',$htmlname='')
|
function select_YesNo($selected='',$htmlname='')
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
print '<select class="flat" name="'.$htmlname.'">';
|
print '<select class="flat" name="'.$htmlname.'">';
|
||||||
|
|||||||
@ -58,6 +58,7 @@ class FormMail
|
|||||||
var $withtoreadonly;
|
var $withtoreadonly;
|
||||||
var $withtoccreadonly;
|
var $withtoccreadonly;
|
||||||
var $withtopicreadonly;
|
var $withtopicreadonly;
|
||||||
|
var $withdeliveryreceipt;
|
||||||
|
|
||||||
var $substit=array();
|
var $substit=array();
|
||||||
var $param=array();
|
var $param=array();
|
||||||
@ -85,6 +86,7 @@ class FormMail
|
|||||||
$this->withtoccreadonly=0;
|
$this->withtoccreadonly=0;
|
||||||
$this->withtopicreadonly=0;
|
$this->withtopicreadonly=0;
|
||||||
$this->withbodyreadonly=0;
|
$this->withbodyreadonly=0;
|
||||||
|
$this->withdeliveryreceiptreadonly=0;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -176,6 +178,22 @@ class FormMail
|
|||||||
}
|
}
|
||||||
print "</td></tr>\n";
|
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
|
// Topic
|
||||||
if ($this->withtopic)
|
if ($this->withtopic)
|
||||||
|
|||||||
@ -57,6 +57,7 @@ class CMailFile
|
|||||||
var $mime_headers;
|
var $mime_headers;
|
||||||
var $mime_boundary;
|
var $mime_boundary;
|
||||||
var $smtp_headers;
|
var $smtp_headers;
|
||||||
|
var $deliveryreceipt;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief CMailFile
|
\brief CMailFile
|
||||||
@ -72,7 +73,7 @@ class CMailFile
|
|||||||
*/
|
*/
|
||||||
function CMailFile($subject,$to,$from,$msg,
|
function CMailFile($subject,$to,$from,$msg,
|
||||||
$filename_list=array(),$mimetype_list=array(),$mimefilename_list=array(),
|
$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]");
|
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_to = $to;
|
||||||
$this->addr_cc = $addr_cc;
|
$this->addr_cc = $addr_cc;
|
||||||
$this->addr_bcc = $addr_bcc;
|
$this->addr_bcc = $addr_bcc;
|
||||||
|
$this->deliveryreceipt = $deliveryreceipt;
|
||||||
$this->smtp_headers = $this->write_smtpheaders();
|
$this->smtp_headers = $this->write_smtpheaders();
|
||||||
$this->text_body = $this->write_body($msg, $filename_list);
|
$this->text_body = $this->write_body($msg, $filename_list);
|
||||||
if (count($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_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->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";
|
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 != "")
|
// if($this->errors_to != "")
|
||||||
//$out = $out . "Errors-to: ".$this->errors_to."\n";
|
//$out = $out . "Errors-to: ".$this->errors_to."\n";
|
||||||
|
|
||||||
|
|||||||
@ -408,7 +408,7 @@ if ($_POST["getcustomercode"] || $_POST["getsuppliercode"] ||
|
|||||||
// Assujeti TVA
|
// Assujeti TVA
|
||||||
$html = new Form($db);
|
$html = new Form($db);
|
||||||
print '<tr><td>'.$langs->trans('VATIsUsed').'</td><td colspan="3">';
|
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";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
|
|
||||||
@ -607,7 +607,7 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit')
|
|||||||
|
|
||||||
// Assujeti TVA
|
// Assujeti TVA
|
||||||
print '<tr><td>'.$langs->trans('VATIsUsed').'</td><td>';
|
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>';
|
||||||
|
|
||||||
print '<td nowrap="nowrap">'.$langs->trans('VATIntraShort').'</td><td>';
|
print '<td nowrap="nowrap">'.$langs->trans('VATIntraShort').'</td><td>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user