From b76f055d2b0c0257c8a55d3fc8932b5f09ab18d4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Jul 2011 21:32:18 +0000 Subject: [PATCH] Fix: Select of recipient on email form --- htdocs/comm/propal.php | 10 +++++----- htdocs/commande/fiche.php | 10 +++++----- htdocs/compta/facture.php | 10 +++++----- htdocs/expedition/fiche.php | 10 +++++----- htdocs/fichinter/fiche.php | 14 +++++++------- htdocs/fourn/commande/fiche.php | 12 ++++++------ htdocs/fourn/facture/fiche.php | 10 +++++----- htdocs/lib/functions.lib.php | 19 +++++++++++-------- htdocs/societe/class/societe.class.php | 12 ++++++------ 9 files changed, 55 insertions(+), 52 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index fd08c7bc5f5..35d69e13cda 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -27,7 +27,7 @@ * \file htdocs/comm/propal.php * \ingroup propale * \brief Page of commercial proposals card and list - * \version $Id: propal.php,v 1.608 2011/07/04 10:30:02 eldy Exp $ + * \version $Id: propal.php,v 1.609 2011/07/07 21:32:22 eldy Exp $ */ require("../main.inc.php"); @@ -475,10 +475,10 @@ if ($_POST['action'] == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile'] $sendto = $_POST['sendto']; $sendtoid = 0; } - elseif ($_POST['receiver']) + elseif ($_POST['receiver'] != '-1') { - // Le destinataire a ete fourni via la liste deroulante - if ($_POST['receiver'] < 0) // Id du tiers + // Recipient was provided from combo list + if ($_POST['receiver'] == 'thirdparty') // Id of third party { $sendto = $object->client->email; $sendtoid = 0; @@ -1975,6 +1975,6 @@ else } $db->close(); -llxFooter('$Date: 2011/07/04 10:30:02 $ - $Revision: 1.608 $'); +llxFooter('$Date: 2011/07/07 21:32:22 $ - $Revision: 1.609 $'); ?> diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 896f166899b..35d5f47a393 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -26,7 +26,7 @@ * \file htdocs/commande/fiche.php * \ingroup commande * \brief Page to show customer order - * \version $Id: fiche.php,v 1.523 2011/07/02 16:48:32 eldy Exp $ + * \version $Id: fiche.php,v 1.524 2011/07/07 21:32:21 eldy Exp $ */ require("../main.inc.php"); @@ -993,10 +993,10 @@ if ($action == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile'] && ! $_P $sendto = $_POST['sendto']; $sendtoid = 0; } - elseif ($_POST['receiver']) + elseif ($_POST['receiver'] != '-1') { - // Le destinataire a ete fourni via la liste deroulante - if ($_POST['receiver'] < 0) // Id du tiers + // Recipient was provided from combo list + if ($_POST['receiver'] == 'thirdparty') // Id of third party { $sendto = $object->client->email; $sendtoid = 0; @@ -2134,5 +2134,5 @@ else $db->close(); -llxFooter('$Date: 2011/07/02 16:48:32 $ - $Revision: 1.523 $'); +llxFooter('$Date: 2011/07/07 21:32:21 $ - $Revision: 1.524 $'); ?> diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 75f62a178a3..4ec4d069d96 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -26,7 +26,7 @@ * \file htdocs/compta/facture.php * \ingroup facture * \brief Page to create/see an invoice - * \version $Id: facture.php,v 1.845 2011/07/02 17:02:00 eldy Exp $ + * \version $Id: facture.php,v 1.846 2011/07/07 21:32:20 eldy Exp $ */ require('../main.inc.php'); @@ -1234,10 +1234,10 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO $sendto = $_POST['sendto']; $sendtoid = 0; } - elseif ($_POST['receiver']) + elseif ($_POST['receiver'] != '-1') { - // Le destinataire a ete fourni via la liste deroulante - if ($_POST['receiver'] < 0) // Id du tiers + // Recipient was provided from combo list + if ($_POST['receiver'] == 'thirdparty') // Id of third party { $sendto = $object->client->email; $sendtoid = 0; @@ -3236,5 +3236,5 @@ else $db->close(); -llxFooter('$Date: 2011/07/02 17:02:00 $ - $Revision: 1.845 $'); +llxFooter('$Date: 2011/07/07 21:32:20 $ - $Revision: 1.846 $'); ?> diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index 4955f460ed0..4eda7ddacb4 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -25,7 +25,7 @@ * \file htdocs/expedition/fiche.php * \ingroup expedition * \brief Fiche descriptive d'une expedition - * \version $Id: fiche.php,v 1.208 2011/07/02 16:48:32 eldy Exp $ + * \version $Id: fiche.php,v 1.209 2011/07/07 21:32:19 eldy Exp $ */ require("../main.inc.php"); @@ -337,10 +337,10 @@ if ($action == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile'] && ! $_P $sendto = $_POST['sendto']; $sendtoid = 0; } - elseif ($_POST['receiver']) + elseif ($_POST['receiver'] != '-1') { - // Le destinataire a ete fourni via la liste deroulante - if ($_POST['receiver'] < 0) // Id du tiers + // Recipient was provided from combo list + if ($_POST['receiver'] == 'thirdparty') // Id of third party { $sendto = $object->client->email; $sendtoid = 0; @@ -1381,5 +1381,5 @@ else $db->close(); -llxFooter('$Date: 2011/07/02 16:48:32 $ - $Revision: 1.208 $'); +llxFooter('$Date: 2011/07/07 21:32:19 $ - $Revision: 1.209 $'); ?> diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index 304a7c9b087..f5458cec70e 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -23,7 +23,7 @@ * \file htdocs/fichinter/fiche.php * \brief Fichier fiche intervention * \ingroup ficheinter - * \version $Id: fiche.php,v 1.168 2011/07/07 15:54:02 simnandez Exp $ + * \version $Id: fiche.php,v 1.169 2011/07/07 21:32:20 eldy Exp $ */ require("../main.inc.php"); @@ -467,10 +467,10 @@ if ($action == 'send' && ! $_POST['cancel'] && (empty($conf->global->MAIN_USE_AD $sendto = $_POST['sendto']; $sendtoid = 0; } - elseif ($_POST['receiver']) + elseif ($_POST['receiver'] != '-1') { - // Le destinataire a ete fourni via la liste deroulante - if ($_POST['receiver'] < 0) // Id du tiers + // Recipient was provided from combo list + if ($_POST['receiver'] == 'thirdparty') // Id of third party { $sendto = $object->client->email; $sendtoid = 0; @@ -482,7 +482,7 @@ if ($action == 'send' && ! $_POST['cancel'] && (empty($conf->global->MAIN_USE_AD } } - if (strlen($sendto)) + if (dol_strlen($sendto)) { $langs->load("commercial"); @@ -1170,7 +1170,7 @@ elseif ($fichinterid) * Linked object block */ $somethingshown=$object->showLinkedObjectBlock(); - + print ''; // List of actions on element include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'); @@ -1184,5 +1184,5 @@ elseif ($fichinterid) $db->close(); -llxFooter('$Date: 2011/07/07 15:54:02 $ - $Revision: 1.168 $'); +llxFooter('$Date: 2011/07/07 21:32:20 $ - $Revision: 1.169 $'); ?> diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index 72894a685c4..e634bbb50b1 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -25,7 +25,7 @@ * \file htdocs/fourn/commande/fiche.php * \ingroup supplier, order * \brief Card supplier order - * \version $Id: fiche.php,v 1.230 2011/07/02 16:48:32 eldy Exp $ + * \version $Id: fiche.php,v 1.231 2011/07/07 21:32:21 eldy Exp $ */ require("../../main.inc.php"); @@ -624,10 +624,10 @@ if ($action == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile'] && ! $_P $sendto = $_POST['sendto']; $sendtoid = 0; } - elseif ($_POST['receiver']) - { - // Le destinataire a ete fourni via la liste deroulante - if ($_POST['receiver'] < 0) // Id du tiers + elseif ($_POST['receiver'] != '-1') + { + // Recipient was provided from combo list + if ($_POST['receiver'] == 'thirdparty') // Id of third party { $sendto = $object->client->email; $sendtoid = 0; @@ -1545,5 +1545,5 @@ if ($id > 0 || ! empty($ref)) $db->close(); -llxFooter('$Date: 2011/07/02 16:48:32 $ - $Revision: 1.230 $'); +llxFooter('$Date: 2011/07/07 21:32:21 $ - $Revision: 1.231 $'); ?> diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 561e484a7ba..027f32a4c98 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -25,7 +25,7 @@ * \file htdocs/fourn/facture/fiche.php * \ingroup facture, fournisseur * \brief Page for supplier invoice card (view, edit, validate) - * \version $Id: fiche.php,v 1.259 2011/07/02 16:48:32 eldy Exp $ + * \version $Id: fiche.php,v 1.260 2011/07/07 21:32:19 eldy Exp $ */ require("../../main.inc.php"); @@ -677,10 +677,10 @@ if ($_POST['action'] == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile'] $sendto = $_POST['sendto']; $sendtoid = 0; } - elseif ($_POST['receiver']) + elseif ($_POST['receiver'] != '-1') { - // Le destinataire a ete fourni via la liste deroulante - if ($_POST['receiver'] < 0) // Id du tiers + // Recipient was provided from combo list + if ($_POST['receiver'] == 'thirdparty') // Id of third party { $sendto = $facturefourn->client->email; $sendtoid = 0; @@ -1916,5 +1916,5 @@ else $db->close(); -llxFooter('$Date: 2011/07/02 16:48:32 $ - $Revision: 1.259 $'); +llxFooter('$Date: 2011/07/07 21:32:19 $ - $Revision: 1.260 $'); ?> diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index 51d16e3050e..2db326cda21 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -29,7 +29,7 @@ * \file htdocs/lib/functions.lib.php * \brief A set of functions for Dolibarr * This file contains all frequently used functions. - * \version $Id: functions.lib.php,v 1.542 2011/07/06 22:42:34 eldy Exp $ + * \version $Id: functions.lib.php,v 1.543 2011/07/07 21:32:18 eldy Exp $ */ // For compatibility during upgrade @@ -3893,15 +3893,18 @@ function dol_htmloutput_mesg($mesgstring='',$mesgarray='', $style='ok', $keepemb $mesgstring=preg_replace('/
/','',$mesgstring); $mesgstring=preg_replace('/<\/div>/','',$mesgstring); // Remove div from texts array - $newmesgarray=array(); - foreach($mesgarray as $val) + if (is_array($mesgarray)) { - $tmpmesgstring=preg_replace('/<\/div>
/','
',$val); - $tmpmesgstring=preg_replace('/
/','',$tmpmesgstring); - $tmpmesgstring=preg_replace('/<\/div>/','',$tmpmesgstring); - $newmesgarray[]=$tmpmesgstring; + $newmesgarray=array(); + foreach($mesgarray as $val) + { + $tmpmesgstring=preg_replace('/<\/div>
/','
',$val); + $tmpmesgstring=preg_replace('/
/','',$tmpmesgstring); + $tmpmesgstring=preg_replace('/<\/div>/','',$tmpmesgstring); + $newmesgarray[]=$tmpmesgstring; + } + $mesgarray=$newmesgarray; } - $mesgarray=$newmesgarray; print get_htmloutput_mesg($mesgstring,$mesgarray,'error',$keepembedded); } else print get_htmloutput_mesg($mesgstring,$mesgarray,'ok',$keepembedded); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 3fa88052e4d..7099b6cc22f 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -27,7 +27,7 @@ * \file htdocs/societe/class/societe.class.php * \ingroup societe * \brief File for third party class - * \version $Id: societe.class.php,v 1.90 2011/07/06 05:08:52 hregis Exp $ + * \version $Id: societe.class.php,v 1.91 2011/07/07 21:32:21 eldy Exp $ */ require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"); @@ -384,7 +384,7 @@ class Societe extends CommonObject $objectstatic->fetch($id); $this->oldobject = $objectstatic; } - + $now=dol_now(); // Clean parameters @@ -1534,14 +1534,14 @@ class Societe extends CommonObject { global $langs; - $contact_email = $this->contact_property_array('email'); + $contact_emails = $this->contact_property_array('email'); if ($this->email) { if (empty($this->name)) $this->name=$this->nom; // TODO: Tester si email non deja present dans tableau contact - $contact_email[-1]=$langs->trans("ThirdParty").': '.dol_trunc($this->name,16)." <".$this->email.">"; + $contact_emails['thirdparty']=$langs->trans("ThirdParty").': '.dol_trunc($this->name,16)." <".$this->email.">"; } - return $contact_email; + return $contact_emails; } /** @@ -1557,7 +1557,7 @@ class Societe extends CommonObject { if (empty($this->name)) $this->name=$this->nom; // TODO: Tester si tel non deja present dans tableau contact - $contact_phone[-1]=$langs->trans("ThirdParty").': '.dol_trunc($this->name,16)." <".$this->tel.">"; + $contact_phone['thirdparty']=$langs->trans("ThirdParty").': '.dol_trunc($this->name,16)." <".$this->tel.">"; } return $contact_phone; }