-- CRM-12787 applied patch and made some modification
authorRavish Nair <ravish.nair@webaccess.co.in>
Fri, 28 Jun 2013 07:12:12 +0000 (12:42 +0530)
committerRavish Nair <ravish.nair@webaccess.co.in>
Fri, 28 Jun 2013 07:12:12 +0000 (12:42 +0530)
----------------------------------------
* CRM-12787: Case Detail report: add filter & display column for Deleted
  http://issues.civicrm.org/jira/browse/CRM-12787

CRM/Report/Form/Case/Detail.php

index f108ff673ec918f34ae2c9a25386129797334779..16fb5b5ead9ed25c2066a26d8319861ab668c205 100644 (file)
@@ -62,6 +62,8 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form {
       $this->rel_types[$relid] = $v['label_b_a'];
     }
 
+    $this->deleted_labels = array('' => ts('- select -'), 0 => ts('No'), 1 => ts('Yes'));
+
     $this->caseActivityTypes = array();
     foreach (CRM_Case_PseudoConstant::caseActivityType() as $typeDetail) {
       $this->caseActivityTypes[$typeDetail['id']] = $typeDetail['label'];
@@ -88,6 +90,10 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form {
           ),
           'status_id' => array('title' => ts('Case Status')),
           'case_type_id' => array('title' => ts('Case Type')),
+          'is_deleted' => array('title' => ts('Deleted?'),
+            'default' => FALSE,
+            'type' => CRM_Utils_Type::T_INT,
+          ),
         ),
         'filters' =>
         array(
@@ -107,6 +113,12 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form {
             'operatorType' => CRM_Report_Form::OP_MULTISELECT,
             'options' => $this->case_types,
           ),
+          'is_deleted' => array('title' => ts('Deleted?'),
+            'type' => CRM_Utils_Type::T_INT,
+            'operatorType' => CRM_Report_Form::OP_SELECT,
+            'options' => $this->deleted_labels,
+            'default' => 0,
+          ),
         ),
       ),
       'civicrm_contact' =>
@@ -639,6 +651,12 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form {
         $entryFound = TRUE;
       }
 
+      if (array_key_exists('civicrm_case_is_deleted', $row)) {
+        $value = $row['civicrm_case_is_deleted'];
+        $rows[$rowNum]['civicrm_case_is_deleted'] = $this->deleted_labels[$value];
+        $entryFound = TRUE;
+      }
+
       if (!$entryFound) {
         break;
       }