Skip to content

Commit

Permalink
Fixed issue #11148: Response detail view in participant list does not…
Browse files Browse the repository at this point in the history
… show the related response in detail
  • Loading branch information
c-schmitz committed May 11, 2016
1 parent 985c3dc commit 334b921
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
25 changes: 23 additions & 2 deletions application/controllers/admin/responses.php
Expand Up @@ -112,9 +112,30 @@ private function _getData($params)
return $aData;
}


public function viewbytoken($iSurveyID, $token, $sBrowseLang = '')
{
// Get Response ID from token
$oResponse = SurveyDynamic::model($iSurveyID)->findByAttributes(array('token'=>$token));
if (!$oResponse){
Yii::app()->setFlashMessage(gT("Sorry, this response was not found."),'error');
$this->getController()->redirect(array("admin/responses/sa/browse/surveyid/{$iSurveyID}"));
}
else
{
$this->getController()->redirect(array("admin/responses/sa/view/surveyid/{$iSurveyID}/id/{$oResponse->id}"));
}

}


/**
* @todo View what?
*/
* View a single response in detail
*
* @param mixed $iSurveyID
* @param mixed $iId
* @param mixed $sBrowseLang
*/
public function view($iSurveyID, $iId, $sBrowseLang = '')
{
if(Permission::model()->hasSurveyPermission($iSurveyID,'responses','read'))
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/admin/tokens.php
Expand Up @@ -471,7 +471,7 @@ function getTokens_json($iSurveyId, $search = null)
// Check is we have an answer
if (in_array($token['token'], $answeredTokens) && $bReadPermission) {
// @@TODO change link
$url = $this->getController()->createUrl("admin/responses/sa/browse/surveyid/{$iSurveyId}", array('token'=>$token['token']));
$url = $this->getController()->createUrl("admin/responses/sa/viewbytoken/surveyid/{$iSurveyId}", array('token'=>$token['token']));
$title = gT("View response details");
$action .= CHtml::link(
'<span class="inputbuttons-square glyphicon glyphicon-list-alt text-success" title="'.$title.'"></span>',
Expand Down

0 comments on commit 334b921

Please sign in to comment.