diff --git a/inc/container.class.php b/inc/container.class.php index 0bed98d9..0ca3778f 100644 --- a/inc/container.class.php +++ b/inc/container.class.php @@ -1091,6 +1091,22 @@ public function showForm($ID, $options = []) echo ''; Dropdown::showYesNo('is_active', $this->fields['is_active']); echo ''; + echo '' . __('Entity') . ' : '; + echo ''; + Entity::dropdown( + [ + 'name' => 'entities_id', + 'value' => $this->fields['entities_id'], + ], + ); + echo ''; + echo ''; + + echo ''; + echo '' . __('Child entities') . ' : '; + echo ''; + Dropdown::showYesNo('is_recursive', $this->fields['is_recursive']); + echo ''; echo ''; $this->showFormButtons($options); @@ -2496,6 +2512,13 @@ public static function getAddSearchOptions($itemtype, $containers_id = false) if (!Session::isCron()) { $request['WHERE'][] = ['glpi_plugin_fields_profiles.profiles_id' => (int) $_SESSION['glpiactiveprofile']['id']]; } + $request['WHERE'][] = getEntitiesRestrictCriteria( + 'glpi_plugin_fields_containers', + '', + $_SESSION['glpiactiveentities'] ?? 0, + true, + true, + ); $iterator = $DB->request($request); foreach ($iterator as $data) {