Disable export when results are invisibles
This commit is contained in:
parent
e8aac339f0
commit
d980571a74
|
@ -42,6 +42,12 @@ $pollService = new PollService($connect, $logService);
|
||||||
if (!empty($_GET['poll'])) {
|
if (!empty($_GET['poll'])) {
|
||||||
$poll_id = filter_input(INPUT_GET, 'poll', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => POLL_REGEX]]);
|
$poll_id = filter_input(INPUT_GET, 'poll', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => POLL_REGEX]]);
|
||||||
$poll = $pollService->findById($poll_id);
|
$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) {
|
if (!$poll) {
|
||||||
|
@ -50,6 +56,11 @@ if (!$poll) {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($poll->hidden && empty($admin_id)) {
|
||||||
|
$smarty->assign('error', __('Error', 'Forbidden!'));
|
||||||
|
$smarty->display('error.tpl');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
$slots = $pollService->allSlotsByPoll($poll);
|
$slots = $pollService->allSlotsByPoll($poll);
|
||||||
$votes = $pollService->allVotesByPollId($poll_id);
|
$votes = $pollService->allVotesByPollId($poll_id);
|
||||||
|
|
|
@ -368,6 +368,7 @@
|
||||||
},
|
},
|
||||||
"Error": {
|
"Error": {
|
||||||
"Error!": "Fazi!",
|
"Error!": "Fazi!",
|
||||||
|
"Forbidden!": "BR_Interdit !",
|
||||||
"Enter a title": "Ret eo enankañ un titl!",
|
"Enter a title": "Ret eo enankañ un titl!",
|
||||||
"Something is going wrong...": "Un dra bennak a-dreuz a zo...",
|
"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",
|
"Something is wrong with the format": "Un dra bennak a-dreuz a zo gant ar mentrezh",
|
||||||
|
|
|
@ -369,6 +369,7 @@
|
||||||
},
|
},
|
||||||
"Error": {
|
"Error": {
|
||||||
"Error!": "Fehler!",
|
"Error!": "Fehler!",
|
||||||
|
"Forbidden!": "Verboten!",
|
||||||
"Enter a title": "Titel eingeben",
|
"Enter a title": "Titel eingeben",
|
||||||
"Something is going wrong...": "Etwas geht schief...",
|
"Something is going wrong...": "Etwas geht schief...",
|
||||||
"Something is wrong with the format": "Mit dem Format stimmt etwas nicht",
|
"Something is wrong with the format": "Mit dem Format stimmt etwas nicht",
|
||||||
|
|
|
@ -370,6 +370,7 @@
|
||||||
},
|
},
|
||||||
"Error": {
|
"Error": {
|
||||||
"Error!": "Error!",
|
"Error!": "Error!",
|
||||||
|
"Forbidden!": "Forbidden!",
|
||||||
"Enter a title": "Enter a title",
|
"Enter a title": "Enter a title",
|
||||||
"Something is going wrong...": "Something has gone wrong...",
|
"Something is going wrong...": "Something has gone wrong...",
|
||||||
"Something is wrong with the format": "Something is wrong with the format",
|
"Something is wrong with the format": "Something is wrong with the format",
|
||||||
|
|
|
@ -369,6 +369,7 @@
|
||||||
},
|
},
|
||||||
"Error": {
|
"Error": {
|
||||||
"Error!": "¡Error!",
|
"Error!": "¡Error!",
|
||||||
|
"Forbidden!": "¡Prohibido!",
|
||||||
"Enter a title": "Introducza un título",
|
"Enter a title": "Introducza un título",
|
||||||
"Something is going wrong...": "Algo anda mal...",
|
"Something is going wrong...": "Algo anda mal...",
|
||||||
"Something is wrong with the format": "Algo está mal con el formato",
|
"Something is wrong with the format": "Algo está mal con el formato",
|
||||||
|
|
|
@ -369,6 +369,7 @@
|
||||||
},
|
},
|
||||||
"Error": {
|
"Error": {
|
||||||
"Error!": "Erreur !",
|
"Error!": "Erreur !",
|
||||||
|
"Forbidden!": "Interdit !",
|
||||||
"Enter a title": "Il faut saisir un titre !",
|
"Enter a title": "Il faut saisir un titre !",
|
||||||
"Something is going wrong...": "Quelque chose ne va pas...",
|
"Something is going wrong...": "Quelque chose ne va pas...",
|
||||||
"Something is wrong with the format": "Quelque chose ne va pas avec le format",
|
"Something is wrong with the format": "Quelque chose ne va pas avec le format",
|
||||||
|
|
|
@ -369,6 +369,7 @@
|
||||||
},
|
},
|
||||||
"Error": {
|
"Error": {
|
||||||
"Error!": "Errore!",
|
"Error!": "Errore!",
|
||||||
|
"Forbidden!": "Proibito!",
|
||||||
"Enter a title": "È necessario inserire un titolo !",
|
"Enter a title": "È necessario inserire un titolo !",
|
||||||
"Something is going wrong...": "Qualcosa non è corretto...",
|
"Something is going wrong...": "Qualcosa non è corretto...",
|
||||||
"Something is wrong with the format": "Qualche errore nel formato",
|
"Something is wrong with the format": "Qualche errore nel formato",
|
||||||
|
|
|
@ -369,6 +369,7 @@
|
||||||
},
|
},
|
||||||
"Error": {
|
"Error": {
|
||||||
"Error!": "Error !",
|
"Error!": "Error !",
|
||||||
|
"Forbidden!": "OC_Interdit !",
|
||||||
"Enter a title": "Cal picar un títol !",
|
"Enter a title": "Cal picar un títol !",
|
||||||
"Something is going wrong...": "I a quicòm que truca...",
|
"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.",
|
"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="col-md-5 hidden-print">
|
||||||
<div class="btn-group pull-right">
|
<div class="btn-group pull-right">
|
||||||
<button onclick="print(); return false;" class="btn btn-default"><span class="glyphicon glyphicon-print"></span> {__('PollInfo', 'Print')}</button>
|
<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 $admin}
|
||||||
{if !$expired}
|
{if !$expired}
|
||||||
<button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown">
|
<button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown">
|
||||||
|
|
Loading…
Reference in New Issue