Code

Updated userFilter
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 10 Mar 2010 16:04:40 +0000 (16:04 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 10 Mar 2010 16:04:40 +0000 (16:04 +0000)
-Is now able to read fixedFilters
-Whats missing, make userFilterEditor able to set fixedFilters as parent

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16385 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_listing.inc
gosa-core/include/class_management.inc
gosa-core/include/class_userFilter.inc

index 38842dfb2ba762d670e1a7140e7b7e14a487a3d9..6175a42323ceff92b0542460d0097feeedf2cbdc 100644 (file)
@@ -121,6 +121,12 @@ class listing {
   }
 
 
+  function getFilter()
+  { 
+    return($this->filter);
+  }  
+
+
   function setFilter($filter)
   {
     $this->filter= &$filter;
index 6bdd603ca37cd0519a890868d897bbb648e12251..b15a124623ef4f417141566efd8d290a03d62a5b 100644 (file)
@@ -186,8 +186,7 @@ class management
  
   function editFilter()
   {
-    $headpage = $this->getHeadpage();
-    $this->dialogObject = new userFilter($this->config,$headpage->categories);
+    $this->dialogObject = new userFilter($this->config,$this->getHeadpage());
   }
  
   function renderList()
index 8a0ba62084765271fc0748d70e3f769b77439c2d..46e1aec4482625845e980e0059c85dd04440ed99 100644 (file)
@@ -2,13 +2,15 @@
 
 class userFilter extends plugin 
 {
-  protected $fitlers = array();
+  protected $filters = array();
   protected $availableCategories = array();
   
   public $objectclasses = array('gosaProperties');
   public $attributes = array('gosaUserDefinedFilter');
   public $gosaUserDefinedFilter = array();
 
+  private $listing = NULL;
+  private $fixedFilter = NULL;
 
   /*! \brief    Returns true if we are able to read and write userFilters 
    *            (schema has to be present, gosaProperties)
@@ -27,14 +29,17 @@ class userFilter extends plugin
  
   /*! \brief  Initiates the filter editing dialog.
    */ 
-  function __construct($config, $categories)
+  function __construct($config, $listing)
   {
     // Initialize this plugin with the users dn to gather user defined filters.
     $ui = get_userinfo();
     plugin::plugin($config, $ui->dn);
+    $this->listing = &$listing;
+    $filter= $this->listing->getFilter();
+    $this->fixedFilter = $filter->getFixedFilters();
 
     // Keep list of currently managed categories.
-    $this->availableCategories = array_unique($categories);
+    $this->availableCategories = array_unique($this->listing->categories);
 
     // Load list of filters
     if(isset($this->attrs['gosaUserDefinedFilter'])){
@@ -157,13 +162,13 @@ class userFilter extends plugin
     if($action['action'] == 'edit' && count($action['targets']) == 1){
       $key= $this->filterWidget->getKey($action['targets'][0]);
       if(isset($this->filters[$key])){
-        $this->dialog=new userFilterEditor($this->filters[$key], $this->availableCategories);
+        $this->dialog=new userFilterEditor($this->filters[$key], $this->availableCategories, $this->fixedFilter);
       }
     }
 
     // Act on new requests
     if(isset($_POST['addFilter'])){
-      $this->dialog=new userFilterEditor(array(), $this->availableCategories);
+      $this->dialog=new userFilterEditor(array(), $this->availableCategories, $this->fixedFilter);
     }
 
     // Act on remove requests