From e9b5a52a4fc134b6ef12baf8682581855e5c863d Mon Sep 17 00:00:00 2001 From: atm-lena Date: Wed, 3 Feb 2021 15:22:04 +0100 Subject: [PATCH 01/15] Add hidden conf to display supplier in object lines --- htdocs/core/tpl/objectline_view.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 0e705f4f844..9e9da40c23a 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -166,7 +166,7 @@ else } } -if ($user->rights->fournisseur->lire && $line->fk_fournprice > 0) +if ($user->rights->fournisseur->lire && $line->fk_fournprice > 0 && !empty($conf->global->DISPLAY_SUPPLIER_OBJECTLINES)) { require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; $productfourn = new ProductFournisseur($this->db); From c5f73ec12aea794b14eecaa7b5fe1f4ee2c74d2b Mon Sep 17 00:00:00 2001 From: atm-lena Date: Thu, 4 Feb 2021 10:42:42 +0100 Subject: [PATCH 02/15] Resolve ret --- htdocs/core/tpl/objectline_view.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 9e9da40c23a..6b86c5aed8c 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -166,7 +166,7 @@ else } } -if ($user->rights->fournisseur->lire && $line->fk_fournprice > 0 && !empty($conf->global->DISPLAY_SUPPLIER_OBJECTLINES)) +if ($user->rights->fournisseur->lire && $line->fk_fournprice > 0 && empty($conf->global->SUPPLIER_HIDE_SUPPLIER_OBJECTLINES)) { require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; $productfourn = new ProductFournisseur($this->db); From fcb5b3900db9038d0fd01e00872348329b260265 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Sat, 6 Feb 2021 12:39:40 +0100 Subject: [PATCH 03/15] FIX: #16189, fix download/see check deposit PDF --- htdocs/compta/paiement/cheque/card.php | 2 +- htdocs/core/modules/cheque/doc/pdf_blochet.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index 4b93cb4cca3..c6afa4def1d 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -749,7 +749,7 @@ if ($action != 'new') if ($object->statut == 1) { $filename = dol_sanitizeFileName($object->ref); - $filedir = $dir.get_exdir($object->ref, 0, 1, 0, $object, 'cheque').dol_sanitizeFileName($object->ref); + $filedir = $dir.get_exdir($object->ref, 0, 1, 0, $object, 'checkdeposits'); $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; print $formfile->showdocuments('remisecheque', $filename, $filedir, $urlsource, 1, 1); diff --git a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php index f3ea817fa73..ee00a98b039 100644 --- a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php +++ b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php @@ -101,7 +101,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts // Load traductions files required by page $outputlangs->loadLangs(array("main", "companies", "bills", "products", "compta")); - $dir = $_dir."/".get_exdir($number, 0, 1, 0, $object, 'cheque').$number; + $dir = $_dir."/".get_exdir($number, 0, 1, 0, $object, 'checkdeposits'); if (!is_dir($dir)) { From 414a2366fb37cec4ec1d6079721efbffcebd581f Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 7 Feb 2021 19:28:00 +0100 Subject: [PATCH 04/15] Fix links to go back on supplier invoice list --- htdocs/fourn/facture/contact.php | 2 +- htdocs/fourn/facture/info.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php index cce1b34822d..d9af2d00101 100644 --- a/htdocs/fourn/facture/contact.php +++ b/htdocs/fourn/facture/contact.php @@ -142,7 +142,7 @@ if ($id > 0 || !empty($ref)) dol_fiche_head($head, 'contact', $langs->trans('SupplierInvoice'), -1, 'bill'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; // Ref supplier diff --git a/htdocs/fourn/facture/info.php b/htdocs/fourn/facture/info.php index f7f99b020fc..74c429f0c2a 100644 --- a/htdocs/fourn/facture/info.php +++ b/htdocs/fourn/facture/info.php @@ -67,7 +67,7 @@ $head = facturefourn_prepare_head($object); $titre = $langs->trans('SupplierInvoice'); dol_fiche_head($head, 'info', $langs->trans('SupplierInvoice'), -1, 'bill'); -$linkback = ''.$langs->trans("BackToList").''; +$linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; // Ref supplier From 9f9ace056589d56c90cc6cdb9b9a61f30317afca Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Feb 2021 22:15:21 +0100 Subject: [PATCH 05/15] FIX Localtax must be converted with price2num --- htdocs/admin/dict.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 92675cbc883..a36d56f9d1d 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -758,8 +758,11 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $keycode = $listfieldvalue[$i]; if (empty($keycode)) $keycode = $value; - if ($value == 'price' || preg_match('/^amount/i', $value) || $value == 'taux') { - $_POST[$keycode] = price2num($_POST[$keycode], 'MU'); + if ($value == 'price' || preg_match('/^amount/i', $value)) { + $_POST[$keycode] = price2num(GETPOST($keycode), 'MU'); + } + elseif ($value == 'taux' || $value == 'localtax1' || $value == 'localtax2') { + $_POST[$keycode] = price2num(GETPOST($keycode), 8); } elseif ($value == 'entity') { $_POST[$keycode] = getEntity($tabname[$id]); @@ -791,7 +794,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) if ($result) // Add is ok { setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs'); - $_POST = array('id'=>$id); // Clean $_POST array, we keep only + $_POST = array('id'=>$id); // Clean $_POST array, we keep only id } else { @@ -824,8 +827,11 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $keycode = $listfieldvalue[$i]; if (empty($keycode)) $keycode = $field; - if ($field == 'price' || preg_match('/^amount/i', $field) || $field == 'taux') { - $_POST[$keycode] = price2num($_POST[$keycode], 'MU'); + if ($field == 'price' || preg_match('/^amount/i', $field)) { + $_POST[$keycode] = price2num(GETPOST($keycode), 'MU'); + } + elseif ($field == 'taux' || $field == 'localtax1' || $field == 'localtax2') { + $_POST[$keycode] = price2num(GETPOST($keycode), 8); } elseif ($field == 'entity') { $_POST[$keycode] = getEntity($tabname[$id]); From b04c342939745676497563be114e01d33c4fa6e7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Feb 2021 15:00:57 +0100 Subject: [PATCH 06/15] FIX #16215 --- htdocs/admin/barcode.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index 6ff8a988899..84fbb8dae30 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -400,7 +400,7 @@ if ($conf->product->enabled) print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } From a140625a8ac84b764ab0b4807704d112da7f1b44 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Mon, 8 Feb 2021 09:47:43 +0100 Subject: [PATCH 07/15] Fix search by statut in list of holiday module --- htdocs/holiday/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index cbd9b76e45e..cb8da24052b 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -106,7 +106,7 @@ $search_month_end = GETPOST('search_month_end', 'int'); $search_year_end = GETPOST('search_year_end', 'int'); $search_employee = GETPOST('search_employee', 'int'); $search_valideur = GETPOST('search_valideur', 'int'); -$search_status = GETPOST('search_status', 'int'); +$search_status = GETPOST('search_statut', 'int'); $search_type = GETPOST('search_type', 'int'); // Initialize technical objects From e15e8bcd05cd96e32bb8be6a55f6ee29c2a9d410 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 8 Feb 2021 00:46:46 +0100 Subject: [PATCH 08/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 b1129dcfb4f..9ff3922659d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4500,7 +4500,7 @@ function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '', //print 'totalnboflines='.$totalnboflines.'-savlimit='.$savlimit.'-limit='.$limit.'-num='.$num.'-nextpage='.$nextpage; print "\n"; - print "\n"; + print "\n"; print ''; // maring bottom must be same than into load_fiche_tire // Left From fe9d23e90b4399c21ddc59ae4cd1eb19073fe622 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Feb 2021 15:08:24 +0100 Subject: [PATCH 09/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 9ff3922659d..719992a52f8 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4500,7 +4500,7 @@ function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '', //print 'totalnboflines='.$totalnboflines.'-savlimit='.$savlimit.'-limit='.$limit.'-num='.$num.'-nextpage='.$nextpage; print "\n"; - print "\n"; + print "\n"; print '
'; // maring bottom must be same than into load_fiche_tire // Left From ee1a4ee54fb175c74a1ed7bc8fb220dd81f16d2a Mon Sep 17 00:00:00 2001 From: Adrien Jussak Date: Mon, 8 Feb 2021 16:47:46 +0100 Subject: [PATCH 10/15] FIX #16143 Remove the function update_modified_column_date_m is required because old triggers can throw errors during PDF generation --- htdocs/install/mysql/migration/12.0.0-13.0.0.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql index f75ef8adee6..4983a932dee 100644 --- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql +++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql @@ -574,3 +574,5 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_PAID','Expense report billed','Executed when an expense report is set as billed','expensereport',204); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_DELETE','Expense report deleted','Executed when an expense report is deleted','expensereport',205); +-- Unsed function +DROP FUNCTION IF EXISTS update_modified_column_date_m CASCADE; From ff3707b6501f4325d4b27f885e6247d5bbd69fb0 Mon Sep 17 00:00:00 2001 From: Florian Mortgat Date: Mon, 8 Feb 2021 17:24:40 +0100 Subject: [PATCH 11/15] FIX: warning when adding a line if $remise_percent is an empty string --- htdocs/commande/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 36f9705aabc..773d5283ede 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -672,6 +672,7 @@ if (empty($reshook)) $qty = price2num(GETPOST('qty'.$predef, 'alpha')); $remise_percent = (GETPOSTISSET('remise_percent'.$predef) ? price2num(GETPOST('remise_percent'.$predef, 'alpha')) : 0); + if ($remise_percent === '') $remise_percent = 0; // Extrafields $extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line); From d073e809e7078327df4ba902aac90b98358eb1d4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Feb 2021 17:32:36 +0100 Subject: [PATCH 12/15] FIX removed no more used proc update_modified_column_date_m on pgsql --- htdocs/install/mysql/migration/12.0.0-13.0.0.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql index 4983a932dee..4c8adf5282e 100644 --- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql +++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql @@ -574,5 +574,5 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_PAID','Expense report billed','Executed when an expense report is set as billed','expensereport',204); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_DELETE','Expense report deleted','Executed when an expense report is deleted','expensereport',205); --- Unsed function -DROP FUNCTION IF EXISTS update_modified_column_date_m CASCADE; +-- Removed no more used function +-- VPGSQL8.2 DROP FUNCTION IF EXISTS update_modified_column_date_m CASCADE; From 8b3c872f2a7461c0fec258802464520a074cdd6d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Feb 2021 17:35:21 +0100 Subject: [PATCH 13/15] Fix warning --- htdocs/commande/card.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 773d5283ede..794b5779964 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -672,7 +672,9 @@ if (empty($reshook)) $qty = price2num(GETPOST('qty'.$predef, 'alpha')); $remise_percent = (GETPOSTISSET('remise_percent'.$predef) ? price2num(GETPOST('remise_percent'.$predef, 'alpha')) : 0); - if ($remise_percent === '') $remise_percent = 0; + if (empty($remise_percent)) { + $remise_percent = 0; + } // Extrafields $extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line); From 6df6286688d8e680453f078ba90fa6e2011d8c1c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Feb 2021 19:21:32 +0100 Subject: [PATCH 14/15] Fix IMAP_FORCE_NORSH and option for imap without ssl --- htdocs/admin/emailcollector_card.php | 5 ++++- htdocs/emailcollector/class/emailcollector.class.php | 9 ++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index 5b037e70a73..9c73199abea 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -415,7 +415,10 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (function_exists('imap_open')) { - $connectstringserver = $object->getConnectStringIMAP(); + // Note: $object->host has been loaded by the fetch + $usessl = 1; + + $connectstringserver = $object->getConnectStringIMAP($usessl); try { if ($sourcedir) { diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 1a05017c1d3..b01f1883d53 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -202,7 +202,6 @@ class EmailCollector extends CommonObject public $debuginfo; - const STATUS_DISABLED = 0; const STATUS_ENABLED = 1; @@ -716,11 +715,15 @@ class EmailCollector extends CommonObject // Connect to IMAP $flags = '/service=imap'; // IMAP - if ($ssl) $flags .= '/ssl'; // '/tls' + if (!empty($conf->global->IMAP_FORCE_TLS)) { + $flags .= '/tls'; + } elseif (empty($conf->global->IMAP_FORCE_NOSSL)) { + if ($ssl) $flags .= '/ssl'; + } $flags .= '/novalidate-cert'; //$flags.='/readonly'; //$flags.='/debug'; - if ($norsh || !empty($conf->global->IMPA_FORCE_NORSH)) $flags .= '/norsh'; + if ($norsh || !empty($conf->global->IMAP_FORCE_NORSH)) $flags .= '/norsh'; $connectstringserver = '{'.$this->host.':993'.$flags.'}'; From 9453caa5bed99dcc79a510698c688ceb072989d9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Feb 2021 22:12:12 +0100 Subject: [PATCH 15/15] Avoid message when not required --- htdocs/admin/company.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 550f4770c08..82753a58fa5 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -215,8 +215,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha')) if ($_POST["optionlocaltax1"] == "localtax1on") { - if (!isset($_REQUEST['lt1'])) - { + if (!GETPOSTISSET('lt1')) { dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX1", 0, 'chaine', 0, '', $conf->entity); } else { dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX1", GETPOST('lt1', 'aZ09'), 'chaine', 0, '', $conf->entity); @@ -225,8 +224,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha')) } if ($_POST["optionlocaltax2"] == "localtax2on") { - if (!isset($_REQUEST['lt2'])) - { + if (!GETPOSTISSET('lt2')) { dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX2", 0, 'chaine', 0, '', $conf->entity); } else { dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX2", GETPOST('lt2', 'aZ09'), 'chaine', 0, '', $conf->entity); @@ -236,7 +234,9 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha')) if (!$error) { - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + if (GETPOST('save')) { // To avoid to show message when we juste switch the country that resubmit the form. + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } $db->commit(); } else { $db->rollback();