Skip to content
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

Merged
merged 3 commits into from
Jul 28, 2017

Conversation

Edzelopez
Copy link
Contributor


----------------------------------------
* CRM-20952: Refresh membership tab on edits to membership payments
  https://issues.civicrm.org/jira/browse/CRM-20952
@Edzelopez
Copy link
Contributor Author

@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));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about using getcount?

@@ -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));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above.

@@ -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) {
Copy link
Contributor

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);
Copy link
Contributor

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
@pradpnayak
Copy link
Contributor

@colemanw , can you please review this?

----------------------------------------
* CRM-20952: Refresh membership tab on edits to membership payments
  https://issues.civicrm.org/jira/browse/CRM-20952
@Edzelopez Edzelopez changed the title [WIP] CRM-20952 Refresh membership tab if contribution is membership payment [ready for review] CRM-20952 Refresh membership tab if contribution is membership payment Jul 27, 2017
@colemanw colemanw merged commit f68731a into civicrm:master Jul 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants