From ffe2b065172bf5af14d3ae3940405f080dca77bd Mon Sep 17 00:00:00 2001 From: Kamel Khelifa Date: Thu, 20 Jun 2024 12:21:47 +0200 Subject: [PATCH 1/2] =?UTF-8?q?-=20L'entit=C3=A9=201=20n'est=20plus=20l'en?= =?UTF-8?q?tit=C3=A9=20globale=20-=20Rajout=20de=20l'entit=C3=A9=200=20com?= =?UTF-8?q?me=20entit=C3=A9=20globale=20(affichage=20dans=20les=20listes?= =?UTF-8?q?=20et=20action=20en=20masse)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ChangeLog.md | 8 ++++++++ VERSION | 2 +- class/dictionary.class.php | 3 --- core/tpl/dictionaries.tpl.php | 18 +++++++++++------- langs/en_US/advancedictionaries.lang | 1 + langs/fr_FR/advancedictionaries.lang | 1 + 6 files changed, 22 insertions(+), 11 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index bd3a4f9..5dfb7ca 100755 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -3,6 +3,10 @@ Le format du fichier est basé sur [Tenez un ChangeLog](http://keepachangelog.co ## [Non Distribué] +## [14.0.5] - 20-06-2024 +- L'entité 1 n'est plus l'entité globale +- Rajout de l'entité 0 comme entité globale (affichage dans les listes et action en masse) + ## [14.0.4] - 11-06-2024 - Ajout version de PHP. @@ -254,8 +258,12 @@ Le format du fichier est basé sur [Tenez un ChangeLog](http://keepachangelog.co ## [4.0.0] - 16-07-2018 - Version initial. +<<<<<<< Updated upstream [Non Distribué]: https://github.com/OPEN-DSI/dolibarr_module_advancedictionaries/compare/14.0.4...HEAD [14.0.4]: https://github.com/OPEN-DSI/dolibarr_module_advancedictionaries/commits/14.0.4 +======= +[Non Distribué]: https://github.com/OPEN-DSI/dolibarr_module_advancedictionaries/compare/14.0.3...HEAD +>>>>>>> Stashed changes [14.0.3]: https://github.com/OPEN-DSI/dolibarr_module_advancedictionaries/commits/14.0.3 [14.0.2]: https://github.com/OPEN-DSI/dolibarr_module_advancedictionaries/commits/14.0.2 [14.0.1]: https://github.com/OPEN-DSI/dolibarr_module_advancedictionaries/commits/14.0.1 diff --git a/VERSION b/VERSION index 25f846f..6dbeddf 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -14.0.4 \ No newline at end of file +14.0.5 \ No newline at end of file diff --git a/class/dictionary.class.php b/class/dictionary.class.php index 6735b91..f6cee03 100755 --- a/class/dictionary.class.php +++ b/class/dictionary.class.php @@ -1680,7 +1680,6 @@ public function fetch_lines($filter_active=-1, $filters=array(), $orders=array() if (!is_array($filter_entity)) $filter_entity = explode(',', $filter_entity); if (empty($filter_entity) && !in_array($conf->entity, $filter_entity)) $filter_entity[] = $conf->entity; if (!in_array(0, $filter_entity)) $filter_entity[] = 0; - if (!in_array(1, $filter_entity)) $filter_entity[] = 1; $where[] = 'd.' . $this->entity_field . ' IN (' . implode(',', $filter_entity) . ')'; } $sql .= !empty($where) ? ' WHERE ' . implode(' AND ', $where) : ''; @@ -2521,7 +2520,6 @@ public function getEntity() $filter_entity = array(); if (!in_array(0, $filter_entity)) $filter_entity[] = 0; - if (!in_array(1, $filter_entity)) $filter_entity[] = 1; if (!in_array($conf->entity, $filter_entity)) $filter_entity[] = $conf->entity; return implode(',', $filter_entity); @@ -3943,7 +3941,6 @@ public function fetch($rowid) $filter_entity = array(); if (!in_array(0, $filter_entity)) $filter_entity[] = 0; - if (!in_array(1, $filter_entity)) $filter_entity[] = 1; if (!in_array($conf->entity, $filter_entity)) $filter_entity[] = $conf->entity; $sql = 'SELECT d.' . $this->dictionary->rowid_field . ', ' . implode(', ', $select) . diff --git a/core/tpl/dictionaries.tpl.php b/core/tpl/dictionaries.tpl.php index a00c575..694b1f7 100755 --- a/core/tpl/dictionaries.tpl.php +++ b/core/tpl/dictionaries.tpl.php @@ -230,7 +230,7 @@ $entity = GETPOST('entity', 'int'); if ($entity === '') $entity = $conf->entity; $formquestion = array( - array('type' => 'other', 'name' => 'entity', 'label' => $langs->trans("Entity"), 'value' => $actionsmulticompany->select_entities($entity)) + array('type' => 'other', 'name' => 'entity', 'label' => $langs->trans("Entity"), 'value' => $actionsmulticompany->select_entities($entity, 'entity', '', false, false, false, false, 1)) ); print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("AdvanceDictionariesConfirmMassModifyEntity"), $langs->trans("AdvanceDictionariesConfirmMassModifyEntityQuestion", count($toselect)), "modifyentity", $formquestion, '', 0, 200, 500, 1); } @@ -351,13 +351,17 @@ if ($dictionary->is_multi_entity && $dictionary->has_entity && $dictionary->show_entity_management && !empty($conf->multicompany->enabled)) { print ''; if (!isset($entity_cached[$line->entity])) { - $result = $daomulticompany->fetch($line->entity); - if ($result < 0) { - setEventMessages($daomulticompany->error, $daomulticompany->errors, 'errors'); - } elseif ($result == 0) { - $entity_cached[$line->entity] = $line->entity; + if ($line->entity > 0) { + $result = $daomulticompany->fetch($line->entity); + if ($result < 0) { + setEventMessages($daomulticompany->error, $daomulticompany->errors, 'errors'); + } elseif ($result == 0) { + $entity_cached[$line->entity] = $line->entity; + } else { + $entity_cached[$line->entity] = $daomulticompany->label; + } } else { - $entity_cached[$line->entity] = $daomulticompany->label; + $entity_cached[$line->entity] = $langs->trans('AdvanceDictionariesAllEntities'); } } print '' . $entity_cached[$line->entity] . ''; diff --git a/langs/en_US/advancedictionaries.lang b/langs/en_US/advancedictionaries.lang index 2e7ebb2..53effc9 100755 --- a/langs/en_US/advancedictionaries.lang +++ b/langs/en_US/advancedictionaries.lang @@ -29,6 +29,7 @@ AdvanceDictionariesReplaceOldDictionariesPage = Replace old dictionaries page AdvanceDictionariesFieldRequired = Field required AdvanceDictionariesDictionaryLines = Dictionary lines AdvanceDictionariesModifyEntity = Modify entity +AdvanceDictionariesAllEntities = All entities ############################################################ ### Confirm box diff --git a/langs/fr_FR/advancedictionaries.lang b/langs/fr_FR/advancedictionaries.lang index cc0572d..5718a4a 100755 --- a/langs/fr_FR/advancedictionaries.lang +++ b/langs/fr_FR/advancedictionaries.lang @@ -31,6 +31,7 @@ AdvanceDictionariesReplaceOldDictionariesPage = Remplace l'ancienne page des d AdvanceDictionariesFieldRequired = Champ requis AdvanceDictionariesDictionaryLines = Lignes de dictionnaire AdvanceDictionariesModifyEntity = Modification de l'environnement +AdvanceDictionariesAllEntities = Toutes les entités ############################################################ ### Confirm box From b677c20ff23e6c649d83f5132f8f2b34dab69a95 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Tue, 25 Jun 2024 17:05:50 +0200 Subject: [PATCH 2/2] NEW changelog version 14.0.5 --- ChangeLog.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 5dfb7ca..51a97a9 100755 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -258,12 +258,8 @@ Le format du fichier est basé sur [Tenez un ChangeLog](http://keepachangelog.co ## [4.0.0] - 16-07-2018 - Version initial. -<<<<<<< Updated upstream [Non Distribué]: https://github.com/OPEN-DSI/dolibarr_module_advancedictionaries/compare/14.0.4...HEAD [14.0.4]: https://github.com/OPEN-DSI/dolibarr_module_advancedictionaries/commits/14.0.4 -======= -[Non Distribué]: https://github.com/OPEN-DSI/dolibarr_module_advancedictionaries/compare/14.0.3...HEAD ->>>>>>> Stashed changes [14.0.3]: https://github.com/OPEN-DSI/dolibarr_module_advancedictionaries/commits/14.0.3 [14.0.2]: https://github.com/OPEN-DSI/dolibarr_module_advancedictionaries/commits/14.0.2 [14.0.1]: https://github.com/OPEN-DSI/dolibarr_module_advancedictionaries/commits/14.0.1