diff options
| author | Antonio Gallo <tonicucoz@gmail.com> | 2012-02-17 23:11:59 +0000 | 
|---|---|---|
| committer | Antonio Gallo <tonicucoz@gmail.com> | 2012-02-17 23:11:59 +0000 | 
| commit | a2c0b2c4f80463a94e2dd87b59f193ab3aa925eb (patch) | |
| tree | 33ca8db836f4bda5250b0d380b8a3f695a59d4e1 /h-source/Application/Controllers/GenericController.php | |
| parent | 1496cb0e9cf4e9893bcc8866fe0b8b8169b158c8 (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.php | 12 | 
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"));  | 
