Commit d980571a authored by Olivier PEREZ's avatar Olivier PEREZ
Browse files

Disable export when results are invisibles

parent e8aac339
......@@ -42,6 +42,12 @@ $pollService = new PollService($connect, $logService);
if (!empty($_GET['poll'])) {
$poll_id = filter_input(INPUT_GET, 'poll', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => POLL_REGEX]]);
$poll = $pollService->findById($poll_id);
} else if (!empty($_GET['admin'])) {
$admin_id = filter_input(INPUT_GET, 'admin', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => ADMIN_POLL_REGEX]]);
$poll = $pollService->findByAdminId($admin_id);
if ($poll) {
$poll_id = $poll->id;
}
}
if (!$poll) {
......@@ -50,6 +56,11 @@ if (!$poll) {
exit;
}
if ($poll->hidden && empty($admin_id)) {
$smarty->assign('error', __('Error', 'Forbidden!'));
$smarty->display('error.tpl');
exit;
}
$slots = $pollService->allSlotsByPoll($poll);
$votes = $pollService->allVotesByPollId($poll_id);
......
......@@ -368,6 +368,7 @@
},
"Error": {
"Error!": "Fazi!",
"Forbidden!": "BR_Interdit !",
"Enter a title": "Ret eo enankañ un titl!",
"Something is going wrong...": "Un dra bennak a-dreuz a zo...",
"Something is wrong with the format": "Un dra bennak a-dreuz a zo gant ar mentrezh",
......
......@@ -369,6 +369,7 @@
},
"Error": {
"Error!": "Fehler!",
"Forbidden!": "Verboten!",
"Enter a title": "Titel eingeben",
"Something is going wrong...": "Etwas geht schief...",
"Something is wrong with the format": "Mit dem Format stimmt etwas nicht",
......
......@@ -370,6 +370,7 @@
},
"Error": {
"Error!": "Error!",
"Forbidden!": "Forbidden!",
"Enter a title": "Enter a title",
"Something is going wrong...": "Something has gone wrong...",
"Something is wrong with the format": "Something is wrong with the format",
......
......@@ -369,6 +369,7 @@
},
"Error": {
"Error!": "¡Error!",
"Forbidden!": "¡Prohibido!",
"Enter a title": "Introducza un título",
"Something is going wrong...": "Algo anda mal...",
"Something is wrong with the format": "Algo está mal con el formato",
......
......@@ -369,6 +369,7 @@
},
"Error": {
"Error!": "Erreur !",
"Forbidden!": "Interdit !",
"Enter a title": "Il faut saisir un titre !",
"Something is going wrong...": "Quelque chose ne va pas...",
"Something is wrong with the format": "Quelque chose ne va pas avec le format",
......
......@@ -369,6 +369,7 @@
},
"Error": {
"Error!": "Errore!",
"Forbidden!": "Proibito!",
"Enter a title": "È necessario inserire un titolo !",
"Something is going wrong...": "Qualcosa non è corretto...",
"Something is wrong with the format": "Qualche errore nel formato",
......
......@@ -369,6 +369,7 @@
},
"Error": {
"Error!": "Error !",
"Forbidden!": "OC_Interdit !",
"Enter a title": "Cal picar un títol !",
"Something is going wrong...": "I a quicòm que truca...",
"Something is wrong with the format": "I a quicòm que truca amb lo format.",
......
......@@ -21,7 +21,13 @@
<div class="col-md-5 hidden-print">
<div class="btn-group pull-right">
<button onclick="print(); return false;" class="btn btn-default"><span class="glyphicon glyphicon-print"></span> {__('PollInfo', 'Print')}</button>
<a href="{$SERVER_URL|html}exportcsv.php?poll={$poll_id|html}" class="btn btn-default"><span class="glyphicon glyphicon-download-alt"></span> {__('PollInfo', 'Export to CSV')}</a>
{if $admin}
<a href="{$SERVER_URL|html}exportcsv.php?admin={$admin_poll_id|html}" class="btn btn-default"><span class="glyphicon glyphicon-download-alt"></span> {__('PollInfo', 'Export to CSV')}</a>
{else}
{if !$hidden}
<a href="{$SERVER_URL|html}exportcsv.php?poll={$poll_id|html}" class="btn btn-default"><span class="glyphicon glyphicon-download-alt"></span> {__('PollInfo', 'Export to CSV')}</a>
{/if}
{/if}
{if $admin}
{if !$expired}
<button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown">
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment