PageRenderTime 53ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/templates/CRM/Event/Form/ManageEvent/Fee.tpl

https://github.com/ksecor/civicrm
Smarty Template | 235 lines | 213 code | 19 blank | 3 comment | 19 complexity | 864a84cb3a03a6a5c37f5826a5fb6d58 MD5 | raw file
  1. {* this template is used for adding event *}
  2. {capture assign="adminPriceSets"}{crmURL p='civicrm/admin/price' q="reset=1"}{/capture}
  3. <div class="form-item">
  4. <div class="crm-submit-buttons">
  5. {$form.buttons.html}
  6. </div>
  7. <fieldset>
  8. {if !$paymentProcessor}
  9. {capture assign=ppUrl}{crmURL p='civicrm/admin/paymentProcessor' q="reset=1"}{/capture}
  10. <div class="status message">
  11. {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="CiviContribute Payment Processor Configuration"}
  12. <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>
  13. </div>
  14. {/if}
  15. <dl>
  16. <dt>{$form.title.label}</dt><dd>{$form.title.html}</dd>
  17. <dt>{$form.is_monetary.label}</dt><dd>{$form.is_monetary.html}</dd>
  18. </dl>
  19. <div id="event-fees">
  20. {if $paymentProcessor}
  21. <div id="paymentProcessor">
  22. <dl>
  23. <dt>{$form.payment_processor_id.label}</dt><dd>{$form.payment_processor_id.html}</dd>
  24. <dt class="">&nbsp;</dt>
  25. <dd class="description">
  26. {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}
  27. {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="CiviContribute Payment Processor Configuration"}
  28. </dd>
  29. </dl>
  30. </div>
  31. {/if}
  32. <div id="contributionType">
  33. <dl>
  34. <dt>{$form.contribution_type_id.label}<span class="marker"> *</span></dt><dd>{$form.contribution_type_id.html}</dd>
  35. <dt>&nbsp;</dt><dd class="description">{ts}This contribution type will be assigned to payments made by participants when they register online.{/ts}
  36. <dt>{$form.fee_label.label}<span class="marker"> *</span> {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='fee_label' id=$id}{/if}</dt><dd>{$form.fee_label.html}</dd>
  37. <dt>&nbsp;</dt><dd class="description">{ts}This label is displayed with the list of event fees.{/ts}
  38. </dl>
  39. </div>
  40. <div id="payLater">
  41. <dl>
  42. <dt class="extra-long-fourty">&nbsp;</dt><dd>{$form.is_pay_later.html}&nbsp;{$form.is_pay_later.label}<br />
  43. <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></dd>
  44. </dl>
  45. </div>
  46. <div id="payLaterOptions">
  47. <dl>
  48. <dt>{$form.pay_later_text.label}<span class="marker"> *</span> {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='pay_later_text' id=$id}{/if}</dt><dd>{$form.pay_later_text.html|crmReplace:class:big}</dd>
  49. <dt>&nbsp;</dt><dd class="description">{ts}Text displayed next to the checkbox for the 'pay later' option on the contribution form.{/ts}</dd>
  50. <dt>{$form.pay_later_receipt.label}<span class="marker"> *</span> {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='pay_later_receipt' id=$id}{/if}</dt><dd>{$form.pay_later_receipt.html|crmReplace:class:big}</dd>
  51. <dt>&nbsp;</dt><dd 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}</dd>
  52. </dl>
  53. </div>
  54. <div id="priceSet">
  55. <dl>
  56. <dt>{$form.price_set_id.label}</dt><dd>{$form.price_set_id.html}</dd>
  57. <dt>&nbsp;</dt><dd class="description">{ts 1=$adminPriceSets}Select a pre-configured Price Set to offer multiple individually priced options for event registrants. Otherwise, select &quot;-none-&quot; and enter one or more fee levels in the table below. Create or edit Price Sets <a href='%1'>here</a>.{/ts}</dd>
  58. </dl>
  59. </div>
  60. <div id="map-field" >
  61. <fieldset id="map-field"><legend>{ts}Regular Fees{/ts}</legend>
  62. <p>{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}</p>
  63. <table id="map-field-table">
  64. <tr class="columnheader"><th scope="column">{ts}Fee Label{/ts}</th><th scope="column">{ts}Amount{/ts}</th><th scope="column">{ts}Default?{/ts}</th></tr>
  65. {section name=loop start=1 loop=11}
  66. {assign var=idx value=$smarty.section.loop.index}
  67. <tr><td class="even-row">{$form.label.$idx.html}</td><td>{$form.value.$idx.html|crmMoney}</td><td class="even-row">{$form.default.$idx.html}</td></tr>
  68. {/section}
  69. </table>
  70. </fieldset>
  71. <div id="isDiscount">
  72. <dl>
  73. <dt class="extra-long-fourty">&nbsp;</dt><dd>{$form.is_discount.html}&nbsp;{$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></dd>
  74. </dl>
  75. </div>
  76. <div class="spacer"></div>
  77. <div class="form-item">
  78. <fieldset id="discount">
  79. <table>
  80. <tr class="columnheader">
  81. <th>&nbsp;</th>
  82. <th>{ts}Discount Set{/ts}</th>
  83. <th>{ts}Start Date{/ts}</th>
  84. <th>{ts}End Date{/ts}</th>
  85. </tr>
  86. {section name=rowLoop start=1 loop=6}
  87. {assign var=index value=$smarty.section.rowLoop.index}
  88. <tr id="discount_{$index}" {if $index GT 1 AND empty( $form.discount_name[$index].value) } style="display:none"{/if} class="form-item {cycle values="odd-row,even-row"}">
  89. <td>{if $index GT 1} <a onclick="hiderow('discount_{$index}','discount');discountValues('{$index}'); return false;" name="discount_{$index}" href="#discount_{$index}" class="form-link"><img src="{$config->resourceBase}i/TreeMinus.gif" class="action-icon" alt="{ts}hide field or section{/ts}"/></a>{/if}
  90. </td>
  91. <td> {$form.discount_name.$index.html}</td>
  92. <td> {$form.discount_start_date.$index.html | crmDate }
  93. <span class="description">
  94. {include file="CRM/common/calendar/desc.tpl" trigger=trigger_discount_start|cat:$index}
  95. {include file="CRM/common/calendar/body.tpl" dateVar=discount_start_date[$index] startDate=currentYear
  96. startDate=startYear offset=10 trigger=trigger_discount_start|cat:$index ampm=1}
  97. </span>
  98. </td>
  99. <td> {$form.discount_end_date.$index.html | crmDate}
  100. <span class="description">
  101. {include file="CRM/common/calendar/desc.tpl" trigger=trigger_discount_end|cat:$index}
  102. {include file="CRM/common/calendar/body.tpl" dateVar=discount_end_date[$index] endDate=currentYear
  103. endDate=startYear offset=10 trigger=trigger_discount_end|cat:$index ampm=1}
  104. </span>
  105. </td>
  106. </tr>
  107. {/section}
  108. </table>
  109. <div id="discountLink" class="add-remove-link">
  110. <a onclick="showrow('discount',5);return false;" name="discountLink" href="#discountLink" 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>
  111. </div>
  112. {$form._qf_Fee_submit.html}
  113. {if $discountSection}
  114. <fieldset id="map-field"><legend>{ts}Discounted Fees{/ts}</legend>
  115. <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>
  116. <table id="map-field-table">
  117. <tr class="columnheader">
  118. <th scope="column">{ts}Fee Label{/ts}</th>
  119. {section name=dloop start=1 loop=6}
  120. {assign var=i value=$smarty.section.dloop.index}
  121. {if $form.discount_name.$i.value}
  122. <th scope="column">{$form.discount_name.$i.value}</th>
  123. {/if}
  124. {/section}
  125. <th scope="column">{ts}Default?{/ts}</th>
  126. </tr>
  127. {section name=loop start=1 loop=11}
  128. {assign var=idx value=$smarty.section.loop.index}
  129. <tr><td class="even-row">{$form.discounted_label.$idx.html}</td>
  130. {section name=loop1 start=1 loop=6}
  131. {assign var=idy value=$smarty.section.loop1.index}
  132. {if $form.discount_name.$idy.value}
  133. <td>{$form.discounted_value.$idx.$idy.html|crmMoney}</td>
  134. {/if}
  135. {/section}
  136. <td class="even-row">{$form.discounted_default.$idx.html}</td>
  137. </tr>
  138. {/section}
  139. </table>
  140. </fieldset>
  141. {/if}
  142. </fieldset>
  143. </div>
  144. </div>
  145. </div>
  146. </fieldset>
  147. <div class="crm-submit-buttons">
  148. {$form.buttons.html}
  149. </div>
  150. </div>
  151. {include file="CRM/common/showHide.tpl"}
  152. <script type="text/javascript">
  153. var showRows = new Array({$showBlocks});
  154. var hideBlocks = new Array({$hideBlocks});
  155. var rowcounter = 0;
  156. {literal}
  157. if (navigator.appName == "Microsoft Internet Explorer") {
  158. for ( var count = 0; count < hideBlocks.length; count++ ) {
  159. var r = document.getElementById(hideBlocks[count]);
  160. r.style.display = 'none';
  161. }
  162. }
  163. {/literal}
  164. {* hide and display the appropriate blocks as directed by the php code *}
  165. on_load_init_blocks( showRows, hideBlocks, '' );
  166. {literal}
  167. // Re-show Fee Level grid if Price Set select has been set to none.
  168. if ( document.getElementById('price_set_id').options[document.getElementById('price_set_id').selectedIndex].value == '' ) {
  169. show( 'map-field' );
  170. }
  171. if ( document.getElementsByName('is_monetary')[0].checked ) {
  172. show( 'event-fees', 'block' );
  173. }
  174. function discountValues( discount_id )
  175. {
  176. document.getElementById("discount_name_"+ discount_id).value = "";
  177. document.getElementById("discount_start_date["+ discount_id +"][M]").value = "";
  178. document.getElementById("discount_start_date["+ discount_id +"][d]").value = "";
  179. document.getElementById("discount_start_date["+ discount_id +"][Y]").value = "";
  180. document.getElementById("discount_end_date["+ discount_id +"][M]").value = "";
  181. document.getElementById("discount_end_date["+ discount_id +"][d]").value = "";
  182. document.getElementById("discount_end_date["+ discount_id +"][Y]").value = "";
  183. }
  184. function warnDiscountDel( ) {
  185. if ( ! document.getElementsByName('is_discount')[0].checked ) {
  186. alert('{/literal}{ts}If you uncheck "Discounts by Signup Date" and Save this form, any existing discount sets will be deleted. This action cannot be undone. If this is NOT what you want to do, you can check "Discounts by Signup Date" again{/ts}{literal}.');
  187. }
  188. }
  189. {/literal}
  190. </script>
  191. {include file="CRM/common/showHideByFieldValue.tpl"
  192. trigger_field_id ="is_pay_later"
  193. trigger_value =""
  194. target_element_id ="payLaterOptions"
  195. target_element_type ="block"
  196. field_type ="radio"
  197. invert = 0
  198. }
  199. {include file="CRM/common/showHideByFieldValue.tpl"
  200. trigger_field_id ="price_set_id"
  201. trigger_value =""
  202. target_element_id ="map-field"
  203. target_element_type ="block"
  204. field_type ="select"
  205. invert = 0
  206. }
  207. {include file="CRM/common/showHideByFieldValue.tpl"
  208. trigger_field_id ="is_discount"
  209. trigger_value =""
  210. target_element_id ="discount"
  211. target_element_type ="block"
  212. field_type ="radio"
  213. invert = 0
  214. }
  215. {* include jscript to warn if unsaved form field changes *}
  216. {include file="CRM/common/formNavigate.tpl"}