Merge pull request #6733 from pradpnayak/CRM-16801
[civicrm-core.git] / templates / CRM / Price / Page / Field.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.6 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2015 |
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 {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}
38
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>
43 {/if}
44
45 {if $action NEQ 8 and $priceField}
46 <div class="action-link">
47 {if !$isReserved}
48 {crmButton q="reset=1&action=add&sid=$sid" id="newPriceField" icon="circle-plus"}{ts}Add Price Field{/ts}{/crmButton}
49 {/if}
50 {crmButton p="civicrm/admin/price" q="action=preview&sid=`$sid`&reset=1&context=field" icon="zoomin"}{ts}Preview (all fields){/ts}{/crmButton}
51 </div>
52 <div id="field_page">
53 {strip}
54 {* handle enable/disable actions*}
55 {include file="CRM/common/enableDisableApi.tpl"}
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>
67 {if $getTaxDetails}
68 <th>{ts}Tax Label{/ts}</th>
69 <th>{ts}Tax Amount{/ts}</th>
70 {/if}
71 <th></th>
72 </tr>
73 </thead>
74 {foreach from=$priceField key=fid item=row}
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}">
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>
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>
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>
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}
88 </td>
89 <td>{if $row.html_type eq "Text / Numeric Quantity" }{$row.tax_amount|crmMoney}{/if}</td>
90 {/if}
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}
99 {crmButton q="reset=1&action=add&sid=$sid" id="newPriceField" icon="circle-plus"}{ts}Add Price Field{/ts}{/crmButton}
100 {/if}
101 {crmButton p="civicrm/admin/price" q="action=preview&sid=`$sid`&reset=1&context=field" icon="zoomin"}{ts}Preview (all fields){/ts}{/crmButton}
102 </div>
103
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">
111 {crmButton q="reset=1&action=add&sid=$sid" id="newPriceField" icon="circle-plus"}{ts}Add Price Field{/ts}{/crmButton}
112 </div>
113 {/if}
114 {/if}