Skip to content

Commit

Permalink
Dev: Add button to purge survey storage
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Sep 28, 2017
1 parent 0342d30 commit 8c0d3eb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 3 additions & 1 deletion application/controllers/admin/globalsettings.php
Expand Up @@ -159,7 +159,9 @@ protected function getSurveyFolderStorage($uploaddir, $decimals)
$surveys[] = array(
'sizeInBytes' => $size,
'size' => humanFilesize($size, $decimals),
'name' => $surveyinfo['name'],
'name' => empty($surveyinfo['name']) ? '(' . gT('deleted') . ')' : $surveyinfo['name'],
'showPurgeButton' => Permission::model()->hasGlobalPermission('superadmin','delete')
&& empty($surveyinfo['name']),
'sid' => $surveyId
);
}
Expand Down
12 changes: 11 additions & 1 deletion application/views/admin/global_settings/_storage_ajax.php
Expand Up @@ -41,7 +41,17 @@
<?php echo $survey['name']; ?>
(<a href="<?php echo $this->createUrl('admin/survey', array('sa' => 'view', 'surveyid' => $survey['sid'])); ?>"><?php echo $survey['sid']; ?></a>)
</td>
<td><?php echo $survey['size']; ?></td>
<td>
<?php echo $survey['size']; ?>
<?php if ($survey['showPurgeButton']): ?>
<span
class='fa fa-trash pull-right btn btn-danger btn-xs'
data-toggle='tooltip'
title='<?php eT('Purge survey'); ?>'
>
</span>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
</table>
Expand Down

0 comments on commit 8c0d3eb

Please sign in to comment.