CRM-16554 - Cannot Use or Delete Smart Groups Created by Contribution Aggregate Search
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Wed, 27 May 2015 11:19:41 +0000 (16:49 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Wed, 27 May 2015 11:19:41 +0000 (16:49 +0530)
CRM/Contact/Form/Search/Custom/ContributionAggregate.php
templates/CRM/Contact/Form/Search/Custom/ContributionAggregate.tpl

index a537622581f9cfc36dcbadf3e9683fd6be54d378..bceebcaa163d70d641285d5460b5e65d103c06ce 100644 (file)
@@ -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)";
     }
 
index cd7be7f59adadc7c76f54fc791fe581a1e4904a2..540f945ff0901c9e7cb1957ae4ee5d6538efe217 100644 (file)
             {/foreach}
             <tr class="crm-contact-custom-search-contributionDetails-form-block-financial_type">
                 <td class="label">{ts}Financial Type{/ts}</td>
-                <td>
-                    <div class="listing-box">
-                        {foreach from=$form.financial_type_id item="financial_type_val"}
-                            <div class="{cycle values="odd-row,even-row"}">
-                                {$financial_type_val.html}
-                            </div>
-                        {/foreach}
-                    </div>
-                    <div class="spacer"></div>
-                </td>
+                <td>{$form.financial_type_id.html|crmAddClass:twenty}</td>
             </tr>
         </table>
         <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>