Skip to content
Snippets Groups Projects
Commit 7105b044 authored by Tim Steiner's avatar Tim Steiner
Browse files

Make vote tallying work.

parent 954dc012
No related branches found
No related tags found
No related merge requests found
......@@ -132,7 +132,8 @@ class ApprovalActionVote extends ApprovalActionQueue
// check to see if quorum is met, tally votes, etc
$voteTally = array();
foreach ($this->votes as $vote) {
$votes = ApproverVotes::getInstance()->fetchByRequestAndAction($request, $this);
foreach ($votes as $vote) {
if (!array_key_exists($vote->vote, $voteTally)) {
$voteTally[$vote->vote] = 0;
}
......@@ -144,7 +145,7 @@ class ApprovalActionVote extends ApprovalActionQueue
if (count($winningVotes) > 1) {
// tie
$winningVote = 'Table';
} else if (count($voteTally) < $this->quorum) {
} else if (count($votes) < $this->quorum) {
// quorum not met
$winningVote = 'Table';
} else {
......@@ -161,6 +162,7 @@ class ApprovalActionVote extends ApprovalActionQueue
$request, $this, ApprovalActionsQueueRequests::STATUS_HOLDING
);
}
$request->save();
}
......@@ -171,4 +173,5 @@ class ApprovalActionVote extends ApprovalActionQueue
parent::advanceQueue();
}
}
\ No newline at end of file
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment