From f874c0450133f7de0f92370dcde3706a0e3ca790 Mon Sep 17 00:00:00 2001 From: cajus Date: Thu, 8 Oct 2009 08:11:45 +0000 Subject: [PATCH] Added inverse filter git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14562 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_listing.inc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/gosa-core/include/class_listing.inc b/gosa-core/include/class_listing.inc index c2c020748..24b8cba92 100644 --- a/gosa-core/include/class_listing.inc +++ b/gosa-core/include/class_listing.inc @@ -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.= " "; - continue; + if (preg_match('/^(.*)!$/', $fa, $m)){ + $fa= $m[1]; + if (isset($this->entries[$row][$fa]) && $this->entries[$row][$fa][0] == $fv) { + $result.= " "; + continue; + } + } else { + if (!isset($this->entries[$row][$fa]) && !$this->entries[$row][$fa][0] == $fv) { + $result.= " "; + continue; + } } } -- 2.30.2