-
-
Notifications
You must be signed in to change notification settings - Fork 817
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ready for review] CRM-20952 Refresh membership tab if contribution is membership payment #10741
Conversation
---------------------------------------- * CRM-20952: Refresh membership tab on edits to membership payments https://issues.civicrm.org/jira/browse/CRM-20952
@monishdeb or @pradpnayak can you please QA? |
@@ -379,6 +379,12 @@ public function submit($submittedValues) { | |||
$params = array('id' => $this->_contributionId); | |||
$contribution = CRM_Contribute_BAO_Contribution::retrieve($params, $defaults, $params); | |||
CRM_Contribute_BAO_Contribution::addPayments(array($contribution), $contributionStatusId); | |||
if ($this->_contributionId && CRM_Core_Permission::access('CiviMember')) { | |||
$membershipPayments = civicrm_api3('MembershipPayment', 'Get', array('contribution_id' => $this->_contributionId)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about using getcount?
CRM/Contribute/Form/Contribution.php
Outdated
@@ -1073,6 +1073,12 @@ public function postProcess() { | |||
if (empty($this->_id) && !empty($contribution->id)) { | |||
$this->_id = $contribution->id; | |||
} | |||
if (!empty($this->_id) && CRM_Core_Permission::access('CiviMember')) { | |||
$membershipPayments = civicrm_api3('MembershipPayment', 'Get', array('contribution_id' => $this->_id)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above.
CRM/Contribute/Form/Contribution.php
Outdated
@@ -1073,6 +1073,12 @@ public function postProcess() { | |||
if (empty($this->_id) && !empty($contribution->id)) { | |||
$this->_id = $contribution->id; | |||
} | |||
if (!empty($this->_id) && CRM_Core_Permission::access('CiviMember')) { | |||
$membershipPayments = civicrm_api3('MembershipPayment', 'Get', array('contribution_id' => $this->_id)); | |||
if ($membershipPayments['count'] > 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be > 0 or >=1?
if ($this->_contributionId && CRM_Core_Permission::access('CiviMember')) { | ||
$membershipPayments = civicrm_api3('MembershipPayment', 'Get', array('contribution_id' => $this->_contributionId)); | ||
if ($membershipPayments['count'] > 1) { | ||
$this->ajaxResponse['updateTabs']['#tab_member'] = CRM_Contact_BAO_Contact::getCountComponent('membership', $this->_contactID); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as below.
---------------------------------------- * CRM-20952: Refresh membership tab on edits to membership payments https://issues.civicrm.org/jira/browse/CRM-20952
@colemanw , can you please review this? |
---------------------------------------- * CRM-20952: Refresh membership tab on edits to membership payments https://issues.civicrm.org/jira/browse/CRM-20952
https://issues.civicrm.org/jira/browse/CRM-20952