2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.5 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2014 |
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="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="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}
107 <table id="contributionType" class="form-layout">
108 <tr class="crm-event-manage-fee-form-block-fee_label">
109 <td class="label">{$form.fee_label.label}<span class="marker"> *</span>
111 <td>{if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='fee_label' id=$id}{/if}{$form.fee_label.html}
116 <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}
119 <tr class="crm-event-manage-fee-form-block-financial_type_id">
120 <td class="label">{$form.financial_type_id.label}<span class="marker"> *</span></td>
121 <td>{$form.financial_type_id.html}</td>
125 <td class="description">{ts}This financial type will be assigned to payments made by participants when they register online.{/ts}
130 <table id="priceSet" class="form-layout">
131 <tr class="crm-event-manage-fee-form-block-price_set_id">
132 <td class="label">{$form.price_set_id.label}</td>
133 <td>{if $price eq false}
134 <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>
136 {$form.price_set_id.html}
141 <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}
147 <div id="map-field" >
148 <fieldset id="map-field"><legend>{ts}Regular Fees{/ts}</legend>
149 {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 />
150 {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}
151 <table id="map-field-table">
152 <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>
153 {section name=loop start=1 loop=11}
154 {assign var=idx value=$smarty.section.loop.index}
155 <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>
160 <div id="isDiscount">
161 <table class="form-layout">
162 <tr class="crm-event-manage-fee-form-block-is_discount">
163 <td class="extra-long-fourty label">{$form.is_discount.html}</td>
164 <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>
169 <div class="spacer"></div>
171 <fieldset id="discount">
173 <tr class="columnheader">
175 <td>{ts}Discount Set{/ts}</td>
176 <td>{ts}Start Date{/ts}</td>
177 <td>{ts}End Date{/ts}</td>
180 {section name=rowLoop start=1 loop=6}
181 {assign var=index value=$smarty.section.rowLoop.index}
182 <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"}">
183 <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}
185 <td class="crm-event-manage-fee-form-block-discount_name"> {$form.discount_name.$index.html}</td>
186 <td class="crm-event-manage-fee-form-block-discount_start_date"> {include file="CRM/common/jcalendar.tpl" elementName='discount_start_date' elementIndex=$index} </td>
187 <td class="crm-event-manage-fee-form-block-discount_end_date"> {include file="CRM/common/jcalendar.tpl" elementName='discount_end_date' elementIndex=$index} </td>
191 <div id="discountLink" class="add-remove-link">
192 <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>
194 {$form._qf_Fee_submit.html}
196 {if $discountSection}
197 <fieldset id="map-field"><legend>{ts}Discounted Fees{/ts}</legend>
198 <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>
199 <table id="map-field-table">
200 <tr class="columnheader">
201 <td scope="column">{ts}Fee Label{/ts}</td>
202 {section name=dloop start=1 loop=6}
203 {assign var=i value=$smarty.section.dloop.index}
204 {if $form.discount_name.$i.value}
205 <td scope="column">{$form.discount_name.$i.value}</td>
208 <td scope="column">{ts}Default?{/ts}</td>
211 {section name=loop start=1 loop=11}
212 {assign var=idx value=$smarty.section.loop.index}
213 <tr><td class="even-row">{$form.discounted_label.$idx.html}</td>
214 {section name=loop1 start=1 loop=6}
215 {assign var=idy value=$smarty.section.loop1.index}
216 {if $form.discount_name.$idy.value}
217 <td>{$form.discounted_value.$idx.$idy.html|crmMoney}</td>
220 <td class="even-row">{$form.discounted_default.$idx.html}</td>
225 {if $discountSection eq 2}
226 <script type="text/javascript">
229 $('#discounted_label_1').focus( );
239 <div class="crm-submit-buttons">
240 {include file="CRM/common/formButtons.tpl" location="bottom"}
244 {include file="CRM/common/showHide.tpl"}
245 <script type="text/javascript">
248 // Re-show Fee Level grid if Price Set select has been set to none.
249 if (cj('#price_set_id').val() == '') {
250 cj('#map-field').show();
256 if ( document.getElementsByName('is_monetary')[0].checked ) {
257 cj('#event-fees').show();
260 function warnDiscountDel( ) {
261 if ( ! document.getElementsByName('is_discount')[0].checked ) {
262 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});
267 * Function used to show /hide discount and set defaults
269 function showHideDiscountRow( rowName, show, index ) {
271 // show first hidden element and set date default
273 cj('tr[id^=' + rowName + ']').each( function( i ) {
275 if ( cj(this).css('display') == 'none' ) {
279 var currentRowId = cj(this).attr('id');
280 var temp = currentRowId.split('_');
281 var currentElementID = temp[1];
282 var lastElementID = currentElementID - 1 ;
284 var lastEndDate = cj( '#discount_end_date_' + lastElementID ).datepicker( 'getDate' );
286 var discountDate = new Date( Date.parse( lastEndDate ) );
287 discountDate.setDate( discountDate.getDate() + 1 );
288 var newDate = discountDate.toDateString();
289 newDate = new Date( Date.parse( newDate ) );
290 cj( '#discount_start_date_' + currentElementID ).datepicker('setDate', newDate );
293 if ( counter == 5 ) {
294 cj('#discountLink').hide( );
300 // hide tr and clear dates
301 cj( '#discount_end_date_' + index ).val('');
302 cj( '#discount_name_' + index ).val('');
303 cj( '#discount_start_date_' + index ).val('');
304 cj( '#' + rowName ).hide( );
305 cj('#discountLink').show( );
313 {include file="CRM/common/showHideByFieldValue.tpl"
314 trigger_field_id ="is_pay_later"
316 target_element_id ="payLaterOptions"
317 target_element_type ="block"
322 {include file="CRM/common/showHideByFieldValue.tpl"
323 trigger_field_id ="price_set_id"
325 target_element_id ="map-field"
326 target_element_type ="block"
331 {include file="CRM/common/showHideByFieldValue.tpl"
332 trigger_field_id ="is_discount"
334 target_element_id ="discount"
335 target_element_type ="block"
342 <script type="text/javascript">
344 $("#quickconfig").click(function(e) {
348 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}
349 }).on('crmConfirm:yes', function() {
351 var dataUrl = '{crmURL p="civicrm/ajax/rest" h=0 q="className=CRM_Core_Page_AJAX&fnName=setIsQuickConfig&context=civicrm_event&id=$eventId" }';
353 $.getJSON(dataUrl).done(function(result) {window.location = CRM.url("civicrm/admin/price/field", {reset: 1, action: 'browse', sid: result});});