. * --------------------------------------------------------------------- */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access this file directly"); } class RuleSoftwareCategoryCollection extends RuleCollection { // From RuleCollection public $stop_on_first_match = true; static $rightname = 'rule_softwarecategories'; public $menu_option = 'softwarecategories'; function getTitle() { return __('Rules for assigning a category to software'); } /** * Get the attributes needed for processing the rules * * @see RuleCollection::prepareInputDataForProcess() * * @param $input input data * @param $software software data array * * @return an array of attributes **/ function prepareInputDataForProcess($input, $software) { $params["name"] = $software["name"]; if (isset($software["comment"])) { $params["comment"] = $software["comment"]; } if (isset($software["_system_category"])) { $params["_system_category"] = $software["_system_category"]; } if (isset($software["manufacturers_id"])) { $params["manufacturer"] = Dropdown::getDropdownName("glpi_manufacturers", $software["manufacturers_id"]); } return $params; } }