/** * Update an existing preloaded port with the instance values * *@return nothing **/ function updateDB() { parent::updateDB(); // update core $this->oFusionInventory_networking_ports->updateDB(); // update fusioninventory $this->connect(); // update connections $this->assignVlans(); // update vlans }
/** * Update an existing preloaded switch with the instance values * *@return nothing **/ function updateDB() { if (array_key_exists('model', $this->ptcdUpdates)) { $manufacturer = Dropdown::getDropdownName("glpi_dropdown_manufacturer", $this->getValue('FK_glpi_enterprise')); $this->ptcdUpdates['model'] = Dropdown::importExternal("NetworkEquipmentModel", $this->ptcdUpdates['model'], 0, array('manufacturer' => $manufacturer)); } if (array_key_exists('firmware', $this->ptcdUpdates)) { $this->ptcdUpdates['firmware'] = Dropdown::importExternal("NetworkEquipmentFirmware", $this->ptcdUpdates['firmware']); } if (array_key_exists('location', $this->ptcdUpdates)) { $this->ptcdUpdates['location'] = Dropdown::importExternal("Location", $this->ptcdUpdates['location']); } parent::updateDB(); // update last_fusioninventory_update even if no other update $this->setValue('last_fusioninventory_update', date("Y-m-d H:i:s")); $this->oFusionInventory_networking->updateDB(); // ports $this->savePorts(); }
/** * Update an existing preloaded switch with the instance values * *@return nothing **/ function updateDB() { global $DB; if (array_key_exists('model', $this->ptcdUpdates)) { $manufacturer = Dropdown::getDropdownName("glpi_dropdown_manufacturer", $this->getValue('FK_glpi_enterprise')); $this->ptcdUpdates['model'] = Dropdown::importExternal("PrinterModel", $this->ptcdUpdates['model'], 0, array('manufacturer' => $manufacturer)); } parent::updateDB(); // update last_fusioninventory_update even if no other update $this->setValue('last_fusioninventory_update', date("Y-m-d H:i:s")); $this->oFusionInventory_printer->updateDB(); // ports $this->savePorts(); // cartridges $this->saveCartridges(); // history if (is_null($this->oFusionInventory_printer_history->getValue('ID'))) { // update only if counters not already set for today $this->oFusionInventory_printer_history->updateDB(); } }