From 78065c5254b6718254bdbde60f53885c84af4eaa Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Wed, 27 May 2015 16:49:41 +0530 Subject: [PATCH] CRM-16554 - Cannot Use or Delete Smart Groups Created by Contribution Aggregate Search --- .../Form/Search/Custom/ContributionAggregate.php | 11 +++++------ .../Form/Search/Custom/ContributionAggregate.tpl | 11 +---------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/CRM/Contact/Form/Search/Custom/ContributionAggregate.php b/CRM/Contact/Form/Search/Custom/ContributionAggregate.php index a537622581..bceebcaa16 100644 --- a/CRM/Contact/Form/Search/Custom/ContributionAggregate.php +++ b/CRM/Contact/Form/Search/Custom/ContributionAggregate.php @@ -83,16 +83,15 @@ class CRM_Contact_Form_Search_Custom_ContributionAggregate extends CRM_Contact_F $form->addDate('start_date', ts('Contribution Date From'), FALSE, array('formatType' => 'custom')); $form->addDate('end_date', ts('...through'), FALSE, array('formatType' => 'custom')); - $financial_types = CRM_Contribute_PseudoConstant::financialType(); - foreach ($financial_types as $financial_type_id => $financial_type) { - $form->addElement('checkbox', "financial_type_id[{$financial_type_id}]", 'Financial Type', $financial_type); - } + $form->addSelect('financial_type_id', + array('entity' => 'contribution', 'multiple' => 'multiple', 'context' => 'search') + ); /** * If you are using the sample template, this array tells the template fields to render * for the search form. */ - $form->assign('elements', array('min_amount', 'max_amount', 'start_date', 'end_date', 'financial_type_id')); + $form->assign('elements', array('min_amount', 'max_amount', 'start_date', 'end_date')); } /** @@ -223,7 +222,7 @@ civicrm_contact AS contact_a } if (!empty($this->_formValues['financial_type_id'])) { - $financial_type_ids = implode(',', array_keys($this->_formValues['financial_type_id'])); + $financial_type_ids = implode(',', array_values($this->_formValues['financial_type_id'])); $clauses[] = "contrib.financial_type_id IN ($financial_type_ids)"; } diff --git a/templates/CRM/Contact/Form/Search/Custom/ContributionAggregate.tpl b/templates/CRM/Contact/Form/Search/Custom/ContributionAggregate.tpl index cd7be7f59a..540f945ff0 100644 --- a/templates/CRM/Contact/Form/Search/Custom/ContributionAggregate.tpl +++ b/templates/CRM/Contact/Form/Search/Custom/ContributionAggregate.tpl @@ -46,16 +46,7 @@ {/foreach} {ts}Financial Type{/ts} - -
- {foreach from=$form.financial_type_id item="financial_type_val"} -
- {$financial_type_val.html} -
- {/foreach} -
-
- + {$form.financial_type_id.html|crmAddClass:twenty}
{include file="CRM/common/formButtons.tpl" location="bottom"}
-- 2.25.1