Code

Dont throw away the hidden inputs..
[gosa.git] / gosa-core / include / class_management.inc
index c8a385764debb8cd96a303884be872887a1cdd01..7b0bdc988c09673ff53942270e0ab4d6620c4d44 100644 (file)
@@ -122,6 +122,9 @@ class management
 
     $this->registerAction("config-filter","editFilter");
     $this->registerAction("saveFilter","saveFilter");
+
+    // To temporay disable the filter caching UNcomment this line.
+    #session::global_un_set(get_class($this)."_filter");
   }
 
   /*! \brief  Execute this plugin
@@ -243,8 +246,9 @@ class management
     // In case an of locked entry, we may have opened a read-only tab.
     $str = "";
     if(isset($this->tabObject->read_only) && $this->tabObject->read_only == TRUE){
-      $str.= "<p style=\"text-align:right\">
-        <input type=submit name=\"edit_cancel\" value=\"".msgPool::cancelButton()."\">
+      $str.= "
+        <p style=\"text-align:right\">
+          <button type=submit name=\"edit_cancel\">".msgPool::cancelButton()."</button>
         </p>";
       return($str);
     }else{
@@ -273,6 +277,9 @@ class management
    */
   protected function removeEntryRequested($action="",$target=array(),$all=array())
   {
+    // Close dialogs and remove locks for currently handled dns
+    $this->cancelEdit();
+  
     $disallowed = array();
     $this->dns = array();
 
@@ -301,16 +308,29 @@ class management
 
       // 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){
-        $dns_names[] =LDAP::fix($dn);
+        $tmp = $h->getType($dn);
+        if(isset($map[$tmp])){
+          $dns_names[LDAP::fix($dn)] = _($map[$tmp]);
+        }else{
+          $dns_names[] =LDAP::fix($dn);
+        }
       }
       add_lock ($this->dns, $this->ui->dn);
 
       // Display confirmation dialog.
       $smarty = get_smarty();
-      $smarty->assign("info", msgPool::deleteInfo($dns_names,_($this->objectName)));
+      $smarty->assign("info", msgPool::deleteInfo($dns_names));
       $smarty->assign("multiple", true);
-      return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
+      return($smarty->fetch(get_template_path('removeEntries.tpl')));
     }
   }  
 
@@ -702,6 +722,9 @@ class management
         @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,$this->dns,"Entry saved!");
         $this->remove_lock();
         $this->closeDialogs();
+
+        // Ask filter to reload information
+        $this->filter->reloadFilters();
       }
     }
   }