diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt
index cce6351950c..7ce22e790c3 100644
--- a/dev/dolibarr_changes.txt
+++ b/dev/dolibarr_changes.txt
@@ -168,6 +168,18 @@ In htdocs/includes/tecnickcom/tcpdf/tcpdf.php
- protected $default_monospaced_font = 'courier';
+ protected $default_monospaced_font = 'freemono';
+* In tecnickcom/tcpdf/include/tcpdf_static, in function intToRoman, right at the beginning
+ of the function, replace:
+
+ $roman = '';
+
+with:
+
+ $roman = '';
+ if ($number >= 4000) {
+ // do not represent numbers above 4000 in Roman numerals
+ return strval($number);
+ }
diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
index 602757522b2..816c07ece42 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -2846,6 +2846,16 @@ if (empty($reshook)) {
* View
*/
+if (empty($object->id)) {
+ llxHeader();
+ $head = facture_prepare_head($object);
+ $langs->load('errors');
+ echo dol_get_fiche_head($head, 'compta', $langs->trans("InvoiceCustomer"), -1, 'bill'),
+ '
' . $langs->trans("ErrorRecordNotFound") . '
';
+ llxFooter();
+ exit;
+}
+
$form = new Form($db);
$formother = new FormOther($db);
$formfile = new FormFile($db);
diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php
index 4381557cd28..230999f18fe 100644
--- a/htdocs/compta/facture/contact.php
+++ b/htdocs/compta/facture/contact.php
@@ -100,6 +100,16 @@ if ($action == 'addcontact' && $user->rights->facture->creer) {
* View
*/
+if (empty($object->id)) {
+ llxHeader();
+ $head = facture_prepare_head($object);
+ $langs->load('errors');
+ echo dol_get_fiche_head($head, 'contact', $langs->trans("InvoiceCustomer"), -1, 'bill'),
+ '' . $langs->trans("ErrorRecordNotFound") . '
';
+ llxFooter();
+ exit;
+}
+
$title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('ContactsAddresses');
$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes";
llxHeader('', $title, $helpurl);
diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php
index c9b6f9a39a8..c194f5dc997 100644
--- a/htdocs/compta/facture/document.php
+++ b/htdocs/compta/facture/document.php
@@ -92,6 +92,16 @@ include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
* View
*/
+if (empty($object->id)) {
+ llxHeader();
+ $head = facture_prepare_head($object);
+ $langs->load('errors');
+ echo dol_get_fiche_head($head, 'documents', $langs->trans("InvoiceCustomer"), -1, 'bill'),
+ '' . $langs->trans("ErrorRecordNotFound") . '
';
+ llxFooter();
+ exit;
+}
+
$title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Documents');
$help_url = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes";
diff --git a/htdocs/compta/facture/info.php b/htdocs/compta/facture/info.php
index 69322187e59..c38e9722267 100644
--- a/htdocs/compta/facture/info.php
+++ b/htdocs/compta/facture/info.php
@@ -62,6 +62,16 @@ $result = restrictedArea($user, 'facture', $object->id, '', '', 'fk_soc', $field
* View
*/
+if (empty($object->id)) {
+ llxHeader();
+ $head = facture_prepare_head($object);
+ $langs->load('errors');
+ echo dol_get_fiche_head($head, 'info', $langs->trans("InvoiceCustomer"), -1, 'bill'),
+ '' . $langs->trans("ErrorRecordNotFound") . '
';
+ llxFooter();
+ exit;
+}
+
$form = new Form($db);
$title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Info');
diff --git a/htdocs/compta/facture/note.php b/htdocs/compta/facture/note.php
index 40bb97fa236..8355d81fe0b 100644
--- a/htdocs/compta/facture/note.php
+++ b/htdocs/compta/facture/note.php
@@ -77,6 +77,16 @@ if (empty($reshook)) {
* View
*/
+if (empty($object->id)) {
+ llxHeader();
+ $head = facture_prepare_head($object);
+ $langs->load('errors');
+ echo dol_get_fiche_head($head, 'note', $langs->trans("InvoiceCustomer"), -1, 'bill'),
+ '' . $langs->trans("ErrorRecordNotFound") . '
';
+ llxFooter();
+ exit;
+}
+
$title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Notes');
$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes";
llxHeader('', $title, $helpurl);
diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php
index 9e9895444b8..62f2262e2d6 100644
--- a/htdocs/contact/card.php
+++ b/htdocs/contact/card.php
@@ -818,7 +818,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
print '';
print ' | ';
- print ''.$form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOST("no_email", 'int') : $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS), 1, false, ($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2)).' | ';
+ print '';
+ print $form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOST("no_email", 'int') : $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS), 1, false, ($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2));
+ print ' | ';
print '
';
}
@@ -1095,8 +1097,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
print '';
print ' | ';
+ print '';
$useempty = (isset($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS) && ($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2));
- print ' | '.$form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOST("no_email", 'int') : $object->no_email), 1, false, $useempty).' | ';
+ print $form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOST("no_email", 'int') : $object->no_email), 1, false, $useempty);
+ print '';
print '
';
}
@@ -1323,7 +1327,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
- print '| '.$langs->trans("No_Email").' | '.yn($object->no_email).' |
';
+ print '| '.$langs->trans("No_Email").' | ';
+ if ($object->email) {
+ print yn($object->no_email);
+ } else {
+ print ''.$langs->trans("EMailNotDefined").'';
+ }
+ print ' |
';
}
print '| '.$langs->trans("ContactVisibility").' | ';
diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php
index e005d6cfb1e..82a2161f89f 100644
--- a/htdocs/contact/list.php
+++ b/htdocs/contact/list.php
@@ -204,6 +204,12 @@ if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) {
$arrayfields['s.nom'] = array('label'=>"ThirdParty", 'position'=>25, 'checked'=>1);
}
+$arrayfields['unsubscribed'] = array(
+ 'label'=>'No_Email',
+ 'checked'=>0,
+ 'enabled'=>(!empty($conf->mailing->enabled)),
+ 'position'=>41);
+
if (!empty($conf->socialnetworks->enabled)) {
foreach ($socialnetworks as $key => $value) {
if ($value['active']) {
@@ -355,7 +361,7 @@ if ($resql) {
}
$sql = "SELECT s.rowid as socid, s.nom as name,";
-$sql .= " p.rowid, p.lastname as lastname, p.statut, p.firstname, p.address, p.zip, p.town, p.poste, p.email, p.no_email,";
+$sql .= " p.rowid, p.lastname as lastname, p.statut, p.firstname, p.address, p.zip, p.town, p.poste, p.email,";
$sql .= " p.socialnetworks, p.photo,";
$sql .= " p.phone as phone_pro, p.phone_mobile, p.phone_perso, p.fax, p.fk_pays, p.priv, p.datec as date_creation, p.tms as date_update,";
$sql .= " st.libelle as stcomm, st.picto as stcomm_picto, p.fk_stcommcontact as stcomm_id, p.fk_prospectcontactlevel,";
@@ -366,6 +372,9 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
}
}
+if (!empty($conf->mailing->enabled)) {
+ $sql .= ", (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = p.email) as unsubscribed";
+}
// Add fields from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
@@ -499,8 +508,11 @@ if (strlen($search_town)) {
if (count($search_roles) > 0) {
$sql .= " AND p.rowid IN (SELECT sc.fk_socpeople FROM ".MAIN_DB_PREFIX."societe_contacts as sc WHERE sc.fk_c_type_contact IN (".$db->sanitize(implode(',', $search_roles))."))";
}
-if ($search_no_email != '' && $search_no_email >= 0) {
- $sql .= " AND p.no_email = ".((int) $search_no_email);
+if ($search_no_email != -1 && $search_no_email > 0) {
+ $sql .= " AND (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = p.email) > 0";
+}
+if ($search_no_email != -1 && $search_no_email == 0) {
+ $sql .= " AND (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = p.email) = 0 AND p.email IS NOT NULL AND p.email <> ''";
}
if ($search_status != '' && $search_status >= 0) {
$sql .= " AND p.statut = ".((int) $search_status);
@@ -568,75 +580,75 @@ llxHeader('', $title, $help_url);
$param = '';
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
- $param .= '&contextpage='.$contextpage;
+ $param .= '&contextpage='.urlencode($contextpage);
}
if ($limit > 0 && $limit != $conf->liste_limit) {
- $param .= '&limit='.$limit;
+ $param .= '&limit='.((int) $limit);
}
-$param .= '&begin='.urlencode($begin).'&userid='.urlencode($userid).'&contactname='.urlencode($sall);
-$param .= '&type='.urlencode($type).'&view='.urlencode($view);
+$param .= '&begin='.urlencode($begin).'&userid='.urlencode($userid).'&contactname='.urlencode($sall);
+$param .= '&type='.urlencode($type).'&view='.urlencode($view);
if (!empty($search_categ) && $search_categ != '-1') {
- $param .= '&search_categ='.urlencode($search_categ);
+ $param .= '&search_categ='.urlencode($search_categ);
}
if (!empty($search_categ_thirdparty) && $search_categ_thirdparty != '-1') {
- $param .= '&search_categ_thirdparty='.urlencode($search_categ_thirdparty);
+ $param .= '&search_categ_thirdparty='.urlencode($search_categ_thirdparty);
}
if (!empty($search_categ_supplier) && $search_categ_supplier != '-1') {
- $param .= '&search_categ_supplier='.urlencode($search_categ_supplier);
+ $param .= '&search_categ_supplier='.urlencode($search_categ_supplier);
}
if ($sall != '') {
- $param .= '&sall='.urlencode($sall);
+ $param .= '&sall='.urlencode($sall);
}
if ($search_id > 0) {
- $param .= "&search_id=".urlencode($search_id);
+ $param .= "&search_id=".urlencode($search_id);
}
if ($search_lastname != '') {
- $param .= '&search_lastname='.urlencode($search_lastname);
+ $param .= '&search_lastname='.urlencode($search_lastname);
}
if ($search_firstname != '') {
- $param .= '&search_firstname='.urlencode($search_firstname);
+ $param .= '&search_firstname='.urlencode($search_firstname);
}
if ($search_societe != '') {
- $param .= '&search_societe='.urlencode($search_societe);
+ $param .= '&search_societe='.urlencode($search_societe);
}
if ($search_address != '') {
- $param .= '&search_address='.urlencode($search_address);
+ $param .= '&search_address='.urlencode($search_address);
}
if ($search_zip != '') {
- $param .= '&search_zip='.urlencode($search_zip);
+ $param .= '&search_zip='.urlencode($search_zip);
}
if ($search_town != '') {
- $param .= '&search_town='.urlencode($search_town);
+ $param .= '&search_town='.urlencode($search_town);
}
if ($search_country != '') {
$param .= "&search_country=".urlencode($search_country);
}
if ($search_poste != '') {
- $param .= '&search_poste='.urlencode($search_poste);
+ $param .= '&search_poste='.urlencode($search_poste);
}
if ($search_phone_pro != '') {
- $param .= '&search_phone_pro='.urlencode($search_phone_pro);
+ $param .= '&search_phone_pro='.urlencode($search_phone_pro);
}
if ($search_phone_perso != '') {
- $param .= '&search_phone_perso='.urlencode($search_phone_perso);
+ $param .= '&search_phone_perso='.urlencode($search_phone_perso);
}
if ($search_phone_mobile != '') {
- $param .= '&search_phone_mobile='.urlencode($search_phone_mobile);
+ $param .= '&search_phone_mobile='.urlencode($search_phone_mobile);
}
if ($search_fax != '') {
- $param .= '&search_fax='.urlencode($search_fax);
+ $param .= '&search_fax='.urlencode($search_fax);
}
if ($search_email != '') {
- $param .= '&search_email='.urlencode($search_email);
+ $param .= '&search_email='.urlencode($search_email);
}
if ($search_no_email != '') {
- $param .= '&search_no_email='.urlencode($search_no_email);
+ $param .= '&search_no_email='.urlencode($search_no_email);
}
if ($search_status != '') {
- $param .= '&search_status='.urlencode($search_status);
+ $param .= '&search_status='.urlencode($search_status);
}
if ($search_priv == '0' || $search_priv == '1') {
- $param .= "&search_priv=".urlencode($search_priv);
+ $param .= "&search_priv=".urlencode($search_priv);
}
if ($search_stcomm != '') {
$param .= '&search_stcomm='.urlencode($search_stcomm);
@@ -843,7 +855,7 @@ if (!empty($arrayfields['p.email']['checked'])) {
print '';
print ' | ';
}
-if (!empty($arrayfields['p.no_email']['checked'])) {
+if (!empty($arrayfields['unsubscribed']['checked'])) {
print '';
print $form->selectarray('search_no_email', array('-1'=>'', '0'=>$langs->trans('No'), '1'=>$langs->trans('Yes')), $search_no_email);
print ' | ';
@@ -965,8 +977,8 @@ if (!empty($arrayfields['p.fax']['checked'])) {
if (!empty($arrayfields['p.email']['checked'])) {
print_liste_field_titre($arrayfields['p.email']['label'], $_SERVER["PHP_SELF"], "p.email", $begin, $param, '', $sortfield, $sortorder);
}
-if (!empty($arrayfields['p.no_email']['checked'])) {
- print_liste_field_titre($arrayfields['p.no_email']['label'], $_SERVER["PHP_SELF"], "p.no_email", $begin, $param, '', $sortfield, $sortorder, 'center ');
+if (!empty($arrayfields['unsubscribed']['checked'])) {
+ print_liste_field_titre($arrayfields['unsubscribed']['label'], $_SERVER["PHP_SELF"], "unsubscribed", $begin, $param, '', $sortfield, $sortorder, 'center ');
}
if (!empty($conf->socialnetworks->enabled)) {
foreach ($socialnetworks as $key => $value) {
@@ -1155,8 +1167,14 @@ while ($i < min($num, $limit)) {
}
}
// No EMail
- if (!empty($arrayfields['p.no_email']['checked'])) {
- print ''.yn($obj->no_email).' | ';
+ if (!empty($arrayfields['unsubscribed']['checked'])) {
+ print '';
+ if (empty($obj->email)) {
+ //print ''.$langs->trans("NoEmail").'';
+ } else {
+ print yn(($obj->unsubscribed > 0) ? 1 : 0);
+ }
+ print ' | ';
if (!$i) {
$totalarray['nbfield']++;
}
diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php
index 2d41dfd9725..ef43f05b86a 100644
--- a/htdocs/core/modules/mailings/contacts1.modules.php
+++ b/htdocs/core/modules/mailings/contacts1.modules.php
@@ -79,8 +79,8 @@ class mailing_contacts1 extends MailingTargets
$statssql[0] .= " count(distinct(c.email)) as nb";
$statssql[0] .= " FROM ".MAIN_DB_PREFIX."socpeople as c";
$statssql[0] .= " WHERE c.entity IN (".getEntity('socpeople').")";
- $statssql[0] .= " AND c.email != ''"; // Note that null != '' is false
- $statssql[0] .= " AND c.no_email = 0";
+ $statssql[0] .= " AND c.email <> ''"; // Note that null != '' is false
+ $statssql[0] .= " AND (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = c.email) = 0";
$statssql[0] .= " AND c.statut = 1";
return $statssql;
@@ -103,8 +103,7 @@ class mailing_contacts1 extends MailingTargets
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as c";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = c.fk_soc";
$sql .= " WHERE c.entity IN (".getEntity('socpeople').")";
- $sql .= " AND c.email != ''"; // Note that null != '' is false
- $sql .= " AND c.no_email = 0";
+ $sql .= " AND c.email <> ''"; // Note that null != '' is false
$sql .= " AND (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = c.email) = 0";
// exclude unsubscribed users
$sql .= " AND c.statut = 1";
@@ -132,10 +131,9 @@ class mailing_contacts1 extends MailingTargets
$sql = "SELECT sp.poste, count(distinct(sp.email)) AS nb";
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as sp";
$sql .= " WHERE sp.entity IN (".getEntity('socpeople').")";
- /*$sql.= " AND sp.email != ''"; // Note that null != '' is false
- $sql.= " AND sp.no_email = 0";
- $sql.= " AND sp.statut = 1";*/
- $sql .= " AND (sp.poste IS NOT NULL AND sp.poste != '')";
+ $sql .= " AND sp.email <> ''"; // Note that null != '' is false
+ $sql .= " AND sp.statut = 1";
+ $sql .= " AND (sp.poste IS NOT NULL AND sp.poste <> '')";
$sql .= " GROUP BY sp.poste";
$sql .= " ORDER BY sp.poste";
$resql = $this->db->query($sql);
@@ -169,10 +167,9 @@ class mailing_contacts1 extends MailingTargets
$sql .= " ".MAIN_DB_PREFIX."socpeople as sp,";
$sql .= " ".MAIN_DB_PREFIX."categorie as c,";
$sql .= " ".MAIN_DB_PREFIX."categorie_contact as cs";
- $sql .= " WHERE sp.statut = 1"; // Note that null != '' is false
- //$sql.= " AND sp.no_email = 0";
- //$sql.= " AND sp.email != ''";
- //$sql.= " AND sp.entity IN (".getEntity('socpeople').")";
+ $sql .= " WHERE sp.entity IN (".getEntity('socpeople').")";
+ $sql .= " AND sp.email <> ''"; // Note that null != '' is false
+ $sql .= " AND sp.statut = 1";
$sql .= " AND cs.fk_categorie = c.rowid";
$sql .= " AND cs.fk_socpeople = sp.rowid";
$sql .= " GROUP BY c.label";
@@ -244,10 +241,9 @@ class mailing_contacts1 extends MailingTargets
$sql .= " ".MAIN_DB_PREFIX."socpeople as sp,";
$sql .= " ".MAIN_DB_PREFIX."categorie as c,";
$sql .= " ".MAIN_DB_PREFIX."categorie_societe as cs";
- $sql .= " WHERE sp.statut = 1"; // Note that null != '' is false
- //$sql.= " AND sp.no_email = 0";
- //$sql.= " AND sp.email != ''";
- //$sql.= " AND sp.entity IN (".getEntity('socpeople').")";
+ $sql .= " WHERE sp.entity IN (".getEntity('socpeople').")";
+ $sql .= " AND sp.email <> ''"; // Note that null != '' is false
+ $sql .= " AND sp.statut = 1";
$sql .= " AND cs.fk_categorie = c.rowid";
$sql .= " AND cs.fk_soc = sp.fk_soc";
$sql .= " GROUP BY c.label";
@@ -282,10 +278,9 @@ class mailing_contacts1 extends MailingTargets
$sql .= " ".MAIN_DB_PREFIX."socpeople as sp,";
$sql .= " ".MAIN_DB_PREFIX."categorie as c,";
$sql .= " ".MAIN_DB_PREFIX."categorie_fournisseur as cs";
- $sql .= " WHERE sp.statut = 1"; // Note that null != '' is false
- //$sql.= " AND sp.no_email = 0";
- //$sql.= " AND sp.email != ''";
- //$sql.= " AND sp.entity IN (".getEntity('socpeople').")";
+ $sql .= " WHERE sp.entity IN (".getEntity('socpeople').")";
+ $sql .= " AND sp.email <> ''"; // Note that null != '' is false
+ $sql .= " AND sp.statut = 1";
$sql .= " AND cs.fk_categorie = c.rowid";
$sql .= " AND cs.fk_soc = sp.fk_soc";
$sql .= " GROUP BY c.label";
@@ -391,7 +386,6 @@ class mailing_contacts1 extends MailingTargets
}
$sql .= " WHERE sp.entity IN (".getEntity('socpeople').")";
$sql .= " AND sp.email <> ''";
- $sql .= " AND sp.no_email = 0";
$sql .= " AND (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = sp.email) = 0";
// Exclude unsubscribed email adresses
$sql .= " AND sp.statut = 1";
diff --git a/htdocs/core/modules/mailings/modules_mailings.php b/htdocs/core/modules/mailings/modules_mailings.php
index afbf1e22481..9df8d44daf1 100644
--- a/htdocs/core/modules/mailings/modules_mailings.php
+++ b/htdocs/core/modules/mailings/modules_mailings.php
@@ -224,7 +224,7 @@ class MailingTargets // This can't be abstract as it is used for some method
$sql = "UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
$sql .= " SET statut=3";
- $sql .= " WHERE fk_mailing =" .((int) $mailing_id)." AND email IN (SELECT mu.email FROM ".MAIN_DB_PREFIX."mailing_unsubscribe AS mu WHERE mu.entity IN ('".getEntity('mailing')."'))";
+ $sql .= " WHERE fk_mailing = ".((int) $mailing_id)." AND email IN (SELECT mu.email FROM ".MAIN_DB_PREFIX."mailing_unsubscribe AS mu WHERE mu.entity IN ('".getEntity('mailing')."'))";
dol_syslog(__METHOD__.":mailing update status to display emails that do not want to be contacted anymore", LOG_DEBUG);
$result = $this->db->query($sql);
diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php
index 8937de62fdf..6bfe3a33dd7 100644
--- a/htdocs/delivery/class/delivery.class.php
+++ b/htdocs/delivery/class/delivery.class.php
@@ -395,7 +395,7 @@ class Delivery extends CommonObject
$error = 0;
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->delivery->creer))
- || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->delivery_advance->validate))) {
+ || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->delivery_advance->validate))) {
if (!empty($conf->global->DELIVERY_ADDON_NUMBER)) {
// Setting the command numbering module name
$modName = $conf->global->DELIVERY_ADDON_NUMBER;
@@ -610,7 +610,7 @@ class Delivery extends CommonObject
{
global $conf;
- $num = count($this->lines);
+ $num = count($this->lines);
$line = new DeliveryLine($this->db);
$line->origin_id = $origin_id;
@@ -736,8 +736,8 @@ class Delivery extends CommonObject
//if ($option !== 'nolink')
//{
- // Add param to save lastsearch_values or not
- $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
+ // Add param to save lastsearch_values or not
+ $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) {
$add_save_lastsearch_values = 1;
}
@@ -997,7 +997,7 @@ class Delivery extends CommonObject
$array[$i]['label'] = $objSourceLine->label ? $objSourceLine->label : $objSourceLine->description;
}
- $i++;
+ $i++;
}
return $array;
} else {
diff --git a/htdocs/langs/en_US/mails.lang b/htdocs/langs/en_US/mails.lang
index 033f86b63aa..22fe0696363 100644
--- a/htdocs/langs/en_US/mails.lang
+++ b/htdocs/langs/en_US/mails.lang
@@ -60,6 +60,7 @@ EMailTestSubstitutionReplacedByGenericValues=When using test mode, substitutions
MailingAddFile=Attach this file
NoAttachedFiles=No attached files
BadEMail=Bad value for Email
+EMailNotDefined=Email not defined
ConfirmCloneEMailing=Are you sure you want to clone this emailing?
CloneContent=Clone message
CloneReceivers=Cloner recipients
diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index 919931d34ce..dd4fd64a28c 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -1922,11 +1922,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '
| '.$langs->trans("CountryOrigin").' | ';
print '';
print img_picto('', 'globe-americas', 'class="paddingrightonly"');
- print $form->select_country($object->country_id, 'country_id', '', 0, 'minwidth100 maxwidthonsmartphone');
+ print $form->select_country(GETPOSTISSET('country_id') ? GETPOST('country_id', 'int') : $object->country_id, 'country_id', '', 0, 'minwidth100 maxwidthonsmartphone');
if ($user->admin) {
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
}
print ' |
';
+
// State
if (empty($conf->global->PRODUCT_DISABLE_STATE)) {
print '';
@@ -1937,7 +1938,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
print img_picto('', 'state', 'class="pictofixedwidth"');
- print $formcompany->select_state($object->state_id, $object->country_code);
+ print $formcompany->select_state(GETPOSTISSET('state_id') ? GETPOST('state_id', 'int') : $object->state_id, $object->country_code);
print '';
print '
';
}