diff --git a/COPYRIGHT b/COPYRIGHT index ed8a667acc8..7457542f060 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -52,6 +52,9 @@ http://www.fsf.org/licensing/licenses/index_html Copyright --------- +Copyright (C) 2015 +- Marcos García + Copyright (C) 2014 - Laurent Destailleur - Raphaël Doursenaud diff --git a/ChangeLog b/ChangeLog index 832ba002dce..679da75fd50 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,7 @@ English Dolibarr ChangeLog - Fix: [ bug #1801 ] FAC_FORCE_DATE_VALIDATION constant alters supplier invoice date given to numeration modules - Fix: [ bug #1802 ] SQL error when updating a task with PostgreSQL database - Fix: [ bug #1785 ] Start date is lost in Project > Linked objects +- Fix: [ bug #1804 ] SQL error when sending email without addresee ***** ChangeLog for 3.6.2 compared to 3.6.1 ***** - Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice. diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 4929ee9c70e..57d2508aefe 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -9,6 +9,7 @@ * Copyright (C) 2010-2011 Philippe Grand * Copyright (C) 2012-2013 Christophe Battarel * Copyright (C) 2013-2014 Florian Henry + * Copyright (C) 2015 Marcos García * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -404,20 +405,23 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G $langs->load('mails'); if ($object->id > 0) { + + $receiver = GETPOST('receiver'); + if ($_POST ['sendto']) { // Le destinataire a ete fourni via le champ libre $sendto = $_POST ['sendto']; $sendtoid = 0; - } elseif ($_POST ['receiver'] != '-1') { + } elseif ($receiver !== "") { // Recipient was provided from combo list - if ($_POST ['receiver'] == 'thirdparty') // Id of third party + if ($receiver == 'thirdparty') // Id of third party { $sendto = $object->client->email; $sendtoid = 0; - } else // Id du contact + } elseif ($receiver != '-1') // Id du contact { - $sendto = $object->client->contact_get_property($_POST ['receiver'], 'email'); - $sendtoid = $_POST ['receiver']; + $sendto = $object->client->contact_get_property($receiver, 'email'); + $sendtoid = $receiver; } }