Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | {* |
2 | +--------------------------------------------------------------------+ | |
819d0d41 | 3 | | CiviCRM version 4.5 | |
6a488035 | 4 | +--------------------------------------------------------------------+ |
819d0d41 | 5 | | Copyright CiviCRM LLC (c) 2004-2014 | |
6a488035 TO |
6 | +--------------------------------------------------------------------+ |
7 | | This file is a part of CiviCRM. | | |
8 | | | | |
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. | | |
12 | | | | |
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. | | |
17 | | | | |
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 | +--------------------------------------------------------------------+ | |
25 | *} | |
26 | <div id="priceset" class="crm-section price_set-section"> | |
27 | {if $priceSet.help_pre} | |
28 | <div class="messages help">{$priceSet.help_pre}</div> | |
29 | {/if} | |
30 | ||
d75f2f47 EM |
31 | {assign var='adminFld' value=false} |
32 | {if call_user_func(array('CRM_Core_Permission','check'), 'administer CiviCRM') } | |
33 | {assign var='adminFld' value=true} | |
34 | {/if} | |
c7b3d063 | 35 | |
6a488035 | 36 | {foreach from=$priceSet.fields item=element key=field_id} |
c7b3d063 DG |
37 | {* Skip 'Admin' visibility price fields WHEN this tpl is used in online registration unless user has administer CiviCRM permission. *} |
38 | {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} | |
6a488035 TO |
39 | <div class="crm-section {$element.name}-section"> |
40 | {if ($element.html_type eq 'CheckBox' || $element.html_type == 'Radio') && $element.options_per_line} | |
41 | {assign var="element_name" value="price_"|cat:$field_id} | |
1c80b665 | 42 | <div class="label">{$form.$element_name.label}</div> |
6a488035 TO |
43 | <div class="content {$element.name}-content"> |
44 | {assign var="rowCount" value="1"} | |
45 | {assign var="count" value="1"} | |
46 | {foreach name=outer key=key item=item from=$form.$element_name} | |
47 | {if is_numeric($key) } | |
48 | {if $count == 1}<div class="price-set-row {$element.name}-row{$rowCount}">{/if} | |
49 | <span class="price-set-option-content">{$form.$element_name.$key.html}</span> | |
50 | {if $count == $element.options_per_line} | |
51 | </div> | |
52 | {assign var="rowCount" value=`$rowCount+1`} | |
53 | {assign var="count" value="1"} | |
54 | {else} | |
55 | {assign var="count" value=`$count+1`} | |
56 | {/if} | |
57 | {/if} | |
58 | {/foreach} | |
59 | {if $element.help_post} | |
60 | <div class="description">{$element.help_post}</div> | |
61 | {/if} | |
62 | </div> | |
63 | <div class="clear"></div> | |
64 | ||
65 | {else} | |
66 | ||
67 | {assign var="element_name" value="price_"|cat:$field_id} | |
68 | ||
69 | <div class="label">{$form.$element_name.label}</div> | |
70 | <div class="content {$element.name}-content">{$form.$element_name.html} | |
4dd3f46d DG |
71 | {if $element.html_type eq 'Text'} |
72 | {if $element.is_display_amounts} | |
73 | <span class="price-field-amount{if $form.$element_name.frozen EQ 1} sold-out-option{/if}"> | |
74 | {foreach item=option from=$element.options} | |
75 | {if ($option.tax_amount || $option.tax_amount == "0") && $displayOpt && $invoicing} | |
76 | {assign var="amount" value=`$option.amount+$option.tax_amount`} | |
77 | {if $displayOpt == 'Do_not_show'} | |
78 | {$amount|crmMoney} | |
79 | {elseif $displayOpt == 'Inclusive'} | |
80 | {$amount|crmMoney} | |
81 | <span class='crm-price-amount-label'> (includes {$taxTerm} of {$option.tax_amount|crmMoney})</span> | |
82 | {else} | |
83 | {$option.amount|crmMoney} | |
84 | <span class='crm-price-amount-label'> + {$option.tax_amount|crmMoney} {$taxTerm}</span> | |
85 | {/if} | |
86 | {else} | |
87 | {$option.amount|crmMoney} {$fieldHandle} {$form.$fieldHandle.frozen} | |
88 | {/if} | |
89 | {if $form.$element_name.frozen EQ 1} ({ts}Sold out{/ts}){/if} | |
90 | {/foreach} | |
6a488035 | 91 | </span> |
4dd3f46d DG |
92 | {else} |
93 | {* Not showing amount, but still need to conditionally show Sold out marker *} | |
94 | {if $form.$element_name.frozen EQ 1} | |
95 | <span class="sold-out-option">({ts}Sold out{/ts})<span> | |
96 | {/if} | |
97 | {/if} | |
6a488035 | 98 | {/if} |
4dd3f46d | 99 | {if $element.help_post}<br /><span class="description">{$element.help_post}</span>{/if} |
6a488035 TO |
100 | </div> |
101 | <div class="clear"></div> | |
102 | ||
103 | {/if} | |
4dd3f46d | 104 | </div> |
6a488035 TO |
105 | {/if} |
106 | {/foreach} | |
107 | ||
108 | {if $priceSet.help_post} | |
109 | <div class="messages help">{$priceSet.help_post}</div> | |
110 | {/if} | |
111 | ||
112 | {* Include the total calculation widget if this is NOT a quickconfig event/contribution page. *} | |
1a0d17b9 | 113 | {if !$quickConfig and !$dontInclCal} |
6a488035 TO |
114 | {include file="CRM/Price/Form/Calculate.tpl"} |
115 | {/if} | |
d75f2f47 | 116 | </div> |