/** * Have I the right to "delete" the Object * * Default is calling canCreateItem * May be overloaded if needed * * @return booleen * @see canCreate **/ function canDeleteItem() { global $CFG_GLPI; if (!$this->canCreateItem()) { return false; } // Can delete an object with Infocom only if can delete Infocom if (in_array($this->getType(), $CFG_GLPI['infocom_types'])) { $infocom = new Infocom(); if ($infocom->getFromDBforDevice($this->getType(), $this->fields['id'])) { return $infocom->canDelete(); } } return true; }