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

Added parameter for votes to table (no UI yet) on voting approval action.

parent 6813b59c
No related branches found
No related tags found
No related merge requests found
......@@ -49,7 +49,7 @@ class Requests_ApprovalActionVoteModel extends Requests_ApprovalActionQueueModel
foreach ($records as $record) {
$objectId = $record['approvalAction'];
$date = $record['date'];
$objects[$objectId]->_data['dates'][] = new Zend_Date($date);
$objects[$objectId]->_data['dates'][] = new Zend_Date($date);
}
if (Unl_Util::isArray($objects)) {
......@@ -215,7 +215,7 @@ class Requests_ApprovalActionVoteModel extends Requests_ApprovalActionQueueModel
foreach ($votes as $vote) {
$voteTally[$vote['vote']]++;
}
if ($voteTally['Table'] >= 2) {
if ($voteTally['Table'] >= $this->getVotesToTable()) {
$request->setState('Table');
continue;
}
......@@ -249,6 +249,11 @@ class Requests_ApprovalActionVoteModel extends Requests_ApprovalActionQueueModel
return $this->_data['quorum'];
}
public function getVotesToTable()
{
return $this->_data['votesToTable'];
}
public function getRequiredVotes()
{
return $this->_data['requiredVotes'];
......
......@@ -92,7 +92,7 @@ class Ucc_ReportsController extends App_Controller_Action
$difference = $currentCourse->getDifferenceSummary($originalCourse, $request);
$voteResult = $this->_tallyVotes($votes, $startDate, $endDate);
$voteResult = $this->_tallyVotes($votes, $startDate, $endDate, $approvalAction->getVotesToTable());
$data[] = new Unl_Model_Array(array(
'time' => $time->getTimestamp(),
......@@ -152,7 +152,7 @@ class Ucc_ReportsController extends App_Controller_Action
$requestVoteTally[$requestId][$vote->getVote()]++;
}
$requestVoteResults[$requestId] = $this->_tallyVotes($votes, $startDate, $endDate);
$requestVoteResults[$requestId] = $this->_tallyVotes($votes, $startDate, $endDate, $approvalAction->getVotesToTable());
}
$this->view->requestVoteTally = $requestVoteTally;
$this->view->requestVoteResults = $requestVoteResults;
......@@ -183,7 +183,7 @@ class Ucc_ReportsController extends App_Controller_Action
$requestVoteTally[$requestId][$vote->getVote()]++;
}
$requestVoteResults[$requestId] = $this->_tallyVotes($votes, $startDate, $endDate);
$requestVoteResults[$requestId] = $this->_tallyVotes($votes, $startDate, $endDate, $approvalAction->getVotesToTable());
}
$this->view->aceRequestVoteTally = $requestVoteTally;
$this->view->aceRequestVoteResults = $requestVoteResults;
......@@ -195,7 +195,7 @@ class Ucc_ReportsController extends App_Controller_Action
$this->render('monthly-extended');
}
protected function _tallyVotes($votes, $startDate, $endDate)
protected function _tallyVotes($votes, $startDate, $endDate, $votesToTable)
{
$voteTally = array();
$voteResult = '';
......@@ -214,7 +214,7 @@ class Ucc_ReportsController extends App_Controller_Action
}
}
if ($voteCount < 7 || $voteTally['Table'] >= 2) {
if ($voteCount < 7 || $voteTally['Table'] >= $votesToTable) {
$voteResult = 'Table';
}
......
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