diff --git a/app/classes/Framadate/Repositories/VoteRepository.php b/app/classes/Framadate/Repositories/VoteRepository.php index 9008c5a..efd7b36 100644 --- a/app/classes/Framadate/Repositories/VoteRepository.php +++ b/app/classes/Framadate/Repositories/VoteRepository.php @@ -18,7 +18,7 @@ class VoteRepository extends AbstractRepository { } function insertDefault($poll_id, $insert_position) { - $prepared = $this->prepare('UPDATE `' . Utils::table('vote') . '` SET choices = CONCAT(SUBSTRING(choices, 1, ?), "0", SUBSTRING(choices, ?)) WHERE poll_id = ?'); + $prepared = $this->prepare('UPDATE `' . Utils::table('vote') . '` SET choices = CONCAT(SUBSTRING(choices, 1, ?), " ", SUBSTRING(choices, ?)) WHERE poll_id = ?'); //#51 : default value for unselected vote return $prepared->execute([$insert_position, $insert_position + 1, $poll_id]); } diff --git a/app/inc/constants.php b/app/inc/constants.php index 1d58299..9db5a52 100644 --- a/app/inc/constants.php +++ b/app/inc/constants.php @@ -23,7 +23,7 @@ const VERSION = '1.0'; // Regex const POLL_REGEX = '/^[a-z0-9-]*$/i'; const ADMIN_POLL_REGEX = '/^[a-z0-9]{24}$/i'; -const CHOICE_REGEX = '/^[012]$/'; +const CHOICE_REGEX = '/^[ 012]$/'; const BOOLEAN_REGEX = '/^(on|off|true|false|1|0)$/i'; const BOOLEAN_TRUE_REGEX = '/^(on|true|1)$/i'; const EDITABLE_CHOICE_REGEX = '/^[0-2]$/'; diff --git a/tpl/part/vote_table_classic.tpl b/tpl/part/vote_table_classic.tpl index 8ae53e6..818c740 100644 --- a/tpl/part/vote_table_classic.tpl +++ b/tpl/part/vote_table_classic.tpl @@ -57,31 +57,42 @@ - {foreach $vote->choices as $id=>$choice} + {$id=0} + {foreach $slots as $slot} + {foreach $slot->moments as $moment} + {$choice=$vote->choices[$id]} +