From: Seamus Lee Date: Sun, 10 May 2020 22:18:10 +0000 (+1000) Subject: [REF] Add contribution_id field to search using metadata instead of hard codeded... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=8cc7686b3aff7b8447041104317a5046cd44af1f;p=civicrm-core.git [REF] Add contribution_id field to search using metadata instead of hard codeded quickform html --- diff --git a/CRM/Contribute/BAO/Query.php b/CRM/Contribute/BAO/Query.php index 8dabd0d8de..2925909aff 100644 --- a/CRM/Contribute/BAO/Query.php +++ b/CRM/Contribute/BAO/Query.php @@ -893,8 +893,10 @@ class CRM_Contribute_BAO_Query extends CRM_Core_BAO_Query { 'receive_date', 'contribution_cancel_date', 'contribution_page_id', + 'contribution_id', ]; $metadata = civicrm_api3('Contribution', 'getfields', [])['values']; + $metadata['contribution_id'] = $metadata['id']; return array_intersect_key($metadata, array_flip($fields)); } @@ -960,7 +962,6 @@ class CRM_Contribute_BAO_Query extends CRM_Core_BAO_Query { $form->addYesNo('contribution_recurring', ts('Contribution is Recurring?'), TRUE); $form->addYesNo('contribution_test', ts('Contribution is a Test?'), TRUE); - $form->add('number', 'contribution_id', ts('Contribution ID'), ['class' => 'four', 'min' => 1]); // Add field for transaction ID search $form->addElement('text', 'contribution_trxn_id', ts("Transaction ID")); $form->addElement('text', 'contribution_check_number', ts('Check Number')); diff --git a/CRM/Contribute/DAO/Contribution.php b/CRM/Contribute/DAO/Contribution.php index d56ce8b8c6..8d736f25f1 100644 --- a/CRM/Contribute/DAO/Contribution.php +++ b/CRM/Contribute/DAO/Contribution.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contribute/Contribution.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:389ae44affe94e52a14c9c6daa79be1d) + * (GenCodeChecksum:0954aa2ae3574927fda6614f14168fc8) */ /** @@ -282,6 +282,9 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO { 'entity' => 'Contribution', 'bao' => 'CRM_Contribute_BAO_Contribution', 'localizable' => 0, + 'html' => [ + 'type' => 'Text', + ], ], 'contribution_contact_id' => [ 'name' => 'contact_id', diff --git a/xml/schema/Contribute/Contribution.xml b/xml/schema/Contribute/Contribution.xml index d2f5593b3d..ad1656a1be 100644 --- a/xml/schema/Contribute/Contribution.xml +++ b/xml/schema/Contribute/Contribution.xml @@ -14,6 +14,9 @@ true Contribution ID Contribution ID + + Text + 1.3