/** * Get modules in the table */ static function getModules() { $a_modules = array(); $a_data = getAllDatasFromTable(PluginFusioninventoryAgentmodule::getTable()); foreach ($a_data as $data) { $a_modules[] = $data['modulename']; } return $a_modules; }
function getSearchOptions() { $tab = array(); $tab['common'] = __('Agent', 'fusioninventory'); $tab[1]['table'] = $this->getTable(); $tab[1]['field'] = 'name'; $tab[1]['linkfield'] = 'name'; $tab[1]['name'] = __('Name'); $tab[1]['datatype'] = 'itemlink'; $tab[2]['table'] = 'glpi_entities'; $tab[2]['field'] = 'completename'; $tab[2]['name'] = __('Entity'); $tab[3]['table'] = $this->getTable(); $tab[3]['field'] = 'is_recursive'; $tab[3]['linkfield'] = 'is_recursive'; $tab[3]['name'] = __('Child entities'); $tab[3]['datatype'] = 'bool'; $tab[4]['table'] = $this->getTable(); $tab[4]['field'] = 'last_contact'; $tab[4]['linkfield'] = ''; $tab[4]['name'] = __('Last contact', 'fusioninventory'); $tab[4]['datatype'] = 'datetime'; $tab[5]['table'] = $this->getTable(); $tab[5]['field'] = 'lock'; $tab[5]['linkfield'] = 'lock'; $tab[5]['name'] = __('locked', 'fusioninventory'); $tab[5]['datatype'] = 'bool'; $tab[6]['table'] = $this->getTable(); $tab[6]['field'] = 'device_id'; $tab[6]['linkfield'] = 'device_id'; $tab[6]['name'] = __('Device_id', 'fusioninventory'); $tab[6]['datatype'] = 'text'; $tab[6]['massiveaction'] = FALSE; $tab[7]['table'] = 'glpi_computers'; $tab[7]['field'] = 'name'; $tab[7]['name'] = __('Computer link', 'fusioninventory'); $tab[7]['datatype'] = 'itemlink'; $tab[7]['itemlink_type'] = 'Computer'; $tab[7]['massiveaction'] = FALSE; $tab[8]['table'] = $this->getTable(); $tab[8]['field'] = 'version'; $tab[8]['linkfield'] = 'version'; $tab[8]['name'] = __('Version'); $tab[8]['datatype'] = 'text'; $tab[8]['massiveaction'] = FALSE; $tab[9]['table'] = $this->getTable(); $tab[9]['field'] = 'token'; $tab[9]['linkfield'] = 'token'; $tab[9]['name'] = __('Token'); $tab[9]['datatype'] = 'text'; $tab[9]['massiveaction'] = FALSE; $tab[10]['table'] = $this->getTable(); $tab[10]['field'] = 'useragent'; $tab[10]['linkfield'] = 'useragent'; $tab[10]['name'] = __('Useragent', 'fusioninventory'); $tab[10]['datatype'] = 'text'; $tab[10]['massiveaction'] = FALSE; $tab[11]['table'] = $this->getTable(); $tab[11]['field'] = 'tag'; $tab[11]['name'] = __('FusionInventory tag', 'fusioninventory'); $tab[11]['datatype'] = 'text'; $tab[11]['massiveaction'] = FALSE; $tab[12]['table'] = $this->getTable(); $tab[12]['field'] = 'threads_networkdiscovery'; $tab[12]['name'] = __('Threads number', 'fusioninventory') . " (" . strtolower(__('Network discovery', 'fusioninventory')) . ")"; $tab[12]['datatype'] = 'integer'; $tab[13]['table'] = $this->getTable(); $tab[13]['field'] = 'threads_networkinventory'; $tab[13]['name'] = __('Threads number', 'fusioninventory') . " (" . strtolower(__('Network inventory (SNMP)', 'fusioninventory')) . ")"; $tab[13]['datatype'] = 'integer'; $tab[14]['table'] = $this->getTable(); $tab[14]['field'] = 'agent_port'; $tab[14]['linkfield'] = 'agent_port'; $tab[14]['name'] = __('Agent port', 'fusioninventory'); $i = 20; $pfAgentmodule = new PluginFusioninventoryAgentmodule(); $a_modules = $pfAgentmodule->find(); foreach ($a_modules as $data) { $tab[$i]['table'] = $pfAgentmodule->getTable(); $tab[$i]['field'] = $data["modulename"]; $tab[$i]['linkfield'] = $data["modulename"]; $tab[$i]['name'] = __('Module', 'fusioninventory') . " - " . $data["modulename"]; $tab[$i]['datatype'] = 'bool'; $tab[$i]['massiveaction'] = FALSE; $i++; } return $tab; }