From fab22f5ebb7c5f757e48292a7f8de605638b7213 Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Mon, 3 Oct 2011 07:53:59 +0000 Subject: when a device is already in the database (same vendorid_productid code) the system puts the link to the device - sudoman issue --- h-source/Application/Models/HardwareModel.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'h-source/Application/Models/HardwareModel.php') diff --git a/h-source/Application/Models/HardwareModel.php b/h-source/Application/Models/HardwareModel.php index d5aaffb..9a40e4b 100644 --- a/h-source/Application/Models/HardwareModel.php +++ b/h-source/Application/Models/HardwareModel.php @@ -282,6 +282,18 @@ class HardwareModel extends Model_Map { return $name; } + //get the model info by the vendorid:productid code + public function getModelByCode($code) + { + $res = $this->clear()->where(array('pci_id'=>sanitizePciid($code)))->send(); + + if (count($res) > 0) + { + return $res[0]['hardware']; + } + return false; + } + //save in the history all the action carried out by users protected function updateHistory($action) { -- cgit v1.2.3