fix votes wrongly calculated because of type check

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2018-02-20 15:17:14 +01:00
parent 2d39a83a7f
commit 76b19ee9ba
3 changed files with 11 additions and 11 deletions

View File

@ -160,10 +160,10 @@ class PollService {
$result['inb'][$i] = 0;
$result['y'][$i] = 0;
}
if ($choice === 1) {
if ($choice === "1") {
$result['inb'][$i]++;
}
if ($choice === 2) {
if ($choice === "2") {
$result['y'][$i]++;
}
}

View File

@ -229,7 +229,7 @@
<td class="bg-info" headers="M{$headersM[$i]} D{$headersD[$i]} H{$headersH[$i]}">
<ul class="list-unstyled choice">
{if $best_choices['y'][$i] lt $poll->ValueMax || $poll->ValueMax eq NULL}
{if $best_choices['y'][$i] lt $poll->ValueMax || $poll->ValueMax eq NULL}
<li class="yes">
<input type="radio" id="y-choice-{$i}" name="choices[{$i}]" value="2" />
<label class="btn btn-default btn-xs" for="y-choice-{$i}" title="{__('Poll results', 'Vote yes for')|html} {$slot->day|date_format:$date_format.txt_short|html} - {$moment|html}">