Code

Attachmentpool dialog fixed
[gosa.git] / plugins / admin / systems / class_glpiDeviceManagement.inc
index e3a5497bc2f6a429ea1a62c3d565d22c170303f9..675ebc4208481ac40431aa625aff8aacdd64ac20 100644 (file)
@@ -122,8 +122,20 @@ class glpiDeviceManagement extends plugin
 
     /* Delete entry, but check if this device is in currently in use */
     if(isset($_POST['delete_glpi_confirm'])){
-      if($this->parent->handle->is_deviceUsed($this->delete)){
-        print_red(_("Can't delete this device, it is actually in use by some glpi accounts. Remove this relation first."));
+      if(count($this->parent->handle->is_deviceUsed($this->delete))){
+
+        $tmp = $this->parent->handle->is_deviceUsed($this->delete);    
+  
+        $names = "";
+        foreach($tmp as $name){
+          $names .= ", ".$name;
+        }
+        $names = preg_replace("/^, /","",$names);
+        $names = trim($names);
+        if(count($tmp) == 3){
+          $names .= " ...";
+        }
+        print_red(sprintf(_("You can't delete this device, it is still in use by these system(s) '%s'"),$names));
       }else{
         $this->parent->handle->deleteDevice($this->delete);
         $this->reload();
@@ -243,8 +255,8 @@ class glpiDeviceManagement extends plugin
     $smarty->assign("search_image", get_template_path('images/search.png'));
     $smarty->assign("searchu_image", get_template_path('images/search_user.png'));
     $smarty->assign("tree_image", get_template_path('images/tree.png'));
-    $smarty->assign("infoimage", get_template_path('images/info.png'));
-    $smarty->assign("launchimage", get_template_path('images/launch.png'));
+    $smarty->assign("infoimage", get_template_path('images/info_small.png'));
+    $smarty->assign("launchimage", get_template_path('images/small_filter.png'));
     $smarty->assign("apply", apply_filter());
     $smarty->assign("alphabet", generate_alphabet());
     $smarty->assign("device_regex", $filter['device_regex']);