Bug 13618: Remove html filters at the intranet
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / itemtypes.tt
1 [% USE Koha %]
2 [% USE AuthorisedValues %]
3 [% USE Price %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha &rsaquo; Administration &rsaquo; Item types [% IF op == 'add_form' %]&rsaquo;
6   [% IF ( itemtype ) %]
7 Modify item type '[% itemtype.itemtype %]'
8   [% ELSE %]
9 Add item type
10   [% END %]
11 [% END %]
12 [% IF op == 'delete_confirm' %]&rsaquo;
13   [% IF ( total ) %]
14 Cannot delete item type '[% itemtype.itemtype %]'
15   [% ELSE %]
16 Delete item type '[% itemtype.itemtype %]'?
17   [% END %]
18 [% END %]
19 [% IF op == 'delete_confirmed' %]&rsaquo;
20 Data deleted
21 [% END %]
22 </title>
23 [% INCLUDE 'doc-head-close.inc' %]
24 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
25 [% INCLUDE 'greybox.inc' %]
26 [% INCLUDE 'datatables.inc' %]
27 <script type="text/javascript">
28 //<![CDATA[
29      $(document).ready(function() {
30         $('#icons').tabs();
31         $("#table_item_type").dataTable($.extend(true, {}, dataTablesDefaults, {
32             "aoColumnDefs": [
33                 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
34             ],
35             "aaSorting": [[ 2, "asc" ]],
36             "iDisplayLength": 10,
37             "sPaginationType": "four_button"
38         }));
39         $( "#itemtypeentry" ).validate({
40             rules: {
41                 itemtype: { required: true },
42                 description: { required: true },
43                 rentalcharge: { number: true }
44             }
45         });
46      });
47 //]]>
48 </script>
49 <style type="text/css">
50         fieldset.rows div.toptabs li { clear:none;margin-right:.5em;padding-bottom:0;width:auto; }
51   fieldset.rows div.toptabs .ui-tabs-nav li.ui-tabs-active {background-color : #F4F8F9; }
52         fieldset.rows .ui-tabs-panel { margin-right : 10px; margin-left : 10px;margin-bottom:10px;}
53   fieldset.rows .ui-tabs-nav { margin-left : 10px; }
54 </style>
55 </head>
56 <body id="admin_itemtypes" class="admin">
57 [% INCLUDE 'header.inc' %]
58 [% INCLUDE 'cat-search.inc' %]
59
60 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo; [% IF op == 'add_form' %]
61   [% IF itemtype %]
62 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> &rsaquo; Modify item type '[% itemtype.itemtype %]'
63   [% ELSE %]
64 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> &rsaquo; Add item type
65   [% END %]
66 [% END %]
67 [% IF op == 'delete_confirm' %]
68   [% IF total %]
69 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> &rsaquo; Cannot delete item type '[% itemtype.itemtype %]'
70   [% ELSE %]
71 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> &rsaquo; Delete item type '[% itemtype.itemtype %]'?
72   [% END %]
73 [% END %]
74 [% IF op == 'delete_confirmed' %]
75 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> &rsaquo;Data deleted
76 [% END %]
77 [% IF op == 'list' %]
78 Item types administration
79 [% END %]</div>
80
81 <div id="doc3" class="yui-t2">
82
83    <div id="bd">
84         <div id="yui-main">
85         <div class="yui-b">
86         
87
88 [% IF op == 'list' %]<div id="toolbar" class="btn-toolbar">
89     <a class="btn btn-small" id="newitemtype" href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form"><i class="fa fa-plus"></i> New item type</a>
90 </div>[% END %]
91
92 [% FOREACH m IN messages %]
93     <div class="dialog [% m.type %]">
94         [% SWITCH m.code %]
95         [% CASE 'error_on_update' %]
96             An error occurred when updating this item type. Perhaps the value already exists.
97         [% CASE 'error_on_insert' %]
98             An error occurred when inserting this item type. Perhaps the value already exists.
99         [% CASE 'error_on_delete' %]
100             An error occurred when deleting this item type. Check the logs.
101         [% CASE 'success_on_update' %]
102             Item type updated successfully.
103         [% CASE 'success_on_insert' %]
104             Item type inserted successfully.
105         [% CASE 'success_on_delete' %]
106             Item type deleted successfully.
107         [% CASE 'already_exists' %]
108             This item type already exists.
109         [% CASE 'cannot_be_deleted' %]
110             Cannot delete this item type. <p><strong>This record is used [% m.total %] times</strong>. Deletion is not possible.</p>
111         [% CASE %]
112             [% m.code %]
113         [% END %]
114     </div>
115 [% END %]
116
117
118 [% IF op == 'add_form' %]
119     [% IF itemtype %]
120         <h3>Modify item type</h3>
121     [% ELSE %]
122         <h3>Add item type</h3>
123     [% END %]
124     <form action="/cgi-bin/koha/admin/itemtypes.pl" name="Aform" method="post" id="itemtypeentry">
125         <input type="hidden" name="op" value="add_validate" />
126         <fieldset class="rows">
127             <ol>
128                 [% IF itemtype %]
129                     <li>
130                         <input type="hidden" name="is_a_modif" value="1" />
131                         <span class="label">Item type: </span> <input type="hidden" name="itemtype" value="[% itemtype.itemtype %]" />
132                         [% itemtype.itemtype %]
133                     </li>
134                 [% ELSE %]
135                     <li>
136                         <label for="itemtype" class="required">Item type: </label>
137                         <input type="text" id="itemtype" name="itemtype" size="10" maxlength="10" onblur="toUC(this)" required="required" /> <span class="required">Required</span>
138                     </li>
139                 [% END %]
140                 <li>
141                     <label for="description" class="required">Description: </label>
142                     <input type="text" id="description" name="description" size="48" value="[% itemtype.description %]" required="required" /> <span class="required">Required</span>
143                     <a href="/cgi-bin/koha/admin/localization.pl?entity=itemtypes&code=[% itemtype.itemtype %]" title="Translate item type [% itemtype.itemtype %]" rel="gb_page_center[600,500]"><i class="icon-edit"></i> Translate into other languages</a>
144                 </li>
145                 <li>
146                     <span class="label">Search category</span>
147                     <select id="searchcategory" name="searchcategory">
148                     <option value="">None</option>
149                         [% FOREACH cat IN searchcategory %]
150                             [% IF cat.selected %]
151                                 <option value="[% cat.authorised_value %]" selected="selected">
152                                     [% cat.lib %]
153                                 </option>
154                             [% ELSE %]
155                                 <option value="[% cat.authorised_value %]" >
156                                     [% cat.lib %]
157                                 </option>
158                             [% END %]
159                         [% END %]
160                     </select>
161                     (Options are defined as the authorized values for the ITEMTYPECAT category)
162                 </li>
163                 [% IF Koha.Preference('noItemTypeImages') %]
164                     <li>
165                         <span class="label">Image: </span>Item type images are disabled. To enable them, turn off the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&amp;searchfield=noItemTypeImages">noItemTypeImages system preference</a>
166                     </li>
167                 [% END %]
168             </ol>
169             [% UNLESS Koha.Preference('noItemTypeImages') %]
170                 <div id="icons" class="toptabs" style="clear:both">
171                     <h5 style="margin-left:10px;">Choose an icon:</h5>
172                     <ul>
173                         <li><a href="#none">None</a></li>
174                         [% FOREACH imageset IN imagesets %]
175                             [% IF ( imageset.imagesetactive ) %]
176                                 <li class="ui-tabs-active">
177                             [% ELSE %]
178                                 <li>
179                             [% END %]
180                             <a href="#[% imageset.imagesetname %]">[% imageset.imagesetname %]</a>
181                             </li>
182                         [% END %]
183                         [% IF itemtype.image_location.match('^http') %]<li class="ui-tabs-active">[% ELSE %]<li>[% END %]<a href="#remote">Remote image</a></li>
184                     </ul>
185                     <div id="none">
186                         <ul>
187                             <li><label for="noimage">No image: </label><input type="radio" name="image" id="noimage" value="removeImage" /></li>
188                         </ul>
189                         <br class="clear" />
190                     </div>
191
192                     [% FOREACH imageset IN imagesets %]
193                         <div id="[% imageset.imagesetname %]">
194                             <ul>
195                                 [% FOREACH image IN imageset.images %]
196                                     <li style="float: none; display: inline-block; clear : none; width: auto;">
197                                         <label>
198                                             [% IF image.StaffImageUrl %]
199                                                 <img src="[% image.StaffImageUrl %]" alt="[% image.StaffImageUrl %]" title="[% image.StaffImageUrl %]" />
200                                             [% END %]
201                                             [% IF image.checked %]
202                                                 <input type="radio" name="image" value="[% image.KohaImage %]" checked="checked" />
203                                             [% ELSIF image.KohaImage %] <!-- to delete the radio button if there is no image after -->
204                                                 <input type="radio" name="image" value="[% image.KohaImage %]" />
205                                             [% END %]
206                                         </label>
207                                     </li>
208                                 [% END %]
209                             </ul>
210                             <br class="clear" />
211                         </div>
212                     [% END %]
213
214                     <div id="remote">
215                         <ul>
216                             <li>
217                                 <label for="remote_image_check"> Remote image:</label>
218                                 [% IF remote_image %]
219                                     <input type="radio" id="remote_image_check" name="image" value="remoteImage" checked="checked" />
220                                 [% ELSE %]
221                                     <input type="radio" id="remote_image_check" name="image" value="remoteImage" />
222                                 [% END %]
223                                 <input type="text" name="remoteImage" size="48" maxlength="200" value="[% remote_image %]" onmousedown="document.getElementById('remote_image_check').checked = true;" />
224                                 [% IF ( remote_image ) %]
225                                     <img src="[% remote_image %]" alt="" />
226                                 [% END %]
227                             </li>
228                         </ul>
229                         <br class="clear" />
230                     </div>
231                 </div>
232             [% END %]
233             <ol>
234                 <li>
235                     <label for="hideinopac">Hide in OPAC: </label>
236                     [% IF ( itemtype.hideinopac ) %]
237                         <input type="checkbox" id="hideinopac" name="hideinopac" checked="checked" value="1" />
238                     [% ELSE %]
239                         <input type="checkbox" id="hideinopac" name="hideinopac" value="1" />
240                     [% END %]
241                     (if checked, items of this type will be hidden as filters in OPAC's advanced search)
242                 </li>
243                 <li>
244                     <label for="notforloan">Not for loan: </label>
245                         [% IF itemtype.notforloan %]
246                             <input type="checkbox" id="notforloan" name="notforloan" checked="checked" value="1" />
247                         [% ELSE %]
248                             <input type="checkbox" id="notforloan" name="notforloan" value="1" />
249                         [% END %]
250                       (if checked, no item of this type can be issued. If not checked, every item of this type can be issued unless notforloan is set for a specific item)
251                 </li>
252                 <li>
253                     <label for="rentalcharge">Rental charge: </label>
254                     <input type="text" id="rentalcharge" name="rentalcharge" size="10" value="[% itemtype.rentalcharge %]" />
255                 </li>
256                 <li>
257                     <label for="checkinmsg">Checkin message: </label>
258                     <textarea id="checkinmsg" name="checkinmsg" cols="55" rows="5">[% itemtype.checkinmsg %]</textarea>
259                 </li>
260                 <li>
261                     <label for="checkinmsgtype">Checkin message type: </label>
262                     <select type="text" id="checkinmsgtype" name="checkinmsgtype">
263                         [% IF itemtype.checkinmsgtype == 'message' %]
264                             <option value="message" selected="selected">Message</option>
265                         [% ELSE %]
266                             <option value="message">Message</option>
267                         [% END %]
268                         [% IF itemtype.checkinmsgtype == 'alert' %]
269                             <option value="alert" selected="selected">Alert</option>
270                         [% ELSE %]
271                             <option value="alert">Alert</option>
272                         [% END %]
273                     </select>
274                 </li>
275                 <li>
276                     <label for="sip_media_type">SIP media type: </label>
277                     <select id="sip_media_type" name="sip_media_type">
278                         <option value=""></option>
279                         [% FOREACH a IN AuthorisedValues.Get('SIP_MEDIA_TYPE', itemtype.sip_media_type ) %]
280                             [% IF a.selected %]
281                                 <option value="[% a.authorised_value %]" selected="selected">[% a.lib %]</option>
282                             [% ELSE %]
283                                 <option value="[% a.authorised_value %]">[% a.lib %]</option>
284                             [% END %]
285                         [% END %]
286                     </select>
287                 </li>
288                 <li>
289                     <label for="summary">Summary: </label>
290                    <textarea id="summary" name="summary" cols="55" rows="5">[% itemtype.summary %]</textarea>
291                     <p>Enter a summary that will overwrite the default one in search results lists. Example, for a website itemtype : </p>
292                     <p><b>&lt;a href="[856u]"&gt;open site&lt;/a&gt;</b> will show the link just below the title</p>
293                 </li>
294             </ol>
295         </fieldset>
296
297         <fieldset class="action">
298             <input type="submit" value="Save changes" />
299             <a href="/cgi-bin/koha/admin/itemtypes.pl" class="cancel">Cancel</a>
300         </fieldset>
301     </form>
302 [% END %]
303
304 [% IF op == 'delete_confirm' %]
305     <div class="dialog message">
306         <h3>Delete item type '[% itemtype.itemtype %]'?</h3>
307         <table>
308             <tr>
309                 <th scope="row">Item type</th>
310                 <td>[% itemtype.itemtype %]</td>
311             </tr>
312             <tr><th scope="row">Description</th><td>[% itemtype.translated_description %]</td></tr>
313             [% UNLESS Koha.Preference('noItemTypeImages') %]
314                 <tr>
315                     <th scope="row">Image</th>
316                     <td>
317                         [% IF itemtype.image_location %]<img src="[% itemtype.image_location %]" alt="" />[% END %]
318                     </td>
319                 </tr>
320             [% END %]
321             <tr><th scope="row">Rental charge</th><td>[% itemtype.rentalcharge | $Price %]</td></tr>
322         </table>
323         <form action="/cgi-bin/koha/admin/itemtypes.pl" method="post">
324             <input type="hidden" name="op" value="delete_confirmed" /><input type="hidden" name="itemtype" value="[% itemtype.itemtype %]" />
325             <input type="submit" class="approve" value="Delete this Item Type" />
326         </form>
327         <form action="/cgi-bin/koha/admin/itemtypes.pl" method="post"><input type="submit" class="deny" value="Do Not Delete" /></form>
328     </div>
329 [% END %]
330
331 [% IF op == 'list' %]
332     <h2>Item types administration</h2>
333     [% IF itemtypes %]
334         <table id="table_item_type">
335           <thead>
336             [% UNLESS Koha.Preference('noItemTypeImages') %]<th>Image</th>[% END %]
337             <th>Code</th>
338             <th>Description</th>
339             <th>Search category</th>
340             <th>Not for loan</th>
341             <th>Hide in OPAC</th>
342             <th>Charge</th>
343             <th>Checkin message</th>
344             <th>Actions</th>
345           </thead>
346           [% FOREACH itemtype IN itemtypes %]
347             <tr>
348            [% UNLESS Koha.Preference('noItemTypeImages') %] <td>[% IF itemtype.image_location %]<img src="[% itemtype.image_location %]" alt="" />[% ELSE %]&nbsp;[% END %]</td>[% END %]
349             <td>
350               <a href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form&amp;itemtype=[% itemtype.itemtype %]">
351                 [% itemtype.itemtype %]
352               </a>
353             </td>
354             <td>
355                 [% IF itemtype.translated_descriptions.size %]
356                     [% itemtype.description %] (default)<br/>
357                     [% FOR description IN itemtype.translated_descriptions %]
358                         [% IF description.translation == itemtype.translated_description %]
359                             <b>[% description.translation %]</b>
360                         [% ELSE %]
361                             [% description.translation %] ([% description.lang %])
362                         [% END %]
363                         <br/>
364                     [% END %]
365                 [% ELSE %]
366                     [% itemtype.description %]
367                 [% END %]
368             </td>
369             <td>[% itemtype.searchcategory %]</td>
370             <td>[% IF ( itemtype.notforloan ) %]Yes[% ELSE %]&nbsp;[% END %]</td>
371             <td>[% IF ( itemtype.hideinopac ) %]Yes[% ELSE %]&nbsp;[% END %]</td>
372             <td>
373             [% UNLESS ( itemtype.notforloan ) %]
374               [% itemtype.rentalcharge | $Price %]
375             [% END %]
376             </td>
377             <td>[% itemtype.checkinmsg | html_line_break %]</td>
378             <td>
379               <a href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form&amp;itemtype=[% itemtype.itemtype %]">Edit</a>
380               <a href="/cgi-bin/koha/admin/itemtypes.pl?op=delete_confirm&amp;itemtype=[% itemtype.itemtype %]">Delete</a>
381             </td>
382           </tr>
383           [% END %]
384         </table>
385     [% ELSE %]
386         <div class="dialog message">There are no itemtypes defined</div>
387     [% END %]
388 [% END %]
389
390 </div>
391 </div>
392 <div class="yui-b">
393 [% INCLUDE 'admin-menu.inc' %]
394 </div>
395 </div>
396 [% INCLUDE 'intranet-bottom.inc' %]