fix votes wrongly calculated because of type check
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
2d39a83a7f
commit
76b19ee9ba
|
@ -160,10 +160,10 @@ class PollService {
|
||||||
$result['inb'][$i] = 0;
|
$result['inb'][$i] = 0;
|
||||||
$result['y'][$i] = 0;
|
$result['y'][$i] = 0;
|
||||||
}
|
}
|
||||||
if ($choice === 1) {
|
if ($choice === "1") {
|
||||||
$result['inb'][$i]++;
|
$result['inb'][$i]++;
|
||||||
}
|
}
|
||||||
if ($choice === 2) {
|
if ($choice === "2") {
|
||||||
$result['y'][$i]++;
|
$result['y'][$i]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -229,7 +229,7 @@
|
||||||
|
|
||||||
<td class="bg-info" headers="M{$headersM[$i]} D{$headersD[$i]} H{$headersH[$i]}">
|
<td class="bg-info" headers="M{$headersM[$i]} D{$headersD[$i]} H{$headersH[$i]}">
|
||||||
<ul class="list-unstyled choice">
|
<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">
|
<li class="yes">
|
||||||
<input type="radio" id="y-choice-{$i}" name="choices[{$i}]" value="2" />
|
<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}">
|
<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}">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user