Skip to content
Snippets Groups Projects
Commit 45716d15 authored by Olivier PEREZ's avatar Olivier PEREZ
Browse files

Display confirmation page before to delete all votes of one poll.

parent 8d46ec6c
No related branches found
No related tags found
No related merge requests found
...@@ -128,6 +128,13 @@ if (!empty($_POST['delete_comment'])) { ...@@ -128,6 +128,13 @@ if (!empty($_POST['delete_comment'])) {
// Remove all votes // Remove all votes
// ------------------------------- // -------------------------------
if (isset($_POST['remove_all_votes'])) { if (isset($_POST['remove_all_votes'])) {
$smarty->assign('poll_id', $poll_id);
$smarty->assign('admin_poll_id', $admin_poll_id);
$smarty->assign('title', _('Poll') . ' - ' . $poll->title);
$smarty->display('confirm/delete_votes.tpl');
exit;
}
if (isset($_POST['confirm_remove_all_votes'])) {
$adminPollService->cleanVotes($poll_id); $adminPollService->cleanVotes($poll_id);
} }
......
{extends file='page.tpl'}
{block name=main}
<form action="{$admin_poll_id|poll_url:true}" method="POST">
<div class="alert alert-danger text-center">
<h2>{_("Confirm removal of all votes of the poll")}</h2>
<p><button class="btn btn-default" type="submit" name="cancel">{_("Keep votes")}</button>
<button type="submit" name="confirm_remove_all_votes" class="btn btn-danger">{_("Remove all votes!")}</button></p>
</div>
</form>
{/block}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment