From 6e68fe2a749532356df703c4e7fb4292c38e79e1 Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Mon, 27 Apr 2015 11:41:54 +0530 Subject: [PATCH] QA fixes --- CRM/Report/Form/Contact/CurrentEmployer.php | 2 +- CRM/Report/Form/Contribute/Bookkeeping.php | 1 + CRM/Report/Form/Contribute/History.php | 18 +++++++++--------- CRM/Report/Form/Contribute/SoftCredit.php | 4 ---- CRM/Report/Form/Contribute/TopDonor.php | 12 +++++++----- templates/CRM/Report/Form/Contact/Detail.tpl | 2 +- 6 files changed, 19 insertions(+), 20 deletions(-) diff --git a/CRM/Report/Form/Contact/CurrentEmployer.php b/CRM/Report/Form/Contact/CurrentEmployer.php index 798720adb6..394a0c26f8 100644 --- a/CRM/Report/Form/Contact/CurrentEmployer.php +++ b/CRM/Report/Form/Contact/CurrentEmployer.php @@ -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); diff --git a/CRM/Report/Form/Contribute/Bookkeeping.php b/CRM/Report/Form/Contribute/Bookkeeping.php index f116e2cd73..864aacba44 100644 --- a/CRM/Report/Form/Contribute/Bookkeeping.php +++ b/CRM/Report/Form/Contribute/Bookkeeping.php @@ -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 / diff --git a/CRM/Report/Form/Contribute/History.php b/CRM/Report/Form/Contribute/History.php index 18177be4cd..292b973219 100644 --- a/CRM/Report/Form/Contribute/History.php +++ b/CRM/Report/Form/Contribute/History.php @@ -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']; diff --git a/CRM/Report/Form/Contribute/SoftCredit.php b/CRM/Report/Form/Contribute/SoftCredit.php index 4720350560..6ed97b2efa 100644 --- a/CRM/Report/Form/Contribute/SoftCredit.php +++ b/CRM/Report/Form/Contribute/SoftCredit.php @@ -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, diff --git a/CRM/Report/Form/Contribute/TopDonor.php b/CRM/Report/Form/Contribute/TopDonor.php index 1cd591000e..a100afd5ce 100644 --- a/CRM/Report/Form/Contribute/TopDonor.php +++ b/CRM/Report/Form/Contribute/TopDonor.php @@ -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, diff --git a/templates/CRM/Report/Form/Contact/Detail.tpl b/templates/CRM/Report/Form/Contact/Detail.tpl index e6e73e2b5b..978b821ceb 100644 --- a/templates/CRM/Report/Form/Contact/Detail.tpl +++ b/templates/CRM/Report/Form/Contact/Detail.tpl @@ -100,7 +100,7 @@ {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'} -- 2.25.1