function getSpecificMassiveActions($checkitem = NULL) { $actions = array(); if (isset($_GET['id'])) { $id = $_GET['id']; } else { $id = $_POST['id']; } $group = new PluginFusioninventoryDeployGroup(); $group->getFromDB($id); //There's no massive action associated with a dynamic group ! if ($group->isDynamicGroup() || !$group->canEdit($group->getID())) { return array(); } if (!isset($_POST['custom_action'])) { $actions['PluginFusioninventoryComputer' . MassiveAction::CLASS_ACTION_SEPARATOR . 'add'] = _x('button', 'Add'); $actions['PluginFusioninventoryComputer' . MassiveAction::CLASS_ACTION_SEPARATOR . 'deleteitem'] = _x('button', 'Delete permanently'); } else { if ($_POST['custom_action'] == 'add_to_group') { $actions['PluginFusioninventoryComputer' . MassiveAction::CLASS_ACTION_SEPARATOR . 'add'] = _x('button', 'Add'); } elseif ($_POST['custom_action'] == 'delete_from_group') { $actions['PluginFusioninventoryComputer' . MassiveAction::CLASS_ACTION_SEPARATOR . 'deleteitem'] = _x('button', 'Delete permanently'); } } return $actions; }
/** * */ static function getSearchParamsAsAnArray(PluginFusioninventoryDeployGroup $group, $check_post_values = FALSE, $getAll = FALSE) { global $DB; $computers_params = array(); unset($_SESSION['glpisearch']['PluginFusioninventoryComputer']); //Check criteria from DB if (!$check_post_values) { if ($group->fields['type'] == PluginFusioninventoryDeployGroup::DYNAMIC_GROUP) { $query = "SELECT `fields_array`\n FROM `glpi_plugin_fusioninventory_deploygroups_dynamicdatas`\n WHERE `plugin_fusioninventory_deploygroups_id`='" . $group->getID() . "'"; $result = $DB->query($query); if ($DB->numrows($result) > 0) { $fields_array = $DB->result($result, 0, 'fields_array'); $computers_params = unserialize($fields_array); } } } else { $computers_params = $_GET; } if ($getAll) { $computers_params['export_all'] = true; } return Search::manageParams('PluginFusioninventoryComputer', $computers_params); }