HTML 5 and fixes

This commit is contained in:
m 2018-04-08 10:46:46 +02:00
parent c180090a59
commit 852c2c0d2a
3 changed files with 13 additions and 9 deletions

View file

@ -201,6 +201,8 @@ if (!empty($_GET['vote'])) {
// Something to save (edit or add)
// -------------------------------
$selectedNewVotes = [];
if (!empty($_POST['save'])) { // Save edition of an old vote
$name = $inputService->filterName($_POST['name']);
$editedVote = filter_input(INPUT_POST, 'save', FILTER_VALIDATE_INT);
@ -252,6 +254,7 @@ if (!empty($_POST['save'])) { // Save edition of an old vote
}
} catch (AlreadyExistsException $aee) {
$message = new Message('danger', __('Error', 'You already voted'));
$selectedNewVotes = $choices;
} catch (ConcurrentEditionException $cee) {
$message = new Message('danger', __('Error', 'Poll has been updated before you vote'));
} catch (ConcurrentVoteException $cve) {
@ -445,5 +448,6 @@ $smarty->assign('accessGranted', true);
$smarty->assign('resultPubliclyVisible', true);
$smarty->assign('editedVoteUniqueId', '');
$smarty->assign('default_to_marldown_editor', $config['markdown_editor_by_default']);
$smarty->assign('selectedNewVotes', $selectedNewVotes);
$smarty->display('studs.tpl');