2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.6 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2015 |
6 +--------------------------------------------------------------------+
7 | This file is a part of CiviCRM. |
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. |
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. |
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 +--------------------------------------------------------------------+
26 {* this template is used for renewing memberships for a contact *}
28 {include file="CRM/Custom/Form/CustomData.tpl"}
30 {if $membershipMode == 'test' }
31 {assign var=registerMode value="TEST"}
32 {elseif $membershipMode == 'live'}
33 {assign var=registerMode value="LIVE"}
36 <div class="messages status no-popup">
37 <div class="icon inform-icon"></div>
38 <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>
43 {ts 1=$displayName 2=$registerMode}Use this form to Renew Membership Record on behalf of %1.
44 <strong>A %2 transaction will be submitted</strong>
45 using the selected payment processor.{/ts}
50 <div class="messages status no-popup">
51 <div class="icon inform-icon"></div>
52 <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.
53 <a href="%1">Click here</a>
54 if you want to cancel the automatic renewal option.{/ts}</p>
58 <div class="crm-block crm-form-block crm-member-membershiprenew-form-block">
59 <div id="help" class="description">
60 {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}
62 <div>{include file="CRM/common/formButtons.tpl" location="top"}</div>
63 <table class="form-layout">
64 <tr class="crm-member-membershiprenew-form-block-payment_processor_id">
65 <td class="label">{$form.payment_processor_id.label}</td>
66 <td class="html-adjust">{$form.payment_processor_id.html}</td>
68 <tr class="crm-member-membershiprenew-form-block-org_name">
69 <td class="label">{ts}Membership Organization and Type{/ts}</td>
70 <td class="html-adjust">{$orgName} - {$memType}
71 {if $member_is_test} {ts}(test){/ts}{/if}
72 <a id="changeMembershipOrgType" href='#'
73 onclick='adjustMembershipOrgType(); return false;'>{ts}change membership type{/ts}</a>
76 <tr id="membershipOrgType" class="crm-member-membershiprenew-form-block-renew_org_name">
77 <td class="label">{$form.membership_type_id.label}</td>
78 <td>{$form.membership_type_id.html}
79 {if $member_is_test} {ts}(test){/ts}{/if}<br/>
80 <span class="description">{ts}Select Membership Organization and then Membership Type.{/ts}</span>
83 <tr class="crm-member-membershiprenew-form-block-membership_status">
84 <td class="label">{ts}Membership Status{/ts}</td>
85 <td class="html-adjust"> {$membershipStatus}<br/>
86 <span class="description">{ts}Status of this membership.{/ts}</span></td>
88 <tr class="crm-member-membershiprenew-form-block-end_date">
89 <td class="label">{ts}Membership End Date{/ts}</td>
90 <td class="html-adjust"> {$endDate}</td>
92 <tr class="crm-member-membershiprenew-form-block-renewal_date">
93 <td class="label">{$form.renewal_date.label}</td>
94 <td>{include file="CRM/common/jcalendar.tpl" elementName=renewal_date}</td>
97 {if !empty($form.auto_renew)}
98 <tr id="autoRenew" class="crm-membership-form-block-auto_renew">
99 <td class="label"> {$form.auto_renew.label} {help id="id-auto_renew" file="CRM/Member/Form/Membership.hlp" action=$action} </td>
100 <td> {$form.auto_renew.html} </td>
103 <tr class="crm-member-membershiprenew-form-block-financial_type_id">
104 <td class="label">{$form.financial_type_id.label}</td>
105 <td>{$form.financial_type_id.html}<br/>
106 <span class="description">{ts}Select the appropriate financial type for this payment.{/ts}</span></td>
109 {if $accessContribution and ! $membershipMode}
110 <tr class="crm-member-membershiprenew-form-block-record_contribution">
111 <td class="label">{$form.record_contribution.label}</td>
112 <td class="html-adjust">{$form.record_contribution.html}<br/>
114 class="description">{ts}Check this box to enter payment information. You will also be able to generate a customized receipt.{/ts}</span>
117 <tr id="recordContribution" class="crm-member-membershiprenew-form-block-membership_renewal">
120 <legend>{ts}Renewal Payment and Receipt{/ts}</legend>
121 <table class="form-layout-compressed">
122 <tr id="defaultNumTerms" class="crm-member-membershiprenew-form-block-default-num_terms">
123 <td colspan="2" class="description">
124 {ts}Renewal extends membership end date by one membership period{/ts}
125 <a id="changeTermsLink" href='#'
126 onclick='changeNumTerms(); return false;'>{ts}change{/ts}</a>
129 <tr id="changeNumTerms" class="crm-member-membershiprenew-form-block-change-num_terms">
130 <td class="label">{$form.num_terms.label}</td>
131 <td>{$form.num_terms.html|crmAddClass:two} {ts}membership periods{/ts}<br/>
133 class="description">{ts}Extend the membership end date by this many membership periods. Make sure the appropriate corresponding fee is entered below.{/ts}</span>
136 {if $context neq 'standalone'}
137 <tr class="crm-membership-form-block-contribution-contact">
138 <td class="label">{$form.contribution_contact.label}</td>
139 <td>{$form.contribution_contact.html} {help id="id-contribution_contact"}</td>
141 <tr id="record-different-contact">
144 <table class="compressed">
145 <tr class="crm-membership-form-block-soft-credit-type">
146 <td class="label">{$form.soft_credit_type_id.label}</td>
147 <td>{$form.soft_credit_type_id.html}</td>
149 <tr class="crm-membership-form-block-soft-credit-contact-id">
150 <td class="label">{$form.soft_credit_contact_id.label}</td>
151 <td>{$form.soft_credit_contact_id.html}</td>
157 <tr class="crm-member-membershiprenew-form-block-financial_type_id">
158 <td class="label">{$form.financial_type_id.label}</td>
159 <td>{$form.financial_type_id.html}<br/>
160 <span class="description">{ts}Select the appropriate financial type for this payment.{/ts}</span>
163 <tr class="crm-member-membershiprenew-form-block-total_amount">
164 <td class="label">{$form.total_amount.label}</td>
165 <td>{$form.total_amount.html}<br/>
167 class="description">{ts}Membership payment amount. A contribution record will be created for this amount.{/ts}</span>
170 <tr class="crm-membershiprenew-form-block-receive_date">
171 <td class="label">{$form.receive_date.label}</td>
172 <td>{include file="CRM/common/jcalendar.tpl" elementName=receive_date}</td>
174 <tr class="crm-member-membershiprenew-form-block-payment_instrument_id">
175 <td class="label">{$form.payment_instrument_id.label}<span class='marker'>*</span></td>
176 <td>{$form.payment_instrument_id.html} {help id="payment_instrument_id" file="CRM/Contribute/Page/Tab.hlp"}</td>
178 <tr id="checkNumber" class="crm-member-membershiprenew-form-block-check_number">
179 <td class="label">{$form.check_number.label}</td>
180 <td>{$form.check_number.html|crmAddClass:six}</td>
182 <tr class="crm-member-membershiprenew-form-block-trxn_id">
183 <td class="label">{$form.trxn_id.label}</td>
184 <td>{$form.trxn_id.html}</td>
186 <tr class="crm-member-membershiprenew-form-block-contribution_status_id">
187 <td class="label">{$form.contribution_status_id.label}</td>
188 <td>{$form.contribution_status_id.html}</td>
195 <tr class="crm-member-membershiprenew-form-block-total_amount">
196 <td class="label">{$form.total_amount.label}</td>
197 <td>{$form.total_amount.html}<br/>
199 class="description">{ts}Membership payment amount. A contribution record will be created for this amount.{/ts}</span>
205 {if $context neq 'standalone'}
206 <table class="form-layout-compressed">
207 <tr class="crm-membership-form-block-contribution-contact">
208 <td class="label">{$form.contribution_contact.label}</td>
209 <td>{$form.contribution_contact.html} {help id="id-contribution_contact"}</td>
211 <tr id="record-different-contact">
214 <table class="form-layout-compressed">
215 <tr class="crm-membership-form-block-soft-credit-type">
216 <td class="label">{$form.soft_credit_type_id.label}</td>
217 <td>{$form.soft_credit_type_id.html}</td>
219 <tr class="crm-membership-form-soft-credit-contact-id">
220 <td class="label">{$form.soft_credit_contact_id.label}</td>
221 <td>{$form.soft_credit_contact_id.html}</td>
228 <div class="spacer"></div>
229 {include file='CRM/Core/BillingBlock.tpl'}
231 {if $email and $outBound_option != 2}
232 <table class="form-layout">
233 <tr class="crm-member-membershiprenew-form-block-send_receipt">
234 <td class="label">{$form.send_receipt.label}</td>
235 <td>{$form.send_receipt.html}<br/>
237 class="description">{ts 1=$email}Automatically email a membership confirmation and receipt to %1?{/ts}</span>
241 <td class="label">{$form.from_email_address.label}</td>
242 <td>{$form.from_email_address.html}</td>
244 <tr id="notice" class="crm-member-membershiprenew-form-block-receipt_text_renewal">
245 <td class="label">{$form.receipt_text_renewal.label}</td>
247 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/>
248 {$form.receipt_text_renewal.html|crmAddClass:huge}</td>
253 <div id="customData"></div>
254 {*include custom data js file*}
255 {include file="CRM/common/customData.tpl"}
257 <div>{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
259 <div class="spacer"></div>
261 {if $accessContribution and ! $membershipMode}
262 {include file="CRM/common/showHideByFieldValue.tpl"
263 trigger_field_id ="record_contribution"
265 target_element_id ="recordContribution"
266 target_element_type ="table-row"
272 {if $email and $outBound_option != 2}
273 {include file="CRM/common/showHideByFieldValue.tpl"
274 trigger_field_id ="send_receipt"
276 target_element_id ="notice"
277 target_element_type ="table-row"
281 {include file="CRM/common/showHideByFieldValue.tpl"
282 trigger_field_id ="send_receipt"
284 target_element_id ="fromEmail"
285 target_element_type ="table-row"
291 {if !$membershipMode}
292 {include file="CRM/common/showHideByFieldValue.tpl"
293 trigger_field_id ="payment_instrument_id"
295 target_element_id ="checkNumber"
296 target_element_type ="table-row"
300 {include file="CRM/common/showHideByFieldValue.tpl"
301 trigger_field_id ="send_receipt"
303 target_element_id ="fromEmail"
304 target_element_type ="table-row"
310 <script type="text/javascript">
312 $('#membershipOrgType').hide();
313 $('#changeNumTerms').hide();
315 CRM.buildCustomData('{$customDataType}');
316 {if $customDataSubType}
317 CRM.buildCustomData('{$customDataType}', {$customDataSubType});
322 function checkPayment() {
323 showHideByValue('record_contribution', '', 'recordContribution', 'table-row', 'radio', false);
324 {/literal}{if $email and $outBound_option != 2}{literal}
325 var record_contribution = document.getElementsByName('record_contribution');
326 if (record_contribution[0].checked) {
327 document.getElementsByName('send_receipt')[0].checked = true;
328 cj('#fromEmail').show();
331 document.getElementsByName('send_receipt')[0].checked = false;
333 showHideByValue('send_receipt', '', 'notice', 'table-row', 'radio', false);
334 {/literal}{/if}{literal}
337 function adjustMembershipOrgType() {
338 cj('#membershipOrgType').show();
339 cj('#changeMembershipOrgType').hide();
342 function changeNumTerms() {
343 cj('#changeNumTerms').show();
344 cj('#defaultNumTerms').hide();
348 cj('#record_contribution').click(function () {
349 if (cj(this).prop('checked')) {
350 cj('#recordContribution').show();
351 setPaymentBlock(true);
354 cj('#recordContribution').hide();
358 cj('#membership_type_id_1').change(function () {
364 function setPaymentBlock(checkboxEvent) {
365 var memType = cj('#membership_type_id_1').val();
371 var allMemberships = {/literal}{$allMembershipInfo}{literal};
372 var mode = {/literal}'{$membershipMode}'{literal};
375 // skip this for test and live modes because contribution type is set automatically
376 cj("#financial_type_id").val(allMemberships[memType]['financial_type_id']);
379 if (!checkboxEvent) {
380 if (allMemberships[memType]['total_amount_numeric'] > 0) {
381 cj('#record_contribution').prop('checked', true);
382 cj('#recordContribution').show();
385 cj('#record_contribution').prop('checked', false);
386 cj('#recordContribution').hide();
390 var term = cj("#num_terms").val();
392 var renewTotal = allMemberships[memType]['total_amount_numeric'] * term;
393 cj("#total_amount").val(CRM.formatMoney(renewTotal, true));
396 cj("#total_amount").val(allMemberships[memType]['total_amount']);
400 // show/hide different contact section
401 setDifferentContactBlock();
402 cj('#contribution_contact').change(function () {
403 setDifferentContactBlock();
406 function setDifferentContactBlock() {
408 if (cj('#contribution_contact').prop('checked')) {
409 cj('#record-different-contact').show();
412 cj('#record-different-contact').hide();
417 {/if}{* closing of custom data if *}