Fixed structure for administrative pages
[civicrm-core.git] / templates / CRM / Price / Page / Set.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.7 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2017 |
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}
27 {include file="CRM/Price/Form/Set.tpl"}
28 {elseif $action eq 1024}
29 {include file="CRM/Price/Form/Preview.tpl"}
30 {elseif $action eq 8 and !$usedBy}
31 {include file="CRM/Price/Form/DeleteSet.tpl"}
32 {else}
33 <div class="help">
34 {ts}Price sets allow you to set up flexible multi-option pricing schemes for your contribution, event and membership pages. Use a price set if the standard pricing options are insufficient for your needs.{/ts}
35 </div>
36
37 {if $usedBy}
38 <div class='spacer'></div>
39 <div id="price_set_used_by" class="messages status no-popup">
40 <div class="icon inform-icon"></div>
41 {if $action eq 8}
42 {ts 1=$usedPriceSetTitle}Unable to delete the '%1' price set - it is currently in use by one or more active events or contribution pages or contributions or event templates.{/ts}
43 {/if}
44
45 {if $usedBy.civicrm_event or $usedBy.civicrm_contribution_page or $usedBy.civicrm_event_template}
46 {include file="CRM/Price/Page/table.tpl"}
47 {/if}
48 </div>
49 {/if}
50
51 {if $rows}
52 <div id="price_set" class="crm-content-block crm-block">
53 {strip}
54 {* handle enable/disable actions*}
55 {include file="CRM/common/enableDisableApi.tpl"}
56 {include file="CRM/common/jsortable.tpl"}
57 <table id="price_set" class="display crm-price-set-listing">
58 <thead>
59 <tr>
60 <th id="sortable">{ts}Set Title{/ts}</th>
61 <th id="nosort">{ts}Used For{/ts}</th>
62 <th>{ts}Enabled?{/ts}</th>
63 <th></th>
64 </tr>
65 </thead>
66 {foreach from=$rows item=row}
67 <tr id="price_set-{$row.id}" class="crm-entity crm-price-set_{$row.id} {cycle values="even-row,odd-row"} {$row.class}{if NOT $row.is_active} disabled{/if}">
68 <td class="crmf-title crm-editable">{$row.title}</td>
69 <td class="crmf-extends">{$row.extends}</td>
70 <td class="crmf-is_active">{if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
71 <td>{$row.action|replace:'xx':$row.id}</td>
72 </tr>
73 {/foreach}
74 </table>
75
76 {if NOT ($action eq 1 or $action eq 2) }
77 <div class="action-link">
78 {crmButton p='civicrm/admin/price' q="action=add&reset=1" id="newPriceSet" icon="plus-circle"}{ts}Add Set of Price Fields{/ts}{/crmButton}
79 </div>
80 {/if}
81
82 {/strip}
83 </div>
84 {else}
85 {if $action ne 1} {* When we are adding an item, we should not display this message *}
86 {capture assign=infoTitle}{ts}No price sets have been added yet.{/ts}{/capture}
87 {assign var="infoType" value="no-popup"}
88 {capture assign=crmURL}{crmURL p='civicrm/admin/price' q='action=add&reset=1'}{/capture}
89 {capture assign=infoMessage}{ts 1=$crmURL}You can <a href='%1'>create one here</a>.{/ts}{/capture}
90 {include file="CRM/common/info.tpl"}
91 {/if}
92 {/if}
93 {/if}