From 9c4284532a2176fea7ddc87d1e2d936923328371 Mon Sep 17 00:00:00 2001
From: Tim Steiner <tsteiner2@unl.edu>
Date: Wed, 27 Jan 2010 16:48:02 +0000
Subject: [PATCH] A better way to filter out internal decisions from UCC
 monthly reports.

---
 .../modules/ucc/controllers/ReportsController.php    | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/application/modules/ucc/controllers/ReportsController.php b/application/modules/ucc/controllers/ReportsController.php
index 2f992e51..4ee4c0d5 100644
--- a/application/modules/ucc/controllers/ReportsController.php
+++ b/application/modules/ucc/controllers/ReportsController.php
@@ -2,6 +2,8 @@
 
 class Ucc_ReportsController extends App_Controller_Action
 {
+	protected $_internalDecisions = array('UCC Queue');
+	
 	public function indexAction()
 	{
 		$this->_redirect('/ucc/reports/monthly');
@@ -125,6 +127,9 @@ class Ucc_ReportsController extends App_Controller_Action
                     $endDate->isEarlier($aHistory->getTime())) {
                     continue;
                 }
+                if (in_array($aHistory->getDecision(), $this->_internalDecisions)) {
+                    continue;
+                }
                 $time = $aHistory->getTime();
                 $voteResult = $aHistory->getDecision();
             }
@@ -139,10 +144,6 @@ class Ucc_ReportsController extends App_Controller_Action
                 $voteResult = $this->_tallyVotes($votes, $startDate, $endDate, $approvalAction->getVotesToTable());
             }
             
-            if (in_array($voteResult, array('UCC Queue'))) {
-            	continue;
-            }
-            
             $data[] = new Unl_Model_Array(array(
                 'time' => $time->getTimestamp(),
                 'college' => $originalCourse->getCollege(),
@@ -245,6 +246,9 @@ class Ucc_ReportsController extends App_Controller_Action
                     $endDate->isEarlier($aHistory->getTime())) {
                     continue;
                 }
+                if (in_array($aHistory->getDecision(), $this->_internalDecisions)) {
+                	continue;
+                }
                 $requestVoteResults[$requestId] = $aHistory->getDecision();
             }
         }
-- 
GitLab