Differential D21845 Diff 52066 src/applications/slowvote/controller/PhabricatorSlowvoteVoteController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/slowvote/controller/PhabricatorSlowvoteVoteController.php
Show All 29 Lines | public function handleRequest(AphrontRequest $request) { | ||||
$old_votes = $poll->getViewerChoices($viewer); | $old_votes = $poll->getViewerChoices($viewer); | ||||
$old_votes = mpull($old_votes, null, 'getOptionID'); | $old_votes = mpull($old_votes, null, 'getOptionID'); | ||||
$votes = $request->getArr('vote'); | $votes = $request->getArr('vote'); | ||||
$votes = array_fuse($votes); | $votes = array_fuse($votes); | ||||
$method = $poll->getMethod(); | $method = $poll->getMethod(); | ||||
$is_plurality = ($method == PhabricatorSlowvotePoll::METHOD_PLURALITY); | $is_plurality = ($method == SlowvotePollVotingMethod::METHOD_PLURALITY); | ||||
if (!$votes) { | if (!$votes) { | ||||
if ($is_plurality) { | if ($is_plurality) { | ||||
$message = pht('You must vote for something.'); | $message = pht('You must vote for something.'); | ||||
} else { | } else { | ||||
$message = pht('You must vote for at least one option.'); | $message = pht('You must vote for at least one option.'); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 60 Lines • Show Last 20 Lines |