From d114c5667267abd7a5350bf8864178bbd61d8ce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 15 Nov 2020 23:49:16 +0100 Subject: [PATCH 01/15] add a tag which list all other tags in odt user --- .../core/modules/user/doc/doc_generic_user_odt.modules.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php index 771231e6041..a6aac58182a 100644 --- a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php +++ b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php @@ -364,6 +364,12 @@ class doc_generic_user_odt extends ModelePDFUser $tmparray = array_merge($array_user, $array_soc, $array_thirdparty, $array_other, $array_thirdparty_contact); complete_substitutions_array($tmparray, $outputlangs, $object); + // to list all tags in odt template + $tags = ''; + foreach ($tmparray as $key => $value) { + $tags .= '{' . $key . '} => ' . $value ."\n"; + } + $tmparray = array_merge($tmparray, array('__ALL_TAGS__' => $tags)); $object->fetch_optionals(); // Call the ODTSubstitution hook $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray); From 4a1f61d759a0f6fccb9329e98fdaba20039b156c Mon Sep 17 00:00:00 2001 From: Tim Otte Date: Mon, 16 Nov 2020 11:12:43 +0100 Subject: [PATCH 02/15] Fix for #15423 --- htdocs/core/class/extrafields.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index b2f8905aba9..e68ef5420de 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -2025,7 +2025,7 @@ class ExtraFields $value_arr = GETPOST("options_".$key, 'alpha'); $value_key = price2num($value_arr); } elseif (in_array($key_type, array('html'))) { - $value_key = GETPOST("options_".$key, 'alpha'); + $value_key = GETPOST("options_".$key, 'none'); } elseif (in_array($key_type, array('text'))) { $value_key = GETPOST("options_".$key, 'alphanohtml'); } else { From 1abef27a1aadfb0634fbda395dc5d873deaa6329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 16 Nov 2020 13:52:35 +0100 Subject: [PATCH 03/15] fix delivery_date --- htdocs/fourn/class/fournisseur.commande.class.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 5f2771594de..7777245fec8 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -9,7 +9,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2018-2020 Frédéric France * Copyright (C) 2018 Ferran Marcet * * This program is free software; you can redistribute it and/or modify @@ -3107,8 +3107,11 @@ class CommandeFournisseur extends CommonOrder if (empty($this->delivery_date) && !empty($this->date_livraison)) $this->delivery_date = $this->date_livraison; // For backward compatibility - if (empty($this->delivery_date)) $text = $langs->trans("OrderDate").' '.dol_print_date($this->date_commande, 'day'); - else $text = $text = $langs->trans("DeliveryDate").' '.dol_print_date($this->date_delivery, 'day'); + if (empty($this->delivery_date)) { + $text = $langs->trans("OrderDate").' '.dol_print_date($this->date_commande, 'day'); + } else { + $text = $text = $langs->trans("DeliveryDate").' '.dol_print_date($this->delivery_date, 'day'); + } $text .= ' '.($conf->commande->fournisseur->warning_delay > 0 ? '+' : '-').' '.round(abs($conf->commande->fournisseur->warning_delay) / 3600 / 24, 1).' '.$langs->trans("days").' < '.$langs->trans("Today"); return $text; From 4ef4792469fcfc20f883f35b07af3927c2f88525 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 16 Nov 2020 13:57:59 +0100 Subject: [PATCH 04/15] Update fournisseur.commande.class.php --- htdocs/fourn/class/fournisseur.commande.class.php | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 7777245fec8..229bf0f0c08 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -121,7 +121,7 @@ class CommandeFournisseur extends CommonOrder public $date_livraison; /** - * Delivery date + * @var int Date expected for delivery */ public $delivery_date; @@ -132,16 +132,6 @@ class CommandeFournisseur extends CommonOrder public $total_ttc; public $source; - /** - * @deprecated - * @see $note_private, $note_public - */ - public $note; - - public $note_private; - public $note_public; - public $model_pdf; - /** * @var int ID */ From 5af557c9027f96a1e5bfe32a0905f5fe9eee2f52 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Mon, 16 Nov 2020 17:36:53 +0100 Subject: [PATCH 05/15] Fix supplier barcode should be same in fetch and fetch list. Refactor fourn to supplier for barcode --- .../fourn/class/fournisseur.product.class.php | 18 ++++++++++++++---- htdocs/product/fournisseurs.php | 10 +++++----- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 264e015298d..4f88e38e947 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -104,6 +104,16 @@ class ProductFournisseur extends Product public $fourn_multicurrency_price; public $fourn_multicurrency_unitprice; + /** + * @var string $supplier_barcode - Supplier barcode + */ + public $supplier_barcode; + + /** + * @var string $supplier_fk_barcode_type - Supplier barcode type + */ + public $supplier_fk_barcode_type; + /** * Constructor * @@ -537,8 +547,8 @@ class ProductFournisseur extends Product $this->fourn_multicurrency_id = $obj->fk_multicurrency; $this->fourn_multicurrency_code = $obj->multicurrency_code; if ($conf->barcode->enabled) { - $this->fourn_barcode = $obj->barcode; - $this->fourn_fk_barcode_type = $obj->fk_barcode_type; + $this->supplier_barcode = $obj->barcode; + $this->supplier_fk_barcode_type = $obj->fk_barcode_type; } if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) { @@ -651,8 +661,8 @@ class ProductFournisseur extends Product } if ($conf->barcode->enabled) { - $prodfourn->barcode = $record["barcode"]; - $prodfourn->fk_barcode_type = $record["fk_barcode_type"]; + $prodfourn->supplier_barcode = $record["barcode"]; + $prodfourn->supplier_fk_barcode_type = $record["fk_barcode_type"]; } if (!empty($conf->dynamicprices->enabled) && !empty($prodfourn->fk_supplier_price_expression)) { diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 5cb12b100f1..f3ac7afbd58 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -725,7 +725,7 @@ END; // Option to define a transport cost on supplier price print ''; print ''.$langs->trans('BarcodeValue').''; - print ''; + print ''; print ''; $formbarcode = new FormBarCode($db); @@ -733,7 +733,7 @@ END; print ''; print ''.$langs->trans('BarcodeType').''; print ''; - print $formbarcode->selectBarcodeType(($rowid ? $object->fourn_fk_barcode_type : $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE), 'fk_barcode_type', 1); + print $formbarcode->selectBarcodeType(($rowid ? $object->supplier_fk_barcode_type : $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE), 'fk_barcode_type', 1); print ''; print ''; } @@ -1071,16 +1071,16 @@ END; // Barcode if (!empty($arrayfields['pfp.barcode']['checked'])) { print ''; - print $productfourn->barcode; + print $productfourn->supplier_barcode; print ''; } // Barcode type if (!empty($arrayfields['pfp.fk_barcode_type']['checked'])) { print ''; - $productfourn->barcode_type = !empty($productfourn->fk_barcode_type) ? $productfourn->fk_barcode_type : 0; + $productfourn->barcode_type = !empty($productfourn->supplier_fk_barcode_type) ? $productfourn->supplier_fk_barcode_type : 0; $productfourn->fetch_barcode(); - print $productfourn->barcode_type_label ? $productfourn->barcode_type_label : ($productfourn->barcode ? '
'.$langs->trans("SetDefaultBarcodeType").'
' : ''); + print $productfourn->barcode_type_label ? $productfourn->barcode_type_label : ($productfourn->supplier_barcode ? '
'.$langs->trans("SetDefaultBarcodeType").'
' : ''); print ''; } From aed6afc3bff0386b343537e46a59cf8978ac455e Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Mon, 16 Nov 2020 17:37:38 +0100 Subject: [PATCH 06/15] doc for delivery_date --- htdocs/commande/class/commande.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 6eb61c0f983..6431f9a0487 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -182,10 +182,13 @@ class Commande extends CommonOrder /** * @var int Date expected for delivery - * @deprecated + * @deprecated Use delivery_date instead. */ - public $date_livraison; // deprecated; Use delivery_date instead. + public $date_livraison; + /** + * @var int Date expected for delivery + */ public $delivery_date; // Date expected of shipment (date starting shipment, not the reception that occurs some days after) /** From 3e491b68799242f74a5f661bf5dfe37018b2a883 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Mon, 16 Nov 2020 18:07:39 +0100 Subject: [PATCH 07/15] Revert "Fix supplier barcode should be same in fetch and fetch list." This reverts commit 5af557c9027f96a1e5bfe32a0905f5fe9eee2f52. --- .../fourn/class/fournisseur.product.class.php | 18 ++++-------------- htdocs/product/fournisseurs.php | 10 +++++----- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 4f88e38e947..264e015298d 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -104,16 +104,6 @@ class ProductFournisseur extends Product public $fourn_multicurrency_price; public $fourn_multicurrency_unitprice; - /** - * @var string $supplier_barcode - Supplier barcode - */ - public $supplier_barcode; - - /** - * @var string $supplier_fk_barcode_type - Supplier barcode type - */ - public $supplier_fk_barcode_type; - /** * Constructor * @@ -547,8 +537,8 @@ class ProductFournisseur extends Product $this->fourn_multicurrency_id = $obj->fk_multicurrency; $this->fourn_multicurrency_code = $obj->multicurrency_code; if ($conf->barcode->enabled) { - $this->supplier_barcode = $obj->barcode; - $this->supplier_fk_barcode_type = $obj->fk_barcode_type; + $this->fourn_barcode = $obj->barcode; + $this->fourn_fk_barcode_type = $obj->fk_barcode_type; } if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) { @@ -661,8 +651,8 @@ class ProductFournisseur extends Product } if ($conf->barcode->enabled) { - $prodfourn->supplier_barcode = $record["barcode"]; - $prodfourn->supplier_fk_barcode_type = $record["fk_barcode_type"]; + $prodfourn->barcode = $record["barcode"]; + $prodfourn->fk_barcode_type = $record["fk_barcode_type"]; } if (!empty($conf->dynamicprices->enabled) && !empty($prodfourn->fk_supplier_price_expression)) { diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index f3ac7afbd58..5cb12b100f1 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -725,7 +725,7 @@ END; // Option to define a transport cost on supplier price print ''; print ''.$langs->trans('BarcodeValue').''; - print ''; + print ''; print ''; $formbarcode = new FormBarCode($db); @@ -733,7 +733,7 @@ END; print ''; print ''.$langs->trans('BarcodeType').''; print ''; - print $formbarcode->selectBarcodeType(($rowid ? $object->supplier_fk_barcode_type : $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE), 'fk_barcode_type', 1); + print $formbarcode->selectBarcodeType(($rowid ? $object->fourn_fk_barcode_type : $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE), 'fk_barcode_type', 1); print ''; print ''; } @@ -1071,16 +1071,16 @@ END; // Barcode if (!empty($arrayfields['pfp.barcode']['checked'])) { print ''; - print $productfourn->supplier_barcode; + print $productfourn->barcode; print ''; } // Barcode type if (!empty($arrayfields['pfp.fk_barcode_type']['checked'])) { print ''; - $productfourn->barcode_type = !empty($productfourn->supplier_fk_barcode_type) ? $productfourn->supplier_fk_barcode_type : 0; + $productfourn->barcode_type = !empty($productfourn->fk_barcode_type) ? $productfourn->fk_barcode_type : 0; $productfourn->fetch_barcode(); - print $productfourn->barcode_type_label ? $productfourn->barcode_type_label : ($productfourn->supplier_barcode ? '
'.$langs->trans("SetDefaultBarcodeType").'
' : ''); + print $productfourn->barcode_type_label ? $productfourn->barcode_type_label : ($productfourn->barcode ? '
'.$langs->trans("SetDefaultBarcodeType").'
' : ''); print ''; } From fb5385180f39b9370acf8f94a39f177fa102fe62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 17 Nov 2020 11:54:18 +0100 Subject: [PATCH 08/15] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 18d98ffd8a0..e6a854405fd 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6660,6 +6660,14 @@ function complete_substitutions_array(&$substitutionarray, $outputlangs, $object } } } + if (!empty($conf->global->ODT_ENABLE_ALL_TAGS_IN_SUBSTITUTIONS) { + // to list all tags in odt template + $tags = ''; + foreach ($substitutionarray as $key => $value) { + $tags .= '{' . $key . '} => ' . $value ."\n"; + } + $substitutionarray = array_merge($substitutionarray, array('__ALL_TAGS__' => $tags)); + } } /** From fcfd630f8455a2a947285c1848ebaccc281fc310 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 17 Nov 2020 11:55:05 +0100 Subject: [PATCH 09/15] Update doc_generic_user_odt.modules.php --- .../core/modules/user/doc/doc_generic_user_odt.modules.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php index a6aac58182a..771231e6041 100644 --- a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php +++ b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php @@ -364,12 +364,6 @@ class doc_generic_user_odt extends ModelePDFUser $tmparray = array_merge($array_user, $array_soc, $array_thirdparty, $array_other, $array_thirdparty_contact); complete_substitutions_array($tmparray, $outputlangs, $object); - // to list all tags in odt template - $tags = ''; - foreach ($tmparray as $key => $value) { - $tags .= '{' . $key . '} => ' . $value ."\n"; - } - $tmparray = array_merge($tmparray, array('__ALL_TAGS__' => $tags)); $object->fetch_optionals(); // Call the ODTSubstitution hook $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray); From bf390ceb4d1e3701d242151d4f4152ac10fd925c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 17 Nov 2020 11:56:11 +0100 Subject: [PATCH 10/15] Update doc_generic_member_odt.class.php --- .../member/doc/doc_generic_member_odt.class.php | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php index cfa8c75ec11..6d2f2772610 100644 --- a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php +++ b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php @@ -322,11 +322,6 @@ class doc_generic_member_odt extends ModelePDFMember $tmparray = array_merge($array_member, $array_soc, $array_thirdparty, $array_other, $array_thirdparty_contact); complete_substitutions_array($tmparray, $outputlangs, $object); - $tags = ''; - foreach ($tmparray as $key => $value) { - $tags .= '{' . $key . '} => ' . $value ."\n"; - } - $tmparray = array_merge($tmparray, array('__ALL_TAGS__' => $tags)); // Call the ODTSubstitution hook $parameters = array( 'file'=>$file, @@ -352,12 +347,10 @@ class doc_generic_member_odt extends ModelePDFMember // Replace labels translated $tmparray = $outputlangs->get_translations_for_substitutions(); - foreach ($tmparray as $key=>$value) - { + foreach ($tmparray as $key=>$value) { try { $odfHandler->setVars($key, $value, true, 'UTF-8'); - } catch (OdfException $e) - { + } catch (OdfException $e) { dol_syslog($e->getMessage(), LOG_WARNING); } } From 3b1f50d5fc742113faa469fe505cef51095826b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 17 Nov 2020 11:58:11 +0100 Subject: [PATCH 11/15] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index e6a854405fd..08c137c1b4a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6660,7 +6660,7 @@ function complete_substitutions_array(&$substitutionarray, $outputlangs, $object } } } - if (!empty($conf->global->ODT_ENABLE_ALL_TAGS_IN_SUBSTITUTIONS) { + if (!empty($conf->global->ODT_ENABLE_ALL_TAGS_IN_SUBSTITUTIONS)) { // to list all tags in odt template $tags = ''; foreach ($substitutionarray as $key => $value) { From 73b35f334e1bbf31e512937fa0d55ea8ccf89ebd Mon Sep 17 00:00:00 2001 From: kamel Date: Wed, 18 Nov 2020 09:41:42 +0100 Subject: [PATCH 12/15] NEW: Add new option for displaying Contact email (or phones if not defined) and town info list (select list or combobox) Contacts will appear with a name format of "Dupond Durand - dupond.durand@email.com - Paris" or "Dupond Durand - 06 07 59 65 66 - Paris" instead of "Dupond Durand". --- htdocs/core/class/html.form.class.php | 31 ++++++++++++++++++++++---- htdocs/langs/en_US/admin.lang | 1 + htdocs/langs/fr_FR/admin.lang | 1 + htdocs/societe/admin/societe.php | 32 +++++++++++++++++++++++++++ 4 files changed, 61 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 092216e531f..cac64ea14ad 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1464,9 +1464,10 @@ class Form // We search third parties $sql = "SELECT sp.rowid, sp.lastname, sp.statut, sp.firstname, sp.poste"; + if (!empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) $sql.= ", sp.email, sp.phone, sp.phone_perso, sp.phone_mobile, sp.town AS contact_town, s.town AS company_town"; if ($showsoc > 0) $sql .= " , s.nom as company"; $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; - if ($showsoc > 0) $sql .= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid=sp.fk_soc"; + if ($showsoc > 0 || !empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) $sql .= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid=sp.fk_soc"; $sql .= " WHERE sp.entity IN (".getEntity('socpeople').")"; if ($socid > 0 || $socid == -1) $sql .= " AND sp.fk_soc=".$socid; if (!empty($conf->global->CONTACT_HIDE_INACTIVE_IN_COMBOBOX)) $sql .= " AND sp.statut <> 0"; @@ -1499,6 +1500,28 @@ class Form { $obj = $this->db->fetch_object($resql); + // Set email (or phones) and town extended infos + $extendedInfos = ''; + if (!empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) { + $extendedInfos = array(); + $email = trim($obj->email); + if (!empty($email)) $extendedInfos[] = $email; + else { + $phone = trim($obj->phone); + $phone_perso = trim($obj->phone_perso); + $phone_mobile = trim($obj->phone_mobile); + if (!empty($phone)) $extendedInfos[] = $phone; + if (!empty($phone_perso)) $extendedInfos[] = $phone_perso; + if (!empty($phone_mobile)) $extendedInfos[] = $phone_mobile; + } + $contact_town = trim($obj->contact_town); + $company_town = trim($obj->company_town); + if (!empty($contact_town)) $extendedInfos[] = $contact_town; + elseif (!empty($company_town)) $extendedInfos[] = $company_town; + $extendedInfos = implode(' - ', $extendedInfos); + if (!empty($extendedInfos)) $extendedInfos = ' - ' . $extendedInfos; + } + $contactstatic->id = $obj->rowid; $contactstatic->lastname = $obj->lastname; $contactstatic->firstname = $obj->firstname; @@ -1513,7 +1536,7 @@ class Form $out .= ''; @@ -1521,7 +1544,7 @@ class Form $out .= ''; @@ -1529,7 +1552,7 @@ class Form } else { if (in_array($obj->rowid, $selected)) { - $out .= $contactstatic->getFullName($langs); + $out .= $contactstatic->getFullName($langs) . $extendedInfos; if ($showfunction && $obj->poste) $out .= ' ('.$obj->poste.')'; if (($showsoc > 0) && $obj->company) $out .= ' - ('.$obj->company.')'; } diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index ac3fb07e796..dd8e6fe6538 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1314,6 +1314,7 @@ PHPModuleLoaded=PHP component %s is loaded PreloadOPCode=Preloaded OPCode is used AddRefInList=Display Customer/Vendor ref. info list (select list or combobox) and most of hyperlink.
Third Parties will appear with a name format of "CC12345 - SC45678 - The Big Company corp." instead of "The Big Company corp". AddAdressInList=Display Customer/Vendor adress info list (select list or combobox)
Third Parties will appear with a name format of "The Big Company corp. - 21 jump street 123456 Big town - USA" instead of "The Big Company corp". +AddEmailPhoneTownInContactList=Display Contact email (or phones if not defined) and town info list (select list or combobox)
Contacts will appear with a name format of "Dupond Durand - dupond.durand@email.com - Paris" or "Dupond Durand - 06 07 59 65 66 - Paris" instead of "Dupond Durand". AskForPreferredShippingMethod=Ask for preferred shipping method for Third Parties. FieldEdition=Edition of field %s FillThisOnlyIfRequired=Example: +2 (fill only if timezone offset problems are experienced) diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index d7842084c17..ffe9e6992b2 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -1276,6 +1276,7 @@ PHPModuleLoaded=Le composant PHP %s est chargé PreloadOPCode=Le code OP préchargé est utilisé AddRefInList=Afficher les références client/fournisseur dans les listes (listes déroulantes ou à autocomplétion) et les libellés des liens clicables.
Les tiers apparaîtront alors sous la forme "CC12345 - SC45678 - La big company coorp", au lieu de "La big company coorp". AddAdressInList=Affiche les informations sur l’adresse du client/fournisseur (liste de sélection ou liste déroulante)
Les tiers apparaîtront avec le format de nom suivant: "The Big Company corp. - 21, rue du saut 123456 Big town - USA" au lieu de "The Big Company corp". +AddEmailPhoneTownInContactList=Affiche les informations sur l’email (ou les telephones si non définie) et la ville du contact (liste de sélection ou liste déroulante)
Les contacts apparaîtront avec le format de nom suivant: "Dupond Durand - dupond.durand@email.com - Paris" ou "Dupond Durand - 06 07 59 65 66 - Paris" au lieu de "Dupond Durand". AskForPreferredShippingMethod=Demander la méthode d'expédition préférée pour les Tiers FieldEdition=Édition du champ %s FillThisOnlyIfRequired=Exemple: +2 (ne remplir que si un décalage d'heure est constaté dans l'export) diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index 4a9c40acd11..73f75ac4698 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -198,6 +198,21 @@ if ($action == "setaddadressinlist") { } } +//Activate Set email phone town in contact list +if ($action=="setaddemailphonetownincontactlist") { + $val = GETPOST('value', 'int'); + $res = dolibarr_set_const($db, "CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST", $val, 'yesno', 0, '', $conf->entity); + if (! $res > 0) $error++; + if (! $error) + { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } + else + { + setEventMessages($langs->trans("Error"), null, 'errors'); + } +} + //Activate Ask For Preferred Shipping Method if ($action == "setaskforshippingmet") { $setaskforshippingmet = GETPOST('value', 'int'); @@ -800,6 +815,23 @@ if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) print ''; print ''; +print ''; +print ''.$langs->trans("AddEmailPhoneTownInContactList").''; +print ' '; +print ''; +if (!empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) +{ + print ''; + print img_picto($langs->trans("Activated"), 'switch_on'); +} +else +{ + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); +} +print ''; +print ''; + if (!empty($conf->expedition->enabled)) { if (!empty($conf->global->MAIN_FEATURES_LEVEL)) { // Visible on experimental only because seems to not be implemented everywhere (only on proposal) print ''; From 709822635cc38021fc18b5478fae7e58cbd384d0 Mon Sep 17 00:00:00 2001 From: kamel Date: Wed, 18 Nov 2020 09:46:23 +0100 Subject: [PATCH 13/15] Correction Stickler CI --- htdocs/societe/admin/societe.php | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index 73f75ac4698..84c53494ce9 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -199,16 +199,13 @@ if ($action == "setaddadressinlist") { } //Activate Set email phone town in contact list -if ($action=="setaddemailphonetownincontactlist") { +if ($action == "setaddemailphonetownincontactlist") { $val = GETPOST('value', 'int'); $res = dolibarr_set_const($db, "CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST", $val, 'yesno', 0, '', $conf->entity); - if (! $res > 0) $error++; - if (! $error) - { + if (!$res > 0) $error++; + if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else - { + } else { setEventMessages($langs->trans("Error"), null, 'errors'); } } @@ -816,17 +813,14 @@ print ''; print ''; print ''; -print ''.$langs->trans("AddEmailPhoneTownInContactList").''; +print '' . $langs->trans("AddEmailPhoneTownInContactList") . ''; print ' '; print ''; -if (!empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) -{ - print ''; +if (!empty($conf->global->CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST)) { + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); -} -else -{ - print ''; +} else { + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); } print ''; From 1a21ace02d646a5c37962d4f431d54a35b014aea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Nov 2020 12:42:33 +0100 Subject: [PATCH 14/15] Update fournisseur.commande.class.php --- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 229bf0f0c08..6ac872d7555 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -3100,7 +3100,7 @@ class CommandeFournisseur extends CommonOrder if (empty($this->delivery_date)) { $text = $langs->trans("OrderDate").' '.dol_print_date($this->date_commande, 'day'); } else { - $text = $text = $langs->trans("DeliveryDate").' '.dol_print_date($this->delivery_date, 'day'); + $text = $langs->trans("DeliveryDate").' '.dol_print_date($this->delivery_date, 'day'); } $text .= ' '.($conf->commande->fournisseur->warning_delay > 0 ? '+' : '-').' '.round(abs($conf->commande->fournisseur->warning_delay) / 3600 / 24, 1).' '.$langs->trans("days").' < '.$langs->trans("Today"); From a5a7197506f86df76a1a6e082023db2b5bf582a2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Nov 2020 12:45:37 +0100 Subject: [PATCH 15/15] Update extrafields.class.php --- htdocs/core/class/extrafields.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index e68ef5420de..60ec9c6f6b4 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -2025,7 +2025,7 @@ class ExtraFields $value_arr = GETPOST("options_".$key, 'alpha'); $value_key = price2num($value_arr); } elseif (in_array($key_type, array('html'))) { - $value_key = GETPOST("options_".$key, 'none'); + $value_key = GETPOST("options_".$key, 'restricthtml'); } elseif (in_array($key_type, array('text'))) { $value_key = GETPOST("options_".$key, 'alphanohtml'); } else {