Code

Reverted last commit
[gosa.git] / gosa-core / include / class_filter.inc
index 64cfded3d8a600559b97bcd076b296cd3ed418fa..286725978de42d16a0ae507d2dd0f39f7e2a7513 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") {
@@ -371,6 +383,9 @@ class filter {
       $filter= $query['filter'];
       $attributes= $query['attribute'];
 
+      $method = "";
+      if(isset($query['method'])) $method = $query['method'];
+
       // Generate final filter
       foreach ($this->elements as $tag => $element) {
         if (!isset($element['set']) || !isset($element['unset'])) {
@@ -396,7 +411,8 @@ class filter {
         }
       }
 
-      $result= array_merge($result, call_user_func(array($backend, 'query'), $this->base, $this->scope, $filter, $attributes, $this->category, $this->objectStorage));
+      $result= array_merge($result, call_user_func(array($backend, 'query'), $this->base, $this->scope, $filter, $attributes, $this->category,$method, $this->objectStorage));
+      $result = call_user_func(array($backend, 'unifyResults'), $result);
     }
     
     return ($result);