Fix: Bad space in predefined messages.

Fix: Signature was not added for email sent from thirdparty page.
This commit is contained in:
Laurent Destailleur 2014-02-19 15:33:04 +01:00
parent d7c9ebd5ee
commit 4915ec8916
5 changed files with 92 additions and 87 deletions

View File

@ -27,6 +27,8 @@ Fix: Enable extrafields for customer order, proposal and invoice lines. This fea
fix enough quickly for 3.5.0 release.
Fix: user right on Holiday for month report nor working.
Fix: [ bug #1250 ] "Supplier Ref. product" sidebar search box does not work
Fix: Bad space in predefined messages.
Fix: Signature was not added for email sent from thirdparty page.
***** ChangeLog for 3.5 compared to 3.4.* *****
For users:

View File

@ -76,7 +76,7 @@ class FormMail
* @param DoliDB $db Database handler
*/
function __construct($db)
{
{
$this->db = $db;
$this->withform=1;
@ -554,7 +554,8 @@ class FormMail
elseif ($this->param["models"]=='invoice_supplier_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendSupplierInvoice"); }
elseif ($this->param["models"]=='shipping_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendShipping"); }
elseif ($this->param["models"]=='fichinter_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendFichInter"); }
elseif (! is_numeric($this->withbody)) { $defaultmessage=$this->withbody; }
elseif ($this->param["models"]=='thirdparty') { $defaultmessage=$langs->transnoentities("PredefinedMailContentThirdparty"); }
elseif (! is_numeric($this->withbody)) { $defaultmessage=$this->withbody; }
// Complete substitution array
if (! empty($conf->paypal->enabled) && ! empty($conf->global->PAYPAL_ADD_PAYMENT_URL))
@ -576,14 +577,14 @@ class FormMail
}
$defaultmessage=str_replace('\n',"\n",$defaultmessage);
// Deal with format differences between message and signature (text / HTML)
if(dol_textishtml($defaultmessage) && !dol_textishtml($this->substit['__SIGNATURE__'])) {
$this->substit['__SIGNATURE__'] = dol_nl2br($this->substit['__SIGNATURE__']);
} else if(!dol_textishtml($defaultmessage) && dol_textishtml($this->substit['__SIGNATURE__'])) {
$defaultmessage = dol_nl2br($defaultmessage);
}
$defaultmessage=make_substitutions($defaultmessage,$this->substit);
if (isset($_POST["message"])) $defaultmessage=$_POST["message"];

View File

@ -49,14 +49,15 @@ Miscellaneous=Miscellaneous
NbOfActiveNotifications=Number of notifications
PredefinedMailTest=This is a test mail.\nThe two lines are separated by a carriage return.\n\n__SIGNATURE__
PredefinedMailTestHtml=This is a <b>test</b> mail (the word test must be in bold).<br>The two lines are separated by a carriage return.<br><br>__SIGNATURE__
PredefinedMailContentSendInvoice=__CONTACTCIVNAME__ \n\n You will find here the invoice __FACREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__ \n\n We would like to warn you that the invoice __FACREF__ seems to not being payed. So this is the invoice in attachment again, as a reminder.\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
PredefinedMailContentSendProposal=__CONTACTCIVNAME__ \n\n You will find here the commercial proposal __PROPREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
PredefinedMailContentSendOrder=__CONTACTCIVNAME__ \n\n You will find here the order __ORDERREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
PredefinedMailContentSendSupplierOrder=__CONTACTCIVNAME__ \n\n You will find here our order __ORDERREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
PredefinedMailContentSendSupplierInvoice=__CONTACTCIVNAME__ \n\n You will find here the invoice __FACREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
PredefinedMailContentSendShipping=__CONTACTCIVNAME__ \n\n You will find here the shipping __SHIPPINGREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
PredefinedMailContentSendFichInter=__CONTACTCIVNAME__ \n\n You will find here the intervention __FICHINTERREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
PredefinedMailContentSendInvoice=__CONTACTCIVNAME__\n\nYou will find here the invoice __FACREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__\n\nWe would like to warn you that the invoice __FACREF__ seems to not being payed. So this is the invoice in attachment again, as a reminder.\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
PredefinedMailContentSendProposal=__CONTACTCIVNAME__\n\nYou will find here the commercial proposal __PROPREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
PredefinedMailContentSendOrder=__CONTACTCIVNAME__\n\nYou will find here the order __ORDERREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
PredefinedMailContentSendSupplierOrder=__CONTACTCIVNAME__\n\nYou will find here our order __ORDERREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
PredefinedMailContentSendSupplierInvoice=__CONTACTCIVNAME__\n\nYou will find here the invoice __FACREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
PredefinedMailContentSendShipping=__CONTACTCIVNAME__\n\nYou will find here the shipping __SHIPPINGREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
PredefinedMailContentSendFichInter=__CONTACTCIVNAME__\n\nYou will find here the intervention __FICHINTERREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
PredefinedMailContentThirdparty=__CONTACTCIVNAME__\n\n__PERSONALIZED__\n\n__SIGNATURE__
DemoDesc=Dolibarr is a compact ERP/CRM composed by several functional modules. A demo that includes all modules does not mean anything as this never occurs. So, several demo profiles are available.
ChooseYourDemoProfil=Choose the demo profile that match your activity...
DemoFundation=Manage members of a foundation

View File

@ -49,14 +49,15 @@ Miscellaneous=Divers
NbOfActiveNotifications=Nombre de notifications
PredefinedMailTest=Ceci est un message de test.\nLes 2 lignes sont séparées par un retour à la ligne.\n\n__SIGNATURE__
PredefinedMailTestHtml=Ceci est un message de <b>test</b> (le mot test doit être en gras).<br>Les 2 lignes sont séparées par un retour à la ligne.<br><br>__SIGNATURE__
PredefinedMailContentSendInvoice=__CONTACTCIVNAME__ \n\n Veuillez trouver ci-joint la facture __FACREF__\n\n__PERSONALIZED__Cordialement\n\n__SIGNATURE__
PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__ \n\nNous voudrions porter à votre connaissance que la facture __FACREF__ ne semble pas avoir été réglée. La voici donc, pour rappel, en pièce jointe.\n\n__PERSONALIZED__Cordialement\n\n__SIGNATURE__
PredefinedMailContentSendProposal=__CONTACTCIVNAME__ \n\n Veuillez trouver ci-joint la proposition commerciale __PROPREF__\n\n__PERSONALIZED__Cordialement\n\n__SIGNATURE__
PredefinedMailContentSendOrder=__CONTACTCIVNAME__ \n\n Veuillez trouver ci-joint la commande __ORDERREF__\n\n__PERSONALIZED__Cordialement\n\n__SIGNATURE__
PredefinedMailContentSendSupplierOrder=__CONTACTCIVNAME__ \n\n Veuillez trouver ci-joint notre commande __ORDERREF__\n\n__PERSONALIZED__Cordialement\n\n__SIGNATURE__
PredefinedMailContentSendSupplierInvoice=__CONTACTCIVNAME__ \n\n Veuillez trouver ci-joint la facture __FACREF__\n\n__PERSONALIZED__Cordialement\n\n__SIGNATURE__
PredefinedMailContentSendShipping=__CONTACTCIVNAME__ \n\n Veuillez trouver ci-joint le bon d'expédition __SHIPPINGREF__\n\n__PERSONALIZED__Cordialement\n\n__SIGNATURE__
PredefinedMailContentSendFichInter=__CONTACTCIVNAME__ \n\n Veuillez trouver ci-joint la fiche d'intervention __FICHINTERREF__\n\n__PERSONALIZED__Cordialement\n\n__SIGNATURE__
PredefinedMailContentSendInvoice=__CONTACTCIVNAME__\n\nVeuillez trouver ci-joint la facture __FACREF__\n\n__PERSONALIZED__Cordialement\n\n__SIGNATURE__
PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__\n\nNous voudrions porter à votre connaissance que la facture __FACREF__ ne semble pas avoir été réglée. La voici donc, pour rappel, en pièce jointe.\n\n__PERSONALIZED__Cordialement\n\n__SIGNATURE__
PredefinedMailContentSendProposal=__CONTACTCIVNAME__\n\nVeuillez trouver ci-joint la proposition commerciale __PROPREF__\n\n__PERSONALIZED__Cordialement\n\n__SIGNATURE__
PredefinedMailContentSendOrder=__CONTACTCIVNAME__\n\nVeuillez trouver ci-joint la commande __ORDERREF__\n\n__PERSONALIZED__Cordialement\n\n__SIGNATURE__
PredefinedMailContentSendSupplierOrder=__CONTACTCIVNAME__\n\nVeuillez trouver ci-joint notre commande __ORDERREF__\n\n__PERSONALIZED__Cordialement\n\n__SIGNATURE__
PredefinedMailContentSendSupplierInvoice=__CONTACTCIVNAME__\n\nVeuillez trouver ci-joint la facture __FACREF__\n\n__PERSONALIZED__Cordialement\n\n__SIGNATURE__
PredefinedMailContentSendShipping=__CONTACTCIVNAME__\n\nVeuillez trouver ci-joint le bon d'expédition __SHIPPINGREF__\n\n__PERSONALIZED__Cordialement\n\n__SIGNATURE__
PredefinedMailContentSendFichInter=__CONTACTCIVNAME__\n\nVeuillez trouver ci-joint la fiche d'intervention __FICHINTERREF__\n\n__PERSONALIZED__Cordialement\n\n__SIGNATURE__
PredefinedMailContentThirdparty=__CONTACTCIVNAME__\n\n__PERSONALIZED__\n\n__SIGNATURE__
DemoDesc=Dolibarr est un logiciel de gestion d'activité (professionnelle ou associative) composé de modules fonctionnels indépendants et optionnels. Une démonstration qui inclut tous ces modules n'a pas de sens car les modules ne sont jamais tous utilisés en même temps. Aussi, plusieurs profils de démonstration type sont disponibles.
ChooseYourDemoProfil=Veuillez choisir le profil de démonstration qui correspond le mieux à votre activité…
DemoFundation=Gestion des adhérents d'une association

View File

@ -1826,7 +1826,7 @@ else
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>';
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->creer)
@ -1851,85 +1851,85 @@ else
if ($action == 'presend')
{
/*
* Affiche formulaire mail
*/
/*
* Affiche formulaire mail
*/
// By default if $action=='presend'
$titreform='SendMail';
$topicmail='';
$action='send';
$modelmail='thirdparty';
// By default if $action=='presend'
$titreform='SendMail';
$topicmail='';
$action='send';
$modelmail='thirdparty';
print '<br>';
print_titre($langs->trans($titreform));
print '<br>';
print_titre($langs->trans($titreform));
// Cree l'objet formulaire mail
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
$formmail->fromtype = 'user';
$formmail->fromid = $user->id;
$formmail->fromname = $user->getFullName($langs);
$formmail->frommail = $user->email;
$formmail->withfrom=1;
$formmail->withtopic=1;
$liste=array();
foreach ($object->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value;
$formmail->withto=GETPOST('sendto')?GETPOST('sendto'):$liste;
$formmail->withtofree=0;
$formmail->withtocc=$liste;
$formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC;
$formmail->withfile=2;
$formmail->withbody=1;
$formmail->withdeliveryreceipt=1;
$formmail->withcancel=1;
// Tableau des substitutions
$formmail->substit['__SIGNATURE__']=$user->signature;
$formmail->substit['__PERSONALIZED__']='';
$formmail->substit['__CONTACTCIVNAME__']='';
// Cree l'objet formulaire mail
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
$formmail->fromtype = 'user';
$formmail->fromid = $user->id;
$formmail->fromname = $user->getFullName($langs);
$formmail->frommail = $user->email;
$formmail->withfrom=1;
$formmail->withtopic=1;
$liste=array();
foreach ($object->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value;
$formmail->withto=GETPOST('sendto')?GETPOST('sendto'):$liste;
$formmail->withtofree=0;
$formmail->withtocc=$liste;
$formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC;
$formmail->withfile=2;
$formmail->withbody=1;
$formmail->withdeliveryreceipt=1;
$formmail->withcancel=1;
// Tableau des substitutions
$formmail->substit['__SIGNATURE__']=$user->signature;
$formmail->substit['__PERSONALIZED__']='';
$formmail->substit['__CONTACTCIVNAME__']='';
//Find the good contact adress
/*
$custcontact='';
$contactarr=array();
$contactarr=$object->liste_contact(-1,'external');
//Find the good contact adress
/*
$custcontact='';
$contactarr=array();
$contactarr=$object->liste_contact(-1,'external');
if (is_array($contactarr) && count($contactarr)>0)
{
foreach($contactarr as $contact)
{
if ($contact['libelle']==$langs->trans('TypeContact_facture_external_BILLING')) {
if (is_array($contactarr) && count($contactarr)>0)
{
foreach($contactarr as $contact)
{
if ($contact['libelle']==$langs->trans('TypeContact_facture_external_BILLING')) {
require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
$contactstatic=new Contact($db);
$contactstatic->fetch($contact['id']);
$custcontact=$contactstatic->getFullName($langs,1);
}
}
$contactstatic=new Contact($db);
$contactstatic->fetch($contact['id']);
$custcontact=$contactstatic->getFullName($langs,1);
}
}
if (!empty($custcontact)) {
$formmail->substit['__CONTACTCIVNAME__']=$custcontact;
}
}*/
if (!empty($custcontact)) {
$formmail->substit['__CONTACTCIVNAME__']=$custcontact;
}
}*/
// Tableau des parametres complementaires du post
$formmail->param['action']=$action;
$formmail->param['models']=$modelmail;
$formmail->param['socid']=$object->id;
$formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?socid='.$object->id;
// Tableau des parametres complementaires du post
$formmail->param['action']=$action;
$formmail->param['models']=$modelmail;
$formmail->param['socid']=$object->id;
$formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?socid='.$object->id;
// Init list of files
if (GETPOST("mode")=='init')
{
$formmail->clear_attached_files();
$formmail->add_attached_files($file,basename($file),dol_mimetype($file));
}
// Init list of files
if (GETPOST("mode")=='init')
{
$formmail->clear_attached_files();
$formmail->add_attached_files($file,basename($file),dol_mimetype($file));
}
$formmail->show_form();
$formmail->show_form();
print '<br>';
print '<br>';
}
else
{