INFRA-132 - Trailing commas for multiline arrays
[civicrm-core.git] / CRM / Report / Form / Case / Detail.php
index 0d88234558fbcfb3ee17a4f70ed6c6fc2ab81eb9..1ce27a138a10b259cdd4ea400563d89819a454f5 100644 (file)
@@ -2,7 +2,7 @@
 
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
@@ -59,7 +59,7 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form {
   /**
    *
    */
-  function __construct() {
+  public function __construct() {
     $this->case_statuses = CRM_Core_OptionGroup::values('case_status');
     $this->case_types = CRM_Case_PseudoConstant::caseType();
     $rels = CRM_Core_PseudoConstant::relationshipType();
@@ -70,7 +70,7 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form {
     $this->deleted_labels = array(
       '' => ts('- select -'),
       0 => ts('No'),
-      1 => ts('Yes')
+      1 => ts('Yes'),
     );
 
     $this->caseActivityTypes = array();
@@ -266,20 +266,20 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form {
     parent::__construct();
   }
 
-  function preProcess() {
+  public function preProcess() {
     parent::preProcess();
   }
 
-  function buildQuickForm() {
+  public function buildQuickForm() {
     parent::buildQuickForm();
     $this->caseDetailSpecialColumnsAdd();
   }
 
-  function caseDetailSpecialColumnsAdd() {
+  public function caseDetailSpecialColumnsAdd() {
     $elements = array();
     $elements[] = &$this->createElement('select', 'case_activity_all_dates', NULL,
       array(
-        '' => ts('- select -')
+        '' => ts('- select -'),
       ) + $this->caseActivityTypes
     );
     $this->addGroup($elements, 'case_detail_extra');
@@ -294,7 +294,7 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form {
     $this->assign('caseDetailExtra', $this->_caseDetailExtra);
   }
 
-  function select() {
+  public function select() {
     $select = array();
     $this->_columnHeaders = array();
     foreach ($this->_columns as $tableName => $table) {
@@ -340,7 +340,7 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form {
     $this->_select = 'SELECT ' . implode(', ', $select) . ' ';
   }
 
-  function from() {
+  public function from() {
 
     $case = $this->_aliases['civicrm_case'];
     $conact = $this->_aliases['civicrm_contact'];
@@ -393,7 +393,7 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form {
     }
   }
 
-  function where() {
+  public function where() {
     $clauses = array();
     $this->_having = '';
     foreach ($this->_columns as $tableName => $table) {
@@ -458,7 +458,7 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form {
     }
   }
 
-  function groupBy() {
+  public function groupBy() {
     $this->_groupBy = " GROUP BY {$this->_aliases['civicrm_case']}.id";
   }
 
@@ -467,7 +467,7 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form {
    *
    * @return array
    */
-  function statistics(&$rows) {
+  public function statistics(&$rows) {
     $statistics = parent::statistics($rows);
 
     $select = "select COUNT( DISTINCT( {$this->_aliases['civicrm_address']}.country_id))";
@@ -479,8 +479,7 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form {
       foreach ($statistics['filters'] as $id => $value) {
         if ($value['title'] == 'Case Type') {
           $statistics['filters'][$id]['value'] = 'Is ' .
-            $this->case_types[substr($statistics['filters'][$id]
-              ['value'], -3, -2
+            $this->case_types[substr($statistics['filters'][$id]['value'], -3, -2
             )];
         }
       }
@@ -497,11 +496,11 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form {
     return $statistics;
   }
 
-  function orderBy() {
+  public function orderBy() {
     $this->_orderBy = " ORDER BY {$this->_aliases['civicrm_case']}.start_date DESC ";
   }
 
-  function caseDetailSpecialColumnProcess() {
+  public function caseDetailSpecialColumnProcess() {
     if (!$this->_includeCaseDetailExtra) {
       return;
     }
@@ -526,7 +525,7 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form {
     $this->_from .= ' ' . implode(' ', $from) . ' ';
   }
 
-  function postProcess() {
+  public function postProcess() {
 
     $this->beginPostProcess();
 
@@ -547,7 +546,7 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form {
     $this->endPostProcess($rows);
   }
 
-  function checkEnabledFields() {
+  public function checkEnabledFields() {
     if (isset($this->_params['worldregion_id_value']) &&
       !empty($this->_params['worldregion_id_value'])
     ) {
@@ -579,7 +578,7 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form {
   /**
    * @param $rows
    */
-  function alterDisplay(&$rows) {
+  public function alterDisplay(&$rows) {
     $entryFound = FALSE;
     $activityTypes = CRM_Core_PseudoConstant::activityType(TRUE, TRUE);
 
@@ -600,9 +599,11 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form {
       }
       if (array_key_exists('civicrm_case_subject', $row)) {
         if ($value = $row['civicrm_case_subject']) {
-          $caseId = $row['civicrm_case_id'];
-          $contactId = $row['civicrm_contact_id'];
-          $rows[$rowNum]['civicrm_case_subject'] = "<a href= 'javascript:viewCase( $caseId,$contactId );'>$value</a>";
+          $url = CRM_Utils_System::url("civicrm/case/ajax/details",
+            "caseId={$row['civicrm_case_id']}&contactId={$row['civicrm_contact_id']}",
+            $this->_absoluteUrl
+          );
+          $rows[$rowNum]['civicrm_case_subject'] = "<a class=\"crm-popup\" href=\"$url\">$value</a>";
           $rows[$rowNum]['civicrm_case_subject_hover'] = ts('View Details of Case.');
 
           $entryFound = TRUE;
@@ -677,4 +678,3 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form {
     }
   }
 }
-