diff --git a/ChangeLog.md b/ChangeLog.md index bd3a4f9..51a97a9 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. 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