From a2c0b2c4f80463a94e2dd87b59f193ab3aa925eb Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Fri, 17 Feb 2012 23:11:59 +0000 Subject: added the search_string filter in the catalogue page to look for a model name containing a string --- h-source/Application/Controllers/GenericController.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'h-source/Application/Controllers/GenericController.php') diff --git a/h-source/Application/Controllers/GenericController.php b/h-source/Application/Controllers/GenericController.php index adf2555..2381866 100644 --- a/h-source/Application/Controllers/GenericController.php +++ b/h-source/Application/Controllers/GenericController.php @@ -446,6 +446,18 @@ class GenericController extends BaseController Params::$nullQueryValue = 'undef'; $data['tree'] = plural($this->controller); + + //look for a string in the model name or in the other_names if the string is different from undef + if (strcmp($this->viewArgs['search_string'],"undef") !== 0) + { + $nWhere = array( + 'OR' => array( + 'model' => "like '%".$this->viewArgs['search_string']."%'", + 'other_names' => "like '%".$this->viewArgs['search_string']."%'", + ), + ); + $this->mod->aWhere($nWhere); + } $this->mod->aWhere(array("deleted"=>"no","cleared"=>"no")); -- cgit v1.2.3