CRM-14408 - get rid of unnecessary calls to crmAccordions
[civicrm-core.git] / templates / CRM / Contribute / Form / ManagePremiums.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 {* this template is used for adding/editing/deleting premium *}
27 <h3>{if $action eq 1}{ts}New Premium{/ts}{elseif $action eq 2}{ts}Edit Premium{/ts}{elseif $action eq 1024}{ts}Preview a Premium{/ts}{else}{ts}Delete Premium Product{/ts}{/if}</h3>
28 <div class="crm-block crm-form-block crm-contribution-manage_premiums-form-block">
29 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
30 {if $action eq 8}
31 <div class="messages status no-popup">
32 <div class="icon inform-icon"></div>
33 {ts}Are you sure you want to delete this premium?{/ts} {ts}This action cannot be undone.{/ts} {ts}This will also remove the premium from any contribution pages that currently include it.{/ts}
34 </div>
35 {elseif $action eq 1024}
36 {include file="CRM/Contribute/Form/Contribution/PremiumBlock.tpl" context="previewPremium"}
37 {else}
38 <table class="form-layout-compressed">
39 <tr class="crm-contribution-form-block-name">
40 <td class="label">{$form.name.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_product' field='name' id=$productId}{/if}
41 </td>
42 <td class="html-adjust">{$form.name.html}<br />
43 <span class="description">{ts}Name of the premium (product, service, subscription, etc.) as it will be displayed to contributors.{/ts}</span>
44 </td>
45 </tr>
46 <tr>
47 <td class="label">{$form.description.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_product' field='description' id=$productId}{/if}
48 </td>
49 <td class="html-adjust">{$form.description.html}
50 </td>
51 <tr class="crm-contribution-form-block-sku">
52 <td class="label">{$form.sku.label}
53 </td>
54 <td class="html-adjust">{$form.sku.html}<br />
55 <span class="description">{ts}Optional product SKU or code. If used, this value will be included in contributor receipts.{/ts}</span>
56 </td>
57 </tr>
58 <tr class="crm-contribution-form-block-imageOption" >
59 <td class="label">{$form.imageOption.label}</td>
60 <td>
61 <fieldset><div class="description">
62 <p>{ts}You can give this premium a picture that will be displayed on the contribution page. Both a 50 x 50 pixel thumbnail image and a 200 x 200 pixel larger image will be displayed. Images must be in GIF, JPEG, or PNG format.{/ts}</p>
63 <p>{ts}You can upload an image from your computer OR enter a URL for an image already on the Web. If you chose to upload an image file, a 'thumbnail' version will be automatically created for you. If you don't have an image available at this time, you may also choose to display a 'No Image Available' icon - by selecting the 'default image'.{/ts}</p>
64 </div>
65 <table class="form-layout-compressed">
66 {if $thumbnailUrl}<tr class="odd-row"><td class="describe-image" colspan="2"><strong>Current Image Thumbnail</strong><br /><img src="{$thumbnailUrl}" /></td></tr>{/if}
67 <tr class="crm-contribution-form-block-imageOption"><td>{$form.imageOption.image.html}</td><td>{$form.uploadFile.html}</td></tr>
68 <tr class="crm-contribution-form-block-imageOption-thumbnail"><td colspan="2">{$form.imageOption.thumbnail.html}</td></tr>
69 <tr id="imageURL"{if $action eq 2}class="show-row" {else} class="hide-row" {/if}>
70 <td class="label">{$form.imageUrl.label}</td><td>{$form.imageUrl.html|crmAddClass:huge}</td>
71 </tr>
72 <tr id="thumbnailURL"{if $action eq 2}class="show-row" {else} class="hide-row" {/if}>
73 <td class="label">{$form.thumbnailUrl.label}</td><td>{$form.thumbnailUrl.html|crmAddClass:huge}</td>
74 </tr>
75 <tr><td colspan="2">{$form.imageOption.default_image.html}</td></tr>
76 <tr><td colspan="2">{$form.imageOption.noImage.html}</td></tr>
77 </table>
78 </fieldset>
79 </td>
80 </tr>
81 <tr class="crm-contribution-form-block-min_contribution">
82 <td class="label">{$form.min_contribution.label}</td>
83 <td class="html-adjust">{$form.min_contribution.html|crmMoney}<br />
84 <span class="description">{ts}The minimum contribution amount required to be eligible to select this premium. If you want to offer it to all contributors regardless of contribution amount, enter '0'. If display of minimum contribution amounts is enabled then this text is displayed:{/ts} <em>{ts}(Contribute at least X to be eligible for this gift.){/ts}</em></span>
85 </td>
86 </tr>
87 <tr class="crm-contribution-form-block-price">
88 <td class="label">{$form.price.label}</td>
89 <td class="html-adjust">{$form.price.html|crmMoney}<br />
90 <span class="description">{ts}The market value of this premium (e.g. retail price). For tax-deductible contributions, this amount will be used to set the non-deductible amount in the contribution record and receipt.{/ts}</span>
91 </td>
92 </tr>
93 <tr class="crm-contribution-form-block-cost">
94 <td class="label">{$form.cost.label}</td>
95 <td class="html-adjust">{$form.cost.html|crmMoney}<br />
96 <span class="description">{ts}You may optionally record the actual cost of this premium to your organization. This may be useful when evaluating net return for this incentive.{/ts}</span>
97 </td>
98 </tr>
99 <tr class="crm-contribution-form-block-financial_type">
100 <td class="label">{$form.financial_type_id.label}</td>
101 <td class="html-adjust">
102 {if !$financialType}
103 {capture assign=ftUrl}{crmURL p='civicrm/admin/financial/financialType' q="reset=1"}{/capture}
104 {ts 1=$ftUrl}There are no financial types configured with linked 'Cost of Sales Premiums' and 'Premiums Inventory Account' accounts. If you want to generate accounting transactions which track the cost of premiums used <a href='%1'>click here</a> to configure financial types and accounts.{/ts}
105 {else}
106 {$form.financial_type_id.html}<br />
107 <span class="description">{ts}Select a financial type that is linked to both a 'Cost of Sales Premiums Account' and a 'Premiums Inventory Account' if you want to generate accounting transactions to track the cost of premiums used.{/ts}</span>
108 {/if}
109 </td>
110 </tr>
111 <tr class="crm-contribution-form-block-options">
112 <td class="label">{$form.options.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_product' field='options' id=$productId}{/if}</td>
113 <td class="html-adjust">{$form.options.html}<br />
114 <span class="description">{ts}Enter a comma-delimited list of color, size, etc. options for the product if applicable. Contributors will be presented a drop-down menu of these options when they select this product.{/ts}</span>
115 </td>
116 </tr>
117 <tr class="crm-contribution-form-block-is_active">
118 <td class="label">{$form.is_active.label}</td>
119 <td class="html-adjust">{$form.is_active.html}</td>
120 </tr>
121 </table>
122 <fieldset id="time-delimited" class="crm-collapsible {if empty($showSubscriptions)}collapsed{/if}">
123 <legend class="collapsible-title">{ts}Subscription or Service Settings{/ts}</legend>
124 <div>
125 <table class="form-layout-compressed">
126 <tr class="crm-contribution-form-block-period_type">
127 <td class="label">{$form.period_type.label}</td>
128 <td class="html-adjust">{$form.period_type.html}<br />
129 <span class="description">{ts}Select 'Rolling' if the subscription or service starts on the current day. Select 'Fixed' if the start date is a fixed month and day within the current year (set this value in the next field).{/ts}</span>
130 </td>
131 </tr>
132 <tr class="crm-contribution-form-block-fixed_period_start_day">
133 <td class="label">{$form.fixed_period_start_day.label}</td>
134 <td class="html-adjust">{$form.fixed_period_start_day.html}<br />
135 <span class="description">{ts}Month and day (MMDD) on which a fixed period subscription or service will start. EXAMPLE: A fixed period subscription with Start Day set to 0101 means that the subscription period would be 1/1/06 - 12/31/06 for anyone signing up during 2006.{/ts}</span>
136 </td>
137 </tr>
138 <tr class="crm-contribution-form-block-duration_interval">
139 <td class="label">{$form.duration_interval.label}</td>
140 <td class="html-adjust">{$form.duration_interval.html} &nbsp; {$form.duration_unit.html}<br />
141 <span class="description">{ts}Duration of subscription or service (e.g. 12-month subscription).{/ts}</span>
142 </td>
143 </tr>
144 <tr class="crm-contribution-form-block-frequency_interval">
145 <td class="label">{$form.frequency_interval.label}</td>
146 <td class="html-adjust">{$form.frequency_interval.html} &nbsp; {$form.frequency_unit.html}<br />
147 <span class="description">{ts}Frequency of subscription or service (e.g. journal delivered every two months).{/ts}</span>
148 </td>
149 </tr>
150 </table>
151 </div>
152 </fieldset>
153 {/if}
154 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
155 </div>
156 {if $action eq 1 or $action eq 2 }
157
158 <script type="text/javascript">
159 {literal}
160
161 function add_upload_file_block(parms) {
162 if (parms =='thumbnail') {
163
164 document.getElementById("imageURL").style.display="table-row";
165 document.getElementById("thumbnailURL").style.display="table-row";
166
167 } else {
168
169 document.getElementById("imageURL").style.display="none";
170 document.getElementById("thumbnailURL").style.display="none";
171
172 }
173 }
174
175 {/literal}
176 </script>
177
178 {/if}