CRM-16415 smarty crmButton uses and many instances of close
[civicrm-core.git] / templates / CRM / Price / Page / Field.tpl
CommitLineData
6a488035
TO
1{*
2 +--------------------------------------------------------------------+
2c4c49ca 3 | CiviCRM version 4.7 |
6a488035 4 +--------------------------------------------------------------------+
e7112fa7 5 | Copyright CiviCRM LLC (c) 2004-2015 |
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}
80bc2820 48 {crmButton q="reset=1&action=add&sid=$sid" id="newPriceField" icon="plus-circle"}{ts}Add Price Field{/ts}{/crmButton}
d5a08746 49 {/if}
80bc2820 50 {crmButton p="civicrm/admin/price" q="action=preview&sid=`$sid`&reset=1&context=field" icon="television"}{ts}Preview (all fields){/ts}{/crmButton}
d5a08746
DG
51 </div>
52 <div id="field_page">
53 {strip}
6a488035 54 {* handle enable/disable actions*}
d5a08746 55 {include file="CRM/common/enableDisableApi.tpl"}
d5a08746
DG
56 <table id="options" class="row-highlight">
57 <thead>
58 <tr>
59 <th>{ts}Field Label{/ts}</th>
60 <th>{ts}Field Type{/ts}</th>
61 <th>{ts}Order{/ts}</th>
62 <th>{ts}Req?{/ts}</th>
63 <th>{ts}Enabled?{/ts}</th>
64 <th>{ts}Active On{/ts}</th>
65 <th>{ts}Expire On{/ts}</th>
66 <th>{ts}Price{/ts}</th>
3b5db8ce 67 {if $getTaxDetails}
68 <th>{ts}Tax Label{/ts}</th>
69 <th>{ts}Tax Amount{/ts}</th>
70 {/if}
d5a08746
DG
71 <th></th>
72 </tr>
73 </thead>
74 {foreach from=$priceField key=fid item=row}
4d17a233 75 <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
76 <td class="crm-editable" data-field="label">{$row.label}</td>
77 <td>{$row.html_type_display}</td>
78 <td class="nowrap">{$row.weight}</td>
b633f8bd 79 <td class="crm-editable" data-field="is_required" data-type="boolean">{if $row.is_required eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
d5a08746
DG
80 <td id="row_{$row.id}_status">{if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
81 <td>{if $row.active_on}{$row.active_on|date_format:"%Y-%m-%d %T"}{/if}</td>
82 <td>{if $row.expire_on}{$row.expire_on|date_format:"%Y-%m-%d %T"}{/if}</td>
83 <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 84 {if $getTaxDetails}
85 <td>{if $row.tax_rate != '' && $row.html_type eq "Text / Numeric Quantity"}
86 {$taxTerm} ({$row.tax_rate|string_format:"%.2f"}%)
87 {/if}
d75f2f47 88 </td>
3b5db8ce 89 <td>{if $row.html_type eq "Text / Numeric Quantity" }{$row.tax_amount|crmMoney}{/if}</td>
6a488035 90 {/if}
d5a08746
DG
91 <td class="field-action">{$row.action|replace:'xx':$row.id}</td>
92 </tr>
93 {/foreach}
94 </table>
95 {/strip}
96 </div>
97 <div class="action-link">
98 {if !$isReserved}
80bc2820 99 {crmButton q="reset=1&action=add&sid=$sid" id="newPriceField" icon="plus-circle"}{ts}Add Price Field{/ts}{/crmButton}
d5a08746 100 {/if}
80bc2820 101 {crmButton p="civicrm/admin/price" q="action=preview&sid=`$sid`&reset=1&context=field" icon="television"}{ts}Preview (all fields){/ts}{/crmButton}
d5a08746 102 </div>
6a488035 103
d5a08746
DG
104{else}
105 {if $action eq 16}
106 <div class="messages status no-popup crm-empty-table">
107 <div class="icon inform-icon"></div>
108 {ts}None found.{/ts}
109 </div>
110 <div class="action-link">
80bc2820 111 {crmButton q="reset=1&action=add&sid=$sid" id="newPriceField" icon="plus-circle"}{ts}Add Price Field{/ts}{/crmButton}
d5a08746 112 </div>
6a488035
TO
113 {/if}
114{/if}