summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5b539ec)
raw | patch | inline | side by side (parent: 5b539ec)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 18 Jan 2006 10:28:19 +0000 (10:28 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 18 Jan 2006 10:28:19 +0000 (10:28 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2519 594d385d-05f5-0310-b6e9-bd551577e9d8
include/class_glpi.inc | patch | blob | history |
diff --git a/include/class_glpi.inc b/include/class_glpi.inc
index fc8dd37f64f254ae84703c3da90d846da9fcbec3..f3de29b24e3dd7ccec5dcfd49992710de322426b 100644 (file)
--- a/include/class_glpi.inc
+++ b/include/class_glpi.inc
return(false);
}
+
+ /* Check if given device is used by some accounts
+ * (helpfull to avoid removement of used devices)
+ */
+ function is_deviceUsed($item)
+ {
+
+ $deviceMappingGOsaGlpi = array_flip($this->deviceMappingGOsaGlpi);
+ $deviceMappingTableNameID = $this->deviceMappingTableNameID;
+ if($this->is_connected){
+ $tablename = $deviceMappingGOsaGlpi[$item['device_type']];
+ $type = $item['device_type'];
+
+ if($type=="monitor"){
+ $str = "SELECT * FROM glpi_connect_wire WHERE end1=".$item['ID']." AND type=4;";
+ }else{
+ $str = "SELECT * FROM glpi_computer_device WHERE device_type=".$deviceMappingTableNameID[$type]." AND FK_device=".$item['ID'].";";
+ }
+ return(count($this->query($str)));
+ }else{
+ echo "not connected";
+ return(false);
+ }
+
+ }
+
+
/* This functions deletes a specified entry
* from our device tables
*/
}
}
-
+
/* Monitor handling
*/
function getMonitors()