From 457a96bc343428cf357275e8385e666e571c4a34 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Tue, 4 May 2021 15:11:30 +0200 Subject: [PATCH 01/30] Fix #17475 : Add of List-Unsubscribe in mass emailing --- htdocs/comm/mailing/card.php | 5 +++-- htdocs/core/lib/functions.lib.php | 8 ++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index c3ef480d2ae..a520a44e467 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -265,9 +265,10 @@ if (empty($reshook)) { } //$substitutionisok=true; + $moreinheader = ''; complete_substitutions_array($substitutionarray, $langs); $newsubject = make_substitutions($subject, $substitutionarray); - $newmessage = make_substitutions($message, $substitutionarray); + $newmessage = make_substitutions($message, $substitutionarray, null, 0, $moreinheader); $arr_file = array(); $arr_mime = array(); @@ -285,7 +286,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 5eda236d6f0..b017f9c037b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7206,10 +7206,11 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, * @param Translate $outputlangs Output language * @param int $converttextinhtmlifnecessary 0=Convert only value into HTML if text is already in HTML * 1=Will also convert initial $text into HTML if we try to insert one value that is HTML + * @param string $moreinheader Header for CMailer module * @return string Output string after substitutions * @see complete_substitutions_array(), getCommonSubstitutionArray() */ -function make_substitutions($text, $substitutionarray, $outputlangs = null, $converttextinhtmlifnecessary = 0) +function make_substitutions($text, $substitutionarray, $outputlangs = null, $converttextinhtmlifnecessary = 0, &$moreinheader = null) { global $conf, $langs; @@ -7312,9 +7313,12 @@ 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 } + if ($key == '__UNSUBSCRIBE__' && (isset($moreinheader))) { + $tmptext = explode('"', $text); + $moreinheader = "List-Unsubscribe: <".$tmptext[1].">\n"; + } } return $text; From 0f2ce8687d8a14252e16dc5c240e639f26ecf1fc Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Fri, 7 May 2021 09:19:44 +0200 Subject: [PATCH 02/30] Fix #17475 : Update of previous fix --- htdocs/comm/mailing/card.php | 10 ++++++++-- htdocs/core/lib/functions.lib.php | 6 +----- scripts/emailings/mailing-send.php | 9 ++++++++- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index a520a44e467..7f6f7f88cc3 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -265,10 +265,16 @@ if (empty($reshook)) { } //$substitutionisok=true; - $moreinheader = ''; complete_substitutions_array($substitutionarray, $langs); $newsubject = make_substitutions($subject, $substitutionarray); - $newmessage = make_substitutions($message, $substitutionarray, null, 0, $moreinheader); + $newmessage = make_substitutions($message, $substitutionarray, null, 0); + + $moreinheader = ''; + if (preg_match('/__UNSUBSCRIBE__/', $message)) { + $moreinheader = make_substitutions('__UNSUBSCRIBE__', $substitutionarray); + $moreinheader = explode('"', $moreinheader); + $moreinheader = "List-Unsubscribe: <".$moreinheader[1].">\n"; + } $arr_file = array(); $arr_mime = array(); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index d058111973a..222dea0ead7 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7212,7 +7212,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, * @return string Output string after substitutions * @see complete_substitutions_array(), getCommonSubstitutionArray() */ -function make_substitutions($text, $substitutionarray, $outputlangs = null, $converttextinhtmlifnecessary = 0, &$moreinheader = null) +function make_substitutions($text, $substitutionarray, $outputlangs = null, $converttextinhtmlifnecessary = 0) { global $conf, $langs; @@ -7317,10 +7317,6 @@ function make_substitutions($text, $substitutionarray, $outputlangs = null, $con } $text = str_replace("$key", "$value", $text); // We must keep the " to work when value is 123.5 for example } - if ($key == '__UNSUBSCRIBE__' && (isset($moreinheader))) { - $tmptext = explode('"', $text); - $moreinheader = "List-Unsubscribe: <".$tmptext[1].">\n"; - } } return $text; diff --git a/scripts/emailings/mailing-send.php b/scripts/emailings/mailing-send.php index 44b8ade0c62..b0975c93397 100755 --- a/scripts/emailings/mailing-send.php +++ b/scripts/emailings/mailing-send.php @@ -268,6 +268,13 @@ if ($resql) { $substitutionisok = true; + $moreinheader = ''; + if (preg_match('/__UNSUBSCRIBE__/', $message)) { + $moreinheader = make_substitutions('__UNSUBSCRIBE__', $substitutionarray); + $moreinheader = explode('"', $moreinheader); + $moreinheader = "List-Unsubscribe: <".$moreinheader[1].">\n"; + } + $arr_file = array(); $arr_mime = array(); $arr_name = array(); @@ -284,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; From f4291dc985385a4bb40bd1cb2e3695fca5bf0b05 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Fri, 7 May 2021 09:20:18 +0200 Subject: [PATCH 03/30] commit missing file --- htdocs/core/lib/functions.lib.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 222dea0ead7..3004a28dae7 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7208,7 +7208,6 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, * @param Translate $outputlangs Output language * @param int $converttextinhtmlifnecessary 0=Convert only value into HTML if text is already in HTML * 1=Will also convert initial $text into HTML if we try to insert one value that is HTML - * @param string $moreinheader Header for CMailer module * @return string Output string after substitutions * @see complete_substitutions_array(), getCommonSubstitutionArray() */ From fa73fde312cd7b4fae03882e608cc2afe3f1689d Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Fri, 7 May 2021 15:12:23 +0200 Subject: [PATCH 04/30] phone_head_document --- htdocs/comm/propal/card.php | 1 + htdocs/commande/card.php | 1 + htdocs/compta/facture/card.php | 1 + htdocs/projet/card.php | 1 + 4 files changed, 4 insertions(+) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 229303849f0..8039e3361ec 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1991,6 +1991,7 @@ if ($action == 'create') { $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherProposals").')'; + $morehtmlref .= '
'.$langs->trans("Phone").' : '.dol_print_phone($object->thirdparty->phone, $obj->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'phone'); } // Project if (!empty($conf->projet->enabled)) { diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index f63b02c035e..01ad66a0af6 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2020,6 +2020,7 @@ if ($action == 'create' && $usercancreate) { $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$soc->getNomUrl(1); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherOrders").')'; + $morehtmlref .= '
'.$langs->trans("Phone").' : '.dol_print_phone($object->thirdparty->phone, $obj->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'phone'); } // Project if (!empty($conf->projet->enabled)) { diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 252b8ac65a2..b4126f1434c 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4157,6 +4157,7 @@ if ($action == 'create') { $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherBills").')'; + $morehtmlref .= '
'.$langs->trans("Phone").' : '.dol_print_phone($object->thirdparty->phone, $obj->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'phone'); } // Project if (!empty($conf->projet->enabled)) { diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 3c2d5b02829..c6fb5d5963b 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -992,6 +992,7 @@ if ($action == 'create' && $user->rights->projet->creer) { $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '; if ($object->thirdparty->id > 0) { $morehtmlref .= $object->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
'.$langs->trans("Phone").' : '.dol_print_phone($object->thirdparty->phone, $obj->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'phone'); } $morehtmlref .= ''; From 0466704dc73b56c1121d129cf25e8d4aca71a084 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Fri, 7 May 2021 15:49:49 +0200 Subject: [PATCH 05/30] Fix #17477 : Sql error in invoices cards --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 625e8e23d57..39a7a247e18 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7693,7 +7693,7 @@ class Form 'invoice'=>array('enabled'=>$conf->facture->enabled, 'perms'=>1, 'label'=>'LinkToInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'), 'invoice_template'=>array('enabled'=>$conf->facture->enabled, 'perms'=>1, 'label'=>'LinkToTemplateInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'), 'contrat'=>array('enabled'=>$conf->contrat->enabled, 'perms'=>1, 'label'=>'LinkToContract', - 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_customer as ref_client, t.ref_supplier, SUM(td.total_ht) as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as t, ".MAIN_DB_PREFIX."contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('contract').')'), + 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_customer as ref_client, t.ref_supplier, SUM(td.total_ht) as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as t, ".MAIN_DB_PREFIX."contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('contract').') GROUP BY t.rowid'), 'fichinter'=>array('enabled'=>$conf->ficheinter->enabled, 'perms'=>1, 'label'=>'LinkToIntervention', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('intervention').')'), 'supplier_proposal'=>array('enabled'=>$conf->supplier_proposal->enabled, 'perms'=>1, 'label'=>'LinkToSupplierProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('supplier_proposal').')'), 'order_supplier'=>array('enabled'=>$conf->supplier_order->enabled, 'perms'=>1, 'label'=>'LinkToSupplierOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande_fournisseur').')'), From f05416903634a9fa08c23861a0aa3008bd0fa077 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Fri, 7 May 2021 15:56:33 +0200 Subject: [PATCH 06/30] revert of last push error of branch --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 39a7a247e18..625e8e23d57 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7693,7 +7693,7 @@ class Form 'invoice'=>array('enabled'=>$conf->facture->enabled, 'perms'=>1, 'label'=>'LinkToInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'), 'invoice_template'=>array('enabled'=>$conf->facture->enabled, 'perms'=>1, 'label'=>'LinkToTemplateInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'), 'contrat'=>array('enabled'=>$conf->contrat->enabled, 'perms'=>1, 'label'=>'LinkToContract', - 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_customer as ref_client, t.ref_supplier, SUM(td.total_ht) as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as t, ".MAIN_DB_PREFIX."contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('contract').') GROUP BY t.rowid'), + 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_customer as ref_client, t.ref_supplier, SUM(td.total_ht) as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as t, ".MAIN_DB_PREFIX."contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('contract').')'), 'fichinter'=>array('enabled'=>$conf->ficheinter->enabled, 'perms'=>1, 'label'=>'LinkToIntervention', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('intervention').')'), 'supplier_proposal'=>array('enabled'=>$conf->supplier_proposal->enabled, 'perms'=>1, 'label'=>'LinkToSupplierProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('supplier_proposal').')'), 'order_supplier'=>array('enabled'=>$conf->supplier_order->enabled, 'perms'=>1, 'label'=>'LinkToSupplierOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande_fournisseur').')'), From 4db618cb6d8ed8673f3a8f680f23165184c95deb Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Fri, 7 May 2021 15:58:50 +0200 Subject: [PATCH 07/30] Fix Dolibarr#17477 : Sql error in invoices cards --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 625e8e23d57..39a7a247e18 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7693,7 +7693,7 @@ class Form 'invoice'=>array('enabled'=>$conf->facture->enabled, 'perms'=>1, 'label'=>'LinkToInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'), 'invoice_template'=>array('enabled'=>$conf->facture->enabled, 'perms'=>1, 'label'=>'LinkToTemplateInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'), 'contrat'=>array('enabled'=>$conf->contrat->enabled, 'perms'=>1, 'label'=>'LinkToContract', - 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_customer as ref_client, t.ref_supplier, SUM(td.total_ht) as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as t, ".MAIN_DB_PREFIX."contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('contract').')'), + 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_customer as ref_client, t.ref_supplier, SUM(td.total_ht) as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as t, ".MAIN_DB_PREFIX."contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('contract').') GROUP BY t.rowid'), 'fichinter'=>array('enabled'=>$conf->ficheinter->enabled, 'perms'=>1, 'label'=>'LinkToIntervention', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('intervention').')'), 'supplier_proposal'=>array('enabled'=>$conf->supplier_proposal->enabled, 'perms'=>1, 'label'=>'LinkToSupplierProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('supplier_proposal').')'), 'order_supplier'=>array('enabled'=>$conf->supplier_order->enabled, 'perms'=>1, 'label'=>'LinkToSupplierOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande_fournisseur').')'), From c068470bca5f41307ebae6c1db42806e7a310b0e Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Fri, 7 May 2021 16:04:39 +0200 Subject: [PATCH 08/30] Fix Dolibarr#17477 : Sql error in invoices cards 2 --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 39a7a247e18..27bb5c5c8e5 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7693,7 +7693,7 @@ class Form 'invoice'=>array('enabled'=>$conf->facture->enabled, 'perms'=>1, 'label'=>'LinkToInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'), 'invoice_template'=>array('enabled'=>$conf->facture->enabled, 'perms'=>1, 'label'=>'LinkToTemplateInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'), 'contrat'=>array('enabled'=>$conf->contrat->enabled, 'perms'=>1, 'label'=>'LinkToContract', - 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_customer as ref_client, t.ref_supplier, SUM(td.total_ht) as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as t, ".MAIN_DB_PREFIX."contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('contract').') GROUP BY t.rowid'), + 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_customer as ref_client, t.ref_supplier, SUM(td.total_ht) as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as t, ".MAIN_DB_PREFIX."contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('contract').') GROUP BY t.rowid'), 'fichinter'=>array('enabled'=>$conf->ficheinter->enabled, 'perms'=>1, 'label'=>'LinkToIntervention', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('intervention').')'), 'supplier_proposal'=>array('enabled'=>$conf->supplier_proposal->enabled, 'perms'=>1, 'label'=>'LinkToSupplierProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('supplier_proposal').')'), 'order_supplier'=>array('enabled'=>$conf->supplier_order->enabled, 'perms'=>1, 'label'=>'LinkToSupplierOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande_fournisseur').')'), From 8a4fd56b23995768d3828e34b4a08429f679bb0d Mon Sep 17 00:00:00 2001 From: Aisuko Hakumei Date: Tue, 11 May 2021 22:54:26 +0200 Subject: [PATCH 09/30] Fix SQL error for Panama Provinces --- .../mysql/data/llx_20_c_departements.sql | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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) From 06c181793082b0ddad5bd007666a0daa07785ace Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Wed, 12 May 2021 09:21:28 +0200 Subject: [PATCH 10/30] Update mailing-send script and mailling card --- htdocs/comm/mailing/card.php | 5 ++--- scripts/emailings/mailing-send.php | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index b26bf5812e9..86aff8a36e0 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -285,9 +285,8 @@ if (empty($reshook)) { $moreinheader = ''; if (preg_match('/__UNSUBSCRIBE__/', $message)) { - $moreinheader = make_substitutions('__UNSUBSCRIBE__', $substitutionarray); - $moreinheader = explode('"', $moreinheader); - $moreinheader = "List-Unsubscribe: <".$moreinheader[1].">\n"; + $moreinheader = "List-Unsubscribe: <__UNSUBSCRIBE_URL__>\n"; + $moreinheader = make_substitutions($moreinheader, $substitutionarray); } $arr_file = array(); diff --git a/scripts/emailings/mailing-send.php b/scripts/emailings/mailing-send.php index 8d9d98aa3d3..0d59a1b5db5 100755 --- a/scripts/emailings/mailing-send.php +++ b/scripts/emailings/mailing-send.php @@ -271,9 +271,8 @@ if ($resql) { $moreinheader = ''; if (preg_match('/__UNSUBSCRIBE__/', $message)) { - $moreinheader = make_substitutions('__UNSUBSCRIBE__', $substitutionarray); - $moreinheader = explode('"', $moreinheader); - $moreinheader = "List-Unsubscribe: <".$moreinheader[1].">\n"; + $moreinheader = "List-Unsubscribe: <__UNSUBSCRIBE_URL__>\n"; + $moreinheader = make_substitutions($moreinheader, $substitutionarray); } $arr_file = array(); From f34d6366d96e84463253a6076ffb34822163eb30 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Wed, 12 May 2021 13:19:23 +0200 Subject: [PATCH 11/30] Sql error in invoices cards 3 end --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 27bb5c5c8e5..acf1dc675ad 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7693,7 +7693,7 @@ class Form 'invoice'=>array('enabled'=>$conf->facture->enabled, 'perms'=>1, 'label'=>'LinkToInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'), 'invoice_template'=>array('enabled'=>$conf->facture->enabled, 'perms'=>1, 'label'=>'LinkToTemplateInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'), 'contrat'=>array('enabled'=>$conf->contrat->enabled, 'perms'=>1, 'label'=>'LinkToContract', - 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_customer as ref_client, t.ref_supplier, SUM(td.total_ht) as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as t, ".MAIN_DB_PREFIX."contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('contract').') GROUP BY t.rowid'), + 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_customer as ref_client, t.ref_supplier, SUM(td.total_ht) as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as t, ".MAIN_DB_PREFIX."contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('contract').') GROUP BY t.rowid,s.rowid,s.nom,s.client,t.ref,t.ref_supplier,t.ref_customer'), 'fichinter'=>array('enabled'=>$conf->ficheinter->enabled, 'perms'=>1, 'label'=>'LinkToIntervention', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('intervention').')'), 'supplier_proposal'=>array('enabled'=>$conf->supplier_proposal->enabled, 'perms'=>1, 'label'=>'LinkToSupplierProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('supplier_proposal').')'), 'order_supplier'=>array('enabled'=>$conf->supplier_order->enabled, 'perms'=>1, 'label'=>'LinkToSupplierOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande_fournisseur').')'), From 9ed041f31a929ce2493f865e524b1aee22d424e9 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Wed, 12 May 2021 13:22:31 +0200 Subject: [PATCH 12/30] fixing style errors --- htdocs/core/class/html.form.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index acf1dc675ad..378a75f7f9c 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7693,7 +7693,8 @@ class Form 'invoice'=>array('enabled'=>$conf->facture->enabled, 'perms'=>1, 'label'=>'LinkToInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'), 'invoice_template'=>array('enabled'=>$conf->facture->enabled, 'perms'=>1, 'label'=>'LinkToTemplateInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'), 'contrat'=>array('enabled'=>$conf->contrat->enabled, 'perms'=>1, 'label'=>'LinkToContract', - 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_customer as ref_client, t.ref_supplier, SUM(td.total_ht) as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as t, ".MAIN_DB_PREFIX."contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('contract').') GROUP BY t.rowid,s.rowid,s.nom,s.client,t.ref,t.ref_supplier,t.ref_customer'), + 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_customer as ref_client, t.ref_supplier, SUM(td.total_ht) as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as t, ".MAIN_DB_PREFIX."contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('contract').') + GROUP BY t.rowid,s.rowid,s.nom,s.client,t.ref,t.ref_supplier,t.ref_customer'), 'fichinter'=>array('enabled'=>$conf->ficheinter->enabled, 'perms'=>1, 'label'=>'LinkToIntervention', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('intervention').')'), 'supplier_proposal'=>array('enabled'=>$conf->supplier_proposal->enabled, 'perms'=>1, 'label'=>'LinkToSupplierProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('supplier_proposal').')'), 'order_supplier'=>array('enabled'=>$conf->supplier_order->enabled, 'perms'=>1, 'label'=>'LinkToSupplierOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande_fournisseur').')'), From 23fe7d1b6302c22b7bd1e1a471cfd445873c0104 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 12 May 2021 18:29:56 +0200 Subject: [PATCH 13/30] add sample completeTabHead --- .../template/class/actions_mymodule.class.php | 51 +++++++++++++++++++ htdocs/theme/eldy/global.inc.php | 6 +-- htdocs/theme/md/style.css.php | 6 +-- 3 files changed, 57 insertions(+), 6 deletions(-) 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/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 912cf21a1de..3518518a5ef 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -6767,9 +6767,9 @@ div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link:before /* ============================================================================== */ span.clipboardCPValue.hidewithsize { - width: 0 !important; - display: inline-block; - color: transparent; + width: 0 !important; + display: inline-block; + color: transparent; } .clipboardCPShowOnHover .clipboardCPButton { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 8152e56e945..4a6c3899d93 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -6611,9 +6611,9 @@ div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link:before /* ============================================================================== */ span.clipboardCPValue.hidewithsize { - width: 0 !important; - display: inline-block; - color: transparent; + width: 0 !important; + display: inline-block; + color: transparent; } .clipboardCPShowOnHover .clipboardCPButton { From 95a5e480a1945d51784530e282840fb2a42751e1 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 12 May 2021 21:55:31 +0200 Subject: [PATCH 14/30] Update llx_00_c_country.sql --- htdocs/install/mysql/data/llx_00_c_country.sql | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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); From 12c2838d91465ba753ec1538b790e5be17531165 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 12 May 2021 22:18:40 +0200 Subject: [PATCH 15/30] Update countries_iso-3166_en.txt --- dev/resources/iso-normes/countries_iso-3166_en.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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 From 0dd999c1f06080c148e532fd7f68a8b050d1b1be Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 12 May 2021 22:25:08 +0200 Subject: [PATCH 16/30] Update vat_number_names.txt --- dev/resources/iso-normes/vat_number_names.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 From 396f3d0fabdd9d84f54c5f88488b9c405b0ed185 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 12 May 2021 22:29:02 +0200 Subject: [PATCH 17/30] Update world_tax_rates.txt delete http://www.taxrates.cc/index.html because now leads to a risky website without appropriate information --- dev/resources/iso-normes/world_tax_rates.txt | 1 + 1 file changed, 1 insertion(+) 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 From a11ed88f6f8ea6983d5e10ca31f6f3f8a14a0f21 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 12 May 2021 22:34:58 +0200 Subject: [PATCH 18/30] Update code_nace.txt --- dev/resources/iso-normes/code_nace.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 From 850ed5eb252d04a3b9273823c360b5ffb969331a Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 12 May 2021 22:41:33 +0200 Subject: [PATCH 19/30] Update countries_iso-3166_fr.txt --- dev/resources/iso-normes/countries_iso-3166_fr.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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 From 65c8eda5c18985ded5f270071ee6bd720464d347 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 12 May 2021 22:47:57 +0200 Subject: [PATCH 20/30] Update address_format.txt --- dev/resources/iso-normes/address_format.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 + From 8bbd915009e67a21770d9a5234f0e57a794cf436 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 12 May 2021 23:03:43 +0200 Subject: [PATCH 21/30] Update text.txt --- dev/resources/sepa/text.txt | 4 ++++ 1 file changed, 4 insertions(+) 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 From 8f49c68aa502835cb621b9535b116c38d5290492 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Sat, 15 May 2021 01:14:28 +0200 Subject: [PATCH 22/30] Update .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 371c8be2f5e..6ccdb28f67d 100644 --- a/.gitignore +++ b/.gitignore @@ -55,3 +55,4 @@ yarn.lock package-lock.json doc/install.lock +desktop.ini From 1d7765ce125eec6ba462d4dd8e468074e98803c3 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Sat, 15 May 2021 02:29:15 +0200 Subject: [PATCH 23/30] update phone and address in popup --- htdocs/comm/propal/card.php | 1 - htdocs/commande/card.php | 1 - htdocs/compta/facture/card.php | 1 - htdocs/societe/class/societe.class.php | 12 ++++++++++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 8039e3361ec..229303849f0 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1991,7 +1991,6 @@ if ($action == 'create') { $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherProposals").')'; - $morehtmlref .= '
'.$langs->trans("Phone").' : '.dol_print_phone($object->thirdparty->phone, $obj->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'phone'); } // Project if (!empty($conf->projet->enabled)) { diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 01ad66a0af6..f63b02c035e 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2020,7 +2020,6 @@ if ($action == 'create' && $usercancreate) { $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$soc->getNomUrl(1); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherOrders").')'; - $morehtmlref .= '
'.$langs->trans("Phone").' : '.dol_print_phone($object->thirdparty->phone, $obj->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'phone'); } // Project if (!empty($conf->projet->enabled)) { diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index b4126f1434c..252b8ac65a2 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4157,7 +4157,6 @@ if ($action == 'create') { $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherBills").')'; - $morehtmlref .= '
'.$langs->trans("Phone").' : '.dol_print_phone($object->thirdparty->phone, $obj->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'phone'); } // Project if (!empty($conf->projet->enabled)) { diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index defcc71a3e5..d207c690a69 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2560,8 +2560,16 @@ class Societe extends CommonObject } } $label .= '
'.$langs->trans('Email').': '.$this->email; - if (!empty($this->country_code)) { - $label .= '
'.$langs->trans('Country').': '.$this->country_code; + $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); } if (!empty($this->tva_intra) || (!empty($conf->global->SOCIETE_SHOW_FIELD_IN_TOOLTIP) && strpos($conf->global->SOCIETE_SHOW_FIELD_IN_TOOLTIP, 'vatnumber') !== false)) { $label .= '
'.$langs->trans('VATIntra').': '.dol_escape_htmltag($this->tva_intra); From 3cccdea20b5b89b2dab8e6d97d4c615ccc0217f3 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Sat, 15 May 2021 02:31:08 +0200 Subject: [PATCH 24/30] Update .gitignore --- .gitignore | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.gitignore b/.gitignore index 6ccdb28f67d..db04b277351 100644 --- a/.gitignore +++ b/.gitignore @@ -50,9 +50,3 @@ node_modules/ #yarn yarn.lock - -#package-lock -package-lock.json - -doc/install.lock -desktop.ini From 5deff6676a9cc0eede19b840f6c8e7ec98ee85fe Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Sat, 15 May 2021 02:31:33 +0200 Subject: [PATCH 25/30] Update .gitignore --- .gitignore | 3 --- 1 file changed, 3 deletions(-) diff --git a/.gitignore b/.gitignore index db04b277351..7b3fc6cb353 100644 --- a/.gitignore +++ b/.gitignore @@ -47,6 +47,3 @@ htdocs/.well-known/apple-developer-merchantid-domain-association build/yarn-error.log build/node_modules/ node_modules/ - -#yarn -yarn.lock From dc8c746057ad3b2ef62173bab17285a4e6696213 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Sat, 15 May 2021 02:32:07 +0200 Subject: [PATCH 26/30] Update .gitignore --- .gitignore | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.gitignore b/.gitignore index 7b3fc6cb353..eab591c9904 100644 --- a/.gitignore +++ b/.gitignore @@ -43,6 +43,13 @@ htdocs/includes/squizlabs/ htdocs/includes/webmozart/ htdocs/.well-known/apple-developer-merchantid-domain-association +#yarn +yarn.lock + +#package-lock +package-lock.json + +doc/install.lock # Node Modules build/yarn-error.log build/node_modules/ From b3358046805a62e2a95410687289e228704db3e9 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Sat, 15 May 2021 02:32:47 +0200 Subject: [PATCH 27/30] Update .gitignore --- .gitignore | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index eab591c9904..371c8be2f5e 100644 --- a/.gitignore +++ b/.gitignore @@ -43,6 +43,11 @@ htdocs/includes/squizlabs/ htdocs/includes/webmozart/ htdocs/.well-known/apple-developer-merchantid-domain-association +# Node Modules +build/yarn-error.log +build/node_modules/ +node_modules/ + #yarn yarn.lock @@ -50,7 +55,3 @@ yarn.lock package-lock.json doc/install.lock -# Node Modules -build/yarn-error.log -build/node_modules/ -node_modules/ From 334f37052c4a02984ab922360b2a2c7ad054fd35 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Sat, 15 May 2021 02:36:56 +0200 Subject: [PATCH 28/30] Update card.php --- htdocs/projet/card.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index c6fb5d5963b..3c2d5b02829 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -992,7 +992,6 @@ if ($action == 'create' && $user->rights->projet->creer) { $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '; if ($object->thirdparty->id > 0) { $morehtmlref .= $object->thirdparty->getNomUrl(1, 'project'); - $morehtmlref .= '
'.$langs->trans("Phone").' : '.dol_print_phone($object->thirdparty->phone, $obj->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'phone'); } $morehtmlref .= ''; From 1093e66d26183beee9ddc8e75fee6d9aedfa1f4f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 May 2021 10:14:14 +0200 Subject: [PATCH 29/30] Update societe.class.php --- htdocs/societe/class/societe.class.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index d207c690a69..91059c7ecc1 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2560,14 +2560,16 @@ class Societe extends CommonObject } } $label .= '
'.$langs->trans('Email').': '.$this->email; - $phonelist = array(); - if ($this->phone) { - $phonelist[] = dol_print_phone($this->phone, $this->country_code, $this->id, 0, '', ' ', 'phone'); + 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 ($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); } From 261414cb7f7b64bc062d3ce6f97998774134b0d7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 May 2021 10:16:33 +0200 Subject: [PATCH 30/30] Update societe.class.php --- htdocs/societe/class/societe.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 91059c7ecc1..66974c7e5e9 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2571,7 +2571,9 @@ class Societe extends CommonObject $label .= '
'.$langs->trans('Phone').': '.implode(' ', $phonelist); } if (!empty($this->address)) { - $label .= '
'.$langs->trans("Address").': '.dol_format_address($this, 1, ' ', $langs); + $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)) { $label .= '
'.$langs->trans('VATIntra').': '.dol_escape_htmltag($this->tva_intra);