diff --git a/adminstuds.php b/adminstuds.php index 5555b82..623c49c 100644 --- a/adminstuds.php +++ b/adminstuds.php @@ -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); @@ -254,6 +256,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) { @@ -447,5 +450,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'); diff --git a/studs.php b/studs.php index 2d5efab..a90514d 100644 --- a/studs.php +++ b/studs.php @@ -50,6 +50,7 @@ $resultPubliclyVisible = true; $slots = []; $votes = []; $comments = []; +$selectedNewVotes = []; /* Services */ /*----------*/ @@ -182,6 +183,7 @@ if ($accessGranted) { } } 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) { @@ -239,5 +241,6 @@ $smarty->assign('accessGranted', $accessGranted); $smarty->assign('resultPubliclyVisible', $resultPubliclyVisible); $smarty->assign('editedVoteUniqueId', $editedVoteUniqueId); $smarty->assign('ValueMax', $poll->ValueMax); +$smarty->assign('selectedNewVotes', $selectedNewVotes); $smarty->display('studs.tpl'); diff --git a/tpl/part/vote_table_classic.tpl b/tpl/part/vote_table_classic.tpl index 97d3c33..2ebfd4b 100644 --- a/tpl/part/vote_table_classic.tpl +++ b/tpl/part/vote_table_classic.tpl @@ -180,26 +180,34 @@ diff --git a/tpl/part/vote_table_date.tpl b/tpl/part/vote_table_date.tpl index ddfdeed..21b0fd3 100644 --- a/tpl/part/vote_table_date.tpl +++ b/tpl/part/vote_table_date.tpl @@ -238,40 +238,43 @@ {foreach $slots as $slot} {foreach $slot->moments as $moment} - - - - {$i = $i+1} {/foreach} {/foreach}