From: hickert Date: Wed, 18 Jan 2006 06:38:24 +0000 (+0000) Subject: Added dialog for device removement X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=54afbe837fd4ceb37a51ce5a06cf3eb768476acf;p=gosa.git Added dialog for device removement git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2508 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_glpiDeviceManagement.inc b/plugins/admin/systems/class_glpiDeviceManagement.inc index dc54bdb6d..84c50362c 100644 --- a/plugins/admin/systems/class_glpiDeviceManagement.inc +++ b/plugins/admin/systems/class_glpiDeviceManagement.inc @@ -24,6 +24,8 @@ class glpiDeviceManagement extends plugin var $Selected = array(); + var $delete = array(); + function glpiDeviceManagement ($config, $dn= NULL,$used=NULL) { plugin::plugin ($config, $dn); @@ -102,7 +104,23 @@ class glpiDeviceManagement extends plugin if((isset($_GET['act']))&&($_GET['act']=="del_device")){ $id = base64_decode($_GET['id']); $tmp = $this->devices[$id]; - $this->parent->handle->deleteDevice($tmp); + + $this->delete = $tmp; + + if(isset($tmp['name'])){ + $smarty->assign("warning", sprintf(_("You're about to delete the glpi device '%s'."), $tmp['name'])); + }elseif(isset($tmp['designation'])){ + $smarty->assign("warning", sprintf(_("You're about to delete the glpi device '%s'."), $tmp['designation'])); + }else{ + print_a(_("Can't detect object name.")); + } + + return($smarty->fetch(get_template_path('remove_glpi.tpl', TRUE))); + } + + + if(isset($_POST['delete_glpi_confirm'])){ + $this->parent->handle->deleteDevice($this->delete); $this->reload(); }