From 24aee0a27424f23e1427715124105f1bc00810a0 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 12 Apr 2023 15:44:56 +0200 Subject: [PATCH 01/24] FIX missing entity field in unique index --- htdocs/install/mysql/migration/15.0.0-16.0.0.sql | 2 ++ htdocs/install/mysql/tables/llx_overwrite_trans.key.sql | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql index f4b7689d6df..ac8fdab8c97 100644 --- a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql +++ b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql @@ -738,6 +738,8 @@ ALTER TABLE llx_expedition ADD COLUMN billed smallint DEFAULT 0; ALTER TABLE llx_loan_schedule ADD UNIQUE INDEX uk_loan_schedule_ref (fk_loan, datep); +ALTER TABLE llx_overwrite_trans DROP INDEX uk_overwrite_trans; +ALTER TABLE llx_overwrite_trans ADD UNIQUE INDEX uk_overwrite_trans(lang, transkey, entity); -- Bank Thirdparty diff --git a/htdocs/install/mysql/tables/llx_overwrite_trans.key.sql b/htdocs/install/mysql/tables/llx_overwrite_trans.key.sql index 617036e66ee..41493d43f9e 100644 --- a/htdocs/install/mysql/tables/llx_overwrite_trans.key.sql +++ b/htdocs/install/mysql/tables/llx_overwrite_trans.key.sql @@ -17,5 +17,5 @@ -- =========================================================================== -ALTER TABLE llx_overwrite_trans ADD UNIQUE INDEX uk_overwrite_trans(lang, transkey); +ALTER TABLE llx_overwrite_trans ADD UNIQUE INDEX uk_overwrite_trans(lang, transkey, entity); From e394e5ba43a4f881b5c0fc791302adc73a2b1dcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Courtier?= Date: Tue, 18 Apr 2023 11:24:40 +0200 Subject: [PATCH 02/24] FIX: Fiscal year list ref display --- htdocs/accountancy/admin/fiscalyear.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php index 2eb77815b60..d20ba244375 100644 --- a/htdocs/accountancy/admin/fiscalyear.php +++ b/htdocs/accountancy/admin/fiscalyear.php @@ -143,6 +143,7 @@ if ($result) { while ($i < $num && $i < $max) { $obj = $db->fetch_object($result); + $fiscalyearstatic->ref = $obj->rowid; $fiscalyearstatic->id = $obj->rowid; print ''; From 3de0a682c1386e9e20cc317222c3fd67710d645f Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Tue, 18 Apr 2023 16:31:58 +0200 Subject: [PATCH 03/24] FIX for empty shipping --- htdocs/expedition/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index e2220ec6367..3286f97002e 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -317,7 +317,7 @@ if (empty($reshook)) { //var_dump($batch_line[2]); - if ($totalqty > 0) { // There is at least one thing to ship + if ($totalqty > 0 && !empty($conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS)) { // There is at least one thing to ship //var_dump($_POST);exit; for ($i = 0; $i < $num; $i++) { $qty = "qtyl".$i; @@ -327,7 +327,7 @@ if (empty($reshook)) { //shipment from multiple stock locations $nbstockline = count($stockLine[$i]); for ($j = 0; $j < $nbstockline; $j++) { - if ($stockLine[$i][$j]['qty'] > 0) { + if ($stockLine[$i][$j]['qty'] > 0 || ($stockLine[$i][$j]['qty'] == 0 && !empty($conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS))) { $ret = $object->addline($stockLine[$i][$j]['warehouse_id'], $stockLine[$i][$j]['ix_l'], $stockLine[$i][$j]['qty'], $array_options[$i]); if ($ret < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -336,7 +336,7 @@ if (empty($reshook)) { } } } else { - if (GETPOST($qty, 'int') > 0 || (GETPOST($qty, 'int') == 0 && $conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS)) { + if (GETPOST($qty, 'int') > 0 || (GETPOST($qty, 'int') == 0 && !empty($conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS))) { $ent = "entl".$i; $idl = "idl".$i; $entrepot_id = is_numeric(GETPOST($ent, 'int')) ?GETPOST($ent, 'int') : GETPOST('entrepot_id', 'int'); From d7436d5d8c0d4629393746b7f906e91e3b2fd537 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Tue, 18 Apr 2023 16:38:13 +0200 Subject: [PATCH 04/24] fix test --- htdocs/expedition/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 3286f97002e..6dbcc538397 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -317,7 +317,7 @@ if (empty($reshook)) { //var_dump($batch_line[2]); - if ($totalqty > 0 && !empty($conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS)) { // There is at least one thing to ship + if ($totalqty > 0 || !empty($conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS)) { // There is at least one thing to ship //var_dump($_POST);exit; for ($i = 0; $i < $num; $i++) { $qty = "qtyl".$i; From 0a4d37dbcb3d09b5d524db88772c5ce88eda1d5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Courtier?= Date: Tue, 18 Apr 2023 16:49:07 +0200 Subject: [PATCH 05/24] FIX: Use max parameters of widget graph product distribution --- htdocs/core/boxes/box_graph_product_distribution.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index 44f94fd48d1..1a1ec5cb311 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -161,7 +161,7 @@ class box_graph_product_distribution extends ModeleBoxes $showpointvalue = 1; $nocolor = 0; $stats_proposal = new PropaleStats($this->db, $socid, ($userid > 0 ? $userid : 0)); - $data2 = $stats_proposal->getAllByProductEntry($year, (GETPOST('action', 'aZ09') == $refreshaction ?-1 : (3600 * 24)), 5); + $data2 = $stats_proposal->getAllByProductEntry($year, (GETPOST('action', 'aZ09') == $refreshaction ?-1 : (3600 * 24)), $max); if (empty($data2)) { $showpointvalue = 0; $nocolor = 1; @@ -224,7 +224,7 @@ class box_graph_product_distribution extends ModeleBoxes $nocolor = 0; $mode = 'customer'; $stats_order = new CommandeStats($this->db, $socid, $mode, ($userid > 0 ? $userid : 0)); - $data3 = $stats_order->getAllByProductEntry($year, (GETPOST('action', 'aZ09') == $refreshaction ?-1 : (3600 * 24)), 5); + $data3 = $stats_order->getAllByProductEntry($year, (GETPOST('action', 'aZ09') == $refreshaction ?-1 : (3600 * 24)), $max); if (empty($data3)) { $showpointvalue = 0; $nocolor = 1; @@ -288,7 +288,7 @@ class box_graph_product_distribution extends ModeleBoxes $nocolor = 0; $mode = 'customer'; $stats_invoice = new FactureStats($this->db, $socid, $mode, ($userid > 0 ? $userid : 0)); - $data1 = $stats_invoice->getAllByProductEntry($year, (GETPOST('action', 'aZ09') == $refreshaction ?-1 : (3600 * 24)), 5); + $data1 = $stats_invoice->getAllByProductEntry($year, (GETPOST('action', 'aZ09') == $refreshaction ?-1 : (3600 * 24)), $max); if (empty($data1)) { $showpointvalue = 0; From b4c196b2fbd636e4645f041b27c811dae5011bef Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Thu, 20 Apr 2023 15:50:24 +0200 Subject: [PATCH 06/24] FIX: product notes rights --- htdocs/core/tpl/notes.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php index 0430ec16e0e..aa7e752fbc0 100644 --- a/htdocs/core/tpl/notes.tpl.php +++ b/htdocs/core/tpl/notes.tpl.php @@ -91,7 +91,7 @@ if ($module == 'propal') { } elseif ($module == 'shipping') { $permission = $user->hasRight("expedition", "creer"); } elseif ($module == 'product') { - $permission = $user->hasRight("produit", "creer"); + $permission = $user->hasRight("product", "creer"); } elseif ($module == 'service') { $permission = $user->hasRight("service", "creer"); } elseif ($module == 'ecmfiles') { From a65bbaf109a90d6843a1fad803e4cd1edca524e2 Mon Sep 17 00:00:00 2001 From: Randall Mora <50120822+randallmoraes@users.noreply.github.com> Date: Fri, 21 Apr 2023 08:27:34 -0600 Subject: [PATCH 07/24] Fix getnomurl function Fix the assignment of the period for the execution of the getnomurl function, executing the previous lookup of the period id --- htdocs/accountancy/admin/fiscalyear.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php index 2eb77815b60..a4020d91e52 100644 --- a/htdocs/accountancy/admin/fiscalyear.php +++ b/htdocs/accountancy/admin/fiscalyear.php @@ -143,7 +143,7 @@ if ($result) { while ($i < $num && $i < $max) { $obj = $db->fetch_object($result); - $fiscalyearstatic->id = $obj->rowid; + $fiscalyearstatic->fetch($obj->rowid); print ''; print ''; From 5ec6b2934511ff3fffba9efdcf3ea3af23a58edb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alo=C3=AFs=20Micard?= Date: Sun, 23 Apr 2023 14:01:52 +0200 Subject: [PATCH 08/24] Fix order line origin/origin_id when creating from proposal --- htdocs/commande/class/commande.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index c636b4e905d..5c38cbdf51d 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1325,6 +1325,9 @@ class Commande extends CommonOrder $line->marge_tx = $marginInfos[1]; $line->marque_tx = $marginInfos[2]; + $line->origin = $object->element; + $line->origin_id = $object->lines[$i]->id; + // get extrafields from original line $object->lines[$i]->fetch_optionals(); foreach ($object->lines[$i]->array_options as $options_key => $value) { From db0b6b0fd5813399302528aa2f77f2dd916c735b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 23 Apr 2023 22:07:14 +0200 Subject: [PATCH 09/24] Fix label --- build/exe/doliwamp/Languages/MyCatalan.isl | 2 +- build/exe/doliwamp/Languages/MyEnglish.isl | 2 +- build/exe/doliwamp/Languages/MyFrench.isl | 2 +- build/exe/doliwamp/Languages/MyGerman.isl | 2 +- build/exe/doliwamp/Languages/MySpanish.isl | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build/exe/doliwamp/Languages/MyCatalan.isl b/build/exe/doliwamp/Languages/MyCatalan.isl index b157d1cea27..cb1066b5f91 100644 --- a/build/exe/doliwamp/Languages/MyCatalan.isl +++ b/build/exe/doliwamp/Languages/MyCatalan.isl @@ -43,5 +43,5 @@ DoliWampWillStartApacheMysql=L'instal·lador DoliWamp intentarà iniciar o reini OldVersionFoundAndMoveInNew=S'ha trobat una versió antiga de base de dades i ha estat moguda per a ser utilitzada per la nova versió de Dolibarr OldVersionFoundButFailedToMoveInNew=S'ha trobat una versió antiga de base de dades, però no es pot moure per a ser utilitzada per la nova versió de Dolibarr -DLLMissing=La teva instal·lació windows no té el component "Microsoft Visual C++ Redistributable for Visual Studio 2012". Instal·la primer la versió de 32-bit (vcredist_x86.exe) (pots trobar-la a https://www.microsoft.com/en-us/download/) i reiniciar després la instal·lació/actualització de DoliWamp. +DLLMissing=La teva instal·lació windows no té el component "Microsoft Visual C++ Redistributable for Visual Studio 2015". Instal·la primer la versió de 32-bit (vcredist_x86.exe) (pots trobar-la a https://www.microsoft.com/en-us/download/) i reiniciar després la instal·lació/actualització de DoliWamp. ContinueAnyway=Continua igualment (el procés d'instal·lació podria fallar sense aquest prerequisit) diff --git a/build/exe/doliwamp/Languages/MyEnglish.isl b/build/exe/doliwamp/Languages/MyEnglish.isl index 7ad94c4ca86..237513cd311 100644 --- a/build/exe/doliwamp/Languages/MyEnglish.isl +++ b/build/exe/doliwamp/Languages/MyEnglish.isl @@ -44,5 +44,5 @@ DoliWampWillStartApacheMysql=DoliWamp installer will now start or restart Apache OldVersionFoundAndMoveInNew=An old database version has been found and moved to be used by new Dolibarr version OldVersionFoundButFailedToMoveInNew=An old database version has been found but could not be moved to be used with new Dolibarr version -DLLMissing=Your Windows installation is missing The "Micrsoft Visual C++ Redistributable for Visual Studio 2012" component. Please install the 32-bit version (vcredist_x86.exe) first (you can find it at https://www.microsoft.com/en-us/download/) and restart DoliWamp installation/upgrade after. +DLLMissing=Your Windows installation is missing The "Micrsoft Visual C++ Redistributable for Visual Studio 2015" component. Please install the 32-bit version (vcredist_x86.exe) first (you can find it at https://www.microsoft.com/en-us/download/) and restart DoliWamp installation/upgrade after. ContinueAnyway=Continue anyway (install process may fails without this prerequisite) diff --git a/build/exe/doliwamp/Languages/MyFrench.isl b/build/exe/doliwamp/Languages/MyFrench.isl index c3fd15cbac8..6c6294fb7c4 100644 --- a/build/exe/doliwamp/Languages/MyFrench.isl +++ b/build/exe/doliwamp/Languages/MyFrench.isl @@ -44,5 +44,5 @@ DoliWampWillStartApacheMysql=L'installeur DoliWamp va maintenant d OldVersionFoundAndMoveInNew=Une ancienne version de base a été trouvée et déplacée pour fonctionner avec la nouvelle version de Dolibarr. OldVersionFoundButFailedToMoveInNew=Une ancienne version de base a été trouvée mais ne peut être déplacée pour être utilisée avec la nouvelle version de Dolibarr. -DLLMissing=L'installation de votre Windows est incomplète. Il manque le composant "Micrsoft Visual C++ Redistributable for Visual Studio 2012". Installer la version 32-bit (vcredist_x86.exe) d'abord (vous pourrez le trouver à https://www.microsoft.com/fr-fr/download/) puis relancer l'installation de DoliWamp après. +DLLMissing=L'installation de votre Windows est incomplète. Il manque le composant "Micrsoft Visual C++ Redistributable for Visual Studio 2015". Installer la version 32-bit (vcredist_x86.exe) d'abord (vous pourrez le trouver à https://www.microsoft.com/fr-fr/download/) puis relancer l'installation de DoliWamp après. ContinueAnyway=Continuer malgré tout (le process d'installaton échouera) diff --git a/build/exe/doliwamp/Languages/MyGerman.isl b/build/exe/doliwamp/Languages/MyGerman.isl index 8bfd78dbea2..132260b7273 100644 --- a/build/exe/doliwamp/Languages/MyGerman.isl +++ b/build/exe/doliwamp/Languages/MyGerman.isl @@ -43,5 +43,5 @@ DoliWampWillStartApacheMysql=Die DoliWamp-Installation wird nun starten oder Apa OldVersionFoundAndMoveInNew=Eine alte Datenbankversion wurde gefunden und verschoben, um von der neuen Dolibarr-Version verwendet zu werden. OldVersionFoundButFailedToMoveInNew=Eine alte Datenbankversion wurde gefunden, konnte jedoch nicht verschoben werden, um mit der neuen Dolibarr-Version verwendet zu werden. -DLLMissing=Your Windows installation is missing The "Micrsoft Visual C++ Redistributable for Visual Studio 2012" component. Please install the 32-bit version (vcredist_x86.exe) first (you can find it at https://www.microsoft.com/en-us/download/) and restart DoliWamp installation/upgrade after. +DLLMissing=Your Windows installation is missing The "Micrsoft Visual C++ Redistributable for Visual Studio 2015" component. Please install the 32-bit version (vcredist_x86.exe) first (you can find it at https://www.microsoft.com/en-us/download/) and restart DoliWamp installation/upgrade after. ContinueAnyway=Fahren Sie trotzdem fort (der Installationsvorgang kann ohne diese Voraussetzung fehlschlagen). diff --git a/build/exe/doliwamp/Languages/MySpanish.isl b/build/exe/doliwamp/Languages/MySpanish.isl index c31aedf895f..6880a9263e1 100644 --- a/build/exe/doliwamp/Languages/MySpanish.isl +++ b/build/exe/doliwamp/Languages/MySpanish.isl @@ -43,5 +43,5 @@ DoliWampWillStartApacheMysql=El instalador DoliWamp intentará iniciar o reinici OldVersionFoundAndMoveInNew=Se ha encontrado una versión antigua de base de datos y ha sido movida para ser utilizada por la nueva versión de Dolibarr OldVersionFoundButFailedToMoveInNew=Se ha encontrado una versión antigua de base de datos, pero no se pudo mover para ser utilizada por la nueva versión de Dolibarr -DLLMissing=Su instalación Windows no tiene el componente "Microsoft Visual C++ Redistributable for Visual Studio 2012". Instale primero la versión de 32-bit (vcredist_x86.exe) (puedes encontrarlo en https://www.microsoft.com/en-us/download/) y reiniciar después la instalación/actualización de DoliWamp. +DLLMissing=Su instalación Windows no tiene el componente "Microsoft Visual C++ Redistributable for Visual Studio 2015". Instale primero la versión de 32-bit (vcredist_x86.exe) (puedes encontrarlo en https://www.microsoft.com/en-us/download/) y reiniciar después la instalación/actualización de DoliWamp. ContinueAnyway=Continua igualmente (el proceso de instalación podría fallar sin este prerequisito) From 99206d55705c84872bc4bc5f56780d02bc1a4e2b Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 24 Apr 2023 12:08:45 +0200 Subject: [PATCH 10/24] FIX special chars in generated file name from build doc mass action --- htdocs/core/actions_massactions.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 3c33765c407..b323b4b3e01 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1035,7 +1035,7 @@ if (!$error && $massaction == "builddoc" && $permissiontoread && !GETPOST('butto $arrayofinclusion[] = '^'.preg_quote(dol_sanitizeFileName($tmppdf), '/').'\.pdf$'; } foreach ($listofobjectref as $tmppdf) { - $arrayofinclusion[] = '^'.preg_quote(dol_sanitizeFileName($tmppdf), '/').'_[a-zA-Z0-9\-\_\']+\.pdf$'; // To include PDF generated from ODX files + $arrayofinclusion[] = '^'.preg_quote(dol_sanitizeFileName($tmppdf), '/').'_[a-zA-Z0-9\-\_\'\&\.]+\.pdf$'; // To include PDF generated from ODX files } $listoffiles = dol_dir_list($uploaddir, 'all', 1, implode('|', $arrayofinclusion), '\.meta$|\.png', 'date', SORT_DESC, 0, true); From 08b81e90912b016b1925eed05470993aa51b4780 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 25 Apr 2023 11:17:27 +0200 Subject: [PATCH 11/24] fix: with auguria when user have only supplier invoie right the Financial top menu is not displayed --- htdocs/core/menus/init_menu_auguria.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 3b173cecb26..f488fc80a8e 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -14,7 +14,7 @@ insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, left insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('bom|mrp', '$conf->bom->enabled || $conf->mrp->enabled', 16__+MAX_llx_menu__, __HANDLER__, 'top', 'mrp', '', 0, '/mrp/index.php?mainmenu=mrp&leftmenu=', 'MRP', -1, 'mrp', '$user->rights->bom->read||$user->rights->mrp->read', '', 0, 31, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('projet', '$conf->projet->enabled', 7__+MAX_llx_menu__, __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 2, 32, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('propal|commande|fournisseur|supplier_order|supplier_invoice|contrat|ficheinter', '$conf->propal->enabled || $conf->commande->enabled || $conf->supplier_order->enabled || $conf->contrat->enabled || $conf->ficheinter->enabled', 5__+MAX_llx_menu__, __HANDLER__, 'top', 'commercial', '', 0, '/comm/index.php?mainmenu=commercial&leftmenu=', 'Commercial', -1, 'commercial', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 40, __ENTITY__); -insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('facture|don|tax|salaries|loan|banque', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->don->enabled || $conf->tax->enabled || $conf->salaries->enabled || $conf->supplier_invoice->enabled || $conf->loan->enabled || $conf->banque->enabled', 6__+MAX_llx_menu__, __HANDLER__, 'top', 'billing', '', 0, '/compta/index.php?mainmenu=billing&leftmenu=', 'MenuFinancial', -1, 'compta', '$user->rights->facture->lire|| $user->rights->don->lire || $user->rights->tax->charges->lire || $user->rights->salaries->read || $user->rights->loan->read || $user->rights->banque->lire', '', 2, 50, __ENTITY__); +insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('facture|don|tax|salaries|loan|banque', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->don->enabled || $conf->tax->enabled || $conf->salaries->enabled || $conf->supplier_invoice->enabled || $conf->loan->enabled || $conf->banque->enabled', 6__+MAX_llx_menu__, __HANDLER__, 'top', 'billing', '', 0, '/compta/index.php?mainmenu=billing&leftmenu=', 'MenuFinancial', -1, 'compta', '$user->rights->facture->lire|| $user->rights->don->lire || $user->rights->tax->charges->lire || $user->rights->salaries->read || $user->rights->loan->read || $user->rights->banque->lire || ($user->rights->fournisseur->facture->lire || $user->rights->supplier_invoice->lire)', '', 2, 50, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('banque|prelevement', '$conf->banque->enabled || $conf->prelevement->enabled', 14__+MAX_llx_menu__, __HANDLER__, 'top', 'bank', '', 0, '/compta/bank/list.php?mainmenu=bank&leftmenu=bank', 'MenuBankCash', -1, 'banks', '$user->rights->banque->lire || $user->rights->prelevement->bons->lire', '', 0, 52, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('comptabilite|accounting|asset', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->asset->enabled', 9__+MAX_llx_menu__, __HANDLER__, 'top', 'accountancy', '', 0, '/compta/index.php?mainmenu=accountancy&leftmenu=accountancy', 'MenuAccountancy', -1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->mouvements->lire || $user->rights->asset->read', '', 2, 54, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '', 8__+MAX_llx_menu__, __HANDLER__, 'top', 'tools', '', 0, '/core/tools.php?mainmenu=tools&leftmenu=', 'Tools', -1, 'other', '', '', 2, 90, __ENTITY__); From 1d235c2fd94a7369d1c55ddfaac59f93057e69bb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Apr 2023 11:32:49 +0200 Subject: [PATCH 12/24] FIX Creation of thumbs when images.lib.php was already included --- htdocs/core/class/commonobject.class.php | 10 ++++++++-- htdocs/core/lib/files.lib.php | 14 ++++++++++---- htdocs/core/lib/images.lib.php | 22 ++++++++++++++++++++++ 3 files changed, 40 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 7baa35d0f27..af1b077b020 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5687,9 +5687,15 @@ abstract class CommonObject */ public function addThumbs($file) { - global $maxwidthsmall, $maxheightsmall, $maxwidthmini, $maxheightmini, $quality; + require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; - require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; // This define also $maxwidthsmall, $quality, ... + $tmparraysize = getDefaultImageSizes(); + $maxwidthsmall = $tmparraysize['maxwidthsmall']; + $maxheightsmall = $tmparraysize['maxheightsmall']; + $maxwidthmini = $tmparraysize['maxwidthmini']; + $maxheightmini = $tmparraysize['maxheightmini']; + //$quality = $tmparraysize['quality']; + $quality = 50; // For thumbs, we force quality to 50 $file_osencoded = dol_osencode($file); if (file_exists($file_osencoded)) { diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 9f067f7ada9..6d15fd180a4 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1690,10 +1690,16 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesess $resupload = dol_move_uploaded_file($TFile['tmp_name'][$i], $destfull, $allowoverwrite, 0, $TFile['error'][$i], 0, $varfiles, $upload_dir); if (is_numeric($resupload) && $resupload > 0) { // $resupload can be 'ErrorFileAlreadyExists' - global $maxwidthsmall, $maxheightsmall, $maxwidthmini, $maxheightmini; - include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; + $tmparraysize = getDefaultImageSizes(); + $maxwidthsmall = $tmparraysize['maxwidthsmall']; + $maxheightsmall = $tmparraysize['maxheightsmall']; + $maxwidthmini = $tmparraysize['maxwidthmini']; + $maxheightmini = $tmparraysize['maxheightmini']; + //$quality = $tmparraysize['quality']; + $quality = 50; // For thumbs, we force quality to 50 + // Generate thumbs. if ($generatethumbs) { if (image_format_supported($destfull) == 1) { @@ -1701,10 +1707,10 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesess // We can't use $object->addThumbs here because there is no $object known // Used on logon for example - $imgThumbSmall = vignette($destfull, $maxwidthsmall, $maxheightsmall, '_small', 50, "thumbs"); + $imgThumbSmall = vignette($destfull, $maxwidthsmall, $maxheightsmall, '_small', $quality, "thumbs"); // Create mini thumbs for image (Ratio is near 16/9) // Used on menu or for setup page for example - $imgThumbMini = vignette($destfull, $maxwidthmini, $maxheightmini, '_mini', 50, "thumbs"); + $imgThumbMini = vignette($destfull, $maxwidthmini, $maxheightmini, '_mini', $quality, "thumbs"); } } diff --git a/htdocs/core/lib/images.lib.php b/htdocs/core/lib/images.lib.php index 37cc70760eb..6892e22df41 100644 --- a/htdocs/core/lib/images.lib.php +++ b/htdocs/core/lib/images.lib.php @@ -23,12 +23,34 @@ */ // Define size of logo small and mini +// TODO Remove this and call getDefaultImageSizes() instead $maxwidthsmall = 480; $maxheightsmall = 270; // Near 16/9eme $maxwidthmini = 128; $maxheightmini = 72; // 16/9eme $quality = 80; +/** + * Return default values for image sizes + * + * @return array Array of default values + */ +function getDefaultImageSizes() +{ + $maxwidthsmall = 480; + $maxheightsmall = 270; // Near 16/9eme + $maxwidthmini = 128; + $maxheightmini = 72; // 16/9eme + $quality = 80; + + return array( + 'maxwidthsmall' => $maxwidthsmall, + 'maxheightsmall' => $maxheightsmall, + 'maxwidthmini' => $maxwidthmini, + 'maxheightmini' => $maxheightmini, + 'quality' => $quality + ); +} /** * Return if a filename is file name of a supported image format From bb350d062b6908ee46331f75a30b233b2361153e Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Wed, 26 Apr 2023 10:25:08 +0200 Subject: [PATCH 13/24] FIX : deletion of a line of time spent (backport e3aa438d2a582313dfd5178b8cc5975e0c912c25) --- htdocs/projet/tasks/time.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 4be29d6f547..4dec93a3654 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -53,6 +53,7 @@ $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected i $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'timespentlist'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'alpha'); +$mode = GETPOST('mode', 'alpha'); $id = GETPOST('id', 'int'); $projectid = GETPOST('projectid', 'int'); @@ -316,10 +317,10 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$cancel && $us } } -if ($action == 'confirm_deleteline' && $confirm == "yes" && $user->rights->projet->supprimer) { +if ($action == 'confirm_deleteline' && $confirm == "yes" && ($user->hasRight('projet', 'time') || $user->hasRight('projet', 'all', 'creer'))) { $object->fetchTimeSpent(GETPOST('lineid', 'int')); // load properties like $object->timespent_id - if (in_array($object->timespent_fk_user, $childids) || $user->rights->projet->all->creer) { + if (in_array($object->timespent_fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) { $result = $object->delTimeSpent($user); // delete line with $object->timespent_id if ($result < 0) { @@ -1897,7 +1898,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser print ' '; print ''; } elseif ($user->hasRight('projet', 'time') || $user->hasRight('projet', 'all', 'creer')) { // Read project and enter time consumed on assigned tasks - if ($task_time->fk_user == $user->id || in_array($task_time->fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) { + if (in_array($task_time->fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) { if (getDolGlobalString('MAIN_FEATURES_LEVEL') >= 2) { print ' '; print 'rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">'; From 1844278c4d99ff40226ad60e3e15143716ed47c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Courtier?= Date: Fri, 28 Apr 2023 10:25:37 +0200 Subject: [PATCH 14/24] FIX: expense report autofill ttc input if force ttc conf is enabled --- htdocs/expensereport/card.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index eb1c93f609a..80f5d0baa41 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -2643,10 +2643,22 @@ if ($action == 'create') { ,async:false ,dataType:"json" ,success:function(response) { - if (response.response_status == "success"){ - jQuery("#value_unit_ht").val(response.data); - jQuery("#value_unit_ht").trigger("change"); - jQuery("#value_unit").val(""); + if (response.response_status == "success"){'; + + if (!empty($conf->global->EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY)) { + print ' + jQuery("#value_unit").val(parseFloat(response.data) * (100 + parseFloat(tva)) / 100); + jQuery("#value_unit").trigger("change"); + '; + } else { + print ' + jQuery("#value_unit_ht").val(response.data); + jQuery("#value_unit_ht").trigger("change"); + jQuery("#value_unit").val(""); + '; + } + + print ' } else if(response.response_status == "error" && response.errorMessage != undefined && response.errorMessage.length > 0 ){ $.jnotify(response.errorMessage, "error", {timeout: 0, type: "error"},{ remove: function (){} } ); } From a93e3ab3f6496afc1c67bb10115ceeb13ae35964 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Fri, 28 Apr 2023 10:50:25 +0200 Subject: [PATCH 15/24] FIX : remove NOTOKENRENOWAL (backport commit v17 7c316229db8060781ee50f4465b1133b5aeef156) --- htdocs/public/ticket/create_ticket.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index 68edd453aaf..0e68d1799ea 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -26,9 +26,6 @@ if (!defined('NOREQUIREUSER')) { define('NOREQUIREUSER', '1'); }*/ -if (!defined('NOTOKENRENEWAL')) { - define('NOTOKENRENEWAL', '1'); -} if (!defined('NOREQUIREMENU')) { define('NOREQUIREMENU', '1'); } From cd949e9fa750ac40ff8fee8114967c89d1136048 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 28 Apr 2023 12:37:01 +0200 Subject: [PATCH 16/24] Fix error message not shown --- htdocs/commande/list.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 2211422f3c5..62603daa082 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -213,6 +213,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +$error = 0; /* @@ -503,6 +504,7 @@ if (empty($reshook)) { } else { $lineid = 0; $error++; + $errors[] = $objecttmp->error; break; } // Defined the new fk_parent_line From 5218a43a4272cb2e71e95d6a1cb6eab7bdbe2970 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 28 Apr 2023 18:59:12 +0200 Subject: [PATCH 17/24] FIX Click on "NEW" in simple POS was broken --- htdocs/cashdesk/affContenu.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/cashdesk/affContenu.php b/htdocs/cashdesk/affContenu.php index d8e31f3b9c9..20f5132bb02 100644 --- a/htdocs/cashdesk/affContenu.php +++ b/htdocs/cashdesk/affContenu.php @@ -26,7 +26,7 @@ require_once 'class/Facturation.class.php'; // Si nouvelle vente, reinitialisation des donnees (destruction de l'objet et vidage de la table contenant la liste des articles) -if (GETPOST('id', 'int') == 'NOUV') { +if (GETPOST('id', 'aZ09') == 'NOUV') { unset($_SESSION['serObjFacturation']); unset($_SESSION['poscart']); } From 25eb177bea63333a9a52e53d3b55e8b6dfa736f9 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Mon, 8 May 2023 22:39:52 +0200 Subject: [PATCH 18/24] Fix search in hidden ecotaxe dictionary by code. --- htdocs/admin/dict.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 774ade233bd..8c3317a46c9 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1250,6 +1250,8 @@ if ($id > 0) { $sql .= natural_search("f.code", $search_code); } elseif ($search_code != '' && $id == 2) { $sql .= natural_search("d.code_departement", $search_code); + } elseif ($search_code != '' && $id == 14) { + $sql .= natural_search("e.code", $search_code); } elseif ($search_code != '' && $id != 9) { $sql .= natural_search("code", $search_code); } From bc42bdef49b688d954b776cf4f4d7b1d74da53d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Courtier?= Date: Thu, 11 May 2023 09:25:07 +0200 Subject: [PATCH 19/24] FIX: wrong colspan for tasks list --- htdocs/projet/tasks.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 64d134a7254..53ad98eb194 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -773,7 +773,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third print ''; // Other options - $parameters = array(); + $parameters = array('arrayfields' => &$arrayfields); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $taskstatic, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -1046,7 +1046,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third $j = 0; $level = 0; $nboftaskshown = projectLinesa($j, 0, $tasksarray, $level, true, 0, $tasksrole, $object->id, 1, $object->id, $filterprogresscalc, ($object->usage_bill_time ? 1 : 0), $arrayfields); } else { - $colspan = 10; + $colspan = count($arrayfields); if ($object->usage_bill_time) { $colspan += 2; } From 4ad585facc76bc62ff2f3c841bb4bd3b914275e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Courtier?= Date: Thu, 11 May 2023 11:41:58 +0200 Subject: [PATCH 20/24] FIX: Add Missing rights check on holiday calendar --- htdocs/comm/action/index.php | 132 +++++++++++++++++++---------------- 1 file changed, 71 insertions(+), 61 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 9b451a47659..4878ecaa13c 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -582,10 +582,18 @@ if (!empty($conf->use_javascript_ajax)) { // If javascript on // Local calendar $s .= '
'.$langs->trans("LocalAgenda").'  
'; - // Holiday calendar - $s .= '
 
'; + if ($user->rights->holiday->read) { + // Holiday calendar + $s .= ' +
+   +
'; + } - // External calendars + // External calendars if (is_array($showextcals) && count($showextcals) > 0) { $s .= '