From 54fd8464d9d4f89df278bd7556ccbb66c9bce27b Mon Sep 17 00:00:00 2001 From: m Date: Wed, 4 Apr 2018 22:18:53 +0200 Subject: [PATCH 1/5] =?UTF-8?q?Ne=20pas=20effacer=20les=20s=C3=A9lections?= =?UTF-8?q?=20apr=C3=A8s=20l'erreur=20"Vous=20avez=20d=C3=A9j=C3=A0=20vot?= =?UTF-8?q?=C3=A9"=20https://framagit.org/framasoft/framadate/issues/194?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- studs.php | 4 ++++ tpl/part/vote_table_classic.tpl | 18 +++++++++++++----- tpl/part/vote_table_date.tpl | 23 +++++++++++++---------- 3 files changed, 30 insertions(+), 15 deletions(-) diff --git a/studs.php b/studs.php index f202c4a..ee8dba9 100644 --- a/studs.php +++ b/studs.php @@ -50,6 +50,8 @@ $resultPubliclyVisible = true; $slots = []; $votes = []; $comments = []; +$selectedNewVotes = []; + /* Services */ /*----------*/ @@ -180,6 +182,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) { @@ -237,5 +240,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 1b57894..9f3193d 100644 --- a/tpl/part/vote_table_classic.tpl +++ b/tpl/part/vote_table_classic.tpl @@ -181,26 +181,34 @@ diff --git a/tpl/part/vote_table_date.tpl b/tpl/part/vote_table_date.tpl index db8cdce..87e3b8e 100644 --- a/tpl/part/vote_table_date.tpl +++ b/tpl/part/vote_table_date.tpl @@ -239,40 +239,43 @@ {foreach $slots as $slot} {foreach $slot->moments as $moment} - - - - {$i = $i+1} {/foreach} {/foreach} From 4e4e21cef240b0ec0366c6bc2d38ab557ddd03fb Mon Sep 17 00:00:00 2001 From: m Date: Wed, 4 Apr 2018 23:01:57 +0200 Subject: [PATCH 2/5] correction CI --- studs.php | 1 - 1 file changed, 1 deletion(-) diff --git a/studs.php b/studs.php index ee8dba9..7c16276 100644 --- a/studs.php +++ b/studs.php @@ -52,7 +52,6 @@ $votes = []; $comments = []; $selectedNewVotes = []; - /* Services */ /*----------*/ From 445dac2e511561f83a17ef0e5445eb5852c0b346 Mon Sep 17 00:00:00 2001 From: m Date: Wed, 4 Apr 2018 22:18:53 +0200 Subject: [PATCH 3/5] =?UTF-8?q?Ne=20pas=20effacer=20les=20s=C3=A9lections?= =?UTF-8?q?=20apr=C3=A8s=20l'erreur=20"Vous=20avez=20d=C3=A9j=C3=A0=20vot?= =?UTF-8?q?=C3=A9"=20https://framagit.org/framasoft/framadate/issues/194?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- studs.php | 4 ++++ tpl/part/vote_table_classic.tpl | 18 +++++++++++++----- tpl/part/vote_table_date.tpl | 23 +++++++++++++---------- 3 files changed, 30 insertions(+), 15 deletions(-) diff --git a/studs.php b/studs.php index 6cef3ee..addce34 100644 --- a/studs.php +++ b/studs.php @@ -50,6 +50,8 @@ $resultPubliclyVisible = true; $slots = []; $votes = []; $comments = []; +$selectedNewVotes = []; + /* Services */ /*----------*/ @@ -180,6 +182,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) { @@ -237,5 +240,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..ba473d3 100644 --- a/tpl/part/vote_table_classic.tpl +++ b/tpl/part/vote_table_classic.tpl @@ -180,26 +180,34 @@
    {if $poll->ValueMax eq NULL || $best_choices['y'][$i] lt $poll->ValueMax}
  • - +
  • - +
  • {/if}
  • - -
  • - +
diff --git a/tpl/part/vote_table_date.tpl b/tpl/part/vote_table_date.tpl index ddfdeed..cb35ff8 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} - -
    {if $poll->ValueMax eq NULL || $best_choices['y'][$i] lt $poll->ValueMax}
  • - +
  • - +
  • - - {/if} + {/if}
  • - +
  • - +
- - {$i = $i+1} {/foreach} {/foreach} From 659cb1ec75aa945ff537408be3ef9dd169765469 Mon Sep 17 00:00:00 2001 From: m Date: Wed, 4 Apr 2018 23:01:57 +0200 Subject: [PATCH 4/5] correction CI --- studs.php | 1 - 1 file changed, 1 deletion(-) diff --git a/studs.php b/studs.php index addce34..517e482 100644 --- a/studs.php +++ b/studs.php @@ -52,7 +52,6 @@ $votes = []; $comments = []; $selectedNewVotes = []; - /* Services */ /*----------*/ From 852c2c0d2a3fab668ab2f8a3fdad067ff4a97124 Mon Sep 17 00:00:00 2001 From: m Date: Sun, 8 Apr 2018 10:46:46 +0200 Subject: [PATCH 5/5] HTML 5 and fixes --- adminstuds.php | 4 ++++ tpl/part/vote_table_classic.tpl | 8 ++++---- tpl/part/vote_table_date.tpl | 10 +++++----- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/adminstuds.php b/adminstuds.php index ab2cacd..5373b5f 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); @@ -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'); diff --git a/tpl/part/vote_table_classic.tpl b/tpl/part/vote_table_classic.tpl index ba473d3..2ebfd4b 100644 --- a/tpl/part/vote_table_classic.tpl +++ b/tpl/part/vote_table_classic.tpl @@ -181,7 +181,7 @@ {if $poll->ValueMax eq NULL || $best_choices['y'][$i] lt $poll->ValueMax}
  • diff --git a/tpl/part/vote_table_date.tpl b/tpl/part/vote_table_date.tpl index cb35ff8..21b0fd3 100644 --- a/tpl/part/vote_table_date.tpl +++ b/tpl/part/vote_table_date.tpl @@ -243,7 +243,7 @@ {if $poll->ValueMax eq NULL || $best_choices['y'][$i] lt $poll->ValueMax}
  • -