Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
Merge pull request #42 from OPEN-DSI/2024_rc
Browse files Browse the repository at this point in the history
_rc -> 2024
  • Loading branch information
lvessiller-opendsi authored Jun 25, 2024
2 parents 71f4954 + e5840d9 commit 4190963
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 11 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.0.4
14.0.5
3 changes: 0 additions & 3 deletions class/dictionary.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) : '';
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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) .
Expand Down
18 changes: 11 additions & 7 deletions core/tpl/dictionaries.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -351,13 +351,17 @@
if ($dictionary->is_multi_entity && $dictionary->has_entity && $dictionary->show_entity_management && !empty($conf->multicompany->enabled)) {
print '<td class="center nowrap">';
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 '<span class="'.$class_fa.' fa-globe"></span><span class="multiselect-selected-title-text">' . $entity_cached[$line->entity] . '</span>';
Expand Down
1 change: 1 addition & 0 deletions langs/en_US/advancedictionaries.lang
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ AdvanceDictionariesReplaceOldDictionariesPage = Replace old dictionaries page
AdvanceDictionariesFieldRequired = Field required
AdvanceDictionariesDictionaryLines = Dictionary lines
AdvanceDictionariesModifyEntity = Modify entity
AdvanceDictionariesAllEntities = All entities

############################################################
### Confirm box
Expand Down
1 change: 1 addition & 0 deletions langs/fr_FR/advancedictionaries.lang
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4190963

Please sign in to comment.