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