diff --git a/app/classes/Framadate/Migration/AddColumn_ValueMax_In_poll_For_1_1.php b/app/classes/Framadate/Migration/AddColumn_ValueMax_In_poll_For_1_1.php index 6715f9b..8b1caa2 100644 --- a/app/classes/Framadate/Migration/AddColumn_ValueMax_In_poll_For_1_1.php +++ b/app/classes/Framadate/Migration/AddColumn_ValueMax_In_poll_For_1_1.php @@ -65,7 +65,6 @@ class AddColumn_ValueMax_In_poll_For_1_1 implements Migration { private function alterPollTable(\PDO $pdo) { $pdo->exec(' ALTER TABLE `' . Utils::table('poll') . '` - ADD `ValueMax` TINYINT, - ADD CHECK (ValueMax > 0)'); + ADD `ValueMax` TINYINT NULL;'); } } diff --git a/studs.php b/studs.php index 531bf13..f202c4a 100644 --- a/studs.php +++ b/studs.php @@ -168,7 +168,7 @@ if ($accessGranted) { try { $result = $pollService->addVote($poll_id, $name, $choices, $slots_hash); if ($result) { - if ($poll->editable === Editable::EDITABLE_BY_OWN) { + if (intval($poll->editable) === Editable::EDITABLE_BY_OWN) { $editedVoteUniqueId = $result->uniqId; $message = getMessageForOwnVoteEditableVote($sessionService, $smarty, $editedVoteUniqueId, $config['use_smtp'], $poll_id, $name); } else { diff --git a/tpl/part/vote_table_classic.tpl b/tpl/part/vote_table_classic.tpl index 62d94e2..fd07e1d 100644 --- a/tpl/part/vote_table_classic.tpl +++ b/tpl/part/vote_table_classic.tpl @@ -101,7 +101,13 @@ {$vote->name|html} - {if $slots gt 4} + {if $active && !$expired && $accessGranted && + ( + $poll->editable == constant('Framadate\Editable::EDITABLE_BY_ALL') + or $admin + or ($poll->editable == constant('Framadate\Editable::EDITABLE_BY_OWN') && $editedVoteUniqueId == $vote->uniqId) + ) && $slots gt 4 + } {__('Generic', 'Edit')} @@ -168,7 +174,7 @@ {foreach $slots as $id=>$slot}