Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | {* |
2 | +--------------------------------------------------------------------+ | |
1188c7a8 | 3 | | Copyright CiviCRM LLC. All rights reserved. | |
6a488035 | 4 | | | |
1188c7a8 TO |
5 | | This work is published under the GNU AGPLv3 license with some | |
6 | | permitted exceptions and without any warranty. For full license | | |
7 | | and copyright information, see https://civicrm.org/licensing | | |
6a488035 TO |
8 | +--------------------------------------------------------------------+ |
9 | *} | |
10 | {* View existing membership record. *} | |
11 | <div class="crm-block crm-content-block crm-membership-view-form-block"> | |
6a488035 TO |
12 | <div class="crm-submit-buttons"> |
13 | {* Check permissions and make sure this is not an inherited membership (edit and delete not allowed for inherited memberships) *} | |
895d596d E |
14 | {if ! ($owner_contact_id AND call_user_func(array('CRM_Core_Permission','check'), 'edit memberships')) |
15 | && (call_user_func(array('CRM_Core_Permission', 'check'), "edit contributions of type $financialTypeId") || $noACL)} | |
6a488035 TO |
16 | {assign var='urlParams' value="reset=1&id=$id&cid=$contact_id&action=update&context=$context"} |
17 | {if ( $context eq 'fulltext' || $context eq 'search' ) && $searchKey} | |
18 | {assign var='urlParams' value="reset=1&id=$id&cid=$contact_id&action=update&context=$context&key=$searchKey"} | |
19 | {/if} | |
13a3d214 | 20 | <a class="button" href="{crmURL p='civicrm/contact/view/membership' q=$urlParams}" accesskey="e" id="crm-membership-edit-button-top"><span><i class="crm-i fa-pencil" aria-hidden="true"></i> {ts}Edit{/ts}</span></a> |
6a488035 | 21 | {/if} |
895d596d E |
22 | {if ! ($owner_contact_id AND call_user_func(array('CRM_Core_Permission','check'), 'delete in CiviMember')) |
23 | && (call_user_func(array('CRM_Core_Permission', 'check'), "delete contributions of type $financialTypeId") || $noACL)} | |
6a488035 TO |
24 | {assign var='urlParams' value="reset=1&id=$id&cid=$contact_id&action=delete&context=$context"} |
25 | {if ( $context eq 'fulltext' || $context eq 'search' ) && $searchKey} | |
26 | {assign var='urlParams' value="reset=1&id=$id&cid=$contact_id&action=delete&context=$context&key=$searchKey"} | |
27 | {/if} | |
13a3d214 | 28 | <a class="button" href="{crmURL p='civicrm/contact/view/membership' q=$urlParams}" id="crm-membership-delete-button-top"><span><i class="crm-i fa-trash" aria-hidden="true"></i> {ts}Delete{/ts}</span></a> |
6a488035 TO |
29 | {/if} |
30 | {include file="CRM/common/formButtons.tpl" location="bottom"} | |
31 | </div> | |
abe11616 MW |
32 | |
33 | {if $is_test} | |
34 | <div class="help"> | |
35 | <strong>{ts}This is a TEST transaction{/ts}</strong> | |
36 | </div> | |
37 | {/if} | |
6a488035 | 38 | <table class="crm-info-panel"> |
abe11616 | 39 | <tr><td class="label">{ts}Member{/ts}</td><td class="bold"><a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=$contact_id&context=$context"}" title="{ts}View contact summary{/ts}">{$displayName}</td></tr> |
6a488035 TO |
40 | {if $owner_display_name} |
41 | <tr><td class="label">{ts}By Relationship{/ts}</td><td>{$relationship} <a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=$owner_contact_id&context=$context"}" title="{ts}View primary member contact summary{/ts}">{$owner_display_name}</a> </td></tr> | |
42 | {/if} | |
43 | <tr><td class="label">{ts}Membership Type{/ts}</td><td>{$membership_type}</td></tr> | |
44 | {if $has_related} | |
45 | <tr><td class="label">{ts}Max related{/ts}</td><td>{$max_related}</td></tr> | |
46 | {/if} | |
9c1df5d4 | 47 | <tr><td class="label">{ts}Status{/ts}</td><td>{$status} {if $member_is_override}({ts}Overridden{/ts}){/if}</td></tr> |
6a488035 TO |
48 | <tr><td class="label">{ts}Source{/ts}</td><td>{$source}</td></tr> |
49 | {if $campaign}<tr><td class="label">{ts}Campaign{/ts}</td><td>{$campaign}</td></tr>{/if} | |
50 | <tr><td class="label">{ts}Member Since{/ts}</td><td>{$join_date|crmDate}</td></tr> | |
51 | <tr><td class="label">{ts}Start date{/ts}</td><td>{$start_date|crmDate}</td></tr> | |
52 | <tr><td class="label">{ts}End date{/ts}</td><td>{$end_date|crmDate}</td></tr> | |
53 | <tr><td class="label">{ts}Auto-renew{/ts}</td><td>{$auto_renew}</td></tr> | |
4627f70f MW |
54 | {if $contribution_recur_id} |
55 | <tr> | |
56 | <td class="label">{ts}Recurring Contribution{/ts}</td> | |
57 | <td> | |
d7ee0af4 | 58 | <a class="crm-hover-button action-item" href='{crmURL p="civicrm/contact/view/contributionrecur" q="reset=1&id=`$contribution_recur_id`&cid=`$contactId`&context=contribution"}'>View Recurring Contribution</a> |
4627f70f MW |
59 | </td> |
60 | </tr> | |
61 | {/if} | |
6a488035 TO |
62 | </table> |
63 | ||
64 | {include file="CRM/Custom/Page/CustomDataView.tpl"} | |
65 | ||
669fc25e CR |
66 | {if $accessContribution} |
67 | <div class="crm-accordion-wrapper"> | |
68 | <div class="crm-accordion-header"> | |
69 | {ts}Related Contributions and Recurring Contributions{/ts} | |
70 | </div> | |
71 | <div class="crm-accordion-body"> | |
72 | {if $rows.0.contribution_id} | |
73 | {include file="CRM/Contribute/Form/Selector.tpl" context="Search"} | |
74 | {/if} | |
75 | <script type="text/javascript"> | |
76 | var membershipID = {$id}; | |
77 | var contactID = {$contactId}; | |
78 | {literal} | |
79 | CRM.$(function($) { | |
80 | CRM.loadPage( | |
81 | CRM.url( | |
82 | 'civicrm/membership/recurring-contributions', | |
83 | { | |
84 | reset: 1, | |
85 | membershipID: membershipID, | |
86 | cid: contactID | |
87 | }, | |
88 | 'back' | |
89 | ), | |
90 | { | |
91 | target : '#membership-recurring-contributions', | |
92 | dialog : false | |
93 | } | |
94 | ); | |
95 | }); | |
96 | {/literal} | |
97 | </script> | |
98 | <div id="membership-recurring-contributions"></div> | |
eb3cfcd6 | 99 | </div> |
669fc25e | 100 | </div> |
6a488035 TO |
101 | {/if} |
102 | ||
91ef9be0 | 103 | {if $softCredit} |
eb3cfcd6 | 104 | <div class="crm-accordion-wrapper"> |
64c1e6ea | 105 | <div class="crm-accordion-header">{ts}Related Soft Contributions{/ts}</div> |
eb3cfcd6 | 106 | <div class="crm-accordion-body">{include file="CRM/Contribute/Page/ContributionSoft.tpl" context="membership"}</div> |
107 | </div> | |
91ef9be0 | 108 | {/if} |
109 | ||
6a488035 TO |
110 | {if $has_related} |
111 | {include file="CRM/Member/Form/MembershipRelated.tpl" context="Search"} | |
112 | {/if} | |
113 | ||
114 | <div class="crm-submit-buttons"> | |
115 | {* Check permissions and make sure this is not a related membership (edit and delete not allowed for related memberships) *} | |
895d596d E |
116 | {if ! ($owner_contact_id AND call_user_func(array('CRM_Core_Permission','check'), 'edit memberships')) |
117 | && (call_user_func(array('CRM_Core_Permission', 'check'), "edit contributions of type $financialTypeId") || $noACL)} | |
6a488035 TO |
118 | {assign var='urlParams' value="reset=1&id=$id&cid=$contact_id&action=update&context=$context"} |
119 | {if ( $context eq 'fulltext' || $context eq 'search' ) && $searchKey} | |
120 | {assign var='urlParams' value="reset=1&id=$id&cid=$contact_id&action=update&context=$context&key=$searchKey"} | |
121 | {/if} | |
13a3d214 | 122 | <a class="button" href="{crmURL p='civicrm/contact/view/membership' q=$urlParams}" accesskey="e" id="crm-membership-edit-button-bottom"><span><i class="crm-i fa-pencil" aria-hidden="true"></i> {ts}Edit{/ts}</span></a> |
6a488035 | 123 | {/if} |
895d596d E |
124 | {if ! ($owner_contact_id AND call_user_func(array('CRM_Core_Permission','check'), 'delete in CiviMember')) |
125 | && (call_user_func(array('CRM_Core_Permission', 'check'), "delete contributions of type $financialTypeId") || $noACL)} | |
6a488035 TO |
126 | {assign var='urlParams' value="reset=1&id=$id&cid=$contact_id&action=delete&context=$context"} |
127 | {if ( $context eq 'fulltext' || $context eq 'search' ) && $searchKey} | |
128 | {assign var='urlParams' value="reset=1&id=$id&cid=$contact_id&action=delete&context=$context&key=$searchKey"} | |
129 | {/if} | |
13a3d214 | 130 | <a class="button" href="{crmURL p='civicrm/contact/view/membership' q=$urlParams}" id="crm-membership-delete-button-bottom"><span><i class="crm-i fa-trash" aria-hidden="true"></i> {ts}Delete{/ts}</span></a> |
6a488035 TO |
131 | {/if} |
132 | {include file="CRM/common/formButtons.tpl" location="bottom"} | |
133 | </div> | |
134 | </div> |