QA fixes
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Mon, 27 Apr 2015 06:11:54 +0000 (11:41 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Mon, 27 Apr 2015 06:12:46 +0000 (11:42 +0530)
CRM/Report/Form/Contact/CurrentEmployer.php
CRM/Report/Form/Contribute/Bookkeeping.php
CRM/Report/Form/Contribute/History.php
CRM/Report/Form/Contribute/SoftCredit.php
CRM/Report/Form/Contribute/TopDonor.php
templates/CRM/Report/Form/Contact/Detail.tpl

index 798720adb6a51694d0841c2cd072e45933c663e8..394a0c26f807615f967ffd1ea6b678a297cfdc25 100644 (file)
@@ -284,7 +284,7 @@ FROM civicrm_contact {$this->_aliases['civicrm_contact']}
             $from = CRM_Utils_Array::value("{$fieldName}_from", $this->_params);
             $to = CRM_Utils_Array::value("{$fieldName}_to", $this->_params);
 
-            $clause = $this->dateClause($field['name'], $relative, $from, $to, $field['type']);
+            $clause = $this->dateClause($field['dbAlias'], $relative, $from, $to, $field['type']);
           }
           else {
             $op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);
index f116e2cd73d8ab1f5734097314fe50a60ba18a58..864aacba44cf4edd1b0b65084932e3926112c9c4 100644 (file)
@@ -505,6 +505,7 @@ class CRM_Report_Form_Contribute_Bookkeeping extends CRM_Report_Form {
 ";
 
     $dao = CRM_Core_DAO::executeQuery($sql);
+    $amount = $avg = array();
     while ($dao->fetch()) {
       $amount[] = CRM_Utils_Money::format($dao->amount, $dao->currency);
       $avg[] = CRM_Utils_Money::format(round(($dao->amount /
index 18177be4cdfb3095179c1c4c5d66faf7badf0ec2..292b9732195142e9d632c8471baab2c03c1fc177 100644 (file)
@@ -808,6 +808,15 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form {
 
     $last_primary = NULL;
     foreach ($rows as $rowNum => $row) {
+      //handle gender
+      if (array_key_exists('civicrm_contact_gender_id', $row)) {
+        if ($value = $row['civicrm_contact_gender_id']) {
+          $gender = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id');
+          $row['civicrm_contact_gender_id'] = $rows[$rowNum]['civicrm_contact_gender_id'] = $gender[$value];
+        }
+        $entryFound = TRUE;
+      }
+
       // Highlight primary contact and amount row
       if (is_numeric($rowNum) ||
         ($last_primary && ($rowNum == "{$last_primary}_total"))
@@ -844,15 +853,6 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form {
         $rows[$rowNum]['civicrm_contact_sort_name_hover'] = ts("View Contribution Details for this Contact.");
       }
 
-      //handle gender
-      if (array_key_exists('civicrm_contact_gender_id', $row)) {
-        if ($value = $row['civicrm_contact_gender_id']) {
-          $gender = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id');
-          $rows[$rowNum]['civicrm_contact_gender_id'] = $gender[$value];
-        }
-        $entryFound = TRUE;
-      }
-
       // display birthday in the configured custom format
       if (array_key_exists('civicrm_contact_birth_date', $row)) {
         $birthDate = $row['civicrm_contact_birth_date'];
index 4720350560a462294af0c7b317d3ba62d1aa81f0..6ed97b2efaa064655dcfb9f7d0e3a140533c03f3 100644 (file)
@@ -158,10 +158,6 @@ class CRM_Report_Form_Contribute_SoftCredit extends CRM_Report_Form {
             'name' => 'sort_name',
             'title' => ts('Soft Credit Name'),
           ),
-          'id' => array(
-            'title' => ts('Contact ID'),
-            'no_display' => TRUE,
-          ),
           'gender_id' => array(
             'title' => ts('Gender'),
             'operatorType' => CRM_Report_Form::OP_MULTISELECT,
index 1cd591000ee555a76244f6bfc703cf0b35a57bce..a100afd5ce78daae752aef205cf5e0972487ca9c 100644 (file)
@@ -92,6 +92,13 @@ class CRM_Report_Form_Contribute_TopDonor extends CRM_Report_Form {
             'title' => ts('Contact Subtype'),
           ),
         ),
+        'filters' => array(
+          'gender_id' => array(
+            'title' => ts('Gender'),
+            'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+            'options' => CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id'),
+          ),
+        ),
       ),
     );
     $this->_columns += $this->getAddressColumns();
@@ -122,11 +129,6 @@ class CRM_Report_Form_Contribute_TopDonor extends CRM_Report_Form {
             'title' => ts('Contact ID'),
             'no_display' => TRUE,
           ),
-          'gender_id' => array(
-            'title' => ts('Gender'),
-            'operatorType' => CRM_Report_Form::OP_MULTISELECT,
-            'options' => CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id'),
-          ),
           'birth_date' => array(
             'title' => ts('Birth Date'),
             'operatorType' => CRM_Report_Form::OP_DATE,
index e6e73e2b5be14831fa974669c5e5fca8554e55d7..978b821ceb9a79e9529d0e6ddf986935e0214784 100644 (file)
 
                                         {if $row.$field eq 'Subtotal'}
                                             {$row.$field}
-                                        {elseif $header.type eq 12}
+                                        {elseif $header.type eq 12 || $header.type eq 4}
                                             {if $header.group_by eq 'MONTH' or $header.group_by eq 'QUARTER'}
                                                 {$row.$field|crmDate:$config->dateformatPartial}
                                             {elseif $header.group_by eq 'YEAR'}