Code

Hide refs, too. Not needed.
[gosa.git] / gosa-core / include / class_filter.inc
index 86b23cf0dce4c8bf6e2daba8ddb3f66caa91876a..9b2fed5458381bcf79bba4e76752ac552e2b6042 100644 (file)
@@ -183,7 +183,7 @@ class filter {
 
   function getCombobox($element)
   {
-    $result= "<select name='".$element['tag']."' size='1' onClick='document.mainform.submit();'>";
+    $result= "<select name='".$element['tag']."' size='1' onChange='document.mainform.submit();'>";
 
     // Fill with presets
     foreach ($element['value'] as $value) {
@@ -214,6 +214,18 @@ class filter {
   }
 
 
+  function setComboBoxOptions($tag, $options)
+  {
+    if (isset($this->elements[$tag]) && $this->elements[$tag]['type'] == "combobox") {
+      
+      $this->elements[$tag]['value']= array();
+      foreach ($options as $key => $label) {
+        $this->elements[$tag]['value'][]= array('label' => $label, 'key' => $key);
+      }
+    }
+  }
+
+
   function getCurrentBase()
   {
     if (isset($this->search->base) && (string)$this->search->scope != "auto") {
@@ -418,13 +430,9 @@ class filter {
 
   function update()
   {
-
     /* React on alphabet links if needed */
     if (isset($_GET['filter'])){
-      $s= mb_substr(validate($_GET['filter']), 0, 1, "UTF8")."*";
-      if ($s == "**"){
-        $s= "*";
-      }
+      $s= mb_substr(validate($_GET['filter']), 0, 1, "UTF8");
       foreach ($this->alphabetElements as $tag) {
         $this->elementValues[$tag]= $s;
       }
@@ -469,7 +477,7 @@ class filter {
     }
 
     // Make filter
-    $filter= preg_replace("/\\$$tag/", normalizeLDAP($value), $filter);
+    $filter= preg_replace("/\\$$tag/", normalizeLdap($value), $filter);
     if (isset($config['base']) && isset($config['scope']) && isset($config['category'])) {
       $result= call_user_func(array($backend, 'query'), $config['base'], $config['scope'], $filter, $attributes,
                            $config["category"], $config["objectStorage"]);