| 1 | {* |
| 2 | +--------------------------------------------------------------------+ |
| 3 | | CiviCRM version 4.5 | |
| 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) 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 | {else} |
| 33 | {if ($usedBy and $action eq 8) or $usedBy.civicrm_event or $usedBy.civicrm_contribution_page} |
| 34 | <div id="price_set_used_by" class="messages status no-popup"> |
| 35 | <div class="icon inform-icon"></div> |
| 36 | {if $action eq 8} |
| 37 | {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} |
| 38 | {/if} |
| 39 | |
| 40 | {if $usedBy.civicrm_event or $usedBy.civicrm_contribution_page or $usedBy.civicrm_event_template} |
| 41 | {include file="CRM/Price/Page/table.tpl"} |
| 42 | {/if} |
| 43 | </div> |
| 44 | {/if} |
| 45 | |
| 46 | |
| 47 | |
| 48 | {if $priceField} |
| 49 | <div class="action-link"> |
| 50 | {if !$isReserved} |
| 51 | <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> |
| 52 | {/if} |
| 53 | <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> |
| 54 | </div> |
| 55 | <div id="field_page"> |
| 56 | {strip} |
| 57 | {* handle enable/disable actions*} |
| 58 | {include file="CRM/common/enableDisableApi.tpl"} |
| 59 | {include file="CRM/common/crmeditable.tpl"} |
| 60 | {include file="CRM/common/jsortable.tpl"} |
| 61 | <table id="options" class="display"> |
| 62 | <thead> |
| 63 | <tr> |
| 64 | <th>{ts}Field Label{/ts}</th> |
| 65 | <th>{ts}Field Type{/ts}</th> |
| 66 | <th id="order" class="sortable">{ts}Order{/ts}</th> |
| 67 | <th>{ts}Req?{/ts}</th> |
| 68 | <th>{ts}Enabled?{/ts}</th> |
| 69 | <th>{ts}Active On{/ts}</th> |
| 70 | <th>{ts}Expire On{/ts}</th> |
| 71 | <th id="nosort">{ts}Price{/ts}</th> |
| 72 | <th></th> |
| 73 | <th class="hiddenElement"></th> |
| 74 | </tr> |
| 75 | </thead> |
| 76 | {foreach from=$priceField key=fid item=row} |
| 77 | <tr id="price_field-{$row.id}" class="crm-entity {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}"> |
| 78 | <td class="crm-editable" data-field="label">{$row.label}</td> |
| 79 | <td>{$row.html_type}</td> |
| 80 | <td class="nowrap">{$row.order}</td> |
| 81 | <td>{if $row.is_required eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td> |
| 82 | <td id="row_{$row.id}_status">{if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td> |
| 83 | <td>{if $row.active_on}{$row.active_on|date_format:"%Y-%m-%d %T"}{/if}</td> |
| 84 | <td>{if $row.expire_on}{$row.expire_on|date_format:"%Y-%m-%d %T"}{/if}</td> |
| 85 | <td>{if $row.html_type eq "Text / Numeric Quantity"}{$row.price|crmMoney}{else}<a 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> |
| 86 | <td class="field-action">{$row.action|replace:'xx':$row.id}</td> |
| 87 | <td class="order hiddenElement">{$row.weight}</td> |
| 88 | </tr> |
| 89 | {/foreach} |
| 90 | </table> |
| 91 | {/strip} |
| 92 | </div> |
| 93 | <div class="action-link"> |
| 94 | {if !$isReserved} |
| 95 | <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> |
| 96 | {/if} |
| 97 | <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> |
| 98 | </div> |
| 99 | |
| 100 | {else} |
| 101 | {if $action eq 16} |
| 102 | <div class="messages status no-popup"> |
| 103 | <div class="icon inform-icon"></div> |
| 104 | {capture assign=crmURL}{crmURL p='civicrm/admin/price/field q="action=add&reset=1&sid=$sid"}{/capture} |
| 105 | {ts 1=$groupTitle 2=$crmURL}There are no fields for price set '%1', <a href='%2'>add one</a>.{/ts} |
| 106 | </div> |
| 107 | {/if} |
| 108 | {/if} |
| 109 | {/if} |