phpcs - Fix error, "Expected 1 newline at end of file; XXX found".
[civicrm-core.git] / CRM / Case / Page / DashBoard.php
index eaba3fa7c59feafd720fec5530a5afb118af5201..fa66d50816e909a5fa0383d6c674afd634ae9c6f 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.4                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
- | 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$
  *
  */
@@ -45,10 +45,9 @@ class CRM_Case_Page_DashBoard extends CRM_Core_Page {
    * the contact and calls the appropriate type of page to view.
    *
    * @return void
-   * @access public
    *
    */
-  function preProcess() {
+  public function preProcess() {
     //check for civicase access.
     if (!CRM_Case_BAO_Case::accessCiviCase()) {
       CRM_Core_Error::fatal(ts('You are not authorized to access this page.'));
@@ -91,6 +90,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);
@@ -98,7 +102,6 @@ class CRM_Case_Page_DashBoard extends CRM_Core_Page {
     if (!empty($recent)) {
       $this->assign('recentCases', $recent);
     }
-    $this->assign('includeWysiwygEditor', TRUE);
   }
 
   /**
@@ -106,12 +109,10 @@ class CRM_Case_Page_DashBoard extends CRM_Core_Page {
    * it decides the which action has to be taken for the page.
    *
    * return null
-   * @access public
    */
-  function run() {
+  public function run() {
     $this->preProcess();
 
     return parent::run();
   }
 }
-