058933e898d051250f0dc6f5e9eec5dca91a0d86
[bse.git] / site / templates / admin / edit_product.tmpl
1 <:wrap admin/base.tmpl title => [cond [ifNew] "Add Product" "Edit Product"], menuitem=>"edit", showtitle=>"1", js => "admin_edit.js" :>
2 <:ifMessage:>
3 <p><b><:message:></b></p>
4 <:or:><:eif:> 
5 <:include admin/product_menu.tmpl:>
6 <:ifNew:><:or:><:if Or [iadminuser_count] [iadmingroup_count]:>
7       <form action="/cgi-bin/admin/adminusers.pl">
8   <input type="hidden" name="id" value="<: article id:>" />
9         <table class="editform editformtiny">
10           <tr>
11             <th>Manage access:</th>
12             <td>
13               <select name="adminid">
14 <:iterator begin adminusers:>
15 <option value="<:iadminuser id:>">User <:iadminuser logon:>
16 </option><:iterator end adminusers:>
17 <:iterator begin admingroups:>
18 <option value="<:iadmingroup id:>">Group <:iadmingroup name:>
19 </option><:iterator end admingroups:>
20               </select>
21               <input type="submit" name="a_showobjectart" value="Manage" />
22       </td>
23             <td class="help"><:help access manage:>
24         </td>
25           </tr>
26         </table>
27       </form>
28 <br />
29 <:or Or:><:eif Or:><:eif:>
30 <form action="<:script:>" enctype="multipart/form-data" method="post">
31     <input type="hidden" name="lastModified" value="<:article lastModified:>" />
32     <input type="hidden" name="type" value="Product" />
33     <input type="hidden" name="id" value="<:product id:>" />
34 <:ifNew:><:csrfp admin_add_article hidden:><:or:><:csrfp admin_save_article hidden:><:eif:>
35         <table class="editform">
36                     <tr> 
37             <th>Catalog:</th>
38             <td>
39 <:ifFieldPerm parentid:><select name="parentid"><:list:></select><:or:><:parent title:> (<:parent id:>)<:eif:></td>
40             <td nowrap="nowrap" bgcolor="#FFFFFF"><:help product catalog:> <:error_img
41               parentid:></td>
42           </tr>
43                   <tr> 
44             <th>Title:</th>
45             <td><:ifFieldPerm title:><input type="text" name="title" value="<:old title default title:>" size="60" /><:or:><:product title:><:eif:> </td>
46             <td class="help"><:help product title:> <:error_img title:></td>
47           </tr>
48           <:if Cfg "title alias" [concatenate level [article level]]:><tr>
49             <th>Alias:</th>
50             <td>
51               <:if FieldPerm titleAlias:><input type="text" name="titleAlias" maxlength="<:cfg fields alias_size 60:>" size="60" value="<:old titleAlias article titleAlias:>" /><:or FieldPerm:><:article titleAlias:><:eif FieldPerm:>
52             </td>
53             <td class="help"><:help edit titleAlias:> <:error_img titleAlias:></td>
54           </tr><:or Cfg:><:eif Cfg:>
55           <tr> 
56             <th>Summary:</th>
57             <td><:ifFieldPerm summary:><input type="text" name="summary" value="<:old summary default summary:>" size="60" /><:or:><:product summary:><:eif:> </td>
58             <td class="edit"><:help product summary:> <:error_img
59             summary:></td>
60           </tr>
61           <tr> 
62             <th>Description:</th>
63             <td><:ifFieldPerm description:><input type="text" name="description" value="<:old description default description:>" size="60" /><:or:><:product description:><:eif:> </td>
64             <td class="help"><:help product description:> <:error_img
65             description:></td>
66           </tr>
67           <tr> 
68             <th>Product Code:</th>
69             <td><:ifFieldPerm product_code:><input type="text" name="product_code" value="<:old product_code default product_code:>" size="60" /><:or:><:product product_code:><:eif:> </td>
70             <td class="help"><:help product product_code:> <:error_img
71             product_code:></td>
72           </tr>
73           <tr> 
74             <th> Body:</th>
75             <td> 
76               <:ifFieldPerm body:><textarea name="body" rows="15" cols="60" ><:old body default body:></textarea><:or:><:bodytext product body:><:eif:>
77             </td>
78             <td class="help"><:help body body:> <:error_img
79             body:></td>
80           </tr>
81           <:if Cfgsection [concatenate level [article level] " menus"]:><tr> 
82             <th>Menu:</th>
83             <td> 
84               <:if FieldPerm menu:><select name="menu" id="menu">
85                 <:iterator begin cfgsection [concatenate level [article level] " menus"] sort=key:><option value="<:cfgentry key:>"<:if Eq [old menu] [cfgentry key]:> selected="selected"<:or Eq:><:eif Eq:>><:cfgentry value:></option><:iterator separator cfgsection:>
86                 <:iterator end cfgsection:>
87               </select><:or FieldPerm:><:article menu:><:eif FieldPerm:>
88             </td>
89             <td class="help"><:help article menu:> <:error_img menu:></td>
90           </tr><:or Cfgsection:><:eif Cfgsection:>
91                   <tr> 
92             <th>Template:</th>
93             <td><:ifFieldPerm template:><:templates:><:or:><:product template:><:eif:></td>
94             <td class="help"><:help product template:> <:error_img
95             template:></td>
96           </tr>
97                   <tr> 
98             <th>List article:</th>
99             <td> <:if FieldPerm listed:><:list listed:><:or FieldPerm:><:if Article listed:><:ifEq [article listed] "1":>Yes<:or:>In Sections, but not menu<:eif:><:or Article:>No<:eif Article:><:eif FieldPerm:> </td>
100             <td class="help"><:help edit listed:> <:error_img listed:></td>
101           </tr>
102           <tr> 
103             <th>Link alias:</th>
104             <td> 
105             <:ifFieldPerm linkAlias:><input type="text" name="linkAlias" maxlength="<:cfg fields linkAlias_size 255:>" size="40" value="<: old linkAlias article linkAlias :>" />
106             <:or:><:default linkAlias:><:eif:></td>
107             <td class="help"><:help edit linkAlias:> <:error_img linkAlias:></td>
108           </tr>
109                   <tr>
110             <th>Flags:</th>
111             <td><:iterator begin flags:><:if FieldPerm flags:>
112               <input type="checkbox" name="flags" value="<:flag id:>" <:ifFlagSet [flag id]:>checked="checked"<:or:>
113               <:eif:> /><:or FieldPerm:><:ifFlagSet [flag id]:>Yes<:or:>No<:eif:>
114               <:eif FieldPerm:><:flag desc:><:iterator separator flags:><br /><:iterator end flags:></td>
115             <td class="help"><:help edit flags:> <:error_img flags:></td>
116           </tr>
117           <tr>
118             <th>Page title:</th>
119             <td>
120               <:ifFieldPerm pageTitle:><input type="text" name="pageTitle" value='<:old pageTitle article pageTitle:>' size="60" maxlength="255" /> (alternate title)<:or:><:article pageTitle:><:eif:>
121             </td>
122            <td class="help"><:help edit pageTitle:> <:error_img pageTitle:></td>
123           </tr>
124           <tr>
125             <th>Meta description:</th>
126             <td>
127               <:ifFieldPerm metaDescription:><input type="text" name="metaDescription" value='<:old metaDescription article metaDescription:>' size="60" maxlength="255" /><:or:><:article metaDescription:><:eif:>
128             </td>
129            <td class="help"><:help edit metaDescription:> <:error_img metaDescription:></td>
130           </tr>
131           <tr>
132             <th>Meta keywords:</th>
133             <td>
134               <:ifFieldPerm metaKeywords:><input type="text" name="metaKeywords" value='<:old metaKeywords article metaKeywords:>' size="60" maxlength="255" /> (comma separated)<:or:><:article metaKeywords:><:eif:>
135             </td>
136            <td class="help"><:help edit metaKeywords:> <:error_img metaKeywords:></td>
137           </tr>
138           <tr>
139             <th>Author name:</th>
140             <td>
141               <:if FieldPerm author:><input type="text" name="author" value='<:ifCfg editor auto_author:><:old author adminuser name:><:or:><:old author:><:eif:>' size="40" maxlength="255" /><:or FieldPerm:><:article author:><:eif FieldPerm:>
142             </td>
143             <td class="help"><:help edit author:> <:error_img author:></td>
144           </tr>
145           <tr> 
146             <th>Lead time:</th>
147             <td> 
148               <:ifFieldPerm leadTime:>
149               <input type="text" name="leadTime" value="<:old leadTime default leadTime:>" size="5" /><:or:><:product leadTime:><:eif:>
150               days</td>
151             <td class="help"><:help product leadtime:> <:error_img leadTime:></td>
152           </tr>
153           <tr> 
154             <th><:cfg "product fields" retailPrice "Retail price":>:</th>
155             <td>$ 
156               <:ifFieldPerm retailPrice:><input type="text" name="retailPrice" value="<:old retailPrice money default retailPrice:>" size="7" />
157               (0.00)<:or:><:money product retailPrice:><:eif:> </td>
158             <td class="help"><:help product retail:> <:error_img retailPrice:></td>
159           </tr>
160 <:if Price_tiers:>
161           <tr>
162             <th><:cfg "product field" tier_prices "Tier prices":>:</th>
163             <td>
164 <input type="hidden" name="save_pricing_tiers" value="1" />
165             <table class="editform editformtiny">
166 <:iterator begin price_tiers:>
167 <tr>
168   <th><:price_tier description:></th>
169   <td>$<:if FieldPerm retailPrice:><input type="text" name="tier_price_<:price_tier id:>" value="<:ifEq [tier_price] "":><:oldi [cat "tier_price_" [price_tier id]] 0:><:or:><:oldi [cat "tier_price_" [price_tier id]] 0 money tier_price:><:eif:>" size="7" /> (0.00)<:or FieldPerm:><:ifEq [tier_price] "":>-<:or:><:money tier_price:><:eif:><:eif FieldPerm:></td>
170   <td class="help"><:error_img [cat "tier_price_" [price_tier id]]:></td>
171
172 </tr>
173 <:iterator end price_tiers:>
174             </table>
175             </td>
176 <td class="help"><:help product tier_price:></td>
177           </tr>
178 <:or Price_tiers:><:eif Price_tiers:>
179           <tr> 
180             <th>Wholesale price:</th>
181             <td>$ 
182               <:ifFieldPerm wholesalePrice:><input type="text" name="wholesalePrice" value="<:old wholesalePrice money default wholesalePrice:>" size="7" />
183               (0.00)<:or:><:money product wholesalePrice:><:eif:></td>
184             <td class="help"><:help product wholesale:> <:error_img wholesalePrice:></td>
185           </tr>
186           <tr> 
187             <th>GST:</th>
188             <td>$ 
189               <:ifFieldPerm gst:><input type="text" name="gst" value="<:old gst money default gst:>" size="7" />
190               (0.00)<:or:><:money product gst:><:eif:></td>
191             <td class="help"><:help product gst:> <:error_img gst:></td>
192           </tr>
193           <tr>
194             <th>Weight:</th>
195             <td><:ifFieldPerm weight:><input type="text" name="weight" value="<:old weight default weight:>" size="7" /><:or:><:product weight:><:eif:> grams</td>
196             <td class="help"><:help product weight:> <:error_img weight:></td>
197           </tr>
198           <tr>
199             <th>Length:</th>
200             <td><:ifFieldPerm length:><input type="text" name="length" value="<:old length default length:>" size="7" /><:or:><:product length:><:eif:> mm</td>
201             <td class="help"><:help product length:> <:error_img length:></td>
202           </tr>
203           <tr>
204             <th>Width:</th>
205             <td><:ifFieldPerm width:><input type="text" name="width" value="<:old width default width:>" size="7" /><:or:><:product width:><:eif:> mm</td>
206             <td class="help"><:help product width:> <:error_img width:></td>
207           </tr>
208           <tr>
209             <th>Height</th>
210             <td><:ifFieldPerm height:><input type="text" name="height" value="<:old height default height:>" size="7" /><:or:><:product height:><:eif:> mm</td>
211             <td class="help"><:help product height:> <:error_img height:></td>
212           </tr>
213           <tr> 
214             <th>Release date:</th>
215             <td> 
216               <:ifFieldPerm release:><input type="text" name="release" value="<:old release date "%d/%m/%Y" default release:>" size="11" />
217               (dd/mm/yyyy)<:or:><:date "%d/%m/%Y" product release:><:eif:></td>
218             <td class="help"><:help product release:> <:error_img
219             release:></td>
220           </tr>
221           <tr> 
222             <th>Expiry date:</th>
223             <td> 
224               <:ifFieldPerm expire:><input type="text" name="expire" value="<:old expire date "%d/%m/%Y" default expire:>" size="11" />
225               (dd/mm/yyyy)<:or:><:date "%d/%m/%Y" product expire:><:eif:></td>
226             <td class="help"><:help product expire:> <:error_img
227             expire:></td>
228           </tr>
229           <tr> 
230             <th>Summary length:</th>
231             <td> 
232               <:ifFieldPerm summaryLength:><input type="text" name="summaryLength" size="10" maxlength="10" value="<:old summaryLength default summaryLength:>" /><:or:><:product summaryLength:><:eif:>
233             </td>
234             <td class="help"><:help product summary:> <:error_img summaryLength:></td>
235           </tr>
236           <tr> 
237             <th>Display threshold:</th>
238             <td> 
239               <:ifFieldPerm threshold:><input type="text" name="threshold" size="10" maxlength="10" value="<:old threshold default threshold:>" /><:or:><:product threshold:><:eif:>
240             </td>
241             <td class="help"><:help product threshold:> <:error_img threshold:></td>
242           </tr>
243 <:include admin/include/edit_common.tmpl:>
244           <tr> 
245             <th>Options:</th>
246             <td> 
247               <:ifFieldPerm options:><input type="text" name="options" value="<:old options default options:>" size="30" />
248               (<:alloptions:>)<:or:><:product options:><:eif:> </td>
249             <td class="help"><:help product options:> <:error_img options:></td>
250           </tr>
251 <:include admin/product_custom.tmpl optional -:>
252 <:include admin/include/custom/product_custom.tmpl optional -:>
253 <:include admin/include/product_custom.tmpl optional -:>
254 <:include admin/include/article_cfg_custom.tmpl -:>
255           <tr> 
256             <th>Thumbnail image:</th>
257             <td> 
258               <:ifFieldPerm thumbImage:><input type="file" name="thumbnail" /><:or:><:eif:>
259               <:ifProduct thumbImage:><img src="/images/<:product thumbImage:>"> 
260               <:if FieldPerm thumbImage:><input type="checkbox" name="remove_thumb" />
261               Remove<:or FieldPerm:><:eif FieldPerm:><:or:><:eif:> </td>
262             <td class="help"><:help product thumb:> <:error_img
263             thumbImage:></td>
264           </tr>
265                   <:if Article id:>
266           <tr> 
267             <th><a name="files"></a>Files:</th>
268             <td> <:if Files:> 
269                     <table class="editform editformsmall">
270                       <tr> 
271                         <th>Filename</th>
272                         <th>Size</th>
273                         <th>Type</th>
274                         <th>D/l</th>
275                         <th>Pay</th>
276                         <th>User</th>
277                       </tr>
278                       <:iterator begin files:> 
279                       <tr> 
280                         <td><:file displayName:></td>
281                         <td align="center"><:kb file sizeInBytes:></td>
282                         <td><:file contentType:></td>
283                         <td align="center"><:ifFile download:>Yes<:or:>No<:eif:></td>
284                         <td align="center"><:ifFile forSale:>Yes<:or:>No<:eif:></td>
285                         <td align="center"><:ifFile requireUser:>Yes<:or:>No<:eif:></td>
286                       </tr>
287                       <:iterator end files:> 
288                     </table>
289               <p><a href="<:script:>?filelist=1&amp;id=<:article id:>"><b>Manage Files</b></a>
290               </p>
291               <:or Files:>
292               No files are attached to this article. <a href="<:script:>?filelist=1&amp;id=<:article id:>"><b>Manage Files</b></a><:eif Files:>
293             </td>
294             <td class="help"><:help product 
295               files:> <:error_img files:></td>
296           </tr>
297           <tr> 
298             <th>Images:</th>
299             <td> <:if Images:> <:iterator begin 
300               images:> <img src="/images/<: image image :>" alt="<:image alt :>" width= 
301               <:image width:> height=<:image height:>> <:iterator separator images:> 
302               <hr noshade size="1">
303               <: iterator end images :>
304               <p align="left"><a href="<:script:>?id=<:article id:>&amp;showimages=1"><b>Manage Images</b></a></p>
305               <:or Images:>No images are attached to this article.  <a href="<:script:>?id=<:article id:>&amp;showimages=1"><b>Manage Images</b></a>
306               <:eif Images:>
307             </td>
308             <td class="help"><:help product images:> <:error_img
309             images:></td>
310           </tr>
311                   <:or Article:><:eif Article:>
312           <tr> 
313             <th>Purchase subscribes to:</th>
314             <td> 
315               <select name="subscription_id">
316                 <option value="-1"<:ifEq [old subscription_id] "-1":> selected="selected"<:or:><:eif:>>(nothing)</option>
317 <:iterator begin subscriptions:>
318                 <option value="<:subscription subscription_id:>"<:ifEq [old subscription_id] [subscription subscription_id]:> selected="selected"<:or:><:eif:>><:subscription title:></option>
319 <:iterator end subscriptions:>
320               </select> for <input type="text" name="subscription_period" value="<:ifEq [old subscription_period] "":><:default subscription_period:><:or:><:old subscription_period:><:eif:>" size="3" /><:error_img subscription_period:> months.
321             </td>
322             <td class="help"><:help product subscription_id:></td>
323           </tr>
324           <tr> 
325             <th>Can be used to:</th>
326             <td> 
327               <select name="subscription_usage">
328                 <option value="3"<:ifEq [old subscription_usage] "3":> selected="selected"<:or:><:eif:>>Start or renew a subscription</option>
329                 <option value="1"<:ifEq [old subscription_usage] "1":> selected="selected"<:or:><:eif:>>Start a subscription only</option>
330                 <option value="2"<:ifEq [old subscription_usage] "2":> selected="selected"<:or:><:eif:>>Renew a subscription only</option>
331               </select>
332             </td>
333             <td class="help"><:help product subscription_usage:></td>
334           </tr>
335           <tr> 
336             <th>User must be subscribed to:</th>
337             <td> 
338               <select name="subscription_required">
339                 <option value="-1"<:ifEq [old subscription_required] "-1":> selected="selected"<:or:><:eif:>>(nothing)</option>
340 <:iterator begin subscriptions:>
341                 <option value="<:subscription subscription_id:>"<:ifEq [old subscription_required] [subscription subscription_id]:> selected="selected"<:or:><:eif:>><:subscription title:></option>
342 <:iterator end subscriptions:>
343               </select> to purchase this product
344             </td>
345             <td class="help"><:help product subscription_id:></td>
346           </tr>
347   <tr><td colspan="3">*These fields cannot be modified once this product has been
348       included in an order.</td></tr>
349   <:if UserCan edit_save:article:>
350   <tr>
351     <td colspan="3" class="buttons"><:ifNew:><input type="submit" name="save" value="Add Product" /><:or:><input type="submit" name="save" value="Update Product" /><:eif:>
352   </td></tr><:or UserCan:><:eif UserCan:>
353         </table>
354 </form>