{* +--------------------------------------------------------------------+ | Copyright CiviCRM LLC. All rights reserved. | | | | This work is published under the GNU AGPLv3 license with some | | permitted exceptions and without any warranty. For full license | | and copyright information, see https://civicrm.org/licensing | +--------------------------------------------------------------------+ *} {crmRegion name="price-set-1"}
{if $priceSet.help_pre}
{$priceSet.help_pre}
{/if} {assign var='adminFld' value=false} {if call_user_func(array('CRM_Core_Permission','check'), 'administer CiviCRM') } {assign var='adminFld' value=true} {if $priceSet.id && !$priceSet.is_quick_config}
{icon icon="fa-wrench"}{ts}Edit Price Set{/ts}{/icon}
{/if} {/if} {foreach from=$priceSet.fields item=element key=field_id} {* Skip 'Admin' visibility price fields WHEN this tpl is used in online registration unless user has administer CiviCRM permission. *} {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} {if $element.help_pre}{$element.help_pre}
{/if}
{if ($element.html_type eq 'CheckBox' || $element.html_type == 'Radio') && $element.options_per_line} {assign var="element_name" value="price_"|cat:$field_id}
{$form.$element_name.label}
{assign var="elementCount" value="0"} {assign var="optionCount" value="0"} {assign var="rowCount" value="0"} {foreach name=outer key=key item=item from=$form.$element_name} {assign var="elementCount" value=`$elementCount+1`} {if is_numeric($key) } {assign var="optionCount" value=`$optionCount+1`} {if $optionCount == 1} {assign var="rowCount" value=`$rowCount+1`}
{/if} {$form.$element_name.$key.html} {if $optionCount == $element.options_per_line || $elementCount == $form.$element_name|@count}
{assign var="optionCount" value="0"} {/if} {/if} {/foreach} {if $element.help_post}
{$element.help_post}
{/if}
{else} {assign var="element_name" value="price_"|cat:$field_id}
{$form.$element_name.label}
{$form.$element_name.html} {if $element.html_type eq 'Text'} {if $element.is_display_amounts} {foreach item=option from=$element.options} {if ($option.tax_amount || $option.tax_amount == "0") && $displayOpt && $invoicing} {assign var="amount" value=`$option.amount+$option.tax_amount`} {if $displayOpt == 'Do_not_show'} {$amount|crmMoney} {elseif $displayOpt == 'Inclusive'} {$amount|crmMoney} {ts 1=$taxTerm 2=$option.tax_amount|crmMoney}(includes %1 of %2){/ts} {else} {$option.amount|crmMoney} + {$option.tax_amount|crmMoney} {$taxTerm} {/if} {else} {$option.amount|crmMoney} {$fieldHandle} {$form.$fieldHandle.frozen} {/if} {if $form.$element_name.frozen EQ 1} ({ts}Sold out{/ts}){/if} {/foreach} {else} {* Not showing amount, but still need to conditionally show Sold out marker *} {if $form.$element_name.frozen EQ 1} ({ts}Sold out{/ts}) {/if} {/if} {/if} {if $element.help_post}
{$element.help_post}{/if}
{/if} {if !empty($extends) && $extends eq "Membership"} {if (!empty($priceSet) && $element.id == $priceSet.auto_renew_membership_field) || (empty($priceSet) && $element.name == 'membership_amount')}
{if isset($form.auto_renew) } {$form.auto_renew.html} {$form.auto_renew.label} {/if}
{/if} {/if}
{/if} {/foreach} {if $priceSet.help_post}
{$priceSet.help_post}
{/if} {include file="CRM/Price/Form/Calculate.tpl"}
{/crmRegion}