Merge pull request #4634 from giant-rabbit/JobLogCommandListingBug
[civicrm-core.git] / CRM / Case / Page / DashBoard.php
index 5ce46ede0f74c23bec7a4a79b80c2428c403c2c4..24a0175bfad89d51a19ae1911d13062ab640e59a 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.4                                                |
+ | CiviCRM version 4.5                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013                                |
+ | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -28,7 +28,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
  *
  */
@@ -38,6 +38,8 @@
  */
 class CRM_Case_Page_DashBoard extends CRM_Core_Page {
 
+  public $useLivePageJS = TRUE;
+
   /**
    * Heart of the viewing process. The runner gets all the meta data for
    * the contact and calls the appropriate type of page to view.
@@ -89,6 +91,11 @@ class CRM_Case_Page_DashBoard extends CRM_Core_Page {
     $upcoming = CRM_Case_BAO_Case::getCases($allCases, $userID, 'upcoming');
     $recent   = CRM_Case_BAO_Case::getCases($allCases, $userID, 'recent');
 
+    foreach($upcoming as $key=>$value) {
+      if(strtotime($value['case_scheduled_activity_date']) < time()) {
+        $upcoming[$key]['activity_status'] = 'status-overdue';
+      }
+    }
     $this->assign('casesSummary', $summary);
     if (!empty($upcoming)) {
       $this->assign('upcomingCases', $upcoming);