From 54afbe837fd4ceb37a51ce5a06cf3eb768476acf Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 18 Jan 2006 06:38:24 +0000 Subject: [PATCH] Added dialog for device removement git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2508 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../systems/class_glpiDeviceManagement.inc | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) 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(); } -- 2.30.2