From b1a7c23daa560aab3bb9362946e21d591a983764 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Champlon?= Date: Wed, 1 Feb 2023 11:20:44 +0100 Subject: [PATCH 01/45] fix updateExtrafield option key empty set null --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 9fa15da550c..ae2acb36d7f 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6350,7 +6350,7 @@ abstract class CommonObject } if ($linealreadyfound) { - if ($this->array_options["options_".$key] === null) { + if ($this->array_options["options_".$key] === null || $this->array_options["options_".$key] === "") { $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element."_extrafields SET ".$key." = null"; } else { $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element."_extrafields SET ".$key." = '".$this->db->escape($this->array_options["options_".$key])."'"; From aa60bd29c1c309f1a6fe2fab14f12612e94e5256 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Champlon?= Date: Mon, 20 Feb 2023 16:39:03 +0100 Subject: [PATCH 02/45] check link empty in switch --- htdocs/core/class/commonobject.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index ae2acb36d7f..a10c649b6e2 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6304,6 +6304,11 @@ abstract class CommonObject $this->array_options["options_".$key] = null; } break; + case 'link': + if ($this->array_options["options_".$key] === '') { + $this->array_options["options_".$key] = null; + } + break; /* case 'link': $param_list = array_keys($attributeParam['options']); @@ -6350,7 +6355,7 @@ abstract class CommonObject } if ($linealreadyfound) { - if ($this->array_options["options_".$key] === null || $this->array_options["options_".$key] === "") { + if ($this->array_options["options_".$key] === null) { $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element."_extrafields SET ".$key." = null"; } else { $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element."_extrafields SET ".$key." = '".$this->db->escape($this->array_options["options_".$key])."'"; From baa28e175da73879d0cc3b14e76aca389efa1e7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Champlon?= Date: Mon, 20 Feb 2023 16:47:01 +0100 Subject: [PATCH 03/45] indent --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a10c649b6e2..58a057834f8 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6307,7 +6307,7 @@ abstract class CommonObject case 'link': if ($this->array_options["options_".$key] === '') { $this->array_options["options_".$key] = null; - } + } break; /* case 'link': From 94b0095f0d8305d26af9458de147ba2c4aa8585c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Fali=C3=A8re?= Date: Wed, 31 May 2023 11:01:17 +0200 Subject: [PATCH 04/45] FIX update product on translation update --- htdocs/product/traduction.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/product/traduction.php b/htdocs/product/traduction.php index 7f91e9c73a8..1f0c766bb13 100644 --- a/htdocs/product/traduction.php +++ b/htdocs/product/traduction.php @@ -1,8 +1,9 @@ * Copyright (C) 2007 Rodolphe Quiedeville - * Copyright (C) 2010-2012 Destailleur Laurent - * Copyright (C) 2014 Henry Florian + * Copyright (C) 2010-2012 Destailleur Laurent + * Copyright (C) 2014 Henry Florian + * Copyright (C) 2023 Benjamin Falière * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -135,6 +136,8 @@ if (empty($reshook)) { $object->label = GETPOST("libelle-" . $key); $object->description = dol_htmlcleanlastbr(GETPOST("desc-" . $key, 'restricthtml')); $object->other = dol_htmlcleanlastbr(GETPOST("other-" . $key, 'restricthtml')); + + $object->update($object->id, $user); } else { $object->multilangs[$key]["label"] = GETPOST("libelle-" . $key); $object->multilangs[$key]["description"] = dol_htmlcleanlastbr(GETPOST("desc-" . $key, 'restricthtml')); From 18d8d0826b479f1929756c274cce0453288ac4a1 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 1 Jun 2023 09:58:25 +0200 Subject: [PATCH 05/45] add stock to date in auguria menu --- htdocs/core/menus/init_menu_auguria.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 0e756dc2193..9ac9eff352e 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -139,7 +139,8 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled', __HANDLER__, 'left', 3102__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/list.php?mainmenu=products', 'List', 1, 'stocks', '$user->rights->stock->lire', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled', __HANDLER__, 'left', 3104__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/movement_list.php?mainmenu=products', 'Movements', 1, 'stocks', '$user->rights->stock->mouvement->lire', '', 2, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled && $conf->supplier_order->enabled', __HANDLER__, 'left', 3105__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/replenish.php?mainmenu=products', 'Replenishments', 1, 'stocks', '$user->rights->stock->mouvement->creer && $user->rights->fournisseur->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled', __HANDLER__, 'left', 3106__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/massstockmove.php?mainmenu=products', 'MassStockTransferShort', 1, 'stocks', '$user->rights->stock->mouvement->creer', '', 2, 5, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled', __HANDLER__, 'left', 3106__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/stockatdate.php?mainmenu=products', 'StockAtDate', 1, 'stocks', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled', __HANDLER__, 'left', 3107__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/massstockmove.php?mainmenu=products', 'MassStockTransferShort', 1, 'stocks', '$user->rights->stock->mouvement->creer', '', 2, 5, __ENTITY__); -- Product - Categories insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3200__+MAX_llx_menu__, 'products', 'cat', 3__+MAX_llx_menu__, '/categories/index.php?mainmenu=products&leftmenu=cat&type=0', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__); From 984ad5febf565fe6d17ff18935226cb8864ce657 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Thu, 1 Jun 2023 11:03:12 +0200 Subject: [PATCH 06/45] FIX : Add/Update required modules for thirdparties (by categ) & partnership --- htdocs/core/modules/mailings/partnership.modules.php | 2 +- htdocs/core/modules/mailings/thirdparties.modules.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/mailings/partnership.modules.php b/htdocs/core/modules/mailings/partnership.modules.php index 7813d93f54d..a554f2dfa28 100644 --- a/htdocs/core/modules/mailings/partnership.modules.php +++ b/htdocs/core/modules/mailings/partnership.modules.php @@ -29,7 +29,7 @@ class mailing_partnership extends MailingTargets public $desc = "Thirdparties or members included into a partnership program"; public $require_admin = 0; - public $require_module = array(); // This module allows to select by categories must be also enabled if category module is not activated + public $require_module = array('partnership'); // This module allows to select by categories must be also enabled if category module is not activated /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php index 81a9bfaea51..a2bd1d3c321 100644 --- a/htdocs/core/modules/mailings/thirdparties.modules.php +++ b/htdocs/core/modules/mailings/thirdparties.modules.php @@ -29,7 +29,7 @@ class mailing_thirdparties extends MailingTargets public $desc = "Third parties (by categories)"; public $require_admin = 0; - public $require_module = array("societe"); // This module allows to select by categories must be also enabled if category module is not activated + public $require_module = array("societe", "category"); // This module allows to select by categories must be also enabled if category module is not activated public $enabled = '$conf->societe->enabled'; From 57defe43828304ff4d0c54bc6ab54d1e1f72228c Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 1 Jun 2023 17:02:10 +0200 Subject: [PATCH 07/45] fix: display budget field on load --- htdocs/projet/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 040b3ea2772..aa02597f029 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -984,7 +984,7 @@ if ($action == 'create' && $user->rights->projet->creer) { print '
'; } if (empty($conf->global->PROJECT_HIDE_TASKS)) { - print 'usage_task ? ' checked="checked"' : '')) . '"> '; + print 'usage_task ? ' checked="checked"' : '')) . '> '; $htmltext = $langs->trans("ProjectFollowTasks"); print ''; print '