fix global searct

This commit is contained in:
yuri
2015-10-12 10:30:16 +03:00
parent ea5321577a
commit 9888ec8a6f
3 changed files with 6 additions and 7 deletions
@@ -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'));
+2 -3
View File
@@ -87,12 +87,11 @@
},
{
"route":"/GlobalSearch/:query",
"route":"/GlobalSearch",
"method":"get",
"params":{
"controller":"GlobalSearch",
"action":"search",
"query": ":query"
"action":"search"
}
},
@@ -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();
},