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 | |
parent | 1496cb0e9cf4e9893bcc8866fe0b8b8169b158c8 (diff) |
added the search_string filter in the catalogue page to look for a model name containing a string
16 files changed, 37 insertions, 11 deletions
diff --git a/h-source/Application/Controllers/AcquisitioncardsController.php b/h-source/Application/Controllers/AcquisitioncardsController.php index bdab8f3..035b81f 100644 --- a/h-source/Application/Controllers/AcquisitioncardsController.php +++ b/h-source/Application/Controllers/AcquisitioncardsController.php @@ -54,7 +54,8 @@ class AcquisitioncardsController extends GenericController 'comm_year:sanitizeString' => 'undef', 'compatibility:sanitizeString' => 'undef', 'interface:sanitizeString' => 'undef', - 'sort-by:sanitizeString' => 'undef' + 'sort-by:sanitizeString' => 'undef', + 'search_string:sanitizeString' => 'undef' ); $this->setArgKeys($argKeys); diff --git a/h-source/Application/Controllers/BluetoothController.php b/h-source/Application/Controllers/BluetoothController.php index f46a3f9..006399d 100644 --- a/h-source/Application/Controllers/BluetoothController.php +++ b/h-source/Application/Controllers/BluetoothController.php @@ -54,7 +54,8 @@ class BluetoothController extends GenericController 'comm_year:sanitizeString' => 'undef', 'bluetooth_works:sanitizeString' => 'undef', 'interface:sanitizeString' => 'undef', - 'sort-by:sanitizeString' => 'undef' + 'sort-by:sanitizeString' => 'undef', + 'search_string:sanitizeString' => 'undef' ); $this->setArgKeys($argKeys); diff --git a/h-source/Application/Controllers/EthernetcardsController.php b/h-source/Application/Controllers/EthernetcardsController.php index baa8d1f..897e0ea 100644 --- a/h-source/Application/Controllers/EthernetcardsController.php +++ b/h-source/Application/Controllers/EthernetcardsController.php @@ -54,7 +54,8 @@ class EthernetcardsController extends GenericController 'comm_year:sanitizeString' => 'undef', 'ethernet_card_works:sanitizeString' => 'undef', 'interface:sanitizeString' => 'undef', - 'sort-by:sanitizeString' => 'undef' + 'sort-by:sanitizeString' => 'undef', + 'search_string:sanitizeString' => 'undef' ); $this->setArgKeys($argKeys); diff --git a/h-source/Application/Controllers/FingerprintreadersController.php b/h-source/Application/Controllers/FingerprintreadersController.php index 8d13b74..9c56c70 100644 --- a/h-source/Application/Controllers/FingerprintreadersController.php +++ b/h-source/Application/Controllers/FingerprintreadersController.php @@ -54,7 +54,8 @@ class FingerprintreadersController extends GenericController 'comm_year:sanitizeString' => 'undef', 'fingerprint_works:sanitizeString' => 'undef', 'interface:sanitizeString' => 'undef', - 'sort-by:sanitizeString' => 'undef' + 'sort-by:sanitizeString' => 'undef', + 'search_string:sanitizeString' => 'undef' ); $this->setArgKeys($argKeys); 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")); diff --git a/h-source/Application/Controllers/ModemsController.php b/h-source/Application/Controllers/ModemsController.php index c306496..d0a97a3 100644 --- a/h-source/Application/Controllers/ModemsController.php +++ b/h-source/Application/Controllers/ModemsController.php @@ -54,7 +54,8 @@ class ModemsController extends GenericController 'comm_year:sanitizeString' => 'undef', 'compatibility:sanitizeString' => 'undef', 'interface:sanitizeString' => 'undef', - 'sort-by:sanitizeString' => 'undef' + 'sort-by:sanitizeString' => 'undef', + 'search_string:sanitizeString' => 'undef' ); $this->setArgKeys($argKeys); diff --git a/h-source/Application/Controllers/NotebooksController.php b/h-source/Application/Controllers/NotebooksController.php index 6cac56e..e05fd75 100644 --- a/h-source/Application/Controllers/NotebooksController.php +++ b/h-source/Application/Controllers/NotebooksController.php @@ -83,6 +83,7 @@ class NotebooksController extends GenericController 'sort-by:sanitizeString' => 'undef', 'bios:sanitizeString' => 'undef', 'architecture:sanitizeString' => 'undef', + 'search_string:sanitizeString' => 'undef' ); $this->setArgKeys($argKeys); diff --git a/h-source/Application/Controllers/PrintersController.php b/h-source/Application/Controllers/PrintersController.php index 71ce9fb..0260032 100644 --- a/h-source/Application/Controllers/PrintersController.php +++ b/h-source/Application/Controllers/PrintersController.php @@ -76,6 +76,7 @@ class PrintersController extends GenericController 'comm_year:sanitizeString' => 'undef', 'interface:sanitizeString' => 'undef', 'sort-by:sanitizeString' => 'undef', + 'search_string:sanitizeString' => 'undef' ); $this->setArgKeys($argKeys); diff --git a/h-source/Application/Controllers/ScannersController.php b/h-source/Application/Controllers/ScannersController.php index 4355f37..ab52d9a 100644 --- a/h-source/Application/Controllers/ScannersController.php +++ b/h-source/Application/Controllers/ScannersController.php @@ -51,6 +51,7 @@ class ScannersController extends GenericController 'comm_year:sanitizeString' => 'undef', 'interface:sanitizeString' => 'undef', 'sort-by:sanitizeString' => 'undef', + 'search_string:sanitizeString' => 'undef' ); $this->setArgKeys($argKeys); diff --git a/h-source/Application/Controllers/SdcardreadersController.php b/h-source/Application/Controllers/SdcardreadersController.php index 7b26375..78ba530 100644 --- a/h-source/Application/Controllers/SdcardreadersController.php +++ b/h-source/Application/Controllers/SdcardreadersController.php @@ -54,7 +54,8 @@ class SdcardreadersController extends GenericController 'comm_year:sanitizeString' => 'undef', 'sd_card_works:sanitizeString' => 'undef', 'interface:sanitizeString' => 'undef', - 'sort-by:sanitizeString' => 'undef' + 'sort-by:sanitizeString' => 'undef', + 'search_string:sanitizeString' => 'undef' ); $this->setArgKeys($argKeys); diff --git a/h-source/Application/Controllers/SoundcardsController.php b/h-source/Application/Controllers/SoundcardsController.php index 60dffed..e48a6fb 100644 --- a/h-source/Application/Controllers/SoundcardsController.php +++ b/h-source/Application/Controllers/SoundcardsController.php @@ -50,7 +50,8 @@ class SoundcardsController extends GenericController 'comm_year:sanitizeString' => 'undef', 'sound_card_works:sanitizeString' => 'undef', 'interface:sanitizeString' => 'undef', - 'sort-by:sanitizeString' => 'undef' + 'sort-by:sanitizeString' => 'undef', + 'search_string:sanitizeString' => 'undef' ); $this->setArgKeys($argKeys); diff --git a/h-source/Application/Controllers/ThreegcardsController.php b/h-source/Application/Controllers/ThreegcardsController.php index c9ecfcb..173466c 100644 --- a/h-source/Application/Controllers/ThreegcardsController.php +++ b/h-source/Application/Controllers/ThreegcardsController.php @@ -50,7 +50,8 @@ class ThreegcardsController extends GenericController 'comm_year:sanitizeString' => 'undef', 'wifi_works:sanitizeString' => 'undef', 'interface:sanitizeString' => 'undef', - 'sort-by:sanitizeString' => 'undef' + 'sort-by:sanitizeString' => 'undef', + 'search_string:sanitizeString' => 'undef' ); $this->setArgKeys($argKeys); diff --git a/h-source/Application/Controllers/VideocardsController.php b/h-source/Application/Controllers/VideocardsController.php index ad6c0ef..477e335 100644 --- a/h-source/Application/Controllers/VideocardsController.php +++ b/h-source/Application/Controllers/VideocardsController.php @@ -51,6 +51,7 @@ class VideocardsController extends GenericController 'video_card_works:sanitizeString' => 'undef', 'interface:sanitizeString' => 'undef', 'sort-by:sanitizeString' => 'undef', + 'search_string:sanitizeString' => 'undef' ); $this->setArgKeys($argKeys); diff --git a/h-source/Application/Controllers/WebcamsController.php b/h-source/Application/Controllers/WebcamsController.php index 98bc2a7..08f9e1b 100644 --- a/h-source/Application/Controllers/WebcamsController.php +++ b/h-source/Application/Controllers/WebcamsController.php @@ -50,7 +50,8 @@ class WebcamsController extends GenericController 'comm_year:sanitizeString' => 'undef', 'webcam_works:sanitizeString' => 'undef', 'interface:sanitizeString' => 'undef', - 'sort-by:sanitizeString' => 'undef' + 'sort-by:sanitizeString' => 'undef', + 'search_string:sanitizeString' => 'undef' ); $this->setArgKeys($argKeys); diff --git a/h-source/Application/Controllers/WifiController.php b/h-source/Application/Controllers/WifiController.php index 960d2c1..5caaf30 100644 --- a/h-source/Application/Controllers/WifiController.php +++ b/h-source/Application/Controllers/WifiController.php @@ -50,7 +50,8 @@ class WifiController extends GenericController 'comm_year:sanitizeString' => 'undef', 'wifi_works:sanitizeString' => 'undef', 'interface:sanitizeString' => 'undef', - 'sort-by:sanitizeString' => 'undef' + 'sort-by:sanitizeString' => 'undef', + 'search_string:sanitizeString' => 'undef' ); $this->setArgKeys($argKeys); diff --git a/h-source/Application/Models/GenericModel.php b/h-source/Application/Models/GenericModel.php index 70bc816..c4c69ab 100644 --- a/h-source/Application/Models/GenericModel.php +++ b/h-source/Application/Models/GenericModel.php @@ -80,7 +80,7 @@ class GenericModel extends Model_Tree { public function getPopupLabel($viewArgs) { $html = null; - $listArray = array('page','history_page'); + $listArray = array('page','history_page','search_string'); $count = 0; |