Code

Prepared fai to use removeEntries.tpl
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 17 Mar 2010 14:42:12 +0000 (14:42 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 17 Mar 2010 14:42:12 +0000 (14:42 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16782 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/fai/admin/fai/class_faiManagement.inc

index da22ad7cd30791e2817191fba520a9631fc8da04..72031cfd93868a7ad1b093cc8cfdd541170052f9 100644 (file)
@@ -374,6 +374,9 @@ class faiManagement extends management
    */
   function removeFAIObjects($to_delete)
   {
+    // Close dialogs and remove locks for currently handled dns
+    $this->cancelEdit();
+
     // Do not allow to remove objects with state freeezed
     $errors = $disallowed = array();
   
@@ -397,20 +400,35 @@ class faiManagement extends management
     }
 
     // Check entry locking
+    $smarty = get_smarty();
     if(count($this->dns)){
       if ($user= get_multiple_locks($this->dns)){
         return(gen_locked_message($user,$this->dns));
       }
       if(count($this->dns)){
-        $smarty = get_smarty();
+
+        // Add locks
         $dns_names = array();
+        $types = array();
+        $h = $this->getHeadpage();
+
+        // Build list of object -labels
+        foreach($h->objectTypes as $type){
+          $map[$type['objectClass']]= $type['label'];
+        }
+
         foreach($this->dns as $dn){
-          add_lock ($dn, $this->ui->dn);
-          $dns_names[] = LDAP::fix($dn);
+          $tmp = $h->getType($dn);
+          if(isset($map[$tmp])){
+            $dns_names[] = '('._($map[$tmp]).')&nbsp;-&nbsp;'.LDAP::fix($dn);
+          }else{
+            $dns_names[] =LDAP::fix($dn);
+          }
         }
-        $smarty->assign("info",msgPool::deleteInfo($dns_names,_("FAI object")));
-        $smarty->assign("multiple", true);
-        return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
+        add_lock ($this->dns, $this->ui->dn);
+
+        $smarty->assign("info",msgPool::deleteInfo($dns_names));
+        return($smarty->fetch(get_template_path('removeEntries.tpl', TRUE)));
       }
     }
   }