Skip to content

Commit

Permalink
Fixed issue #09854: Token page view reponse links lead to all respons…
Browse files Browse the repository at this point in the history
…es instead of to the one selected

Dev: different system than before : add token to default search
Dev: Same token can have multiple responses, then better to add to default search
Dev: maybe some test to update link in token json ? Not really needed
Dev: defaultSearch js can accept anythink in defaultSearch array : extend to other in browse function ?
  • Loading branch information
Shnoulle committed Aug 30, 2015
1 parent 9123ffd commit 4727013
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion application/controllers/admin/responses.php
Expand Up @@ -413,6 +413,7 @@ function browse($iSurveyId)
'align'=>'center',
'label' => gt("Completed"),
);
// defaultSearch is the default search done before send request in json. Actually : completed and token only. Can be extended ( js is ready) ?
$defaultSearch=array();
if (incompleteAnsFilterState() == "incomplete")
{
Expand All @@ -426,7 +427,6 @@ function browse($iSurveyId)
{
$defaultSearch['completed']="";
}

//add token to top of list if survey is not private
if ($aData['surveyinfo']['anonymized'] == "N" && tableExists('tokens_' . $iSurveyId)) //add token to top of list if survey is not private
{
Expand Down Expand Up @@ -465,6 +465,11 @@ function browse($iSurveyId)
'align'=>'left',
'title'=>gt('Email'),
);
// If token exist, test if token is set in params, add it to defaultSearch
if($sTokenSearch= Yii::app()->request->getQuery('token'))
{
$defaultSearch['token']=$sTokenSearch;
}
}


Expand Down
4 changes: 3 additions & 1 deletion scripts/admin/listresponse.js
Expand Up @@ -145,7 +145,9 @@ $(function() {
});
if(firstload)
{
$("#gs_completed").val(defaultSearch.completed);
jQuery.each(defaultSearch, function(index, value) {
$("#gs_"+index).val(value);
});
firstload=false;
}
/* Column button */
Expand Down

0 comments on commit 4727013

Please sign in to comment.