Skip to content

Commit

Permalink
Fixed #7075: browse results bug with upload type question (display fe…
Browse files Browse the repository at this point in the history
…w answer and no download)

dev: fixed link from show individual record
  • Loading branch information
mennodekker committed Jan 8, 2013
1 parent 94e9083 commit a4c34ec
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions application/controllers/admin/responses.php
Expand Up @@ -258,7 +258,7 @@ public function view($iSurveyID, $iId, $sBrowseLang = '')
if ($metadata === "size")
$answervalue = rawurldecode(((int) ($phparray[$index][$metadata])) . " KB");
else if ($metadata === "name")
$answervalue = CHtml::link(rawurldecode($phparray[$index][$metadata]), $this->getController()->createUrl("/admin/responses/sa/index/downloadindividualfile/{$phparray[$index][$metadata]}/fieldname/{$fnames[$i][0]}/id/{$iId}/surveyid/{$iSurveyID}"));
$answervalue = CHtml::link(rawurldecode($phparray[$index][$metadata]), $this->getController()->createUrl("/admin/responses/sa/browse/downloadindividualfile/{$phparray[$index][$metadata]}/fieldname/{$fnames[$i][0]}/id/{$iId}/surveyid/{$iSurveyID}"));
else
$answervalue = rawurldecode($phparray[$index][$metadata]);
}
Expand Down Expand Up @@ -377,12 +377,12 @@ function browse($iSurveyID)
$zipfilename = "Files_for_responses_" . Yii::app()->request->getPost('downloadfile') . ".zip";
$this->_zipFiles($iSurveyID, Yii::app()->request->getPost('downloadfile'), $zipfilename,$aData['language']);
}
else if (Yii::app()->request->getPost('downloadindividualfile') != '')
else if (Yii::app()->request->getParam('downloadindividualfile') != '')
{
$iId = (int) Yii::app()->request->getPost('id');
$downloadindividualfile = Yii::app()->request->getPost('downloadindividualfile');
$fieldname = Yii::app()->request->getPost('fieldname');

$iId = (int) Yii::app()->request->getParam('id');
$downloadindividualfile = Yii::app()->request->getParam('downloadindividualfile');
$fieldname = Yii::app()->request->getParam('fieldname');
$oRow = Survey_dynamic::model($iSurveyID)->findByAttributes(array('id' => $iId));
$phparray = json_decode_ls($oRow->$fieldname);

Expand All @@ -391,7 +391,7 @@ function browse($iSurveyID)
if ($phparray[$i]['name'] == $downloadindividualfile)
{
$file = Yii::app()->getConfig('uploaddir') . "/surveys/" . $iSurveyID . "/files/" . $phparray[$i]['filename'];

if (file_exists($file))
{
header('Content-Description: File Transfer');
Expand Down

0 comments on commit a4c34ec

Please sign in to comment.