Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | {* |
2 | +--------------------------------------------------------------------+ | |
fee14197 | 3 | | CiviCRM version 5 | |
6a488035 | 4 | +--------------------------------------------------------------------+ |
6b83d5bd | 5 | | Copyright CiviCRM LLC (c) 2004-2019 | |
6a488035 TO |
6 | +--------------------------------------------------------------------+ |
7 | | This file is a part of CiviCRM. | | |
8 | | | | |
9 | | CiviCRM is free software; you can copy, modify, and distribute it | | |
10 | | under the terms of the GNU Affero General Public License | | |
11 | | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | | |
12 | | | | |
13 | | CiviCRM is distributed in the hope that it will be useful, but | | |
14 | | WITHOUT ANY WARRANTY; without even the implied warranty of | | |
15 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | | |
16 | | See the GNU Affero General Public License for more details. | | |
17 | | | | |
18 | | You should have received a copy of the GNU Affero General Public | | |
19 | | License and the CiviCRM Licensing Exception along | | |
20 | | with this program; if not, contact CiviCRM LLC | | |
21 | | at info[AT]civicrm[DOT]org. If you have questions about the | | |
22 | | GNU Affero General Public License or the licensing of CiviCRM, | | |
23 | | see the CiviCRM license FAQ at http://civicrm.org/licensing | | |
24 | +--------------------------------------------------------------------+ | |
25 | *} | |
26 | {* View existing membership record. *} | |
27 | <div class="crm-block crm-content-block crm-membership-view-form-block"> | |
6a488035 TO |
28 | <div class="crm-submit-buttons"> |
29 | {* Check permissions and make sure this is not an inherited membership (edit and delete not allowed for inherited memberships) *} | |
895d596d E |
30 | {if ! ($owner_contact_id AND call_user_func(array('CRM_Core_Permission','check'), 'edit memberships')) |
31 | && (call_user_func(array('CRM_Core_Permission', 'check'), "edit contributions of type $financialTypeId") || $noACL)} | |
6a488035 TO |
32 | {assign var='urlParams' value="reset=1&id=$id&cid=$contact_id&action=update&context=$context"} |
33 | {if ( $context eq 'fulltext' || $context eq 'search' ) && $searchKey} | |
34 | {assign var='urlParams' value="reset=1&id=$id&cid=$contact_id&action=update&context=$context&key=$searchKey"} | |
35 | {/if} | |
aac8c264 | 36 | <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"></i> {ts}Edit{/ts}</span></a> |
6a488035 | 37 | {/if} |
895d596d E |
38 | {if ! ($owner_contact_id AND call_user_func(array('CRM_Core_Permission','check'), 'delete in CiviMember')) |
39 | && (call_user_func(array('CRM_Core_Permission', 'check'), "delete contributions of type $financialTypeId") || $noACL)} | |
6a488035 TO |
40 | {assign var='urlParams' value="reset=1&id=$id&cid=$contact_id&action=delete&context=$context"} |
41 | {if ( $context eq 'fulltext' || $context eq 'search' ) && $searchKey} | |
42 | {assign var='urlParams' value="reset=1&id=$id&cid=$contact_id&action=delete&context=$context&key=$searchKey"} | |
43 | {/if} | |
aac8c264 | 44 | <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"></i> {ts}Delete{/ts}</span></a> |
6a488035 TO |
45 | {/if} |
46 | {include file="CRM/common/formButtons.tpl" location="bottom"} | |
47 | </div> | |
abe11616 MW |
48 | |
49 | {if $is_test} | |
50 | <div class="help"> | |
51 | <strong>{ts}This is a TEST transaction{/ts}</strong> | |
52 | </div> | |
53 | {/if} | |
6a488035 | 54 | <table class="crm-info-panel"> |
abe11616 | 55 | <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 |
56 | {if $owner_display_name} |
57 | <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> | |
58 | {/if} | |
59 | <tr><td class="label">{ts}Membership Type{/ts}</td><td>{$membership_type}</td></tr> | |
60 | {if $has_related} | |
61 | <tr><td class="label">{ts}Max related{/ts}</td><td>{$max_related}</td></tr> | |
62 | {/if} | |
63 | <tr><td class="label">{ts}Status{/ts}</td><td>{$status}</td></tr> | |
64 | <tr><td class="label">{ts}Source{/ts}</td><td>{$source}</td></tr> | |
65 | {if $campaign}<tr><td class="label">{ts}Campaign{/ts}</td><td>{$campaign}</td></tr>{/if} | |
66 | <tr><td class="label">{ts}Member Since{/ts}</td><td>{$join_date|crmDate}</td></tr> | |
67 | <tr><td class="label">{ts}Start date{/ts}</td><td>{$start_date|crmDate}</td></tr> | |
68 | <tr><td class="label">{ts}End date{/ts}</td><td>{$end_date|crmDate}</td></tr> | |
69 | <tr><td class="label">{ts}Auto-renew{/ts}</td><td>{$auto_renew}</td></tr> | |
4627f70f MW |
70 | {if $contribution_recur_id} |
71 | <tr> | |
72 | <td class="label">{ts}Recurring Contribution{/ts}</td> | |
73 | <td> | |
d7ee0af4 | 74 | <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 |
75 | </td> |
76 | </tr> | |
77 | {/if} | |
6a488035 TO |
78 | </table> |
79 | ||
80 | {include file="CRM/Custom/Page/CustomDataView.tpl"} | |
81 | ||
669fc25e CR |
82 | {if $accessContribution} |
83 | <div class="crm-accordion-wrapper"> | |
84 | <div class="crm-accordion-header"> | |
85 | {ts}Related Contributions and Recurring Contributions{/ts} | |
86 | </div> | |
87 | <div class="crm-accordion-body"> | |
88 | {if $rows.0.contribution_id} | |
89 | {include file="CRM/Contribute/Form/Selector.tpl" context="Search"} | |
90 | {/if} | |
91 | <script type="text/javascript"> | |
92 | var membershipID = {$id}; | |
93 | var contactID = {$contactId}; | |
94 | {literal} | |
95 | CRM.$(function($) { | |
96 | CRM.loadPage( | |
97 | CRM.url( | |
98 | 'civicrm/membership/recurring-contributions', | |
99 | { | |
100 | reset: 1, | |
101 | membershipID: membershipID, | |
102 | cid: contactID | |
103 | }, | |
104 | 'back' | |
105 | ), | |
106 | { | |
107 | target : '#membership-recurring-contributions', | |
108 | dialog : false | |
109 | } | |
110 | ); | |
111 | }); | |
112 | {/literal} | |
113 | </script> | |
114 | <div id="membership-recurring-contributions"></div> | |
eb3cfcd6 | 115 | </div> |
669fc25e | 116 | </div> |
6a488035 TO |
117 | {/if} |
118 | ||
91ef9be0 | 119 | {if $softCredit} |
eb3cfcd6 | 120 | <div class="crm-accordion-wrapper"> |
64c1e6ea | 121 | <div class="crm-accordion-header">{ts}Related Soft Contributions{/ts}</div> |
eb3cfcd6 | 122 | <div class="crm-accordion-body">{include file="CRM/Contribute/Page/ContributionSoft.tpl" context="membership"}</div> |
123 | </div> | |
91ef9be0 | 124 | {/if} |
125 | ||
6a488035 TO |
126 | {if $has_related} |
127 | {include file="CRM/Member/Form/MembershipRelated.tpl" context="Search"} | |
128 | {/if} | |
129 | ||
130 | <div class="crm-submit-buttons"> | |
131 | {* Check permissions and make sure this is not a related membership (edit and delete not allowed for related memberships) *} | |
895d596d E |
132 | {if ! ($owner_contact_id AND call_user_func(array('CRM_Core_Permission','check'), 'edit memberships')) |
133 | && (call_user_func(array('CRM_Core_Permission', 'check'), "edit contributions of type $financialTypeId") || $noACL)} | |
6a488035 TO |
134 | {assign var='urlParams' value="reset=1&id=$id&cid=$contact_id&action=update&context=$context"} |
135 | {if ( $context eq 'fulltext' || $context eq 'search' ) && $searchKey} | |
136 | {assign var='urlParams' value="reset=1&id=$id&cid=$contact_id&action=update&context=$context&key=$searchKey"} | |
137 | {/if} | |
aac8c264 | 138 | <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"></i> {ts}Edit{/ts}</span></a> |
6a488035 | 139 | {/if} |
895d596d E |
140 | {if ! ($owner_contact_id AND call_user_func(array('CRM_Core_Permission','check'), 'delete in CiviMember')) |
141 | && (call_user_func(array('CRM_Core_Permission', 'check'), "delete contributions of type $financialTypeId") || $noACL)} | |
6a488035 TO |
142 | {assign var='urlParams' value="reset=1&id=$id&cid=$contact_id&action=delete&context=$context"} |
143 | {if ( $context eq 'fulltext' || $context eq 'search' ) && $searchKey} | |
144 | {assign var='urlParams' value="reset=1&id=$id&cid=$contact_id&action=delete&context=$context&key=$searchKey"} | |
145 | {/if} | |
aac8c264 | 146 | <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"></i> {ts}Delete{/ts}</span></a> |
6a488035 TO |
147 | {/if} |
148 | {include file="CRM/common/formButtons.tpl" location="bottom"} | |
149 | </div> | |
150 | </div> |