2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.7 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2017 |
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 adding event *}
27 {capture assign="adminPriceSets"}{crmURL p='civicrm/admin/price' q="reset=1"}{/capture}
28 {if !$paymentProcessor}
29 {capture assign=ppUrl}{crmURL p='civicrm/admin/paymentProcessor' q="reset=1"}{/capture}
30 <div class="status message">
31 {ts 1=$ppUrl}No Payment Processor has been configured / enabled for your site. If this is a <strong>paid event</strong> AND you want users to be able to <strong>register and pay online</strong>, you will need to <a href='%1'>configure a Payment Processor</a> first. Then return to this screen and assign the processor to this event.{/ts} {docURL page="user/contributions/payment-processors"}
32 <p>{ts}NOTE: Alternatively, you can enable the <strong>Pay Later</strong> option below without setting up a payment processor. All users will then be asked to submit payment offline (e.g. mail in a check, call in a credit card, etc.).{/ts}</p>
35 <div class="crm-block crm-form-block crm-event-manage-fee-form-block">
36 <div class="crm-submit-buttons">
37 {include file="CRM/common/formButtons.tpl" location="top"}
40 <table class="form-layout">
41 <tr class="crm-event-manage-fee-form-block-title">
42 <td class="label">{$form.title.label}</td>
43 <td>{$form.title.html}</td>
45 <tr class="crm-event-manage-fee-form-block-is_monetary">
46 <td class="label">{$form.is_monetary.label}</td>
47 <td>{$form.is_monetary.html}</td>
52 <table id="currency" class="form-layout">
53 <tr class='crm-event-manage-fee-form-block-currency'>
54 <td class="label">{$form.currency.label}</td>
55 <td>{$form.currency.html}<br />
56 <span class="description">{ts}Select the currency to be used for event registration.{/ts}</span>
60 {if $paymentProcessor}
61 <table id="paymentProcessor" class="form-layout">
62 <tr class="crm-event-manage-fee-form-block-payment_processor">
63 <td class="label">{$form.payment_processor.label}</td>
64 <td>{$form.payment_processor.html}</td>
67 <td class=""> </td>
68 <td class="description">
69 {ts}If this is a paid event and you want users to be able to register and pay online, select a payment processor to use.{/ts}
70 {ts}NOTE: Alternatively, you can enable the <strong>Pay Later</strong> feature below without setting up a payment processor. All users will then be asked to submit payment offline (e.g. mail in a check, call in a credit card, etc.).{/ts} {docURL page="user/contributions/payment-processors"}<td>
75 <table id="payLater" class="form-layout">
76 <tr class="crm-event-manage-fee-form-block-is_pay_later">
77 <td class="extra-long-fourty label">{$form.is_pay_later.html}</td>
78 <td>{$form.is_pay_later.label}<br />
79 <span class="description">{ts}Check this box if you want to give users the option to submit payment offline (e.g. mail in a check, call in a credit card, etc.).{/ts}</span>
84 <table id="payLaterOptions" class="form-layout">
85 <tr class="crm-event-manage-fee-form-block-pay_later_text">
86 <td class="label">{$form.pay_later_text.label}<span class="crm-marker"> *</span> </td>
87 <td>{if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='pay_later_text' id=$id}{/if}{$form.pay_later_text.html|crmAddClass:big}
92 <td class="description">{ts}Text displayed next to the checkbox for the 'pay later' option on the contribution form. You may include HTML formatting tags.{/ts}</td>
94 <tr class="crm-event-manage-fee-form-block-pay_later_receipt">
95 <td class="label">{$form.pay_later_receipt.label}<span class="crm-marker"> *</span> </td>
96 <td>{if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='pay_later_receipt' id=$id}{/if}{$form.pay_later_receipt.html|crmAddClass:big}
101 <td class="description">{ts}Instructions added to Confirmation and Thank-you pages when the user selects the 'pay later' option (e.g. 'Mail your check to ... within 3 business days.').{/ts}
105 <td class="extra-long-fourty label">{$form.is_billing_required.html}</td>
107 {$form.is_billing_required.label}<br />
108 <span class="description">{ts}Check this box to require users who select the pay later option to provide billing name and address.{/ts}</span>
113 <table id="contributionType" class="form-layout">
114 <tr class="crm-event-manage-fee-form-block-fee_label">
115 <td class="label">{$form.fee_label.label}<span class="crm-marker"> *</span>
117 <td>{if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='fee_label' id=$id}{/if}{$form.fee_label.html}
122 <td class="description">{ts}This label is displayed with the list of event fees. When using a Price Set, this label is the title for the section containing the price fields.{/ts}
125 <tr class="crm-event-manage-fee-form-block-financial_type_id">
126 <td class="label">{$form.financial_type_id.label}<span class="crm-marker"> *</span></td>
127 <td>{$form.financial_type_id.html}</td>
131 <td class="description">{ts}This financial type will be assigned to payments made by participants when they register online. If using a price set below note that the contribution record will have this financial type, however line items will be processed using the actual financial type selected for the price set item.{/ts}
136 <table id="priceSet" class="form-layout">
137 <tr class="crm-event-manage-fee-form-block-price_set_id">
138 <td class="label">{$form.price_set_id.label}</td>
139 <td>{if $price eq false}
140 <div class="status message">{ts 1=$adminPriceSets}No Price Set has been configured / enabled for your site. Price sets allow you to meet the complex demands of your event registration structure.(e.g. "Pay $15 more for lunch."). Click <a href='%1'>here</a> if you want to configure price sets for your site.{/ts}</div>
142 {$form.price_set_id.html}
147 <td class="description">{ts 1=$adminPriceSets}Select a pre-configured Price Set to offer multiple individually priced options for event registrants. Otherwise, select "-none-" and enter one or more fee levels in the table below. Create or edit Price Sets <a href='%1'>here</a>.{/ts}
153 <div id="map-field" >
154 <fieldset id="map-field"><legend>{ts}Regular Fees{/ts}</legend>
155 {ts}Use the table below to enter descriptive labels and amounts for up to ten event fee levels. These will be presented as a list of radio button options. Both the label and dollar amount will be displayed. You can also configure one or more sets of discounted fees by checking "Discounts by Signup Date" below.{/ts}<br />
156 {if $isQuick}{ts}Click <a id='quickconfig' href='#'>here</a> if you want to configure the Regular Fees below as part of a Price Set, with the added flexibility and complexity that entails.{/ts}{/if}
157 <table id="map-field-table">
158 <tr class="columnheader"><td scope="column">{ts}Fee Label{/ts}</td><td scope="column">{ts}Amount{/ts}</td><td scope="column">{ts}Default?{/ts}<br />{$form.default.0.html}</td></tr>
159 {section name=loop start=1 loop=11}
160 {assign var=idx value=$smarty.section.loop.index}
161 <tr><td class="even-row crm-event-manage-fee-form-block-label_{$idx}">{$form.label.$idx.html}</td><td class="crm-event-manage-fee-form-block-value_{$idx}">{$form.value.$idx.html|crmMoney}</td><td class="even-row crm-event-manage-fee-form-block-default_{$idx}">{$form.default.$idx.html}</td></tr>
166 <div id="isDiscount">
167 <table class="form-layout">
168 <tr class="crm-event-manage-fee-form-block-is_discount">
169 <td class="extra-long-fourty label">{$form.is_discount.html}</td>
170 <td>{$form.is_discount.label}<br /><span class="description">{ts}Check this box if you want to offer discounted fees based on registration date (e.g. 'early-registration discounts').{/ts}</span>
175 <div class="spacer"></div>
177 <fieldset id="discount">
179 <tr class="columnheader">
181 <td>{ts}Discount Set{/ts}</td>
182 <td>{ts}Start Date{/ts}</td>
183 <td>{ts}End Date{/ts}</td>
186 {section name=rowLoop start=1 loop=6}
187 {assign var=index value=$smarty.section.rowLoop.index}
188 <tr id="discount_{$index}" class=" crm-event-manage-fee-form-block-discount_{$index} {if $index GT 1 AND empty( $form.discount_name[$index].value) } hiddenElement {/if} form-item {cycle values="odd-row,even-row"}">
189 <td>{if $index GT 1} <a onclick="showHideDiscountRow('discount_{$index}', false, {$index}); return false;" name="discount_{$index}" href="#" class="form-link"><img src="{$config->resourceBase}i/TreeMinus.gif" class="action-icon" alt="{ts}hide field or section{/ts}"/></a>{/if}
191 <td class="crm-event-manage-fee-form-block-discount_name"> {$form.discount_name.$index.html}</td>
192 <td class="crm-event-manage-fee-form-block-discount_start_date"> {include file="CRM/common/jcalendar.tpl" elementName='discount_start_date' elementIndex=$index} </td>
193 <td class="crm-event-manage-fee-form-block-discount_end_date"> {include file="CRM/common/jcalendar.tpl" elementName='discount_end_date' elementIndex=$index} </td>
197 <div id="discountLink" class="add-remove-link">
198 <a onclick="showHideDiscountRow( 'discount', true);return false;" id="discountLink" href="#" class="form-link"><img src="{$config->resourceBase}i/TreePlus.gif" class="action-icon" alt="{ts}show field or section{/ts}"/>{ts}another discount set{/ts}</a>
200 {$form._qf_Fee_submit.html}
202 {if $discountSection}
203 <fieldset id="map-field"><legend>{ts}Discounted Fees{/ts}</legend>
204 <p>{ts}Use the table below to enter descriptive labels and amounts for up to ten discounted event fees for each discount set. <strong>Don't forget to click 'Save' when you are finished.</strong>{/ts}</p>
205 <table id="map-field-table">
206 <tr class="columnheader">
207 <td scope="column">{ts}Fee Label{/ts}</td>
208 {section name=dloop start=1 loop=6}
209 {assign var=i value=$smarty.section.dloop.index}
210 {if $form.discount_name.$i.value}
211 <td scope="column">{$form.discount_name.$i.value}</td>
214 <td scope="column">{ts}Default?{/ts}</td>
217 {section name=loop start=1 loop=11}
218 {assign var=idx value=$smarty.section.loop.index}
219 <tr><td class="even-row">{$form.discounted_label.$idx.html}</td>
220 {section name=loop1 start=1 loop=6}
221 {assign var=idy value=$smarty.section.loop1.index}
222 {if $form.discount_name.$idy.value}
223 <td>{$form.discounted_value.$idx.$idy.html|crmMoney}</td>
226 <td class="even-row">{$form.discounted_default.$idx.html}</td>
231 {if $discountSection eq 2}
232 <script type="text/javascript">
235 $('#discounted_label_1').focus( );
245 <div class="crm-submit-buttons">
246 {include file="CRM/common/formButtons.tpl" location="bottom"}
250 {include file="CRM/common/deferredFinancialType.tpl" context='Event'}
251 {include file="CRM/common/showHide.tpl"}
252 <script type="text/javascript">
255 // Re-show Fee Level grid if Price Set select has been set to none.
256 if (cj('#price_set_id').val() == '') {
257 cj('#map-field').show();
263 if ( document.getElementsByName('is_monetary')[0].checked ) {
264 cj('#event-fees').show();
267 function warnDiscountDel( ) {
268 if ( ! document.getElementsByName('is_discount')[0].checked ) {
269 CRM.alert('{/literal}{ts escape="js"}If you uncheck "Discounts by Signup Date" and Save this form, any existing discount sets will be deleted.{/ts} {ts escape="js"}This action cannot be undone.{/ts} {ts escape="js"}If this is NOT what you want to do, you can check "Discounts by Signup Date" again.{/ts}', '{ts escape="js}Warning{/ts}{literal}', 'alert', {expires: 0});
274 * Function used to show /hide discount and set defaults
276 function showHideDiscountRow( rowName, show, index ) {
278 // show first hidden element and set date default
280 cj('tr[id^=' + rowName + ']').each( function( i ) {
282 if ( cj(this).css('display') == 'none' ) {
286 var currentRowId = cj(this).attr('id');
287 var temp = currentRowId.split('_');
288 var currentElementID = temp[1];
289 var lastElementID = currentElementID - 1 ;
291 var lastEndDate = cj( '#discount_end_date_' + lastElementID ).datepicker( 'getDate' );
293 var discountDate = new Date( Date.parse( lastEndDate ) );
294 discountDate.setDate( discountDate.getDate() + 1 );
295 var newDate = discountDate.toDateString();
296 newDate = new Date( Date.parse( newDate ) );
297 cj( '#discount_start_date_' + currentElementID ).datepicker('setDate', newDate );
300 if ( counter == 5 ) {
301 cj('#discountLink').hide( );
307 // hide tr and clear dates
308 cj( '#discount_end_date_' + index ).val('');
309 cj( '#discount_name_' + index ).val('');
310 cj( '#discount_start_date_' + index ).val('');
311 cj( '#' + rowName ).hide( );
312 cj('#discountLink').show( );
320 {include file="CRM/common/showHideByFieldValue.tpl"
321 trigger_field_id ="is_pay_later"
323 target_element_id ="payLaterOptions"
324 target_element_type ="block"
329 {include file="CRM/common/showHideByFieldValue.tpl"
330 trigger_field_id ="price_set_id"
332 target_element_id ="map-field"
333 target_element_type ="block"
338 {include file="CRM/common/showHideByFieldValue.tpl"
339 trigger_field_id ="is_discount"
341 target_element_id ="discount"
342 target_element_type ="block"
349 <script type="text/javascript">
351 $("#quickconfig").click(function(e) {
355 message: {/literal}"{ts escape='js'}Once you switch to using a Price Set, you won't be able to switch back to your existing settings below except by re-entering them. Are you sure you want to switch to a Price Set?{/ts}"{literal}
356 }).on('crmConfirm:yes', function() {
358 var dataUrl = '{crmURL p="civicrm/ajax/rest" h=0 q="className=CRM_Core_Page_AJAX&fnName=setIsQuickConfig&context=civicrm_event&id=$eventId" }';
360 $.getJSON(dataUrl).done(function(result) {window.location = CRM.url("civicrm/admin/price/field", {reset: 1, action: 'browse', sid: result});});