-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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)); | ||
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 commentThe reason will be displayed to describe this comment to others. Learn more. same as below. |
||
} | ||
} | ||
|
||
$statusMsg = ts('The payment record has been processed.'); | ||
// send email | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. same as above. |
||
if ($membershipPayments['count'] > 1) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should be > 0 or >=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.
How about using getcount?