Skip to content

Commit

Permalink
Fixed issue #08906: Long URI with autofilter
Browse files Browse the repository at this point in the history
Dev: surely same for filter too, same fix can be applied
  • Loading branch information
Shnoulle committed Jul 8, 2014
1 parent 38a3f65 commit 79d86fe
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
9 changes: 7 additions & 2 deletions application/controllers/admin/tokens.php
Expand Up @@ -361,13 +361,18 @@ function getTokens_json($iSurveyId, $search = null)
$sidx = Yii::app()->request->getPost('sidx', 'lastname');
$sord = Yii::app()->request->getPost('sord', 'asc');
$limit = Yii::app()->request->getPost('rows', 25);

$aData = new stdClass;
$aData->page = $page;

$aSearchArray=Yii::app()->request->getPost('searcharray');
if(empty($search) && !empty($aSearchArray)){
$search=$aSearchArray;
}
//die("<pre>".print_r($search,1)."</pre>");
if (!empty($search)) {
$condition = TokenDynamic::model($iSurveyId)->getSearchMultipleCondition($search);
} else {
}else{
$condition = new CDbCriteria();
}

Expand Down
11 changes: 6 additions & 5 deletions scripts/admin/tokens.js
Expand Up @@ -394,13 +394,14 @@ $(document).ready(function() {
if(sSearchString != ""){
var aSearchConditions=new Array;
for(col in colInformation){
if(colInformation[col]['quickfilter'])
aSearchConditions.push(col+"||contains||"+sSearchString);
if(colInformation[col]['quickfilter']){
aSearchConditions.push(col);aSearchConditions.push('contains');aSearchConditions.push(sSearchString);aSearchConditions.push("or");
}
}
var sSearchConditions=aSearchConditions.join("||or||");
oGrid.jqGrid('setGridParam', {url: jsonSearchUrl+"/"+sSearchConditions}).trigger('reloadGrid', [{current: true, page: 1}]);
aSearchConditions.pop();// remove last 'or'
oGrid.jqGrid('setGridParam', {url: jsonUrl, postData: { searcharray: aSearchConditions} }).trigger('reloadGrid', [{current: true, page: 1}]);
}else{
oGrid.jqGrid('setGridParam', {url: jsonUrl}).trigger('reloadGrid', [{current: true, page: 1}]);
oGrid.jqGrid('setGridParam', {url: jsonUrl, postData: { }}).trigger('reloadGrid', [{current: true, page: 1}]);
}
}, 500);

Expand Down

0 comments on commit 79d86fe

Please sign in to comment.