Skip to content

Commit

Permalink
Dev: Good link to DL zip file in browse individual response
Browse files Browse the repository at this point in the history
Dev: Allow to translate KB
Dev: filter comment and title
  • Loading branch information
Shnoulle committed Apr 10, 2015
1 parent 3a1673f commit ea4b821
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
18 changes: 12 additions & 6 deletions application/controllers/admin/responses.php
Expand Up @@ -207,7 +207,7 @@ public function view($iSurveyID, $iId, $sBrowseLang = '')
}
$next = SurveyDynamic::model($iSurveyID)->next($iId);
$previous = SurveyDynamic::model($iSurveyID)->previous($iId);

$aData['bHasFile']=false;
if (isset($rlanguage))
{
$aData['rlanguage'] = $rlanguage;
Expand Down Expand Up @@ -246,15 +246,21 @@ public function view($iSurveyID, $iId, $sBrowseLang = '')

if (isset($phparray[$index]))
{
if ($metadata === "size")
$answervalue = rawurldecode(((int) ($phparray[$index][$metadata])) . " KB");
else if ($metadata === "name")
switch ($metadata)
{
case "size":
$answervalue = sprintf(gt("%s KB"),intval($phparray[$index][$metadata]));
break;
case "name":
$answervalue = CHtml::link(
$oPurifier->purify(rawurldecode($phparray[$index][$metadata])),
$this->getController()->createUrl("/admin/responses",array("sa"=>"actionDownloadfile","surveyid"=>$surveyid,"iResponseId"=>$iId,"sFileName"=>$phparray[$index][$metadata]))
);
else
$answervalue = rawurldecode($phparray[$index][$metadata]);
break;
default:
$answervalue = htmlspecialchars(strip_tags(stripJavaScript($phparray[$index][$metadata])));
}
$aData['bHasFile']=true;
}
else
$answervalue = "";
Expand Down
6 changes: 3 additions & 3 deletions application/views/admin/responses/browseidheader_view.php
Expand Up @@ -25,10 +25,10 @@
{ ?>
<img src='<?php echo $sImageURL; ?>delete_disabled.png' alt='<?php eT("You don't have permission to delete this entry."); ?>'/>
<?php }
if (hasFileUploadQuestion($surveyid))
if ($bHasFile)
{ ?>
<a href='#' title='<?php eT("Download files for this entry"); ?>' >
<img id='downloadfile_<?php echo $id;?>' src='<?php echo $sImageURL; ?>download.png' alt='<?php eT("Download files for this entry"); ?>' class='downloadfile'></a>
<a href='<?php echo Yii::app()->createUrl("admin/responses",array("sa"=>"actionDownloadfiles","surveyid"=>$surveyid,"sResponseId"=>$id)); ?>' title='<?php eT("Download files for this entry"); ?>' >
<img src='<?php echo $sImageURL; ?>download.png' alt='<?php eT("Download files for this entry"); ?>' class='downloadfile'></a>
<?php } ?>

<a href='<?php echo $this->createUrl("admin/export/sa/exportresults/surveyid/$surveyid/id/$id"); ?>' title='<?php eT("Export this Response"); ?>' >
Expand Down

0 comments on commit ea4b821

Please sign in to comment.