Code

Added inverse filter
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 8 Oct 2009 08:11:45 +0000 (08:11 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 8 Oct 2009 08:11:45 +0000 (08:11 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14562 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_listing.inc

index c2c0207488580a2194fbda192ca38537f2ada145..24b8cba925d46491d0b023a313ff0896311e5cd1 100644 (file)
@@ -778,11 +778,19 @@ class listing {
       }
 
       // Skip entry if the pseudo filter does not fit
-      if (isset($action['filter']) && preg_match('/^[a-z0-9_]+=[a-z0-9_]+$/i', $action['filter'])) {
+      if (isset($action['filter']) && preg_match('/^[a-z0-9_]+!?=[a-z0-9_]+$/i', $action['filter'])) {
         list($fa, $fv)= split('=', $action['filter']);
-        if (!isset($this->entries[$row][$fa]) && !$this->entries[$row][$fa][0] == $fv) {
-          $result.= "<img src='images/empty.png' alt=' ' class='center' style='padding:1px'>";
-          continue;
+        if (preg_match('/^(.*)!$/', $fa, $m)){
+          $fa= $m[1];
+          if (isset($this->entries[$row][$fa]) && $this->entries[$row][$fa][0] == $fv) {
+            $result.= "<img src='images/empty.png' alt=' ' class='center' style='padding:1px'>";
+            continue;
+          }
+        } else {
+          if (!isset($this->entries[$row][$fa]) && !$this->entries[$row][$fa][0] == $fv) {
+            $result.= "<img src='images/empty.png' alt=' ' class='center' style='padding:1px'>";
+            continue;
+          }
         }
       }