Package: dolibarr
Version: 3.5.5+dfsg1-1
Severity: normal
Tags: upstream patch

Dear Maintainer,

The form to send an invoice by email allows choosing the recipient of the
email, with a free-form text field or via a drop-down menu.  A similar choice
exists for the second recipient (Cc:).  However, picking an option from the
drop-down menu for Cc: is silently ignored, and only the text field is taken
into account.

The problem also exists for the form to send a quotation by email.

Attached is a patch fixing both bugs.  I suggest sending it upstream and
including it in debian/patches until it gets merged upstream.

Thanks,

Roland.

-- System Information:
Debian Release: 8.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-4-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages dolibarr depends on:
ii  fonts-dejavu-core    2.34-1
ii  libapache2-mod-php5  5.6.7+dfsg-1
ii  libfpdi-php          1.4.1-1
ii  libjs-flot           0.8.2+dfsg-1
ii  libjs-jquery         1.7.2+dfsg-3.2
ii  libjs-jquery-cookie  10-1
ii  libjs-jquery-ui      1.10.1+dfsg-1
ii  libnusoap-php        0.9.5-2
ii  libphp-adodb         5.15-1
ii  php-mail-mime        1.8.9-1
ii  php-pclzip           2.8.2-3
ii  php-pear             5.6.7+dfsg-1
ii  php-tcpdf            6.0.093+dfsg-1
ii  php5                 5.6.7+dfsg-1
ii  php5-cli             5.6.7+dfsg-1
ii  php5-curl            5.6.7+dfsg-1
ii  php5-gd              5.6.7+dfsg-1
ii  php5-ldap            5.6.7+dfsg-1
ii  php5-mysql           5.6.7+dfsg-1
ii  ttf-dejavu-core      2.34-1
ii  xdg-utils            1.1.0~rc1+git20111210-7.4

Versions of packages dolibarr recommends:
ii  apache2 [httpd]                  2.4.10-10
ii  mysql-client-5.5 [mysql-client]  5.5.43-0+deb8u1
ii  mysql-server                     5.5.43-0+deb8u1

Versions of packages dolibarr suggests:
pn  php5-geoip   <none>
pn  www-browser  <none>

-- no debconf information

-- debsums errors found:
debsums: changed file /usr/share/dolibarr/htdocs/comm/propal.php (from dolibarr 
package)
debsums: changed file /usr/share/dolibarr/htdocs/compta/facture.php (from 
dolibarr package)
debsums: changed file /usr/share/dolibarr/htdocs/core/class/CMailFile.class.php 
(from dolibarr package)
debsums: changed file /usr/share/dolibarr/htdocs/langs/fr_FR/bills.lang (from 
dolibarr package)
--- /tmp/tmp.ip8gzXuk8X/dolibarr_3.5.5+dfsg1-1_all/usr/share/dolibarr/htdocs/comm/propal.php	2014-10-03 19:04:41.000000000 +0200
+++ /usr/share/dolibarr/htdocs/comm/propal.php	2015-05-22 09:06:19.418887266 +0200
@@ -492,18 +492,38 @@
 				$sendto = $object->client->contact_get_property($_POST['receiver'],'email');
 				$sendtoid = $_POST['receiver'];
 			}
 		}
 
+        if ($_POST['sendtocc'])
+            {
+                // Le destinataire a ete fourni via le champ libre
+                $sendtocc = $_POST['sendtocc'];
+                $sendtoccid = 0;
+            }
+        elseif ($_POST['receivercc'] != '-1')
+            {
+                // Recipient was provided from combo list
+                if ($_POST['receivercc'] == 'thirdparty') // Id of third party
+                    {
+                        $sendtocc = $object->client->email;
+                        $sendtoccid = 0;
+                    }
+                else    // Id du contact
+                    {
+                        $sendtocc = $object->client->contact_get_property($_POST['receivercc'],'email');
+                        $sendtoccid = $_POST['receivercc'];
+                    }
+            }
+
 		if (dol_strlen($sendto))
 		{
 			$langs->load("commercial");
 
 			$from = $_POST['fromname'] . ' <' . $_POST['frommail'] .'>';
 			$replyto = $_POST['replytoname']. ' <' . $_POST['replytomail'].'>';
 			$message = $_POST['message'];
-			$sendtocc = $_POST['sendtocc'];
 			$deliveryreceipt = $_POST['deliveryreceipt'];
 
 			if (dol_strlen($_POST['subject'])) $subject = $_POST['subject'];
 			else $subject = $langs->transnoentities('Propal').' '.$object->ref;
 			$actiontypecode='AC_PROP';
--- /tmp/tmp.ip8gzXuk8X/dolibarr_3.5.5+dfsg1-1_all/usr/share/dolibarr/htdocs/compta/facture.php	2014-10-03 19:04:41.000000000 +0200
+++ /usr/share/dolibarr/htdocs/compta/facture.php	2015-04-10 20:29:40.861976693 +0200
@@ -1710,18 +1710,39 @@
 				$sendto = $object->client->contact_get_property($_POST['receiver'],'email');
 				$sendtoid = $_POST['receiver'];
 			}
 		}
 
+if ($_POST['sendtocc'])
+{
+        // Le destinataire a ete fourni via le champ libre
+        $sendtocc = $_POST['sendtocc'];
+        $sendtoccid = 0;
+}
+elseif ($_POST['receivercc'] != '-1')
+{
+        // Recipient was provided from combo list
+        if ($_POST['receivercc'] == 'thirdparty') // Id of third party
+        {
+                $sendtocc = $object->client->email;
+                $sendtoccid = 0;
+        }
+        else    // Id du contact
+        {
+                $sendtocc = $object->client->contact_get_property($_POST['receivercc'],'email');
+                $sendtoccid = $_POST['receivercc'];
+        }
+}
+
+
 		if (dol_strlen($sendto))
 		{
 			$langs->load("commercial");
 
 			$from = $_POST['fromname'] . ' <' . $_POST['frommail'] .'>';
 			$replyto = $_POST['replytoname']. ' <' . $_POST['replytomail'].'>';
 			$message = $_POST['message'];
-			$sendtocc = $_POST['sendtocc'];
 			$deliveryreceipt = $_POST['deliveryreceipt'];
 
 			if ($action == 'send')
 			{
 				if (dol_strlen($_POST['subject'])) $subject = $_POST['subject'];

Reply via email to