Merge remote-tracking branch 'upstream/4.5' into 4.5-master-2015-02-09-11-44-07
[civicrm-core.git] / templates / CRM / Member / Form / MembershipType.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.6 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2014 |
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 {* this template is used for adding/editing/deleting membership type *}
27 <div class="crm-block crm-form-block crm-membership-type-form-block">
28
29 <div class="form-item" id="membership_type_form">
30 {if $action eq 8}
31 <div class="messages status no-popup">
32 {ts}WARNING: Deleting this option will result in the loss of all membership records of this type.{/ts} {ts}This may mean the loss of a substantial amount of data, and the action cannot be undone.{/ts} {ts}Do you want to continue?{/ts}
33 </div>
34 <div> {include file="CRM/common/formButtons.tpl"}</div>
35 {else}
36 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
37 <table class="form-layout-compressed">
38 <tr class="crm-membership-type-form-block-name">
39 <td class="label">{$form.name.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_membership_type' field='name' id=$membershipTypeId}{/if}
40 </td>
41 <td>{$form.name.html}<br />
42 <span class="description">{ts}e.g. 'Student', 'Senior', 'Honor Society'...{/ts}</span>
43 </td>
44 </tr>
45 <tr class="crm-membership-type-form-block-description">
46 <td class="label">{$form.description.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_membership_type' field='description' id=$membershipTypeId}{/if}
47 </td>
48 <td>{$form.description.html}<br />
49 <span class="description">{ts}Description of this membership type for internal use. May include eligibility, benefits, terms, etc.{/ts}</span>
50 </td>
51 </tr>
52
53 <tr class="crm-membership-type-form-block-member_org">
54 <td class="label">{$form.member_of_contact_id.label}</td>
55 <td>{$form.member_of_contact_id.html}<br />
56 <span class="description">{ts}Members assigned this membership type belong to which organization (e.g. this is for membership in 'Save the Whales - Northwest Chapter'). NOTE: This organization/group/chapter must exist as a CiviCRM Organization type contact.{/ts}</span>
57 </td>
58 </tr>
59
60 <tr class="crm-membership-type-form-block-minimum_fee">
61 <td class="label">{$form.minimum_fee.label}</td>
62 <td>{$form.minimum_fee.html|crmMoney}<br />
63 <span class="description">{ts}Minimum fee required for this membership type. For free/complimentary memberships - set minimum fee to zero (0). NOTE: When using CiviCRM to process sales taxes this should be the tax exclusive amount.{/ts}</span>
64 </td>
65 </tr>
66 <tr class="crm-membership-type-form-block-financial_type_id">
67 <td class="label">{$form.financial_type_id.label}</td>
68 <td>{$form.financial_type_id.html}<br />
69 <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>
70 </td>
71 </tr>
72 <tr class="crm-membership-type-form-block-auto_renew">
73 <td class="label">{$form.auto_renew.label}</td>
74 {if $authorize}
75 <td>{$form.auto_renew.html}</td>
76 {else}
77 <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>
78 {/if}
79 </tr>
80 <tr class="crm-membership-type-form-block-duration_unit_interval">
81 <td class="label">{$form.duration_unit.label}</td>
82 <td>{$form.duration_interval.html}&nbsp;&nbsp;{$form.duration_unit.html}<br />
83 <span class="description">{ts}Duration of this membership (e.g. 30 days, 2 months, 5 years, 1 lifetime){/ts}</span>
84 </td>
85 </tr>
86 <tr class="crm-membership-type-form-block-period_type">
87 <td class="label">{$form.period_type.label}</td>
88 <td>{$form.period_type.html}<br />
89 <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>
90 </td>
91 </tr>
92 <tr id="fixed_start_day_row" class="crm-membership-type-form-block-fixed_period_start_day">
93 <td class="label">{$form.fixed_period_start_day.label}</td>
94 <td>{$form.fixed_period_start_day.html}<br />
95 <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>
96 </td>
97 </tr>
98 <tr id="fixed_rollover_day_row" class="crm-membership-type-form-block-fixed_period_rollover_day">
99 <td class="label">{$form.fixed_period_rollover_day.label}</td>
100 <td>{$form.fixed_period_rollover_day.html}<br />
101 <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>
102 </td>
103 </tr>
104 <tr id="month_fixed_rollover_day_row" class="crm-membership-type-form-block-fixed_period_rollover_day">
105 <td class="label">{$form.month_fixed_period_rollover_day.label}</td>
106 <td>{$form.month_fixed_period_rollover_day.html}<br />
107 <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>
108 </td>
109 </tr>
110 <tr class="crm-membership-type-form-block-relationship_type_id">
111 <td class="label">{$form.relationship_type_id.label}</td>
112 <td>
113 {if !$membershipRecordsExists}
114 {$form.relationship_type_id.html}
115 <br />
116 {else}
117 {$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>
118 {/if}
119 <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>
120 </td>
121 </tr>
122 <tr id="maxRelated" class="crm-membership-type-form-block-max_related">
123 <td class="label">{$form.max_related.label}</td>
124 <td>{$form.max_related.html}<br />
125 <span class="description">{ts}Maximum number of related memberships (leave blank for unlimited).{/ts}</span>
126 </td>
127 </tr>
128 <tr class="crm-membership-type-form-block-visibility">
129 <td class="label">{$form.visibility.label}</td>
130 <td>{$form.visibility.html}<br />
131 <span class="description">{ts}Is this membership type available for self-service signups ('Public') or assigned by CiviCRM 'staff' users only ('Admin'){/ts}</span>
132 </td>
133 </tr>
134 <tr class="crm-membership-type-form-block-weight">
135 <td class="label">{$form.weight.label}</td>
136 <td>{$form.weight.html}</td>
137 </tr>
138 <tr class="crm-membership-type-form-block-is_active">
139 <td class="label">{$form.is_active.label}</td>
140 <td>{$form.is_active.html}</td>
141 </tr>
142 </table>
143 <div class="spacer"></div>
144
145 <fieldset><legend>{ts}Renewal Reminders{/ts}</legend>
146 <div class="help">
147 {capture assign=reminderLink}{crmURL p='civicrm/admin/scheduleReminders' q='reset=1'}{/capture}
148 <div class="icon inform-icon"></div>&nbsp;
149 {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"}
150 </div>
151 </fieldset>
152
153 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
154 {/if}
155 <div class="spacer"></div>
156 </div>
157 </div>
158
159 {literal}
160 <script type="text/javascript">
161 CRM.$(function($) {
162 showHidePeriodSettings();
163 $('#duration_unit').change(function(){
164 showHidePeriodSettings();
165 });
166
167 $('#period_type').change(function(){
168 showHidePeriodSettings();
169 });
170
171 {/literal}
172 {if $action eq 2}
173 {literal}
174 showHideMaxRelated($('#relationship_type_id').val());
175 $('#relationship_type_id').change(function(){
176 showHideMaxRelated($('#relationship_type_id').val());
177 });
178 {/literal}{else}{literal}
179 showHideMaxRelated($('#relationship_type_id :selected').val());
180 $('#relationship_type_id').change(function(){
181 showHideMaxRelated($('#relationship_type_id :selected').val());
182 });
183 {/literal}{/if}{literal}
184 });
185
186 function showHidePeriodSettings() {
187 if ((cj("#period_type :selected").val() == "fixed") &&
188 (cj("#duration_unit :selected").val() == "year")) {
189 cj('#fixed_start_day_row, #fixed_rollover_day_row').show();
190 cj('#month_fixed_rollover_day_row').hide();
191 if (!cj("#fixed_period_start_day_M, #fixed_period_start_day_d").val()) {
192 cj("#fixed_period_start_day_M, #fixed_period_start_day_d").val("1");
193 }
194 if (!cj("#fixed_period_rollover_day_M").val()) {
195 cj("#fixed_period_rollover_day_M").val("12");
196 }
197 if (!cj("#fixed_period_rollover_day_d").val()) {
198 cj("#fixed_period_rollover_day_d").val("31");
199 }
200 cj("#month_fixed_rollover_day_row").val("");
201 }
202 else if ((cj("#period_type :selected").val() == "fixed" ) &&
203 (cj("#duration_unit :selected").val() == "month" )) {
204 cj('#month_fixed_rollover_day_row').show();
205 cj('#fixed_start_day_row, #fixed_rollover_day_row').hide();
206 cj("#fixed_period_start_day_M, #fixed_period_start_day_d").val("");
207 cj("#fixed_period_rollover_day_M, #fixed_period_rollover_day_d").val("");
208 }
209 else {
210 cj('#fixed_start_day_row, #fixed_rollover_day_row, #month_fixed_rollover_day_row').hide();
211 cj("#fixed_period_start_day_M, #fixed_period_start_day_d").val("");
212 cj("#fixed_period_rollover_day_M, #fixed_period_rollover_day_d").val("");
213 cj("#month_fixed_rollover_day_row").val("");
214 }
215 }
216
217 //load the auto renew msg if recur allow.
218 {/literal}{if $authorize and $allowAutoRenewMsg}{literal}
219 CRM.$(function($) {
220 setReminder( null );
221 });
222 {/literal}{/if}{literal}
223
224 function setReminder( autoRenewOpt ) {
225 //don't process.
226 var allowToProcess = {/literal}'{$allowAutoRenewMsg}'{literal};
227 if ( !allowToProcess ) {
228 return;
229 }
230 if ( !autoRenewOpt ) {
231 autoRenewOpt = cj( 'input:radio[name="auto_renew"]:checked').val();
232 }
233 funName = 'hide();';
234 if ( autoRenewOpt == 1 || autoRenewOpt == 2 ) funName = 'show();';
235 eval( "cj('#autoRenewalMsgId')." + funName );
236 }
237
238 function showHideMaxRelated(relTypeId) {
239 if (relTypeId) {
240 cj('#maxRelated').show();
241 }
242 else {
243 cj('#maxRelated').hide();
244 }
245 }
246 </script>
247 {/literal}