2 +--------------------------------------------------------------------+
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2018 |
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 {crmRegion name="price-set-1"}
27 <div id="priceset" class="crm-section price_set-section">
28 {if $priceSet.help_pre}
29 <div class="messages help">{$priceSet.help_pre}</div>
32 {assign var='adminFld' value=false}
33 {if call_user_func(array('CRM_Core_Permission','check'), 'administer CiviCRM') }
34 {assign var='adminFld' value=true}
37 {foreach from=$priceSet.fields item=element key=field_id}
38 {* Skip 'Admin' visibility price fields WHEN this tpl is used in online registration unless user has administer CiviCRM permission. *}
39 {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}
40 {if $element.help_pre}<span class="content description">{$element.help_pre}</span><br />{/if}
41 <div class="crm-section {$element.name}-section">
42 {if ($element.html_type eq 'CheckBox' || $element.html_type == 'Radio') && $element.options_per_line}
43 {assign var="element_name" value="price_"|cat:$field_id}
44 <div class="label">{$form.$element_name.label}</div>
45 <div class="content {$element.name}-content">
46 {assign var="elementCount" value="0"}
47 {assign var="optionCount" value="0"}
48 {assign var="rowCount" value="0"}
49 {foreach name=outer key=key item=item from=$form.$element_name}
50 {assign var="elementCount" value=`$elementCount+1`}
51 {if is_numeric($key) }
52 {assign var="optionCount" value=`$optionCount+1`}
53 {if $optionCount == 1}
54 {assign var="rowCount" value=`$rowCount+1`}
55 <div class="price-set-row {$element.name}-row{$rowCount}">
57 <span class="price-set-option-content">{$form.$element_name.$key.html}</span>
58 {if $optionCount == $element.options_per_line || $elementCount == $form.$element_name|@count}
60 {assign var="optionCount" value="0"}
64 {if $element.help_post}
65 <div class="description">{$element.help_post}</div>
70 {assign var="element_name" value="price_"|cat:$field_id}
72 <div class="label">{$form.$element_name.label}</div>
73 <div class="content {$element.name}-content">
74 {$form.$element_name.html}
75 {if $element.html_type eq 'Text'}
76 {if $element.is_display_amounts}
77 <span class="price-field-amount{if $form.$element_name.frozen EQ 1} sold-out-option{/if}">
78 {foreach item=option from=$element.options}
79 {if ($option.tax_amount || $option.tax_amount == "0") && $displayOpt && $invoicing}
80 {assign var="amount" value=`$option.amount+$option.tax_amount`}
81 {if $displayOpt == 'Do_not_show'}
83 {elseif $displayOpt == 'Inclusive'}
85 <span class='crm-price-amount-label'> {ts 1=$taxTerm 2=$option.tax_amount|crmMoney}(includes %1 of %2){/ts}</span>
87 {$option.amount|crmMoney}
88 <span class='crm-price-amount-label'> + {$option.tax_amount|crmMoney} {$taxTerm}</span>
91 {$option.amount|crmMoney} {$fieldHandle} {$form.$fieldHandle.frozen}
93 {if $form.$element_name.frozen EQ 1} ({ts}Sold out{/ts}){/if}
97 {* Not showing amount, but still need to conditionally show Sold out marker *}
98 {if $form.$element_name.frozen EQ 1}
99 <span class="sold-out-option">({ts}Sold out{/ts})<span>
103 {if $element.help_post}<br /><span class="description">{$element.help_post}</span>{/if}
107 {if !empty($extends) && $extends eq "Membership"}
108 {if (!empty($priceSet) && $element.id == $priceSet.auto_renew_membership_field) || (empty($priceSet) && $element.name == 'membership_amount')}
109 <div id="allow_auto_renew">
110 <div class='crm-section auto-renew'>
111 <div class='label'></div>
112 <div class='content' id="auto_renew_section">
113 {if isset($form.auto_renew) }
114 {$form.auto_renew.html} {$form.auto_renew.label}
117 <div class='content' id="force_renew" style='display: none'>{ts}Membership will renew automatically.{/ts}</div>
122 <div class="clear"></div>
127 {if $priceSet.help_post}
128 <div class="messages help">{$priceSet.help_post}</div>
131 {include file="CRM/Price/Form/Calculate.tpl"}