Skip to content

Commit

Permalink
Fix static group criteria
Browse files Browse the repository at this point in the history
fixes #430
  • Loading branch information
stonebuzz authored Nov 14, 2023
1 parent a903ebd commit e272d84
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 2 additions & 1 deletion inc/deploygroup.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,7 @@ public static function getSearchParamsAsAnArray(PluginGlpiinventoryDeployGroup $
{
global $DB;

$is_dynamic = $group->isDynamicGroup();
$computers_params = [];

//Check criteria from DB
Expand Down Expand Up @@ -695,7 +696,7 @@ public static function getSearchParamsAsAnArray(PluginGlpiinventoryDeployGroup $
}

$computers_params["reset"] = true;
return Search::manageParams('Computer', $computers_params, true, false);
return Search::manageParams('Computer', $computers_params, $is_dynamic, false);
}


Expand Down
4 changes: 1 addition & 3 deletions inc/deploygroup_staticdata.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,10 @@ public static function showCriteriaAndSearch(PluginGlpiinventoryDeployGroup $ite
$search_params['massiveactionparams']['extraparams']['specific_actions']['PluginGlpiinventoryComputer' . MassiveAction::CLASS_ACTION_SEPARATOR . 'add'] = __('Add to static group', 'glpiinventory');
$search_params['massiveactionparams']['extraparams']['massive_action_fields'] = ['action', 'id'];

$data = Search::prepareDatasForSearch('PluginGlpiinventoryComputer', $search_params);
$data['itemtype'] = 'Computer';
$data = Search::prepareDatasForSearch('Computer', $search_params);
Search::constructSQL($data);
Search::constructData($data);
$data['search']['target'] = PluginGlpiinventoryDeployGroup::getSearchEngineTargetURL($item->getID(), false);
$data['itemtype'] = 'PluginGlpiinventoryComputer';
$limit_backup = $_SESSION['glpilist_limit'];
$_SESSION['glpilist_limit'] = 200;
Search::displayData($data);
Expand Down

0 comments on commit e272d84

Please sign in to comment.