From 9888ec8a6fd400a08471cd97cd4865248f0748f2 Mon Sep 17 00:00:00 2001 From: yuri Date: Mon, 12 Oct 2015 10:30:16 +0300 Subject: [PATCH] fix global searct --- application/Espo/Controllers/GlobalSearch.php | 2 +- application/Espo/Resources/routes.json | 5 ++--- frontend/client/src/views/global-search/global-search.js | 6 +++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/application/Espo/Controllers/GlobalSearch.php b/application/Espo/Controllers/GlobalSearch.php index 0c8800a8b6..4faa825829 100644 --- a/application/Espo/Controllers/GlobalSearch.php +++ b/application/Espo/Controllers/GlobalSearch.php @@ -29,7 +29,7 @@ class GlobalSearch extends \Espo\Core\Controllers\Base { public function actionSearch($params, $data, $request) { - $query = $params['query']; + $query = $request->get('q'); $offset = intval($request->get('offset')); $maxSize = intval($request->get('maxSize')); diff --git a/application/Espo/Resources/routes.json b/application/Espo/Resources/routes.json index d453f680be..f35f655a19 100644 --- a/application/Espo/Resources/routes.json +++ b/application/Espo/Resources/routes.json @@ -87,12 +87,11 @@ }, { - "route":"/GlobalSearch/:query", + "route":"/GlobalSearch", "method":"get", "params":{ "controller":"GlobalSearch", - "action":"search", - "query": ":query" + "action":"search" } }, diff --git a/frontend/client/src/views/global-search/global-search.js b/frontend/client/src/views/global-search/global-search.js index a833b322d1..4cc398ff07 100644 --- a/frontend/client/src/views/global-search/global-search.js +++ b/frontend/client/src/views/global-search/global-search.js @@ -19,11 +19,11 @@ * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ -Espo.define('Views.GlobalSearch.GlobalSearch', 'View', function (Dep) { +Espo.define('views/global-search/global-search', 'view', function (Dep) { return Dep.extend({ - template: 'global-search.global-search', + template: 'global-search/global-search', events: { 'keypress #global-search-input': function (e) { @@ -63,7 +63,7 @@ Espo.define('Views.GlobalSearch.GlobalSearch', 'View', function (Dep) { }, search: function (text) { - this.collection.url = this.collection.urlRoot = 'GlobalSearch/' + text; + this.collection.url = this.collection.urlRoot = 'GlobalSearch?q=' + encodeURIComponent(text); this.showPanel(); },