Skip to content

Commit

Permalink
Merge pull request civicrm#11358 from mattwire/CRM-21504_membership_o…
Browse files Browse the repository at this point in the history
…n_recurring_detail

CRM-21504 Add membership to recurring contribution detail
  • Loading branch information
colemanw authored and sluc23 committed Jan 10, 2018
2 parents b6ce288 + 801a82f commit 68efb5f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions CRM/Contribute/Page/ContributionRecur.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ public function view() {
}
}

// Add linked membership
$membership = civicrm_api3('Membership', 'get', array(
'contribution_recur_id' => $recur->id,
));
if (!empty($membership['count'])) {
$membershipDetails = reset($membership['values']);
$values['membership_id'] = $membershipDetails['id'];
$values['membership_name'] = $membershipDetails['membership_name'];
}

$this->assign('recur', $values);
}
}
Expand Down
5 changes: 5 additions & 0 deletions templates/CRM/Contribute/Page/ContributionRecur.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@
{if $recur.payment_processor}<tr><td class="label">{ts}Payment Processor{/ts}</td><td>{$recur.payment_processor}</td></tr>{/if}
{if $recur.financial_type}<tr><td class="label">{ts}Financial Type{/ts}</td><td>{$recur.financial_type}</td></tr>{/if}
{if $recur.campaign}<tr><td class="label">{ts}Campaign{/ts}</td><td>{$recur.campaign}</td></tr>{/if}
{if $recur.membership_id}<tr>
<td class="label">{ts}Membership{/ts}</td>
<td><a class="crm-hover-button" href='{crmURL p="civicrm/contact/view/membership" q="action=view&reset=1&cid=`$contactId`&id=`$recur.membership_id`&context=membership&selectedChild=member"}'>{$recur.membership_name}</a></td>
</tr>
{/if}
</table>
<div class="crm-submit-buttons"><a class="button cancel crm-form-submit" href="{crmURL p='civicrm/contact/view' q='action=browse&selectedChild=contribute'}">{ts}Done{/ts}</a></div>
</div>
Expand Down

0 comments on commit 68efb5f

Please sign in to comment.