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} | |
d5a08746 | 27 | {include file="CRM/Price/Form/Field.tpl"} |
6a488035 | 28 | {elseif $action eq 8 and !$usedBy and !$isReserved} |
d5a08746 | 29 | {include file="CRM/Price/Form/DeleteField.tpl"} |
6a488035 | 30 | {elseif $action eq 1024 } |
d5a08746 | 31 | {include file="CRM/Price/Form/Preview.tpl"} |
e5e8ab99 CW |
32 | {elseif ($usedBy and $action eq 8) or $usedBy.civicrm_event or $usedBy.civicrm_contribution_page} |
33 | <div id="price_set_used_by" class="messages status no-popup"> | |
34 | <div class="icon inform-icon"></div> | |
35 | {if $action eq 8} | |
36 | {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} | |
37 | {/if} | |
6a488035 | 38 | |
e5e8ab99 CW |
39 | {if $usedBy.civicrm_event or $usedBy.civicrm_contribution_page or $usedBy.civicrm_event_template} |
40 | {include file="CRM/Price/Page/table.tpl"} | |
41 | {/if} | |
42 | </div> | |
d5a08746 | 43 | {/if} |
6a488035 | 44 | |
d5a08746 DG |
45 | {if $action NEQ 8 and $priceField} |
46 | <div class="action-link"> | |
47 | {if !$isReserved} | |
48 | <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> | |
49 | {/if} | |
50 | <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> | |
51 | </div> | |
52 | <div id="field_page"> | |
53 | {strip} | |
6a488035 | 54 | {* handle enable/disable actions*} |
d5a08746 DG |
55 | {include file="CRM/common/enableDisableApi.tpl"} |
56 | {include file="CRM/common/crmeditable.tpl"} | |
57 | <table id="options" class="row-highlight"> | |
58 | <thead> | |
59 | <tr> | |
60 | <th>{ts}Field Label{/ts}</th> | |
61 | <th>{ts}Field Type{/ts}</th> | |
62 | <th>{ts}Order{/ts}</th> | |
63 | <th>{ts}Req?{/ts}</th> | |
64 | <th>{ts}Enabled?{/ts}</th> | |
65 | <th>{ts}Active On{/ts}</th> | |
66 | <th>{ts}Expire On{/ts}</th> | |
67 | <th>{ts}Price{/ts}</th> | |
3b5db8ce | 68 | {if $getTaxDetails} |
69 | <th>{ts}Tax Label{/ts}</th> | |
70 | <th>{ts}Tax Amount{/ts}</th> | |
71 | {/if} | |
d5a08746 DG |
72 | <th></th> |
73 | </tr> | |
74 | </thead> | |
75 | {foreach from=$priceField key=fid item=row} | |
4d17a233 | 76 | <tr id="price_field-{$row.id}" class="crm-entity {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}"> |
d5a08746 DG |
77 | <td class="crm-editable" data-field="label">{$row.label}</td> |
78 | <td>{$row.html_type_display}</td> | |
79 | <td class="nowrap">{$row.weight}</td> | |
80 | <td>{if $row.is_required eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td> | |
81 | <td id="row_{$row.id}_status">{if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td> | |
82 | <td>{if $row.active_on}{$row.active_on|date_format:"%Y-%m-%d %T"}{/if}</td> | |
83 | <td>{if $row.expire_on}{$row.expire_on|date_format:"%Y-%m-%d %T"}{/if}</td> | |
84 | <td>{if $row.html_type eq "Text"}{$row.price|crmMoney}{else}<a class="action-item" 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> | |
3b5db8ce | 85 | {if $getTaxDetails} |
86 | <td>{if $row.tax_rate != '' && $row.html_type eq "Text / Numeric Quantity"} | |
87 | {$taxTerm} ({$row.tax_rate|string_format:"%.2f"}%) | |
88 | {/if} | |
d75f2f47 | 89 | </td> |
3b5db8ce | 90 | <td>{if $row.html_type eq "Text / Numeric Quantity" }{$row.tax_amount|crmMoney}{/if}</td> |
6a488035 | 91 | {/if} |
d5a08746 DG |
92 | <td class="field-action">{$row.action|replace:'xx':$row.id}</td> |
93 | </tr> | |
94 | {/foreach} | |
95 | </table> | |
96 | {/strip} | |
97 | </div> | |
98 | <div class="action-link"> | |
99 | {if !$isReserved} | |
100 | <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> | |
101 | {/if} | |
102 | <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> | |
103 | </div> | |
6a488035 | 104 | |
d5a08746 DG |
105 | {else} |
106 | {if $action eq 16} | |
107 | <div class="messages status no-popup crm-empty-table"> | |
108 | <div class="icon inform-icon"></div> | |
109 | {ts}None found.{/ts} | |
110 | </div> | |
111 | <div class="action-link"> | |
112 | <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> | |
113 | </div> | |
6a488035 TO |
114 | {/if} |
115 | {/if} |