Fix poll not possible to be closed
Closes #532 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
12d4bdb857
commit
00ad08d037
@ -113,7 +113,7 @@ if (isset($_POST['update_poll_info'])) {
|
|||||||
$updated = true;
|
$updated = true;
|
||||||
}
|
}
|
||||||
} elseif ($field === 'rules') {
|
} elseif ($field === 'rules') {
|
||||||
$rules = strip_tags($_POST['rules']);
|
$rules = (int) strip_tags($_POST['rules']);
|
||||||
switch ($rules) {
|
switch ($rules) {
|
||||||
case 0:
|
case 0:
|
||||||
$poll->active = false;
|
$poll->active = false;
|
||||||
|
@ -57,7 +57,7 @@ class PollRepository extends AbstractRepository {
|
|||||||
function update($poll) {
|
function update($poll) {
|
||||||
$prepared = $this->prepare('UPDATE `' . Utils::table('poll') . '` SET title=?, admin_name=?, admin_mail=?, description=?, end_date=?, active=?, editable=?, hidden=?, password_hash=?, results_publicly_visible=? WHERE id = ?');
|
$prepared = $this->prepare('UPDATE `' . Utils::table('poll') . '` SET title=?, admin_name=?, admin_mail=?, description=?, end_date=?, active=?, editable=?, hidden=?, password_hash=?, results_publicly_visible=? WHERE id = ?');
|
||||||
|
|
||||||
return $prepared->execute([$poll->title, $poll->admin_name, $poll->admin_mail, $poll->description, $poll->end_date, $poll->active, ($poll->editable>=0 && $poll->editable<=2) ? $poll->editable : 0, $poll->hidden ? 1 : 0, $poll->password_hash, $poll->results_publicly_visible ? 1 : 0, $poll->id]);
|
return $prepared->execute([$poll->title, $poll->admin_name, $poll->admin_mail, $poll->description, $poll->end_date, $poll->active ? 1 : 0, ($poll->editable>=0 && $poll->editable<=2) ? $poll->editable : 0, $poll->hidden ? 1 : 0, $poll->password_hash, $poll->results_publicly_visible ? 1 : 0, $poll->id]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteById($poll_id) {
|
function deleteById($poll_id) {
|
||||||
|
Loading…
Reference in New Issue
Block a user