From e7afe635e1779db6038e9bcb4ba6806f2bca2554 Mon Sep 17 00:00:00 2001 From: Sunil Pawar Date: Fri, 28 Aug 2020 19:59:56 +0530 Subject: [PATCH] report#48 View Payment owned by Different contact on Membership and Participant View --- CRM/Contribute/Form/Search.php | 8 +++++--- CRM/Event/Page/Tab.php | 2 +- CRM/Member/Page/Tab.php | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CRM/Contribute/Form/Search.php b/CRM/Contribute/Form/Search.php index 4f1009b41a..341c54c868 100644 --- a/CRM/Contribute/Form/Search.php +++ b/CRM/Contribute/Form/Search.php @@ -386,12 +386,14 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form_Search { $cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this); - if ($cid) { + // skip cid (contact id of membership/participant record) to get associated payments for membership/participant record, + // contribution record may be on different contact id. + $skip_cid = CRM_Utils_Request::retrieve('skip_cid', 'Boolean', $this, FALSE, FALSE); + + if ($cid && !$skip_cid) { $cid = CRM_Utils_Type::escape($cid, 'Integer'); if ($cid > 0) { $this->_formValues['contact_id'] = $cid; - // @todo - why do we retrieve these when they are not used? - list($display, $image) = CRM_Contact_BAO_Contact::getDisplayAndImage($cid); $this->_defaults['sort_name'] = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $cid, 'sort_name' ); diff --git a/CRM/Event/Page/Tab.php b/CRM/Event/Page/Tab.php index ab29c9ce35..0ecd0f8063 100644 --- a/CRM/Event/Page/Tab.php +++ b/CRM/Event/Page/Tab.php @@ -287,7 +287,7 @@ class CRM_Event_Page_Tab extends CRM_Core_Page { ); $controller->setEmbedded(TRUE); $controller->set('force', 1); - $controller->set('cid', $this->_contactId); + $controller->set('skip_cid', TRUE); $controller->set('participantId', $this->_id); $controller->set('context', 'contribution'); $controller->process(); diff --git a/CRM/Member/Page/Tab.php b/CRM/Member/Page/Tab.php index ec2300d0ba..123f1ce953 100644 --- a/CRM/Member/Page/Tab.php +++ b/CRM/Member/Page/Tab.php @@ -590,7 +590,7 @@ class CRM_Member_Page_Tab extends CRM_Core_Page { $controller->setEmbedded(TRUE); $controller->reset(); $controller->set('force', 1); - $controller->set('cid', $contactId); + $controller->set('skip_cid', TRUE); $controller->set('memberId', $membershipId); $controller->set('context', 'contribution'); $controller->process(); -- 2.25.1