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 | {if ($action eq 1 or $action eq 2 or $action eq 4) and !$isReserved} | |
27 | {include file="CRM/Price/Form/Field.tpl"} | |
28 | {elseif $action eq 8 and !$usedBy and !$isReserved} | |
29 | {include file="CRM/Price/Form/DeleteField.tpl"} | |
30 | {elseif $action eq 1024 } | |
31 | {include file="CRM/Price/Form/Preview.tpl"} | |
32 | {else} | |
33 | {if ($usedBy and $action eq 8) or $usedBy.civicrm_event or $usedBy.civicrm_contribution_page} | |
34 | <div id="price_set_used_by" class="messages status no-popup"> | |
35 | <div class="icon inform-icon"></div> | |
36 | {if $action eq 8} | |
c34e4bb4 | 37 | {ts 1=$usedPriceSetTitle}Unable to delete the '%1' Price Field - it is currently in use by one or more active events or contribution pages or contributions or event templates.{/ts} |
6a488035 TO |
38 | {/if} |
39 | ||
c34e4bb4 | 40 | {if $usedBy.civicrm_event or $usedBy.civicrm_contribution_page or $usedBy.civicrm_event_template} |
6a488035 TO |
41 | {include file="CRM/Price/Page/table.tpl"} |
42 | {/if} | |
43 | </div> | |
44 | {/if} | |
45 | ||
46 | ||
47 | ||
48 | {if $priceField} | |
49 | <div class="action-link"> | |
50 | {if !$isReserved} | |
51 | <a href="{crmURL q="reset=1&action=add&sid=$sid"}" id="newPriceField" class="button"><span><div class="icon add-icon"></div>{ts}Add Price Field{/ts}</span></a> | |
52 | {/if} | |
53 | <a href="{crmURL p="civicrm/admin/price" q="action=preview&sid=`$sid`&reset=1&context=field"}" class="button"><span><div class="icon preview-icon"></div>{ts}Preview (all fields){/ts}</span></a> | |
54 | </div> | |
55 | <div id="field_page"> | |
56 | {strip} | |
57 | {* handle enable/disable actions*} | |
4d17a233 CW |
58 | {include file="CRM/common/enableDisableApi.tpl"} |
59 | {include file="CRM/common/crmeditable.tpl"} | |
6a488035 TO |
60 | {include file="CRM/common/jsortable.tpl"} |
61 | <table id="options" class="display"> | |
62 | <thead> | |
63 | <tr> | |
64 | <th>{ts}Field Label{/ts}</th> | |
65 | <th>{ts}Field Type{/ts}</th> | |
66 | <th id="order" class="sortable">{ts}Order{/ts}</th> | |
67 | <th>{ts}Req?{/ts}</th> | |
68 | <th>{ts}Enabled?{/ts}</th> | |
69 | <th>{ts}Active On{/ts}</th> | |
70 | <th>{ts}Expire On{/ts}</th> | |
71 | <th id="nosort">{ts}Price{/ts}</th> | |
a32709be PB |
72 | {if $getTaxDetails} |
73 | <th>{ts}Tax Label{/ts}</th> | |
74 | <th>{ts}Tax Amount{/ts}</th> | |
75 | {/if} | |
6a488035 TO |
76 | <th></th> |
77 | <th class="hiddenElement"></th> | |
78 | </tr> | |
79 | </thead> | |
80 | {foreach from=$priceField key=fid item=row} | |
4d17a233 CW |
81 | <tr id="price_field-{$row.id}" class="crm-entity {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}"> |
82 | <td class="crm-editable" data-field="label">{$row.label}</td> | |
6a488035 TO |
83 | <td>{$row.html_type}</td> |
84 | <td class="nowrap">{$row.order}</td> | |
85 | <td>{if $row.is_required eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td> | |
86 | <td id="row_{$row.id}_status">{if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td> | |
87 | <td>{if $row.active_on}{$row.active_on|date_format:"%Y-%m-%d %T"}{/if}</td> | |
88 | <td>{if $row.expire_on}{$row.expire_on|date_format:"%Y-%m-%d %T"}{/if}</td> | |
89 | <td>{if $row.html_type eq "Text / Numeric Quantity"}{$row.price|crmMoney}{else}<a href="{crmURL p="civicrm/admin/price/field/option" q="action=browse&reset=1&sid=$sid&fid=$fid"}">{if $isReserved}{ts}View Price Options{/ts}{else}{ts}Edit Price Options{/ts}{/if}</a>{/if}</td> | |
a32709be PB |
90 | {if $getTaxDetails} |
91 | <td>{if $row.tax_rate != '' && $row.html_type eq "Text / Numeric Quantity"} | |
03b412ae PB |
92 | {$taxTerm} ({$row.tax_rate|string_format:"%.2f"}%) |
93 | {/if} | |
94 | </td> | |
a32709be PB |
95 | <td>{if $row.html_type eq "Text / Numeric Quantity" }{$row.tax_amount|crmMoney}{/if}</td> |
96 | {/if} | |
6a488035 TO |
97 | <td class="field-action">{$row.action|replace:'xx':$row.id}</td> |
98 | <td class="order hiddenElement">{$row.weight}</td> | |
99 | </tr> | |
100 | {/foreach} | |
101 | </table> | |
102 | {/strip} | |
103 | </div> | |
104 | <div class="action-link"> | |
105 | {if !$isReserved} | |
106 | <a href="{crmURL q="reset=1&action=add&sid=$sid"}" id="newPriceField" class="button"><span><div class="icon add-icon"></div>{ts}Add Price Field{/ts}</span></a> | |
107 | {/if} | |
108 | <a href="{crmURL p="civicrm/admin/price" q="action=preview&sid=`$sid`&reset=1&context=field"}" class="button"><span><div class="icon preview-icon"></div>{ts}Preview (all fields){/ts}</span></a> | |
109 | </div> | |
110 | ||
111 | {else} | |
112 | {if $action eq 16} | |
113 | <div class="messages status no-popup"> | |
114 | <div class="icon inform-icon"></div> | |
115 | {capture assign=crmURL}{crmURL p='civicrm/admin/price/field q="action=add&reset=1&sid=$sid"}{/capture} | |
116 | {ts 1=$groupTitle 2=$crmURL}There are no fields for price set '%1', <a href='%2'>add one</a>.{/ts} | |
117 | </div> | |
118 | {/if} | |
119 | {/if} | |
120 | {/if} |