aboutsummaryrefslogtreecommitdiff
path: root/h-source/Application/Controllers/GenericController.php
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2012-02-17 23:11:59 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2012-02-17 23:11:59 +0000
commita2c0b2c4f80463a94e2dd87b59f193ab3aa925eb (patch)
tree33ca8db836f4bda5250b0d380b8a3f695a59d4e1 /h-source/Application/Controllers/GenericController.php
parent1496cb0e9cf4e9893bcc8866fe0b8b8169b158c8 (diff)
added the search_string filter in the catalogue page to look for a model name containing a string
Diffstat (limited to 'h-source/Application/Controllers/GenericController.php')
-rw-r--r--h-source/Application/Controllers/GenericController.php12
1 files changed, 12 insertions, 0 deletions
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"));