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 | {* this template is used for adding/editing/deleting membership type *} | |
2147e326 MW |
11 | {if $action eq 8} |
12 | {include file="CRM/Core/Form/EntityForm.tpl"} | |
13 | {else} | |
6a488035 TO |
14 | <div class="crm-block crm-form-block crm-membership-type-form-block"> |
15 | ||
6a488035 | 16 | <div class="form-item" id="membership_type_form"> |
e2046b33 | 17 | <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div> |
6a488035 | 18 | <table class="form-layout-compressed"> |
c41292e8 | 19 | {foreach from=$tpl_standardised_fields item=fieldName} |
20 | {assign var=fieldSpec value=$entityFields.$fieldName} | |
21 | <tr class="crm-{$entityInClassFormat}-form-block-{$fieldName}"> | |
22 | {include file="CRM/Core/Form/Field.tpl"} | |
23 | </tr> | |
24 | {/foreach} | |
6a488035 | 25 | <tr class="crm-membership-type-form-block-financial_type_id"> |
ab5e0c41 | 26 | <td class="label">{$form.financial_type_id.label}</td> |
6a488035 TO |
27 | <td>{$form.financial_type_id.html}<br /> |
28 | <span class="description">{ts}Select the financial type assigned to fees for this membership type (for example 'Membership Fees'). This is required for all membership types - including free or complimentary memberships.{/ts}</span> | |
29 | </td> | |
30 | </tr> | |
31 | <tr class="crm-membership-type-form-block-auto_renew"> | |
32 | <td class="label">{$form.auto_renew.label}</td> | |
33 | {if $authorize} | |
34 | <td>{$form.auto_renew.html}</td> | |
35 | {else} | |
36 | <td>{ts}You will need to select and configure a supported payment processor (currently Authorize.Net, PayPal Pro, or PayPal Website Standard) in order to offer automatically renewing memberships.{/ts} {docURL page="user/contributions/payment-processors"}</td> | |
37 | {/if} | |
38 | </tr> | |
39 | <tr class="crm-membership-type-form-block-duration_unit_interval"> | |
ab5e0c41 | 40 | <td class="label">{$form.duration_unit.label}</td> |
6a488035 TO |
41 | <td>{$form.duration_interval.html} {$form.duration_unit.html}<br /> |
42 | <span class="description">{ts}Duration of this membership (e.g. 30 days, 2 months, 5 years, 1 lifetime){/ts}</span> | |
43 | </td> | |
44 | </tr> | |
45 | <tr class="crm-membership-type-form-block-period_type"> | |
ab5e0c41 | 46 | <td class="label">{$form.period_type.label}</td> |
6a488035 TO |
47 | <td>{$form.period_type.html}<br /> |
48 | <span class="description">{ts}Select 'rolling' if membership periods begin at date of signup. Select 'fixed' if membership periods begin on a set calendar date.{/ts} {help id="period-type" file="CRM/Member/Page/MembershipType.hlp"}</span> | |
49 | </td> | |
50 | </tr> | |
51 | <tr id="fixed_start_day_row" class="crm-membership-type-form-block-fixed_period_start_day"> | |
52 | <td class="label">{$form.fixed_period_start_day.label}</td> | |
53 | <td>{$form.fixed_period_start_day.html}<br /> | |
54 | <span class="description">{ts}Month and day on which a <strong>fixed</strong> period membership or subscription begins. Example: A fixed period membership with Start Day set to Jan 01 means that membership periods would be 1/1/06 - 12/31/06 for anyone signing up during 2006.{/ts}</span> | |
55 | </td> | |
56 | </tr> | |
57 | <tr id="fixed_rollover_day_row" class="crm-membership-type-form-block-fixed_period_rollover_day"> | |
58 | <td class="label">{$form.fixed_period_rollover_day.label}</td> | |
59 | <td>{$form.fixed_period_rollover_day.html}<br /> | |
97f6063c | 60 | <span class="description">{ts}Membership signups on or after this date cover the following calendar year as well. Example: If the rollover day is November 30, membership period for signups during December will cover the following year.{/ts}</span> |
6a488035 TO |
61 | </td> |
62 | </tr> | |
63 | <tr id="month_fixed_rollover_day_row" class="crm-membership-type-form-block-fixed_period_rollover_day"> | |
64 | <td class="label">{$form.month_fixed_period_rollover_day.label}</td> | |
65 | <td>{$form.month_fixed_period_rollover_day.html}<br /> | |
66 | <span class="description">{ts}Membership signups on or after this day of the month cover the rest of the month plus the specified number of months.{/ts}</span> | |
67 | </td> | |
68 | </tr> | |
69 | <tr class="crm-membership-type-form-block-relationship_type_id"> | |
70 | <td class="label">{$form.relationship_type_id.label}</td> | |
71 | <td> | |
72 | {if !$membershipRecordsExists} | |
73 | {$form.relationship_type_id.html} | |
74 | <br /> | |
75 | {else} | |
76 | {$form.relationship_type_id.html}<div class="status message">{ts}You cannot modify relationship type because there are membership records associated with this membership type.{/ts}</div> | |
77 | {/if} | |
78 | <span class="description">{ts}Memberships can be automatically granted to related contacts by selecting a Relationship Type.{/ts} {help id="rel-type" file="CRM/Member/Page/MembershipType.hlp"}</span> | |
79 | </td> | |
80 | </tr> | |
81 | <tr id="maxRelated" class="crm-membership-type-form-block-max_related"> | |
82 | <td class="label">{$form.max_related.label}</td> | |
83 | <td>{$form.max_related.html}<br /> | |
84 | <span class="description">{ts}Maximum number of related memberships (leave blank for unlimited).{/ts}</span> | |
85 | </td> | |
86 | </tr> | |
87 | <tr class="crm-membership-type-form-block-visibility"> | |
88 | <td class="label">{$form.visibility.label}</td> | |
89 | <td>{$form.visibility.html}<br /> | |
5afcf706 | 90 | <span class="description">{ts}Can this membership type be used for self-service signups ('Public'), or is it only for CiviCRM users with 'Edit Contributions' permission ('Admin').{/ts}</span> |
6a488035 TO |
91 | </td> |
92 | </tr> | |
93 | <tr class="crm-membership-type-form-block-weight"> | |
94 | <td class="label">{$form.weight.label}</td> | |
95 | <td>{$form.weight.html}</td> | |
96 | </tr> | |
97 | <tr class="crm-membership-type-form-block-is_active"> | |
98 | <td class="label">{$form.is_active.label}</td> | |
99 | <td>{$form.is_active.html}</td> | |
100 | </tr> | |
101 | </table> | |
102 | <div class="spacer"></div> | |
103 | ||
104 | <fieldset><legend>{ts}Renewal Reminders{/ts}</legend> | |
105 | <div class="help"> | |
106 | {capture assign=reminderLink}{crmURL p='civicrm/admin/scheduleReminders' q='reset=1'}{/capture} | |
34d6cec4 | 107 | {icon icon="fa-info-circle"}{/icon} |
6a488035 TO |
108 | {ts 1=$reminderLink}Configure membership renewal reminders using <a href="%1">Schedule Reminders</a>. If you have previously configured renewal reminder templates, you can re-use them with your new scheduled reminders.{/ts} {docURL page="user/email/scheduled-reminders"} |
109 | </div> | |
110 | </fieldset> | |
111 | ||
92fe4140 MWMC |
112 | {include file="CRM/common/customDataBlock.tpl"} |
113 | ||
6a488035 TO |
114 | <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div> |
115 | {/if} | |
116 | <div class="spacer"></div> | |
117 | </div> | |
118 | </div> | |
119 | ||
cebff547 | 120 | {include file="CRM/common/deferredFinancialType.tpl" context='MembershipType'} |
6a488035 TO |
121 | {literal} |
122 | <script type="text/javascript"> | |
3cc60a06 | 123 | CRM.$(function($) { |
6a488035 | 124 | showHidePeriodSettings(); |
ae8f569f | 125 | $('#duration_unit').change(function(){ |
6a488035 TO |
126 | showHidePeriodSettings(); |
127 | }); | |
128 | ||
ae8f569f | 129 | $('#period_type').change(function(){ |
6a488035 TO |
130 | showHidePeriodSettings(); |
131 | }); | |
132 | ||
77d6c935 | 133 | {/literal} |
34408315 E |
134 | {if $action eq 2} |
135 | {literal} | |
ae8f569f CW |
136 | showHideMaxRelated($('#relationship_type_id').val()); |
137 | $('#relationship_type_id').change(function(){ | |
138 | showHideMaxRelated($('#relationship_type_id').val()); | |
34408315 E |
139 | }); |
140 | {/literal}{else}{literal} | |
ae8f569f CW |
141 | showHideMaxRelated($('#relationship_type_id :selected').val()); |
142 | $('#relationship_type_id').change(function(){ | |
143 | showHideMaxRelated($('#relationship_type_id :selected').val()); | |
34408315 E |
144 | }); |
145 | {/literal}{/if}{literal} | |
6a488035 TO |
146 | }); |
147 | ||
148 | function showHidePeriodSettings() { | |
149 | if ((cj("#period_type :selected").val() == "fixed") && | |
150 | (cj("#duration_unit :selected").val() == "year")) { | |
151 | cj('#fixed_start_day_row, #fixed_rollover_day_row').show(); | |
152 | cj('#month_fixed_rollover_day_row').hide(); | |
13d83702 | 153 | if (!cj("#fixed_period_start_day_M, #fixed_period_start_day_d").val()) { |
154 | cj("#fixed_period_start_day_M, #fixed_period_start_day_d").val("1"); | |
155 | } | |
156 | if (!cj("#fixed_period_rollover_day_M").val()) { | |
157 | cj("#fixed_period_rollover_day_M").val("12"); | |
158 | } | |
159 | if (!cj("#fixed_period_rollover_day_d").val()) { | |
160 | cj("#fixed_period_rollover_day_d").val("31"); | |
34408315 | 161 | } |
6a488035 TO |
162 | cj("#month_fixed_rollover_day_row").val(""); |
163 | } | |
164 | else if ((cj("#period_type :selected").val() == "fixed" ) && | |
165 | (cj("#duration_unit :selected").val() == "month" )) { | |
166 | cj('#month_fixed_rollover_day_row').show(); | |
167 | cj('#fixed_start_day_row, #fixed_rollover_day_row').hide(); | |
168 | cj("#fixed_period_start_day_M, #fixed_period_start_day_d").val(""); | |
169 | cj("#fixed_period_rollover_day_M, #fixed_period_rollover_day_d").val(""); | |
170 | } | |
171 | else { | |
172 | cj('#fixed_start_day_row, #fixed_rollover_day_row, #month_fixed_rollover_day_row').hide(); | |
173 | cj("#fixed_period_start_day_M, #fixed_period_start_day_d").val(""); | |
174 | cj("#fixed_period_rollover_day_M, #fixed_period_rollover_day_d").val(""); | |
175 | cj("#month_fixed_rollover_day_row").val(""); | |
176 | } | |
177 | } | |
178 | ||
179 | //load the auto renew msg if recur allow. | |
180 | {/literal}{if $authorize and $allowAutoRenewMsg}{literal} | |
3cc60a06 | 181 | CRM.$(function($) { |
6a488035 TO |
182 | setReminder( null ); |
183 | }); | |
184 | {/literal}{/if}{literal} | |
185 | ||
186 | function setReminder( autoRenewOpt ) { | |
187 | //don't process. | |
188 | var allowToProcess = {/literal}'{$allowAutoRenewMsg}'{literal}; | |
189 | if ( !allowToProcess ) { | |
190 | return; | |
191 | } | |
192 | if ( !autoRenewOpt ) { | |
193 | autoRenewOpt = cj( 'input:radio[name="auto_renew"]:checked').val(); | |
194 | } | |
195 | funName = 'hide();'; | |
196 | if ( autoRenewOpt == 1 || autoRenewOpt == 2 ) funName = 'show();'; | |
197 | eval( "cj('#autoRenewalMsgId')." + funName ); | |
198 | } | |
199 | ||
200 | function showHideMaxRelated(relTypeId) { | |
201 | if (relTypeId) { | |
202 | cj('#maxRelated').show(); | |
203 | } | |
204 | else { | |
205 | cj('#maxRelated').hide(); | |
206 | } | |
207 | } | |
208 | </script> | |
209 | {/literal} |