diff --git a/dev/resources/iso-normes/address_format.txt b/dev/resources/iso-normes/address_format.txt
index cc3b23285c8..d87e90e79b5 100644
--- a/dev/resources/iso-normes/address_format.txt
+++ b/dev/resources/iso-normes/address_format.txt
@@ -1 +1,4 @@
-http://bitboost.com/ref/international-address-formats.html#Formats
\ No newline at end of file
+https://bitboost.com/ref/international-address-formats.html#Formats
+
+https://www.upu.int/en/Postal-Solutions/Programmes-Services/Addressing-Solutions
+
diff --git a/dev/resources/iso-normes/code_nace.txt b/dev/resources/iso-normes/code_nace.txt
index 0c490bd4bf1..a07e3a76b31 100644
--- a/dev/resources/iso-normes/code_nace.txt
+++ b/dev/resources/iso-normes/code_nace.txt
@@ -1 +1,5 @@
-http://ec.europa.eu/eurostat/ramon/nomenclatures/index.cfm?TargetUrl=LST_CLS_DLD&StrNom=NACE_REV2&StrLanguageCode=FR&StrLayoutCode=#
\ No newline at end of file
+NACE
+
+https://ec.europa.eu/eurostat/ramon/nomenclatures/index.cfm?TargetUrl=LST_CLS_DLD&StrNom=NACE_REV2&StrLanguageCode=EN&StrLayoutCode=
+
+https://en.wikipedia.org/wiki/Statistical_Classification_of_Economic_Activities_in_the_European_Community
diff --git a/dev/resources/iso-normes/countries_iso-3166_en.txt b/dev/resources/iso-normes/countries_iso-3166_en.txt
index b953435d1c9..d6624026963 100644
--- a/dev/resources/iso-normes/countries_iso-3166_en.txt
+++ b/dev/resources/iso-normes/countries_iso-3166_en.txt
@@ -3,11 +3,12 @@
# The list is updated whenever a change to the official code list in ISO 3166-1 is effected by the ISO 3166/MA.
# It lists 240 official short names and code elements. One line of text contains one entry.
# A country name and its code element are separated by a semicolon (;).
-# http://www.iso.org/iso/fr/iso3166_en_code_lists.txt
+# https://www.iso.org/iso-3166-country-codes.html
-# ISO-3166: http://en.wikipedia.org/wiki/ISO_3166-1
-# ISO-3166 alpha 2: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
-# ISO-3166 alpha 3: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-3
+# https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes
+# ISO-3166: https://en.wikipedia.org/wiki/ISO_3166-1
+# ISO-3166 alpha 2: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
+# ISO-3166 alpha 3: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3
AFGHANISTAN;AF
ÅLAND ISLANDS;AX
@@ -254,4 +255,4 @@ WALLIS AND FUTUNA;WF
WESTERN SAHARA;EH
YEMEN;YE
ZAMBIA;ZM
-ZIMBABWE;ZW
\ No newline at end of file
+ZIMBABWE;ZW
diff --git a/dev/resources/iso-normes/countries_iso-3166_fr.txt b/dev/resources/iso-normes/countries_iso-3166_fr.txt
index 578c0f0effe..532b73ef47e 100644
--- a/dev/resources/iso-normes/countries_iso-3166_fr.txt
+++ b/dev/resources/iso-normes/countries_iso-3166_fr.txt
@@ -3,11 +3,12 @@
# The list is updated whenever a change to the official code list in ISO 3166-1 is effected by the ISO 3166/MA.
# It lists 240 official short names and code elements. One line of text contains one entry.
# A country name and its code element are separated by a semicolon (;).
-# http://www.iso.org/iso/fr/iso3166_fr_code_lists.txt
+# https://www.iso.org/fr/iso-3166-country-codes.html
-# ISO-3166: http://en.wikipedia.org/wiki/ISO_3166-1
-# ISO-3166 alpha 2: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
-# ISO-3166 alpha 3: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-3
+# https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes
+# ISO-3166: https://fr.wikipedia.org/wiki/ISO_3166-1
+# ISO-3166 alpha 2: https://fr.wikipedia.org/wiki/ISO_3166-1_alpha-2
+# ISO-3166 alpha 3: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3
AFGHANISTAN;AF
AFRIQUE DU SUD;ZA
@@ -254,4 +255,4 @@ VIET NAM;VN
WALLIS ET FUTUNA;WF
YÉMEN;YE
ZAMBIE;ZM
-ZIMBABWE;ZW
\ No newline at end of file
+ZIMBABWE;ZW
diff --git a/dev/resources/iso-normes/vat_number_names.txt b/dev/resources/iso-normes/vat_number_names.txt
index 23fce59ed3b..b1e8d469ec8 100644
--- a/dev/resources/iso-normes/vat_number_names.txt
+++ b/dev/resources/iso-normes/vat_number_names.txt
@@ -1 +1,7 @@
-http://en.wikipedia.org/wiki/VAT_identification_number
\ No newline at end of file
+https://en.wikipedia.org/wiki/VAT_identification_number
+
+terms
+(en) VAT = Value Added Tax
+(fr) TVA = Taxe sur la Valeur Ajouté
+(es) NIF / CIF
+(de) USt / MwSt
diff --git a/dev/resources/iso-normes/world_tax_rates.txt b/dev/resources/iso-normes/world_tax_rates.txt
index 740062288dc..c007474e5fd 100644
--- a/dev/resources/iso-normes/world_tax_rates.txt
+++ b/dev/resources/iso-normes/world_tax_rates.txt
@@ -1,4 +1,5 @@
http://www.taxrates.cc/index.html
+https://en.wikipedia.org/wiki/List_of_countries_by_tax_rates
For India: VAT=IGST/CGST=Localtax1/SGST=Localtax2: https://cleartax.in/s/what-is-sgst-cgst-igst
diff --git a/dev/resources/sepa/text.txt b/dev/resources/sepa/text.txt
index dbcfeded5a4..dfa55834e58 100644
--- a/dev/resources/sepa/text.txt
+++ b/dev/resources/sepa/text.txt
@@ -1,3 +1,7 @@
+https://en.wikipedia.org/wiki/Single_Euro_Payments_Area
+https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html
+https://www.europeanpaymentscouncil.eu/about-sepa
+
Spec for credit transfer:
https://docs.oracle.com/cd/E39124_01/doc.91/e60210/fields_sepa_pay_file_appx.htm#EOAEL00515
diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php
index 654dea6d697..86aff8a36e0 100644
--- a/htdocs/comm/mailing/card.php
+++ b/htdocs/comm/mailing/card.php
@@ -281,7 +281,13 @@ if (empty($reshook)) {
complete_substitutions_array($substitutionarray, $langs);
$newsubject = make_substitutions($subject, $substitutionarray);
- $newmessage = make_substitutions($message, $substitutionarray);
+ $newmessage = make_substitutions($message, $substitutionarray, null, 0);
+
+ $moreinheader = '';
+ if (preg_match('/__UNSUBSCRIBE__/', $message)) {
+ $moreinheader = "List-Unsubscribe: <__UNSUBSCRIBE_URL__>\n";
+ $moreinheader = make_substitutions($moreinheader, $substitutionarray);
+ }
$arr_file = array();
$arr_mime = array();
@@ -299,7 +305,7 @@ if (empty($reshook)) {
// Mail making
$trackid = 'emailing-'.$obj->fk_mailing.'-'.$obj->rowid;
- $mail = new CMailFile($newsubject, $sendto, $from, $newmessage, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $errorsto, $arr_css, $trackid, '', 'emailing');
+ $mail = new CMailFile($newsubject, $sendto, $from, $newmessage, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $errorsto, $arr_css, $trackid, $moreinheader, 'emailing');
if ($mail->error) {
$res = 0;
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 970ec73e373..8251c850ddf 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -7317,7 +7317,6 @@ function make_substitutions($text, $substitutionarray, $outputlangs = null, $con
} else {
$value = dol_nl2br("$value");
}
-
$text = str_replace("$key", "$value", $text); // We must keep the " to work when value is 123.5 for example
}
}
diff --git a/htdocs/install/mysql/data/llx_00_c_country.sql b/htdocs/install/mysql/data/llx_00_c_country.sql
index fa2b4339983..296b6d0e412 100644
--- a/htdocs/install/mysql/data/llx_00_c_country.sql
+++ b/htdocs/install/mysql/data/llx_00_c_country.sql
@@ -117,13 +117,13 @@ INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (86
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (87,'GQ','GNQ','Guinée Equatoriale',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (88,'ER','ERI','Erythrée',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (89,'EE','EST','Estonia',1,0);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (90,'ET','ETH','Ethiopie',1,0);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (91,'FK','FLK','Iles Falkland',1,0);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (92,'FO','FRO','Iles Féroé',1,0);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (93,'FJ','FJI','Iles Fidji',1,0);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (94,'FI','FIN','Finlande',1,0);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (95,'GF','GUF','Guyane française',1,0);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (96,'PF','PYF','Polynésie française',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (90,'ET','ETH','Ethiopia',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (91,'FK','FLK','Falkland Islands',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (92,'FO','FRO','Faroe Islands',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (93,'FJ','FJI','Fidji Islands',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (94,'FI','FIN','Finland',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (95,'GF','GUF','French Guiana',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (96,'PF','PYF','French Polynesia',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (97,'TF','ATF','Terres australes françaises',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (98,'GM','GMB','Gambie',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (99,'GE','GEO','Georgia',1,0);
diff --git a/htdocs/install/mysql/data/llx_20_c_departements.sql b/htdocs/install/mysql/data/llx_20_c_departements.sql
index 7436c123100..5e739f07b72 100644
--- a/htdocs/install/mysql/data/llx_20_c_departements.sql
+++ b/htdocs/install/mysql/data/llx_20_c_departements.sql
@@ -765,16 +765,16 @@ INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc
-- Panama - 10 Provinces (id country=178)
-INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES (17801, 'PA-1', '', 0, '', 'Bocas del Toro');
-INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES (17801, 'PA-2', '', 0, '', 'Coclé');
-INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES (17801, 'PA-3', '', 0, '', 'Colón');
-INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES (17801, 'PA-4', '', 0, '', 'Chiriquí');
-INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES (17801, 'PA-5', '', 0, '', 'Darién');
-INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES (17801, 'PA-6', '', 0, '', 'Herrera');
-INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES (17801, 'PA-7', '', 0, '', 'Los Santos');
-INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES (17801, 'PA-8', '', 0, '', 'Panamá');
-INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES (17801, 'PA-9', '', 0, '', 'Veraguas');
-INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES (17801, 'PA-13', '', 0, '', 'Panamá Oeste');
+INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('PA-1', 17801, '', 0, '', 'Bocas del Toro');
+INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('PA-2', 17801, '', 0, '', 'Coclé');
+INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('PA-3', 17801, '', 0, '', 'Colón');
+INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('PA-4', 17801, '', 0, '', 'Chiriquí');
+INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('PA-5', 17801, '', 0, '', 'Darién');
+INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('PA-6', 17801, '', 0, '', 'Herrera');
+INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('PA-7', 17801, '', 0, '', 'Los Santos');
+INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('PA-8', 17801, '', 0, '', 'Panamá');
+INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('PA-9', 17801, '', 0, '', 'Veraguas');
+INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('PA-13', 17801, '', 0, '', 'Panamá Oeste');
-- Provinces Peru (id country=181)
diff --git a/htdocs/modulebuilder/template/class/actions_mymodule.class.php b/htdocs/modulebuilder/template/class/actions_mymodule.class.php
index 8559411a3d4..24be0243b8d 100644
--- a/htdocs/modulebuilder/template/class/actions_mymodule.class.php
+++ b/htdocs/modulebuilder/template/class/actions_mymodule.class.php
@@ -303,5 +303,56 @@ class ActionsMyModule
return 0;
}
+ /**
+ * Execute action completeTabsHead
+ *
+ * @param array $parameters Array of parameters
+ * @param CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
+ * @param string $action 'add', 'update', 'view'
+ * @param Hookmanager $hookmanager hookmanager
+ * @return int <0 if KO,
+ * =0 if OK but we want to process standard actions too,
+ * >0 if OK and we want to replace standard actions.
+ */
+ public function completeTabsHead(&$parameters, &$object, &$action, $hookmanager)
+ {
+ global $langs, $conf, $user;
+
+ if (!isset($parameters['object']->element)) {
+ return 0;
+ }
+ if ($parameters['mode'] == 'remove') {
+ // utilisé si on veut faire disparaitre des onglets.
+ return 0;
+ } elseif ($parameters['mode'] == 'add') {
+ $langs->load('mymodule@mymodule');
+ // utilisé si on veut ajouter des onglets.
+ $counter = count($parameters['head']);
+ $element = $parameters['object']->element;
+ $id = $parameters['object']->id;
+ // verifier le type d'onglet comme member_stats où ça ne doit pas apparaitre
+ // if (in_array($element, ['societe', 'member', 'contrat', 'fichinter', 'project', 'propal', 'commande', 'facture', 'order_supplier', 'invoice_supplier'])) {
+ if (in_array($element, ['context1', 'context2'])) {
+ $datacount = 0;
+
+ $parameters['head'][$counter][0] = dol_buildpath('/mymodule/mymodule_tab.php', 1) . '?id=' . $id . '&module='.$element;
+ $parameters['head'][$counter][1] = $langs->trans('MyModuleTab');
+ if ($datacount > 0) {
+ $parameters['head'][$counter][1] .= '' . $datacount . '';
+ }
+ $parameters['head'][$counter][2] = 'mymoduleemails';
+ $counter++;
+ }
+ if ($counter > 0 && (int) DOL_VERSION < 14) {
+ $this->results = $parameters['head'];
+ // return 1 to replace standard code
+ return 1;
+ } else {
+ // en V14 et + $parameters['head'] est modifiable par référence
+ return 0;
+ }
+ }
+ }
+
/* Add here any other hooked methods... */
}
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index 946ceeb42f3..e53675d8bb6 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -2570,7 +2570,19 @@ class Societe extends CommonObject
}
}
$label .= '
'.$langs->trans('Email').': '.$this->email;
- if (!empty($this->country_code)) {
+ if (!empty($this->phone) || !empty($this->fax)) {
+ $phonelist = array();
+ if ($this->phone) {
+ $phonelist[] = dol_print_phone($this->phone, $this->country_code, $this->id, 0, '', ' ', 'phone');
+ }
+ if ($this->fax) {
+ $phonelist[] = dol_print_phone($this->fax, $this->country_code, $this->id, 0, '', ' ', 'fax');
+ }
+ $label .= '
'.$langs->trans('Phone').': '.implode(' ', $phonelist);
+ }
+ if (!empty($this->address)) {
+ $label .= '
'.$langs->trans("Address").': '.dol_format_address($this, 1, ' ', $langs); // Address + country
+ } elseif (!empty($this->country_code)) {
$label .= '
'.$langs->trans('Country').': '.$this->country_code;
}
if (!empty($this->tva_intra) || (!empty($conf->global->SOCIETE_SHOW_FIELD_IN_TOOLTIP) && strpos($conf->global->SOCIETE_SHOW_FIELD_IN_TOOLTIP, 'vatnumber') !== false)) {
diff --git a/scripts/emailings/mailing-send.php b/scripts/emailings/mailing-send.php
index d3c8e152c6b..0d59a1b5db5 100755
--- a/scripts/emailings/mailing-send.php
+++ b/scripts/emailings/mailing-send.php
@@ -269,6 +269,12 @@ if ($resql) {
$substitutionisok = true;
+ $moreinheader = '';
+ if (preg_match('/__UNSUBSCRIBE__/', $message)) {
+ $moreinheader = "List-Unsubscribe: <__UNSUBSCRIBE_URL__>\n";
+ $moreinheader = make_substitutions($moreinheader, $substitutionarray);
+ }
+
$arr_file = array();
$arr_mime = array();
$arr_name = array();
@@ -285,7 +291,7 @@ if ($resql) {
}
// Fabrication du mail
$trackid = 'emailing-'.$obj->fk_mailing.'-'.$obj->rowid;
- $mail = new CMailFile($newsubject, $sendto, $from, $newmessage, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $errorsto, $arr_css, $trackid, '', 'emailing');
+ $mail = new CMailFile($newsubject, $sendto, $from, $newmessage, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $errorsto, $arr_css, $trackid, $moreinheader, 'emailing');
if ($mail->error) {
$res = 0;