From: hickert Date: Mon, 15 Mar 2010 15:32:15 +0000 (+0000) Subject: Updated opsiLicenses search filter X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=8c59f9799c1f765b65637c0cd51724c67ec8f30a;p=gosa.git Updated opsiLicenses search filter git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16538 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/opsi/admin/opsiLicenses/class_filterOpsiLicense.inc b/gosa-plugins/opsi/admin/opsiLicenses/class_filterOpsiLicense.inc index 10d0e1958..13c5bfde1 100644 --- a/gosa-plugins/opsi/admin/opsiLicenses/class_filterOpsiLicense.inc +++ b/gosa-plugins/opsi/admin/opsiLicenses/class_filterOpsiLicense.inc @@ -12,10 +12,17 @@ class filterOpsiLicense { $flag= ($scope == "sub")?GL_SUBSEARCH:0; $result= filterOpsiLicense::get_list($base, $filter, $attributes, $category, $objectStorage, $flag); + // Prepare filter and split it into attribute and value to search for + $filter=preg_replace("/\*/","",$filter); + $attr = $value = ""; + if(!empty($filter) && preg_match("/=/", $filter)){ + list($attr,$value) = preg_split("/=/", $filter); + } + // Simple filtering - if(!empty($filter)){ + if(!empty($attr)){ foreach($result as $key => $entry){ - if(!preg_match($filter, $entry['cn'][0])){ + if(!preg_match("/".$value."/i", $entry[$attr][0])){ unset($result[$key]); } } diff --git a/gosa-plugins/opsi/admin/opsiLicenses/class_opsiLicenses.inc b/gosa-plugins/opsi/admin/opsiLicenses/class_opsiLicenses.inc index 4e969cce6..6c67c5253 100644 --- a/gosa-plugins/opsi/admin/opsiLicenses/class_opsiLicenses.inc +++ b/gosa-plugins/opsi/admin/opsiLicenses/class_opsiLicenses.inc @@ -40,13 +40,13 @@ class opsiLicenses extends management $this->storagePoints = array(""); - // Build filter - if (session::global_is_set(get_class($this)."_filter")){ - $filter= session::global_get(get_class($this)."_filter"); - } else { +# // Build filter + # if (session::global_is_set(get_class($this)."_filter")){ + # $filter= session::global_get(get_class($this)."_filter"); + # } else { $filter = new filter(get_template_path("opsiLicense-filter.xml", true)); $filter->setObjectStorage($this->storagePoints); - } + #} $this->setFilter($filter); // Build headpage diff --git a/gosa-plugins/opsi/admin/opsiLicenses/opsiLicense-filter.tpl b/gosa-plugins/opsi/admin/opsiLicenses/opsiLicense-filter.tpl deleted file mode 100644 index 3d47da615..000000000 --- a/gosa-plugins/opsi/admin/opsiLicenses/opsiLicense-filter.tpl +++ /dev/null @@ -1,29 +0,0 @@ -
-

- [F]{t}Filter{/t} -

-
- -
- - - - - - -
- - - {$NAME} -
- - - - - -
- {$APPLY} -
-
diff --git a/gosa-plugins/opsi/admin/opsiLicenses/opsiLicense-filter.xml b/gosa-plugins/opsi/admin/opsiLicenses/opsiLicense-filter.xml index 7abcde7e6..8fccaecca 100644 --- a/gosa-plugins/opsi/admin/opsiLicenses/opsiLicense-filter.xml +++ b/gosa-plugins/opsi/admin/opsiLicenses/opsiLicense-filter.xml @@ -3,38 +3,43 @@ opsi - true + default + one + dn + objectClass + cn + description + productId + default + OpsiLicense - $NAME - dn - objectClass - cn - description + cn=$ auto + + cn + 0.5 + 3 + - - textfield - NAME - 20 - 60 - - - /$/i - false - + + byProduct + + OpsiLicense - /$NAME/i + productId=$ + + auto + cn 0.5 3 - - + diff --git a/gosa-plugins/opsi/admin/opsiLicenses/opsiLicense-list.tpl b/gosa-plugins/opsi/admin/opsiLicenses/opsiLicense-list.tpl index bc45133df..3327d4f10 100644 --- a/gosa-plugins/opsi/admin/opsiLicenses/opsiLicense-list.tpl +++ b/gosa-plugins/opsi/admin/opsiLicenses/opsiLicense-list.tpl @@ -1,28 +1,27 @@ - - - - - -
-
-

 {$HEADLINE} {$SIZELIMIT}

-
- -
-
- - -
{$ROOT} {$BACK} {$HOME} {$RELOAD} {$SEPARATOR}  {$ACTIONS}
-
-
- -
-
- {$LIST} -
- {$FILTER} -
+
+ +
+

{$HEADLINE} {$SIZELIMIT}

+
+ + + + + + + + + +
{$ROOT}{$BACK}{$HOME}{$RELOAD}{$ACTIONS}{$FILTER}
+
+
+ + {$LIST} +
+ +
+