2 +--------------------------------------------------------------------+
3 | Copyright CiviCRM LLC. All rights reserved. |
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 |
8 +--------------------------------------------------------------------+
10 {crmRegion name="price-set-1"}
11 <div id="priceset" class="crm-section price_set-section">
12 {if $priceSet.help_pre}
13 <div class="messages help">{$priceSet.help_pre}</div>
16 {assign var='adminFld' value=false}
17 {if call_user_func(array('CRM_Core_Permission','check'), 'administer CiviCRM') }
18 {assign var='adminFld' value=true}
21 {foreach from=$priceSet.fields item=element key=field_id}
22 {* Skip 'Admin' visibility price fields WHEN this tpl is used in online registration unless user has administer CiviCRM permission. *}
23 {if $element.visibility EQ 'public' || ($element.visibility EQ 'admin' && $adminFld EQ true) || $context eq 'standalone' || $context eq 'advanced' || $context eq 'search' || $context eq 'participant' || $context eq 'dashboard' || $action eq 1024}
24 {if $element.help_pre}<span class="content description">{$element.help_pre}</span><br />{/if}
25 <div class="crm-section {$element.name}-section">
26 {if ($element.html_type eq 'CheckBox' || $element.html_type == 'Radio') && $element.options_per_line}
27 {assign var="element_name" value="price_"|cat:$field_id}
28 <div class="label">{$form.$element_name.label}</div>
29 <div class="content {$element.name}-content">
30 {assign var="elementCount" value="0"}
31 {assign var="optionCount" value="0"}
32 {assign var="rowCount" value="0"}
33 {foreach name=outer key=key item=item from=$form.$element_name}
34 {assign var="elementCount" value=`$elementCount+1`}
35 {if is_numeric($key) }
36 {assign var="optionCount" value=`$optionCount+1`}
37 {if $optionCount == 1}
38 {assign var="rowCount" value=`$rowCount+1`}
39 <div class="price-set-row {$element.name}-row{$rowCount}">
41 <span class="price-set-option-content">{$form.$element_name.$key.html}</span>
42 {if $optionCount == $element.options_per_line || $elementCount == $form.$element_name|@count}
44 {assign var="optionCount" value="0"}
48 {if $element.help_post}
49 <div class="description">{$element.help_post}</div>
54 {assign var="element_name" value="price_"|cat:$field_id}
56 <div class="label">{$form.$element_name.label}</div>
57 <div class="content {$element.name}-content">
58 {$form.$element_name.html}
59 {if $element.html_type eq 'Text'}
60 {if $element.is_display_amounts}
61 <span class="price-field-amount{if $form.$element_name.frozen EQ 1} sold-out-option{/if}">
62 {foreach item=option from=$element.options}
63 {if ($option.tax_amount || $option.tax_amount == "0") && $displayOpt && $invoicing}
64 {assign var="amount" value=`$option.amount+$option.tax_amount`}
65 {if $displayOpt == 'Do_not_show'}
67 {elseif $displayOpt == 'Inclusive'}
69 <span class='crm-price-amount-label'> {ts 1=$taxTerm 2=$option.tax_amount|crmMoney}(includes %1 of %2){/ts}</span>
71 {$option.amount|crmMoney}
72 <span class='crm-price-amount-label'> + {$option.tax_amount|crmMoney} {$taxTerm}</span>
75 {$option.amount|crmMoney} {$fieldHandle} {$form.$fieldHandle.frozen}
77 {if $form.$element_name.frozen EQ 1} ({ts}Sold out{/ts}){/if}
81 {* Not showing amount, but still need to conditionally show Sold out marker *}
82 {if $form.$element_name.frozen EQ 1}
83 <span class="sold-out-option">({ts}Sold out{/ts})<span>
87 {if $element.help_post}<br /><span class="description">{$element.help_post}</span>{/if}
91 {if !empty($extends) && $extends eq "Membership"}
92 {if (!empty($priceSet) && $element.id == $priceSet.auto_renew_membership_field) || (empty($priceSet) && $element.name == 'membership_amount')}
93 <div id="allow_auto_renew">
94 <div class='crm-section auto-renew'>
95 <div class='label'></div>
96 <div class='content' id="auto_renew_section">
97 {if isset($form.auto_renew) }
98 {$form.auto_renew.html} {$form.auto_renew.label}
101 <div class='content' id="force_renew" style='display: none'>{ts}Membership will renew automatically.{/ts}</div>
106 <div class="clear"></div>
111 {if $priceSet.help_post}
112 <div class="messages help">{$priceSet.help_post}</div>
115 {include file="CRM/Price/Form/Calculate.tpl"}