Merge pull request #4789 from totten/master-test-tx
[civicrm-core.git] / templates / CRM / Price / Page / Option.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.6 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2014 |
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 or $action eq 8 and !$usedBy) and !$isReserved}
27 {include file="CRM/Price/Form/Option.tpl"}
28
29 {elseif $usedBy}
30 <div class='spacer'></div>
31 <div id="price_set_used_by" class="messages status no-popup">
32 <div class="icon inform-icon"></div>
33 {if $action eq 8}
34 {ts 1=$usedPriceSetTitle}Unable to delete the '%1' Price Field Option - it is currently in use by one or more active events or contribution pages or contributions.{/ts}
35 {/if}
36
37 {if $usedBy.civicrm_event or $usedBy.civicrm_contribution_page}
38 {include file="CRM/Price/Page/table.tpl"}
39 {/if}
40
41 </div>
42 {else}
43
44
45 {if $customOption}
46
47 <div id="field_page">
48 <p></p>
49 {strip}
50 {* handle enable/disable actions*}
51 {include file="CRM/common/enableDisableApi.tpl"}
52 {include file="CRM/common/crmeditable.tpl"}
53 <table id="options" class="row-highlight">
54 <thead>
55 <tr>
56 <th>{ts}Option Label{/ts}</th>
57 <th>{ts}Option Amount{/ts}</th>
58 <th>{ts}Default{/ts}</th>
59 <th>{ts}Financial Type{/ts}</th>
60 <th>{ts}Order{/ts}</th>
61 {if $getTaxDetails}
62 <th>{ts}Tax Label{/ts}</th>
63 <th>{ts}Tax Amount{/ts}</th>
64 {/if}
65 <th>{ts}Enabled?{/ts}</th>
66 <th></th>
67 </tr>
68 </thead>
69 <tbody>
70 {foreach from=$customOption item=row}
71 <tr id="price_field_value-{$row.id}" class="crm-entity {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
72 <td class="crm-price-option-label crm-editable" data-field="label">{$row.label}</td>
73 <td class="crm-price-option-value">{$row.amount|crmMoney}</td>
74 <td class="crm-price-option-is_default">{if $row.is_default}<img src="{$config->resourceBase}i/check.gif" alt="{ts}Default{/ts}" />{/if}</td>
75 <td class="nowrap crm-price-option-financial-type-id">{$row.financial_type_id}</td>
76 <td class="nowrap crm-price-option-order">{$row.weight}</td>
77 {if $getTaxDetails}
78 <td>{if $row.tax_rate != '' }
79 {$taxTerm} ({$row.tax_rate|string_format:"%.2f"}%)
80 {/if}
81 </td>
82 <td>{$row.tax_amount|crmMoney}</td>
83 {/if}
84 <td id="row_{$row.id}_status" class="crm-price-option-is_active">{if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
85 <td>{$row.action|replace:'xx':$row.id}</td>
86 </tr>
87 {/foreach}
88 </tbody>
89 </table>
90 {/strip}
91 </div>
92
93 {else}
94 {if $action eq 16}
95 <div class="messages status no-popup">
96 <img src="{$config->resourceBase}i/Inform.gif" alt="{ts}status{/ts}"/>
97 {ts}None found.{/ts}
98 </div>
99 {/if}
100 {/if}
101 {if $addMoreFields && !$isReserved}
102 <div class="action-link">
103 <a href="{crmURL q="reset=1&action=add&fid=$fid&sid=$sid"}" class="button"><span><div class="icon add-icon"></div> {ts 1=$fieldTitle}New Option for '%1'{/ts}</span></a>
104 <a href="{crmURL p="civicrm/admin/price/field" q="reset=1&sid=$sid"}" class="button cancel no-popup"><span><div class="icon ui-icon-close"></div> {ts}Done{/ts}</span></a>
105 </div>
106 {/if}
107 {/if}