2 +--------------------------------------------------------------------+
3 | Copyright CiviCRM LLC. All rights reserved. |
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 |
8 +--------------------------------------------------------------------+
10 {* this template is used for renewing memberships for a contact *}
11 {if $membershipMode == 'test' }
12 {assign var=registerMode value="TEST"}
13 {elseif $membershipMode == 'live'}
14 {assign var=registerMode value="LIVE"}
17 <div class="messages status no-popup">
18 {icon icon="fa-info-circle"}{/icon}
19 <p>{ts}You will not be able to send an automatic email receipt for this Renew Membership because there is no email address recorded for this contact. If you want a receipt to be sent when this Membership is recorded, click Cancel and then click Edit from the Summary tab to add an email address before Renewal the Membership.{/ts}</p>
24 {ts 1=$displayName 2=$registerMode}Use this form to Renew Membership Record on behalf of %1.
25 <strong>A %2 transaction will be submitted</strong>
26 using the selected payment processor.{/ts}
31 <div class="messages status no-popup">
32 {icon icon="fa-info-circle"}{/icon}
33 <p>{ts 1=$cancelAutoRenew}This membership is set to renew automatically {if $renewalDate}on {$renewalDate|crmDate}{/if}. You will need to cancel the auto-renew option if you want to modify the Membership Type, End Date or Membership Status.
34 <a href="%1">Click here</a>
35 if you want to cancel the automatic renewal option.{/ts}</p>
39 <div class="crm-block crm-form-block crm-member-membershiprenew-form-block">
40 <div id="help" class="description">
41 {ts}Renewing will add the normal membership period to the End Date of the previous period for members whose status is Current or Grace. For Expired memberships, renewing will create a membership period commencing from the 'Date Renewal Entered'. This date can be adjusted including being set to the day after the previous End Date - if continuous membership is required.{/ts}
43 <div>{include file="CRM/common/formButtons.tpl" location="top"}</div>
44 <table class="form-layout">
45 <tr class="crm-member-membershiprenew-form-block-contact-id">
46 <td class="label">{$form.contact_id.label}</td>
47 <td>{$form.contact_id.html}</td>
49 <tr class="crm-member-membershiprenew-form-block-org_name">
50 <td class="label">{ts}Membership Organization and Type{/ts}</td>
51 <td class="html-adjust">{$orgName} - {$memType}
52 {if $member_is_test} {ts}(test){/ts}{/if}
53 <a id="changeMembershipOrgType" href='#'
54 onclick='adjustMembershipOrgType(); return false;'>{ts}change membership type{/ts}</a>
57 <tr id="membershipOrgType" class="crm-member-membershiprenew-form-block-renew_org_name hiddenElement">
58 <td class="label">{$form.membership_type_id.label}</td>
59 <td>{$form.membership_type_id.html}
60 {if $member_is_test} {ts}(test){/ts}{/if}<br/>
61 <span class="description">{ts}Select Membership Organization and then Membership Type.{/ts}</span>
64 <tr class="crm-member-membershiprenew-form-block-membership_status">
65 <td class="label">{ts}Membership Status{/ts}</td>
66 <td class="html-adjust"> {$membershipStatus}<br/>
67 <span class="description">{ts}Status of this membership.{/ts}</span></td>
69 <tr class="crm-member-membershiprenew-form-block-end_date">
70 <td class="label">{ts}Membership End Date{/ts}</td>
71 <td class="html-adjust"> {$endDate|crmDate}</td>
73 <tr class="crm-member-membershiprenew-form-block-renewal_date">
74 <td class="label">{$form.renewal_date.label}</td>
75 <td>{$form.renewal_date.html}</td>
77 <tr id="defaultNumTerms" class="crm-member-membershiprenew-form-block-default-num_terms">
78 <td colspan="2" class="description">
79 {ts}Renewal extends membership end date by one membership period{/ts}
80 <a id="changeTermsLink" href='#'
81 onclick='changeNumTerms(); return false;'>{ts}change{/ts}</a>
84 <tr id="changeNumTerms" class="crm-member-membershiprenew-form-block-change-num_terms">
85 <td class="label">{$form.num_terms.label}</td>
86 <td>{$form.num_terms.html|crmAddClass:two} {ts}membership periods{/ts}<br/>
88 class="description">{ts}Extend the membership end date by this many membership periods. Make sure the appropriate corresponding fee is entered below.{/ts}</span>
91 {if $accessContribution and ! $membershipMode}
92 <tr class="crm-member-membershiprenew-form-block-record_contribution">
93 <td class="label">{$form.record_contribution.label}</td>
94 <td class="html-adjust">{$form.record_contribution.html}<br/>
96 class="description">{ts}Check this box to enter payment information. You will also be able to generate a customized receipt.{/ts}</span>
99 <tr id="recordContribution" class="crm-member-membershiprenew-form-block-membership_renewal">
102 <legend>{ts}Renewal Payment and Receipt{/ts}</legend>
104 {include file="CRM/Member/Form/MembershipCommon.tpl"}
106 {if $emailExists and $outBound_option != 2}
107 <table class="form-layout">
108 <tr class="crm-{$formClass}-form-block-send_receipt">
109 <td class="label">{$form.send_receipt.label}</td>
110 <td>{$form.send_receipt.html}<br/>
111 <span class="description">{ts 1=$emailExists}Automatically email a membership confirmation and receipt to %1?{/ts}</span>
115 <td class="label">{$form.from_email_address.label}</td>
116 <td>{$form.from_email_address.html} {help id="id-from_email" file="CRM/Contact/Form/Task/Email.hlp" isAdmin=$isAdmin}</td>
118 <tr id="notice" class="crm-member-membershiprenew-form-block-receipt_text_renewal">
119 <td class="label">{$form.receipt_text_renewal.label}</td>
121 class="description">{ts}Enter a message you want included at the beginning of the emailed receipt. EXAMPLE: 'Thanks for supporting our organization with your membership.'{/ts}</span><br/>
122 {$form.receipt_text_renewal.html|crmAddClass:huge}</td>
127 {include file="CRM/common/customDataBlock.tpl"}
129 <div>{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
131 <div class="spacer"></div>
133 {if $accessContribution and ! $membershipMode}
134 {include file="CRM/common/showHideByFieldValue.tpl"
135 trigger_field_id ="record_contribution"
137 target_element_id ="recordContribution"
138 target_element_type ="table-row"
144 {if $email and $outBound_option != 2}
145 {include file="CRM/common/showHideByFieldValue.tpl"
146 trigger_field_id ="send_receipt"
148 target_element_id ="notice"
149 target_element_type ="table-row"
153 {include file="CRM/common/showHideByFieldValue.tpl"
154 trigger_field_id ="send_receipt"
156 target_element_id ="fromEmail"
157 target_element_type ="table-row"
163 {if !$membershipMode}
164 {include file="CRM/common/showHideByFieldValue.tpl"
165 trigger_field_id ="send_receipt"
167 target_element_id ="fromEmail"
168 target_element_type ="table-row"
174 <script type="text/javascript">
176 $('#membershipOrgType').hide();
177 $('#changeNumTerms').hide();
180 function checkPayment() {
181 showHideByValue('record_contribution', '', 'recordContribution', 'table-row', 'radio', false);
182 {/literal}{if $email and $outBound_option != 2}{literal}
183 var record_contribution = document.getElementsByName('record_contribution');
184 if (record_contribution[0].checked) {
185 document.getElementsByName('send_receipt')[0].checked = true;
186 cj('#fromEmail').show();
189 document.getElementsByName('send_receipt')[0].checked = false;
191 showHideByValue('send_receipt', '', 'notice', 'table-row', 'radio', false);
192 {/literal}{/if}{literal}
195 function adjustMembershipOrgType() {
196 cj('#membershipOrgType').show();
197 cj('#changeMembershipOrgType').hide();
200 function changeNumTerms() {
201 cj('#changeNumTerms').show();
202 cj('#defaultNumTerms').hide();
206 cj('#record_contribution').click(function () {
207 if (cj(this).prop('checked')) {
208 cj('#recordContribution').show();
209 setPaymentBlock(true);
212 cj('#recordContribution').hide();
216 cj('#membership_type_id_1').change(function () {
222 function setPaymentBlock(checkboxEvent) {
223 var memType = cj('#membership_type_id_1').val();
229 var allMemberships = {/literal}{$allMembershipInfo}{literal};
230 var mode = {/literal}'{$membershipMode}'{literal};
233 // skip this for test and live modes because contribution type is set automatically
234 cj("#financial_type_id").val(allMemberships[memType]['financial_type_id']);
237 if (!checkboxEvent) {
238 if (allMemberships[memType]['total_amount_numeric'] > 0) {
239 cj('#record_contribution').prop('checked', true);
240 cj('#recordContribution').show();
243 cj('#record_contribution').prop('checked', false);
244 cj('#recordContribution').hide();
248 var term = cj("#num_terms").val();
250 var renewTotal = allMemberships[memType]['total_amount_numeric'] * term;
251 cj("#total_amount").val(CRM.formatMoney(renewTotal, true));
254 cj("#total_amount").val(allMemberships[memType]['total_amount']);
257 cj('.totaltaxAmount').html(allMemberships[memType]['tax_message']);
260 // show/hide different contact section
261 setDifferentContactBlock();
262 cj('#is_different_contribution_contact').change(function () {
263 setDifferentContactBlock();
266 function setDifferentContactBlock() {
268 if (cj('#is_different_contribution_contact').prop('checked')) {
269 cj('#record-different-contact').show();
272 cj('#record-different-contact').hide();