Code

Added dialog for device removement
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 18 Jan 2006 06:38:24 +0000 (06:38 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 18 Jan 2006 06:38:24 +0000 (06:38 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2508 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_glpiDeviceManagement.inc

index dc54bdb6d19db6ff2002009841ecde6ceda90f0d..84c50362c05faa9072176ff4de0cee6ed491a88f 100644 (file)
@@ -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();
     }