From 68ac62d09c8a01dc09f2d0e947094757dff871d0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Oct 2021 11:05:06 +0200 Subject: [PATCH 01/21] Fix phpcs --- htdocs/fourn/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index e4aeae07581..985c9a4cc62 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -984,7 +984,7 @@ if (empty($reshook)) if (!in_array($lines[$i]->id, $selectedLines)) { continue; // Skip unselected lines } - + $desc = ($lines[$i]->desc ? $lines[$i]->desc : $lines[$i]->libelle); $product_type = ($lines[$i]->product_type ? $lines[$i]->product_type : 0); From 1efc2eda694479940fd143cc8a5e6207c82a60be Mon Sep 17 00:00:00 2001 From: lvessiller Date: Fri, 8 Oct 2021 11:54:38 +0200 Subject: [PATCH 02/21] FIX reload user lang --- scripts/cron/cron_run_jobs.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php index 80f586a6788..7e6fb991478 100755 --- a/scripts/cron/cron_run_jobs.php +++ b/scripts/cron/cron_run_jobs.php @@ -125,7 +125,7 @@ if ($userlogin == 'firstadmin') { // Check user login $user = new User($db); -$result = $user->fetch('', $userlogin); +$result = $user->fetch('', $userlogin, '', 1); if ($result < 0) { echo "User Error: ".$user->error; dol_syslog("cron_run_jobs.php:: User Error:".$user->error, LOG_ERR); @@ -137,6 +137,16 @@ if ($result < 0) { exit(-1); } } + +// Reload langs +$langcode = (empty($conf->global->MAIN_LANG_DEFAULT) ? 'auto' : $conf->global->MAIN_LANG_DEFAULT); +if (!empty($user->conf->MAIN_LANG_DEFAULT)) { + $langcode = $user->conf->MAIN_LANG_DEFAULT; +} +if ($langs->getDefaultLang() != $langcode) { + $langs->setDefaultLang($langcode); +} + $user->getrights(); if (isset($argv[3]) && $argv[3]) { @@ -195,8 +205,8 @@ if (is_array($qualifiedjobs) && (count($qualifiedjobs) > 0)) { $mysoc->setMysoc($conf); // Force recheck that user is ok for the entity to process and reload permission for entity - if ($conf->entity != $user->entity && $user->entity != 0) { - $result = $user->fetch('', $userlogin, '', 0, $conf->entity); + if ($conf->entity != $user->entity) { + $result = $user->fetch('', $userlogin, '', 1); if ($result < 0) { echo "\nUser Error: ".$user->error."\n"; dol_syslog("cron_run_jobs.php:: User Error:".$user->error, LOG_ERR); From be4a00213c6765d239bac5a861ed7f0d8ed8b141 Mon Sep 17 00:00:00 2001 From: lvessiller Date: Fri, 8 Oct 2021 15:58:08 +0200 Subject: [PATCH 03/21] FIX optional visibility on create card --- htdocs/asset/type.php | 2 +- htdocs/categories/card.php | 2 +- htdocs/comm/action/card.php | 2 +- htdocs/comm/mailing/card.php | 2 +- htdocs/commande/card.php | 2 +- htdocs/compta/bank/card.php | 2 +- htdocs/compta/facture/card.php | 2 +- htdocs/don/card.php | 2 +- htdocs/expensereport/card.php | 2 +- htdocs/fichinter/card.php | 2 +- htdocs/fourn/commande/card.php | 2 +- htdocs/fourn/facture/card.php | 2 +- htdocs/product/card.php | 2 +- htdocs/reception/card.php | 2 +- htdocs/salaries/card.php | 2 +- htdocs/supplier_proposal/card.php | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/htdocs/asset/type.php b/htdocs/asset/type.php index 6103b963e21..b09b56ffbcf 100644 --- a/htdocs/asset/type.php +++ b/htdocs/asset/type.php @@ -389,7 +389,7 @@ if ($action == 'create') { $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit', $parameters); + print $object->showOptionals($extrafields, 'create', $parameters); } print ''; print "\n"; diff --git a/htdocs/categories/card.php b/htdocs/categories/card.php index 141e061ac20..a11d9f843a5 100644 --- a/htdocs/categories/card.php +++ b/htdocs/categories/card.php @@ -266,7 +266,7 @@ if ($user->rights->categorie->creer) { $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit', $parameters); + print $object->showOptionals($extrafields, 'create', $parameters); } print ''; diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index bc9b77cc881..53b6e329c90 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1262,7 +1262,7 @@ if ($action == 'create') { $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit', $parameters); + print $object->showOptionals($extrafields, 'create', $parameters); } print ''; diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index e03d13c29e8..b91bc866d9a 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -726,7 +726,7 @@ if ($action == 'create') { $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit'); + print $object->showOptionals($extrafields, 'create'); } print ''; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index c40a64032c0..1c0ae369be6 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1721,7 +1721,7 @@ if ($action == 'create' && $usercancreate) { } }; - print $object->showOptionals($extrafields, 'edit', $parameters); + print $object->showOptionals($extrafields, 'create', $parameters); } // Template to use by default diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index d1cc0413bfd..c6b852be444 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -444,7 +444,7 @@ if ($action == 'create') { $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit', $parameters); + print $object->showOptionals($extrafields, 'create', $parameters); } print ''; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 6ea03d8bd23..83c8ec8d718 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3636,7 +3636,7 @@ if ($action == 'create') { } }; - print $object->showOptionals($extrafields, 'edit', $parameters); + print $object->showOptionals($extrafields, 'create', $parameters); } // Template to use by default diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 1b3c72906b4..9579497411f 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -492,7 +492,7 @@ if ($action == 'create') { $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit', $parameters); + print $object->showOptionals($extrafields, 'create', $parameters); } print ''; diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 81995792dbb..eec14c85a99 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -1421,7 +1421,7 @@ if ($action == 'create') { $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit', $parameters); + print $object->showOptionals($extrafields, 'create', $parameters); } print ''; diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index e138c8ed6fe..225f9ebacb8 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -930,7 +930,7 @@ if ($action == 'create') { $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit'); + print $object->showOptionals($extrafields, 'create'); } // Show link to origin object diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index f02ffb99d77..cdeeeff9d17 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1760,7 +1760,7 @@ if ($action == 'create') { print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit'); + print $object->showOptionals($extrafields, 'create'); } // Bouton "Create Draft" diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 6241a0cee15..80f868f3484 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2270,7 +2270,7 @@ if ($action == 'create') { } if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit'); + print $object->showOptionals($extrafields, 'create'); } // Public note diff --git a/htdocs/product/card.php b/htdocs/product/card.php index b7aba2ec398..9aa2c1a1a09 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1334,7 +1334,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit', $parameters); + print $object->showOptionals($extrafields, 'create', $parameters); } // Note (private, no output on invoices, propales...) diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 40b605bbe17..111d65e8c7f 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -869,7 +869,7 @@ if ($action == 'create') { if ($objectsrc->fetch_optionals() > 0) { $recept->array_options = array_merge($recept->array_options, $objectsrc->array_options); } - print $object->showOptionals($extrafields, 'edit', $parameters); + print $object->showOptionals($extrafields, 'create', $parameters); } // Incoterms diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index b6f8dd91f14..486b4fd70ea 100755 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -576,7 +576,7 @@ if ($action == 'create') { $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit'); + print $object->showOptionals($extrafields, 'create'); } print ''; diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 6f1d0824b0b..1500f00ba91 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1233,7 +1233,7 @@ if ($action == 'create') { $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit', $parameters); + print $object->showOptionals($extrafields, 'create', $parameters); } From 90be175c500d57f60118764b7a2110e118a7c07b Mon Sep 17 00:00:00 2001 From: lvessiller Date: Fri, 8 Oct 2021 16:20:51 +0200 Subject: [PATCH 04/21] FIX load tranlate array after setting lang --- scripts/cron/cron_run_jobs.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php index 7e6fb991478..8aa996f9c17 100755 --- a/scripts/cron/cron_run_jobs.php +++ b/scripts/cron/cron_run_jobs.php @@ -76,9 +76,6 @@ $userlogin = $argv[2]; $version = DOL_VERSION; $error = 0; -// Language Management -$langs->loadLangs(array('main', 'admin', 'cron', 'dict')); - /* * Main @@ -145,7 +142,10 @@ if (!empty($user->conf->MAIN_LANG_DEFAULT)) { } if ($langs->getDefaultLang() != $langcode) { $langs->setDefaultLang($langcode); + $langs->tab_translate = array(); } +// Language Management +$langs->loadLangs(array('main', 'admin', 'cron', 'dict')); $user->getrights(); @@ -228,6 +228,8 @@ if (is_array($qualifiedjobs) && (count($qualifiedjobs) > 0)) { } if ($langs->getDefaultLang() != $langcode) { $langs->setDefaultLang($langcode); + $langs->tab_translate = array(); + $langs->loadLangs(array('main', 'admin', 'cron', 'dict')); } } From cdf1d37a1d50f57bec4a6a5140cafde5ef82a818 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Oct 2021 18:52:01 +0200 Subject: [PATCH 05/21] Fix changelog --- ChangeLog | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/ChangeLog b/ChangeLog index 4625e7bc077..f202acb2403 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,48 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 14.0.3 compared to 14.0.2 ***** + +FIX: #18698 Supplier invoice list - "alert" checkbox not working +FIX: #18735 +FIX: #18767 : Member delete +FIX: #18854 +FIX: #18910 : MRP List SQL query syntax error with more than one extrafileds. +FIX: Accountancy - Format Quadra export - Missing line type C to create automaticly a subledger account with label +FIX: Accountancy - Missing specific filename for export on format FEC2, Ciel & repare it +FIX: Accountancy - Option of export popup are inverted +FIX: Accountancy - Some correction on export name +FIX: Accountancy - Trunc code_journal to 2 in format XIMPORT (Ciel, Sage50) +FIX: add warehouse in projects' overview count +FIX: autocalculation of the supplier price in main currency. +FIX: avoid warning if $categories is an id +FIX: Bad use of a forced contact of another company on PDF/ODT documents +FIX: Button text on proposal card to create a invoice +FIX: calculateCosts of BOM must not be included into fetch +FIX: check if greater 0 +FIX: default language defined for IN country +FIX: fetch of product with modulebuilder load too much data +FIX: Filter on categories +FIX: indentation +FIX: init hookmanager after loading $conf values +FIX: legal issue on expense report pdf (must also show price without tax) +FIX: missing filter status=1 on rss feeds +FIX: move fetch_optionnal into $ac_static->fetch() +FIX: payment using wrong type in takepos when too many payment mode +FIX: Product accountancy affectation with product_perentity activated (PR #18620) +FIX: products/services card: hidden extrafields were overridden +FIX: Propal list - Problem of pagination on date +FIX: selected lines on supplier invoice create +FIX: Selection of type "people" for membership must hide the company +FIX: select list of orders not complete when field type of company is on +FIX: support of localtax on expense report +FIX: task time: can't filter by user with pgsql + show error message +FIX: task time: keep on using natural_search +FIX: Test when date of invoie is in future (pb with TZ and offset) +FIX: translation into email for member at membership validation. +FIX: unprivileged user can see task associated with a not allowed project +FIX: user without permission can set ticket subject + ***** ChangeLog for 14.0.2 compared to 14.0.1 ***** FIX: #18353 Invoice list translation issue From de17b367c8e873d12c86ed004f7521097f5e5927 Mon Sep 17 00:00:00 2001 From: Benjamin Chantalat <74144396+PyroShape@users.noreply.github.com> Date: Sat, 9 Oct 2021 20:14:16 +0200 Subject: [PATCH 06/21] FIX #18875 in v14 --- htdocs/reception/list.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index 624748ded8f..2d6600dcc45 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -612,11 +612,13 @@ if ($search_ref_supplier) { $param .= "&search_ref_supplier=".urlencode($search_ref_supplier); } // Add $param from extra fields -foreach ($search_array_options as $key => $val) { - $crit = $val; - $tmpkey = preg_replace('/search_options_/', '', $key); - if ($val != '') { - $param .= '&search_options_'.$tmpkey.'='.urlencode($val); +if ($search_array_options) { + foreach ($search_array_options as $key => $val) { + $crit = $val; + $tmpkey = preg_replace('/search_options_/', '', $key); + if ($val != '') { + $param .= '&search_options_'.$tmpkey.'='.urlencode($val); + } } } From 6e60e1f45308c4bcf5b08636ad6bda6cc601b1fe Mon Sep 17 00:00:00 2001 From: Benjamin Chantalat <74144396+PyroShape@users.noreply.github.com> Date: Sat, 9 Oct 2021 20:38:46 +0200 Subject: [PATCH 07/21] Fix date format into supplier order info tab --- htdocs/fourn/class/fournisseur.commande.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 3facc342f08..2e9727de83c 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2927,11 +2927,11 @@ class CommandeFournisseur extends CommonOrder $this->user_approve_id2 = $obj->fk_user_approve2; } - $this->date_creation = $this->db->idate($obj->datec); - $this->date_modification = $this->db->idate($obj->datem); - $this->date_approve = $this->db->idate($obj->datea); - $this->date_approve2 = $this->db->idate($obj->datea2); - $this->date_validation = $this->db->idate($obj->date_validation); + $this->date_creation = $obj->datec; + $this->date_modification = $obj->datem; + $this->date_approve = $obj->datea; + $this->date_approve2 = $obj->datea2; + $this->date_validation = $obj->date_validation; } $this->db->free($result); } else { From ff5f3714280979bc3899ac74c760f2e09f35f448 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Oct 2021 20:46:06 +0200 Subject: [PATCH 08/21] Fix add protection to avoid deletion of page when deleting a file --- htdocs/website/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 6aab64736e3..f40c21778f5 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -1231,7 +1231,7 @@ if ($action == 'confirm_deletesite' && $confirm == 'yes' && $permissiontodelete) } // Delete page (from website page menu) -if (GETPOSTISSET('pageid') && $action == 'delete' && $permissiontodelete) { +if (GETPOSTISSET('pageid') && $action == 'delete' && $permissiontodelete && !GETPOST('file_manager')) { $error = 0; $db->begin(); From b43dcb24f0b0c2819b30fed0bde5d76f8a6523d7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Oct 2021 11:04:21 +0200 Subject: [PATCH 09/21] Update fournisseur.commande.class.php --- htdocs/fourn/class/fournisseur.commande.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 2e9727de83c..02ffc77918a 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2927,11 +2927,11 @@ class CommandeFournisseur extends CommonOrder $this->user_approve_id2 = $obj->fk_user_approve2; } - $this->date_creation = $obj->datec; - $this->date_modification = $obj->datem; - $this->date_approve = $obj->datea; - $this->date_approve2 = $obj->datea2; - $this->date_validation = $obj->date_validation; + $this->date_creation = $this->db->jdate($obj->datec); + $this->date_modification = $this->db->jdate($obj->datem); + $this->date_approve = $this->db->jdate($obj->datea); + $this->date_approve2 = $this->db->jdate($obj->datea2); + $this->date_validation = $this->db->jdate($obj->date_validation); } $this->db->free($result); } else { From 91164951deb1f246e50183cb72ecc96bf6afe84d Mon Sep 17 00:00:00 2001 From: Benjamin Chantalat <74144396+PyroShape@users.noreply.github.com> Date: Mon, 11 Oct 2021 15:24:56 +0200 Subject: [PATCH 10/21] Remove not complete order from virtual stock --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index d746bf4a812..acb66eb1ebb 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5271,7 +5271,7 @@ class Product extends CommonObject $stock_sending_client = $this->stats_expedition['qty']; } if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) { - $filterStatus = empty($conf->global->SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK) ? '2,3,4' : $conf->global->SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK; + $filterStatus = empty($conf->global->SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK) ? '3,4' : $conf->global->SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK; if (isset($includedraftpoforvirtual)) { $filterStatus = '0,1,2,'.$filterStatus; // 1,2 may have already been inside $filterStatus but it is better to have twice than missing $filterStatus does not include them } From 7c8bde885bf85abf454d57444a27a80bd9da2be9 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Mon, 11 Oct 2021 16:03:56 +0200 Subject: [PATCH 11/21] hook createDictioaryFieldList : tr html tag to right place --- htdocs/admin/dict.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 897fcdf7555..ab7eaf73653 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1238,6 +1238,10 @@ if ($id) print $tdsoffields; + // Line to enter new values + print ''; + print ''; + $obj = new stdClass(); // If data was already input, we define them in obj to populate input fields. if (GETPOST('actionadd')) @@ -1256,9 +1260,6 @@ if ($id) if ($id == 3) unset($fieldlist[2]); // Remove field ??? if dictionary Regions - // Line to enter new values - print ''; - print ''; if (empty($reshook)) { From 5fc0802eb1a6462d923c04f0e3e503254012cda7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Oct 2021 16:13:55 +0200 Subject: [PATCH 12/21] Fix for backward compatibility --- htdocs/core/lib/functions.lib.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 54ef73f19d6..ac019f33bc2 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -41,6 +41,30 @@ include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php'; +/** + * Return dolibarr global constant string value + * @param string $key key to return value, return '' if not set + * @return string + */ +function getDolGlobalString($key) +{ + global $conf; + // return $conf->global->$key ?? ''; + return (string) (empty($conf->global->$key) ? '' : $conf->global->$key); +} + +/** + * Return dolibarr global constant int value + * @param string $key key to return value, return 0 if not set + * @return int + */ +function getDolGlobalInt($key) +{ + global $conf; + // return $conf->global->$key ?? 0; + return (int) (empty($conf->global->$key) ? 0 : $conf->global->$key); +} + /** * Return a DoliDB instance (database handler). * From 3a32787f150d7071210a00a6ead2aeae752a2c25 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Oct 2021 16:14:34 +0200 Subject: [PATCH 13/21] Fix for backward compatibility --- htdocs/core/lib/functions.lib.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 51b7442defe..01e8acf4896 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -40,6 +40,30 @@ include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php'; +/** + * Return dolibarr global constant string value + * @param string $key key to return value, return '' if not set + * @return string + */ +function getDolGlobalString($key) +{ + global $conf; + // return $conf->global->$key ?? ''; + return (string) (empty($conf->global->$key) ? '' : $conf->global->$key); +} + +/** + * Return dolibarr global constant int value + * @param string $key key to return value, return 0 if not set + * @return int + */ +function getDolGlobalInt($key) +{ + global $conf; + // return $conf->global->$key ?? 0; + return (int) (empty($conf->global->$key) ? 0 : $conf->global->$key); +} + /** * Return a DoliDB instance (database handler). * From 4e9c7c9efb4166f79cc159615e6a19f4a661ca2c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Oct 2021 20:04:45 +0200 Subject: [PATCH 14/21] FIX Attachment of pdf into shipment when sending email --- htdocs/core/class/html.formmail.class.php | 2 ++ htdocs/core/lib/files.lib.php | 5 +++-- htdocs/core/tpl/massactions_pre.tpl.php | 5 +---- htdocs/expedition/card.php | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 3dc2743adf1..40496ee7fa9 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -792,6 +792,7 @@ class FormMail extends Form if (count($listofpaths)) { foreach ($listofpaths as $key => $val) { $relativepathtofile = substr($val, (strlen(DOL_DATA_ROOT) - strlen($val))); + if ($conf->entity > 1) { $relativepathtofile = str_replace($conf->entity.'/', '', $relativepathtofile); } @@ -802,6 +803,7 @@ class FormMail extends Form $out .= '
'; // Preview of attachment $out .= img_mime($listofnames[$key]).' '.$listofnames[$key]; + $out .= $formfile->showPreview(array(), $formfile_params[2], $formfile_params[4]); if (!$this->withfilereadonly) { $out .= ' '; diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 43ad95157dc..613f7f2d8a8 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2707,13 +2707,14 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, if ($fuser->rights->expedition->{$lire} || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } - $original_file = $conf->expedition->dir_output."/sending/".$original_file; + $original_file = $conf->expedition->dir_output."/".(strpos('sending/', $original_file) == 0 ? '' : 'sending/').$original_file; + //$original_file = $conf->expedition->dir_output."/".$original_file; } elseif (($modulepart == 'livraison' || $modulepart == 'delivery') && !empty($conf->expedition->dir_output)) { // Delivery Note Wrapping if ($fuser->rights->expedition->delivery->{$lire} || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } - $original_file = $conf->expedition->dir_output."/receipt/".$original_file; + $original_file = $conf->expedition->dir_output."/".(strpos('receipt/', $original_file) == 0 ? '' : 'receipt/').$original_file; } elseif ($modulepart == 'actions' && !empty($conf->agenda->dir_output)) { // Wrapping pour les actions if ($fuser->rights->agenda->myactions->{$read} || preg_match('/^specimen/i', $original_file)) { diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index f9c74dd7085..91fc11ac217 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -99,12 +99,9 @@ if ($massaction == 'presend') { print ''; - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - print dol_get_fiche_head(null, '', ''); - // Cree l'objet formulaire mail + // Create mail form include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; $formmail = new FormMail($db); $formmail->withform = -1; diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 902914c4327..3d2b995233a 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -2552,8 +2552,8 @@ if ($action == 'create') { // Presend form $modelmail = 'shipping_send'; - $defaulttopic = 'SendShippingRef'; - $diroutput = $conf->expedition->dir_output; + $defaulttopic = $langs->trans('SendShippingRef'); + $diroutput = $conf->expedition->dir_output.'/sending'; $trackid = 'shi'.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; From 2e32254574c03e712024f5a4c6ddb92e747598da Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 11 Oct 2021 20:36:10 +0200 Subject: [PATCH 15/21] Fix rul to shipment files --- htdocs/core/lib/files.lib.php | 4 ++-- htdocs/core/lib/functions.lib.php | 24 ------------------------ 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 613f7f2d8a8..36feaf79a6e 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2707,14 +2707,14 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, if ($fuser->rights->expedition->{$lire} || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } - $original_file = $conf->expedition->dir_output."/".(strpos('sending/', $original_file) == 0 ? '' : 'sending/').$original_file; + $original_file = $conf->expedition->dir_output."/".(strpos('sending/', $original_file) === 0 ? '' : 'sending/').$original_file; //$original_file = $conf->expedition->dir_output."/".$original_file; } elseif (($modulepart == 'livraison' || $modulepart == 'delivery') && !empty($conf->expedition->dir_output)) { // Delivery Note Wrapping if ($fuser->rights->expedition->delivery->{$lire} || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } - $original_file = $conf->expedition->dir_output."/".(strpos('receipt/', $original_file) == 0 ? '' : 'receipt/').$original_file; + $original_file = $conf->expedition->dir_output."/".(strpos('receipt/', $original_file) === 0 ? '' : 'receipt/').$original_file; } elseif ($modulepart == 'actions' && !empty($conf->agenda->dir_output)) { // Wrapping pour les actions if ($fuser->rights->agenda->myactions->{$read} || preg_match('/^specimen/i', $original_file)) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 443a757b512..e0dcc51917b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -65,30 +65,6 @@ function getDolGlobalInt($key) return (int) (empty($conf->global->$key) ? 0 : $conf->global->$key); } -/** - * Return dolibarr global constant string value - * @param string $key key to return value, return '' if not set - * @return string - */ -function getDolGlobalString($key) -{ - global $conf; - // return $conf->global->$key ?? ''; - return (string) (empty($conf->global->$key) ? '' : $conf->global->$key); -} - -/** - * Return dolibarr global constant int value - * @param string $key key to return value, return 0 if not set - * @return int - */ -function getDolGlobalInt($key) -{ - global $conf; - // return $conf->global->$key ?? 0; - return (int) (empty($conf->global->$key) ? 0 : $conf->global->$key); -} - /** * Return a DoliDB instance (database handler). * From 17885089636859773c1bce76c66dec3a59af0479 Mon Sep 17 00:00:00 2001 From: lvessiller Date: Tue, 12 Oct 2021 14:11:19 +0200 Subject: [PATCH 16/21] FIX payment style and html5 tags --- htdocs/takepos/css/pos.css.php | 7 ++-- htdocs/takepos/pay.php | 66 +++++++++++++++++----------------- 2 files changed, 35 insertions(+), 38 deletions(-) diff --git a/htdocs/takepos/css/pos.css.php b/htdocs/takepos/css/pos.css.php index e180dc33b3e..395c786b232 100644 --- a/htdocs/takepos/css/pos.css.php +++ b/htdocs/takepos/css/pos.css.php @@ -320,12 +320,11 @@ table.postablelines tr td { div.paymentbordline { - width:calc(50% - 16px); - background-color:#888; + background-color: #888; border-radius: 8px; - margin-bottom: 4px; - display: inline-block; + margin: 4px auto; padding: 5px; + width: calc(50% - 10px); } @media only screen and (max-aspect-ratio: 6/4) { diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index 60a4840471e..66d710c2a52 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -37,9 +37,9 @@ if (!defined('NOREQUIREMENU')) { if (!defined('NOREQUIREHTML')) { define('NOREQUIREHTML', '1'); } -if (!defined('NOREQUIREAJAX')) { - define('NOREQUIREAJAX', '1'); -} +//if (!defined('NOREQUIREAJAX')) { +// define('NOREQUIREAJAX', '1'); +//} require '../main.inc.php'; // Load $user and permissions require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; @@ -257,38 +257,36 @@ if ($conf->global->TAKEPOS_NUMPAD == 0) { } -
- -
-
trans('TotalTTC'); ?>: total_ttc, 1, '', 1, -1, -1, $invoice->multicurrency_code); ?>
+
+
+
+ trans('TotalTTC'); ?>: total_ttc, 1, '', 1, -1, -1, $invoice->multicurrency_code); ?> +
+ total_ttc) { ?> +
+ trans('RemainToPay'); ?>: multicurrency_code); ?> +
+ +
+ trans("Received"); ?>: multicurrency_code); ?> +
+
+ trans("Change"); ?>: multicurrency_code); ?> +
+ global->TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT)) { + require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; + print '
'; + $filter = ''; + $form = new Form($db); + print ''.$langs->trans("BankAccount").': '; + $form->select_comptes(0, 'accountid', 0, $filter, 1, ''); + print ajax_combobox('selectaccountid'); + print '
'; + } + ?> +
-total_ttc) { ?> -
-
trans('RemainToPay'); ?>: multicurrency_code); ?>
-
- -
-
trans("Received"); ?>: multicurrency_code); ?>
-
-
-
trans("Change"); ?>: multicurrency_code); ?>
-
-global->TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT)) { - print '
-
'; - $filter = ''; - $form = new Form($db); - print ''.$langs->trans("BankAccount").': '; - $form->select_comptes(0, 'accountid', 0, $filter, 1, ''); - print ajax_combobox('selectaccountid'); - print '
-
'; -} -?> - -
-
Date: Tue, 12 Oct 2021 15:52:59 +0200 Subject: [PATCH 17/21] FIX 2 columns for total labels --- htdocs/takepos/css/pos.css.php | 7 +++-- htdocs/takepos/pay.php | 54 ++++++++++++++++------------------ 2 files changed, 30 insertions(+), 31 deletions(-) diff --git a/htdocs/takepos/css/pos.css.php b/htdocs/takepos/css/pos.css.php index 395c786b232..e180dc33b3e 100644 --- a/htdocs/takepos/css/pos.css.php +++ b/htdocs/takepos/css/pos.css.php @@ -320,11 +320,12 @@ table.postablelines tr td { div.paymentbordline { - background-color: #888; + width:calc(50% - 16px); + background-color:#888; border-radius: 8px; - margin: 4px auto; + margin-bottom: 4px; + display: inline-block; padding: 5px; - width: calc(50% - 10px); } @media only screen and (max-aspect-ratio: 6/4) { diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index 66d710c2a52..4bd20f33f4b 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -257,35 +257,33 @@ if ($conf->global->TAKEPOS_NUMPAD == 0) { } -
-
-
- trans('TotalTTC'); ?>: total_ttc, 1, '', 1, -1, -1, $invoice->multicurrency_code); ?> -
- total_ttc) { ?> -
- trans('RemainToPay'); ?>: multicurrency_code); ?> -
- -
- trans("Received"); ?>: multicurrency_code); ?> -
-
- trans("Change"); ?>: multicurrency_code); ?> -
- global->TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT)) { - require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; - print '
'; - $filter = ''; - $form = new Form($db); - print ''.$langs->trans("BankAccount").': '; - $form->select_comptes(0, 'accountid', 0, $filter, 1, ''); - print ajax_combobox('selectaccountid'); - print '
'; - } - ?> +
+
+ trans('TotalTTC'); ?>: total_ttc, 1, '', 1, -1, -1, $invoice->multicurrency_code); ?>
+ total_ttc) { ?> +
+ trans('RemainToPay'); ?>: multicurrency_code); ?> +
+ +
+ trans("Received"); ?>: multicurrency_code); ?> +
+
+ trans("Change"); ?>: multicurrency_code); ?> +
+ global->TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT)) { + require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; + print '
'; + $filter = ''; + $form = new Form($db); + print ''.$langs->trans("BankAccount").': '; + $form->select_comptes(0, 'accountid', 0, $filter, 1, ''); + print ajax_combobox('selectaccountid'); + print '
'; + } + ?>
From 371c75e76a1be84fc4ce497f2d7ccb70256d41f6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Oct 2021 11:58:21 +0200 Subject: [PATCH 18/21] FIX list of categories in stats of supplier invoices --- htdocs/compta/facture/stats/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 49f9be88ac6..7482faebad8 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -283,7 +283,7 @@ if (! empty($conf->category->enabled)) { $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Supplier")); } print ''.$cat_label.''; - $cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, 'parent', null, null, 1); + $cate_arbo = $form->select_all_categories($cat_type, null, 'parent', null, null, 1); print $form->multiselectarray('custcats', $cate_arbo, GETPOST('custcats', 'array'), null, null, null, null, "90%"); //print $formother->select_categories($cat_type, $categ_id, 'categ_id', true); print ''; From db3d16f080a1151ab581920553b6d4dd227aed42 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Oct 2021 15:43:35 +0200 Subject: [PATCH 19/21] Fix filter tag for supplier invoice statistics --- htdocs/compta/facture/stats/index.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 7482faebad8..fb47a3eb788 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -92,18 +92,15 @@ print load_fiche_titre($title, '', $picto); dol_mkdir($dir); $stats = new FactureStats($db, $socid, $mode, ($userid > 0 ? $userid : 0), ($typent_id > 0 ? $typent_id : 0), ($categ_id > 0 ? $categ_id : 0)); -if ($mode == 'customer') -{ - if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND f.fk_statut IN ('.$db->escape($object_status).')'; +if ($mode == 'customer' || $mode == 'supplier') { + if ($object_status != '' && $object_status >= 0) { + $stats->where .= ' AND f.fk_statut IN ('.$db->escape($object_status).')'; + } if (is_array($custcats) && !empty($custcats)) { $stats->from .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_societe as cat ON (f.fk_soc = cat.fk_soc)'; $stats->where .= ' AND cat.fk_categorie IN ('.implode(',', $custcats).')'; } } -if ($mode == 'supplier') -{ - if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND f.fk_statut IN ('.$db->escape($object_status).')'; -} // Build graphic number of object // $data = array(array('Lib',val1,val2,val3),...) From 3875d26a2feb7f6fb39cc158101521f7b563b617 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Oct 2021 15:55:12 +0200 Subject: [PATCH 20/21] Fix filter for supplierinvoice stats --- htdocs/compta/facture/stats/index.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index fb47a3eb788..03fcf5b37d0 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -92,7 +92,7 @@ print load_fiche_titre($title, '', $picto); dol_mkdir($dir); $stats = new FactureStats($db, $socid, $mode, ($userid > 0 ? $userid : 0), ($typent_id > 0 ? $typent_id : 0), ($categ_id > 0 ? $categ_id : 0)); -if ($mode == 'customer' || $mode == 'supplier') { +if ($mode == 'customer') { if ($object_status != '' && $object_status >= 0) { $stats->where .= ' AND f.fk_statut IN ('.$db->escape($object_status).')'; } @@ -101,6 +101,16 @@ if ($mode == 'customer' || $mode == 'supplier') { $stats->where .= ' AND cat.fk_categorie IN ('.implode(',', $custcats).')'; } } +if ($mode == 'supplier') { + if ($object_status != '' && $object_status >= 0) { + $stats->where .= ' AND f.fk_statut IN ('.$db->escape($object_status).')'; + } + if (is_array($custcats) && !empty($custcats)) { + $stats->from .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_fournisseur as cat ON (f.fk_soc = cat.fk_soc)'; + $stats->where .= ' AND cat.fk_categorie IN ('.implode(',', $custcats).')'; + } + +} // Build graphic number of object // $data = array(array('Lib',val1,val2,val3),...) From 07052196e27229d69f7ba580f32a17aed35b4a2e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Oct 2021 12:33:19 +0200 Subject: [PATCH 21/21] Fix popup message on sepa creation --- htdocs/compta/prelevement/create.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index e93b2a7472d..311f030f013 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -100,9 +100,11 @@ if (empty($reshook)) } } else { if ($type != 'bank-transfer') { - setEventMessages($langs->trans("DirectDebitOrderCreated", $bprev->getNomUrl(1)), null); + $s = $langs->trans("DirectDebitOrderCreated", '{s}'); + setEventMessages(str_replace('{s}', $bprev->getNomUrl(1), $s), null); } else { - setEventMessages($langs->trans("CreditTransferOrderCreated", $bprev->getNomUrl(1)), null); + $s = $langs->trans("CreditTransferOrderCreated", '{s}'); + setEventMessages(str_replace('{s}', $bprev->getNomUrl(1), $s), null); } header("Location: ".DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$bprev->id);