Skip to content

Commit

Permalink
Fixed issue #10289: Replace 0 with actual icon for viewing details
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Feb 3, 2016
1 parent 5618675 commit 644b138
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions application/controllers/admin/responses.php
Expand Up @@ -769,19 +769,28 @@ public function getResponses_json($iSurveyID)
$dtresult = SurveyDynamic::model($iSurveyID)->findAllAsArray($oCriteria);
$all_rows = array();
foreach ($dtresult as $row) {
$action_html = "<a href='" . Yii::app()->createUrl("admin/responses/view/surveyid/$surveyid/id/{$row['id']}") . "'>";
$action_html += "<span class='glyphicon glyphicon-list-alt text-success' title='" . gT('View response details') . "'></span></a>";

// View detail icon
$action_html = '<a href="' . Yii::app()->createUrl("admin/responses/view/surveyid/$surveyid/id/{$row['id']}")
. '"><span class="glyphicon glyphicon-list-alt text-success" title="'
. gT('View response details') . '"></span></a>';

// Edit icon
if (Permission::model()->hasSurveyPermission($iSurveyID,'responses','update')) {
$action_html .= "<a href='" . Yii::app()->createUrl("admin/dataentry/editdata/subaction/edit/surveyid/{$surveyid}/id/{$row['id']}") . "'>
<span class='glyphicon glyphicon-pencil text-success' title='" . gT('Edit this response') . "'></span></a>";
}

// Download icon
if (hasFileUploadQuestion($surveyid)) {
if(Response::model($surveyid)->findByPk($row['id'])->getFiles())
{
$action_url = Yii::app()->createUrl("admin/responses",array("sa"=>"actionDownloadfiles","surveyid"=>$surveyid,"sResponseId"=>$row['id']));
$action_html .='<a title="'.gT('Download all files in this response as a zip file').'" href="'.$action_url.'"><span class="glyphicon glyphicon-download-alt downloadfile"></span></a>';
}
}

// Delete icon
if (Permission::model()->hasSurveyPermission($iSurveyID,'responses','delete')) {
$action_html .= "<a href='".Yii::app()->createUrl("admin/responses",array("sa"=>"actionDelete","surveyid"=>$surveyid,"sResponseId"=>$row['id']))."' data-delete='".$row['id']."'>
<span title='" . sprintf(gT('Delete response %s'),$row['id']) . "' class='deleteresponse glyphicon glyphicon-trash text-warning'></span></a>";
Expand Down

0 comments on commit 644b138

Please sign in to comment.