diff --git a/adminstuds.php b/adminstuds.php index aae0bbd..d2ad6c5 100644 --- a/adminstuds.php +++ b/adminstuds.php @@ -329,7 +329,7 @@ $smarty->assign('poll', $poll); $smarty->assign('title', _('Poll') . ' - ' . $poll->title); $smarty->assign('slots', $poll->format === 'D' ? $pollService->splitSlots($slots) : $slots); $smarty->assign('votes', $pollService->splitVotes($votes)); -$smarty->assign('best_moments', $pollService->computeBestMoments($votes)); +$smarty->assign('best_choices', $pollService->computeBestChoices($votes)); $smarty->assign('comments', $comments); $smarty->assign('editingVoteId', $editingVoteId); $smarty->assign('message', $message); diff --git a/app/classes/Framadate/Services/PollService.php b/app/classes/Framadate/Services/PollService.php index 7edcdf0..47407f3 100644 --- a/app/classes/Framadate/Services/PollService.php +++ b/app/classes/Framadate/Services/PollService.php @@ -75,7 +75,7 @@ class PollService { return $this->connect->insertComment($poll_id, $name, $comment); } - function computeBestMoments($votes) { + function computeBestChoices($votes) { $result = []; foreach ($votes as $vote) { $choices = str_split($vote->reponses); diff --git a/studs.php b/studs.php index 7ff18a5..2fbcbf4 100644 --- a/studs.php +++ b/studs.php @@ -171,7 +171,7 @@ $smarty->assign('poll', $poll); $smarty->assign('title', _('Poll') . ' - ' . $poll->title); $smarty->assign('slots', $poll->format === 'D' ? $pollService->splitSlots($slots) : $slots); $smarty->assign('votes', $pollService->splitVotes($votes)); -$smarty->assign('best_moments', $pollService->computeBestMoments($votes)); +$smarty->assign('best_choices', $pollService->computeBestChoices($votes)); $smarty->assign('comments', $comments); $smarty->assign('editingVoteId', $editingVoteId); $smarty->assign('message', $message); diff --git a/tpl/part/vote_table_classic.tpl b/tpl/part/vote_table_classic.tpl index 7d7e703..961274d 100644 --- a/tpl/part/vote_table_classic.tpl +++ b/tpl/part/vote_table_classic.tpl @@ -1,5 +1,5 @@ -{if !is_array($best_moments) || empty($best_moments)} - {$best_moments = [0]} +{if !is_array($best_choices) || empty($best_choices)} + {$best_choices = [0]} {/if}

{_('Votes of the poll')}

@@ -138,12 +138,12 @@ {* Line displaying best moments *} {$count_bests = 0} - {$max = max($best_moments)} + {$max = max($best_choices)} {if $max > 0} {_("Addition")} - {foreach $best_moments as $best_moment} - {if $max == $best_moment} + {foreach $best_choices as $best_choice} + {if $max == $best_choice} {$count_bests = $count_bests +1} {$max} {else} @@ -159,7 +159,7 @@ {* Best votes listing *} -{$max = max($best_moments)} +{$max = max($best_choices)} {if $max > 0}
{if $count_bests == 1} @@ -176,12 +176,10 @@ {$i = 0}

{_("with")} {$max} {if $max==1}{_('vote')}{else}{_('votes')}{/if}.