Code

Updated filter
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 8 Jan 2010 10:38:01 +0000 (10:38 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 8 Jan 2010 10:38:01 +0000 (10:38 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15121 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/systems/admin/systems/class_systemManagement.inc
gosa-plugins/systems/admin/systems/system-filter.xml

index 5128ca66d96eb19131f0b147542d4db779bd2c96..c3efc23d9dbaf871aebc7398960f99351e0db200 100644 (file)
@@ -64,6 +64,8 @@ class systemManagement extends management
     $headpage = new listing(get_template_path("system-list.xml", true));
     $headpage->setFilter($filter);
 
+    $filter->setConverter('INCOMING', 'systemManagement::incomingFilterConverter');
+
     // Add copy&paste and snapshot handler.
     if ($this->config->boolValueIsTrue("main", "copyPaste")){
       $this->cpHandler = new CopyPasteHandler($this->config);
@@ -74,6 +76,12 @@ class systemManagement extends management
     parent::__construct($config, $ui, "systems", $headpage);
   }
 
+  static function incomingFilterConverter($filter)
+  {
+    $rdn = preg_replace("/^[^=]*=/", "", get_ou('systemIncomingRDN'));
+    $rdn = preg_replace("/,.*$/","",$rdn);
+    return(preg_replace("/%systemIncomingRDN/", $rdn,$filter));
+  }
 
   
  /*! \brief   Overridden render method of class mangement.
index 9b1f30595da031d70b000c025ca5edc69895ec30..bb9f5942c48f5552b9a41ff1122fad44ea9858c2 100644 (file)
   <search>
     <query>
       <backend>SYSTEMS</backend>
-      <filter>(&amp;(|$SERVER $WORKSTATION $TERMINAL $PRINTER $COMPONENT $WINSTATION )$NAME)</filter>
+      <filter>(&amp;(|$SERVER $WORKSTATION $TERMINAL $PRINTER $COMPONENT $WINSTATION $INCOMING)$NAME)</filter>
       <attribute>dn</attribute>
       <attribute>objectClass</attribute>
       <attribute>cn</attribute>
       <attribute>description</attribute>
+      <attribute>gotoMode</attribute>
       <attribute>macAddress</attribute>
     </query>
     <scope>auto</scope>
@@ -81,7 +82,7 @@
     <tag>INCOMING</tag>
     <default>true</default>
     <unset></unset>
-    <set>(objectClass=goWorkstation)</set>
+    <set>(&amp;(|(objectClass=goWorkstation)(objectClass=gotoTerminal)(objectClass=goHard))(ou:dn:=%systemIncomingRDN))</set>
   </element>