Merge pull request #2687 from giant-rabbit/event_info_custom_validation
[civicrm-core.git] / templates / CRM / Price / Page / Set.tpl
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}
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 id="help">
34 {ts}Price sets allow you to set up multiple event registration options with associated fees (e.g. pre-conference workshops, additional meals, etc.). Configure Price Sets for events which need more than a single set of fee levels.{/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">
53 <p></p>
54 {strip}
55 {* handle enable/disable actions*}
56 {include file="CRM/common/enableDisableApi.tpl"}
57 {include file="CRM/common/crmeditable.tpl"}
58 {include file="CRM/common/jsortable.tpl"}
59 <table id="price_set" class="display crm-price-set-listing">
60 <thead>
61 <tr>
62 <th id="sortable">{ts}Set Title{/ts}</th>
63 <th id="nosort">{ts}Used For{/ts}</th>
64 <th>{ts}Enabled?{/ts}</th>
65 <th></th>
66 </tr>
67 </thead>
68 {foreach from=$rows item=row}
69 <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}">
70 <td class="crm-price-set-title crm-editable" data-field="title">{$row.title}</td>
71 <td class="crm-price-set-extends">{$row.extends}</td>
72 <td id="row_{$row.id}_status" class="crm-price-set-is_active">{if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
73 <td>{$row.action|replace:'xx':$row.id}</td>
74 </tr>
75 {/foreach}
76 </table>
77
78 {if NOT ($action eq 1 or $action eq 2) }
79 <div class="action-link">
80 <a href="{crmURL p='civicrm/admin/price' q="action=add&reset=1"}" id="newPriceSet" class="button"><span><div class="icon add-icon"></div>{ts}Add Set of Price Fields{/ts}</span></a>
81 </div>
82 {/if}
83
84 {/strip}
85 </div>
86 {else}
87 {if $action ne 1} {* When we are adding an item, we should not display this message *}
88 {capture assign=infoTitle}{ts}No price sets have been added yet.{/ts}{/capture}
89 {assign var="infoType" value="no-popup"}
90 {capture assign=crmURL}{crmURL p='civicrm/admin/price' q='action=add&reset=1'}{/capture}
91 {capture assign=infoMessage}{ts 1=$crmURL}You can <a href='%1'>create one here</a>.{/ts}{/capture}
92 {include file="CRM/common/info.tpl"}
93 {/if}
94 {/if}
95 {/if}