Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | {* |
2 | +--------------------------------------------------------------------+ | |
2c4c49ca | 3 | | CiviCRM version 4.7 | |
6a488035 | 4 | +--------------------------------------------------------------------+ |
fa938177 | 5 | | Copyright CiviCRM LLC (c) 2004-2016 | |
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 or $action eq 8 and !$usedBy) and !$isReserved} | |
1d61ba2b | 27 | {include file="CRM/Price/Form/Option.tpl"} |
6a488035 | 28 | |
e5e8ab99 | 29 | {elseif $usedBy} |
1d61ba2b CW |
30 | <div class='spacer'></div> |
31 | <div id="price_set_used_by" class="messages status no-popup"> | |
6a488035 | 32 | <div class="icon inform-icon"></div> |
1d61ba2b CW |
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} | |
6a488035 | 36 | |
1d61ba2b CW |
37 | {if $usedBy.civicrm_event or $usedBy.civicrm_contribution_page} |
38 | {include file="CRM/Price/Page/table.tpl"} | |
6a488035 TO |
39 | {/if} |
40 | ||
1d61ba2b | 41 | </div> |
e5e8ab99 | 42 | {else} |
6a488035 TO |
43 | |
44 | ||
e5e8ab99 | 45 | {if $customOption} |
6a488035 TO |
46 | |
47 | <div id="field_page"> | |
e5e8ab99 CW |
48 | <p></p> |
49 | {strip} | |
50 | {* handle enable/disable actions*} | |
51 | {include file="CRM/common/enableDisableApi.tpl"} | |
e5e1786f | 52 | <table id="options" class="row-highlight"> |
e5e8ab99 CW |
53 | <thead> |
54 | <tr> | |
55 | <th>{ts}Option Label{/ts}</th> | |
56 | <th>{ts}Option Amount{/ts}</th> | |
5bfef8fa SL |
57 | <th>{ts}Pre Help{/ts}</th> |
58 | <th>{ts}Post Help{/ts}</th> | |
a8e4ceb4 DG |
59 | {if $isEvent} |
60 | <th>{ts}Participant Count{/ts}</th> | |
61 | <th>{ts}Maximum{/ts}</th> | |
62 | {/if} | |
e5e8ab99 CW |
63 | <th>{ts}Default{/ts}</th> |
64 | <th>{ts}Financial Type{/ts}</th> | |
65 | <th>{ts}Order{/ts}</th> | |
a32709be PB |
66 | {if $getTaxDetails} |
67 | <th>{ts}Tax Label{/ts}</th> | |
68 | <th>{ts}Tax Amount{/ts}</th> | |
69 | {/if} | |
e5e8ab99 CW |
70 | <th>{ts}Enabled?{/ts}</th> |
71 | <th></th> | |
1d61ba2b | 72 | </tr> |
e5e8ab99 CW |
73 | </thead> |
74 | <tbody> | |
75 | {foreach from=$customOption item=row} | |
76 | <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}"> | |
77 | <td class="crm-price-option-label crm-editable" data-field="label">{$row.label}</td> | |
78 | <td class="crm-price-option-value">{$row.amount|crmMoney}</td> | |
5bfef8fa SL |
79 | <td class="crm-price-option-pre-help">{$row.help_pre}</td> |
80 | <td class="crm-price-option-post-help">{$row.help_post}</td> | |
a8e4ceb4 DG |
81 | {if $isEvent} |
82 | <td class="crm-price-option-count">{$row.count}</td> | |
83 | <td class="crm-price-option-max">{$row.max_value}</td> | |
84 | {/if} | |
e5e8ab99 CW |
85 | <td class="crm-price-option-is_default">{if $row.is_default}<img src="{$config->resourceBase}i/check.gif" alt="{ts}Default{/ts}" />{/if}</td> |
86 | <td class="nowrap crm-price-option-financial-type-id">{$row.financial_type_id}</td> | |
87 | <td class="nowrap crm-price-option-order">{$row.weight}</td> | |
3b5db8ce | 88 | {if $getTaxDetails} |
89 | <td>{if $row.tax_rate != '' } | |
90 | {$taxTerm} ({$row.tax_rate|string_format:"%.2f"}%) | |
91 | {/if} | |
92 | </td> | |
93 | <td>{$row.tax_amount|crmMoney}</td> | |
94 | {/if} | |
e5e8ab99 CW |
95 | <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> |
96 | <td>{$row.action|replace:'xx':$row.id}</td> | |
97 | </tr> | |
98 | {/foreach} | |
99 | </tbody> | |
6a488035 | 100 | </table> |
e5e8ab99 | 101 | {/strip} |
6a488035 TO |
102 | </div> |
103 | ||
e5e8ab99 | 104 | {else} |
6a488035 | 105 | {if $action eq 16} |
e5e8ab99 CW |
106 | <div class="messages status no-popup"> |
107 | <img src="{$config->resourceBase}i/Inform.gif" alt="{ts}status{/ts}"/> | |
108 | {ts}None found.{/ts} | |
1d61ba2b | 109 | </div> |
6a488035 | 110 | {/if} |
e5e8ab99 CW |
111 | {/if} |
112 | {if $addMoreFields && !$isReserved} | |
113 | <div class="action-link"> | |
80bc2820 AH |
114 | {crmButton q="reset=1&action=add&fid=$fid&sid=$sid" icon="plus-circle"}{ts 1=$fieldTitle}New Option for '%1'{/ts}{/crmButton} |
115 | {crmButton p="civicrm/admin/price/field" q="reset=1&sid=$sid" class="cancel" icon="times"}{ts}Done{/ts}{/crmButton} | |
1d61ba2b CW |
116 | </div> |
117 | {/if} | |
6a488035 | 118 | {/if} |