Bug 16241 - Move staff client CSS out of language directory
[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="[% interface %]/[% theme %]/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 |html %]" required="required" /> <span class="required">Required</span>
143                     [% IF can_be_translated %]
144                         <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="fa fa-pencil"></i> Translate into other languages</a>
145                     [% END %]
146                 </li>
147                 <li>
148                     <span class="label">Search category</span>
149                     <select id="searchcategory" name="searchcategory">
150                     <option value="">None</option>
151                         [% FOREACH cat IN searchcategory %]
152                             [% IF cat.authorised_value == itemtype.searchcategory %]
153                                 <option value="[% cat.authorised_value %]" selected="selected">
154                                     [% cat.lib %]
155                                 </option>
156                             [% ELSE %]
157                                 <option value="[% cat.authorised_value %]" >
158                                     [% cat.lib %]
159                                 </option>
160                             [% END %]
161                         [% END %]
162                     </select>
163                     (Options are defined as the authorized values for the ITEMTYPECAT category)
164                 </li>
165                 [% IF Koha.Preference('noItemTypeImages') %]
166                     <li>
167                         <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>
168                     </li>
169                 [% END %]
170             </ol>
171             [% UNLESS Koha.Preference('noItemTypeImages') %]
172                 <div id="icons" class="toptabs" style="clear:both">
173                     <h5 style="margin-left:10px;">Choose an icon:</h5>
174                     <ul>
175                         <li><a href="#none">None</a></li>
176                         [% FOREACH imageset IN imagesets %]
177                             [% IF ( imageset.imagesetactive ) %]
178                                 <li class="ui-tabs-active">
179                             [% ELSE %]
180                                 <li>
181                             [% END %]
182                             <a href="#[% imageset.imagesetname %]">[% imageset.imagesetname %]</a>
183                             </li>
184                         [% END %]
185                         [% IF itemtype.image_location.match('^http') %]<li class="ui-tabs-active">[% ELSE %]<li>[% END %]<a href="#remote">Remote image</a></li>
186                     </ul>
187                     <div id="none">
188                         <ul>
189                             <li><label for="noimage">No image: </label><input type="radio" name="image" id="noimage" value="removeImage" /></li>
190                         </ul>
191                         <br class="clear" />
192                     </div>
193
194                     [% FOREACH imageset IN imagesets %]
195                         <div id="[% imageset.imagesetname %]">
196                             <ul>
197                                 [% FOREACH image IN imageset.images %]
198                                     <li style="float: none; display: inline-block; clear : none; width: auto;">
199                                         <label>
200                                             [% IF image.StaffImageUrl %]
201                                                 <img src="[% image.StaffImageUrl %]" alt="[% image.StaffImageUrl %]" title="[% image.StaffImageUrl %]" />
202                                             [% END %]
203                                             [% IF image.checked %]
204                                                 <input type="radio" name="image" value="[% image.KohaImage %]" checked="checked" />
205                                             [% ELSIF image.KohaImage %] <!-- to delete the radio button if there is no image after -->
206                                                 <input type="radio" name="image" value="[% image.KohaImage %]" />
207                                             [% END %]
208                                         </label>
209                                     </li>
210                                 [% END %]
211                             </ul>
212                             <br class="clear" />
213                         </div>
214                     [% END %]
215
216                     <div id="remote">
217                         <ul>
218                             <li>
219                                 <label for="remote_image_check"> Remote image:</label>
220                                 [% IF remote_image %]
221                                     <input type="radio" id="remote_image_check" name="image" value="remoteImage" checked="checked" />
222                                 [% ELSE %]
223                                     <input type="radio" id="remote_image_check" name="image" value="remoteImage" />
224                                 [% END %]
225                                 <input type="text" name="remoteImage" size="48" maxlength="200" value="[% remote_image %]" onmousedown="document.getElementById('remote_image_check').checked = true;" />
226                                 [% IF ( remote_image ) %]
227                                     <img src="[% remote_image %]" alt="" />
228                                 [% END %]
229                             </li>
230                         </ul>
231                         <br class="clear" />
232                     </div>
233                 </div>
234             [% END %]
235             <ol>
236                 <li>
237                     <label for="hideinopac">Hide in OPAC: </label>
238                     [% IF ( itemtype.hideinopac ) %]
239                         <input type="checkbox" id="hideinopac" name="hideinopac" checked="checked" value="1" />
240                     [% ELSE %]
241                         <input type="checkbox" id="hideinopac" name="hideinopac" value="1" />
242                     [% END %]
243                     (if checked, items of this type will be hidden as filters in OPAC's advanced search)
244                 </li>
245                 <li>
246                     <label for="notforloan">Not for loan: </label>
247                         [% IF itemtype.notforloan %]
248                             <input type="checkbox" id="notforloan" name="notforloan" checked="checked" value="1" />
249                         [% ELSE %]
250                             <input type="checkbox" id="notforloan" name="notforloan" value="1" />
251                         [% END %]
252                       (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)
253                 </li>
254                 <li>
255                     <label for="rentalcharge">Rental charge: </label>
256                     <input type="text" id="rentalcharge" name="rentalcharge" size="10" value="[% itemtype.rentalcharge %]" />
257                 </li>
258                 <li>
259                     <label for="checkinmsg">Checkin message: </label>
260                     <textarea id="checkinmsg" name="checkinmsg" cols="55" rows="5">[% itemtype.checkinmsg %]</textarea>
261                 </li>
262                 <li>
263                     <label for="checkinmsgtype">Checkin message type: </label>
264                     <select type="text" id="checkinmsgtype" name="checkinmsgtype">
265                         [% IF itemtype.checkinmsgtype == 'message' %]
266                             <option value="message" selected="selected">Message</option>
267                         [% ELSE %]
268                             <option value="message">Message</option>
269                         [% END %]
270                         [% IF itemtype.checkinmsgtype == 'alert' %]
271                             <option value="alert" selected="selected">Alert</option>
272                         [% ELSE %]
273                             <option value="alert">Alert</option>
274                         [% END %]
275                     </select>
276                 </li>
277                 <li>
278                     <label for="sip_media_type">SIP media type: </label>
279                     <select id="sip_media_type" name="sip_media_type">
280                         <option value=""></option>
281                         [% FOREACH a IN AuthorisedValues.Get('SIP_MEDIA_TYPE') %]
282                             [% IF a.authorised_value == itemtype.sip_media_type %]
283                                 <option value="[% a.authorised_value %]" selected="selected">[% a.lib %]</option>
284                             [% ELSE %]
285                                 <option value="[% a.authorised_value %]">[% a.lib %]</option>
286                             [% END %]
287                         [% END %]
288                     </select>
289                 </li>
290                 <li>
291                     <label for="summary">Summary: </label>
292                    <textarea id="summary" name="summary" cols="55" rows="5">[% itemtype.summary %]</textarea>
293                     <p>Enter a summary that will overwrite the default one in search results lists. Example, for a website itemtype : </p>
294                     <p><b>&lt;a href="[856u]"&gt;open site&lt;/a&gt;</b> will show the link just below the title</p>
295                 </li>
296             </ol>
297         </fieldset>
298
299         <fieldset class="action">
300             <input type="submit" value="Save changes" />
301             <a href="/cgi-bin/koha/admin/itemtypes.pl" class="cancel">Cancel</a>
302         </fieldset>
303     </form>
304 [% END %]
305
306 [% IF op == 'delete_confirm' %]
307     <div class="dialog alert">
308         <h3>Delete item type '[% itemtype.itemtype %]'?</h3>
309         <table>
310             <tr>
311                 <th scope="row">Item type</th>
312                 <td>[% itemtype.itemtype %]</td>
313             </tr>
314             <tr><th scope="row">Description</th><td>[% itemtype.translated_description %]</td></tr>
315             [% UNLESS Koha.Preference('noItemTypeImages') %]
316                 <tr>
317                     <th scope="row">Image</th>
318                     <td>
319                         [% IF itemtype.image_location %]<img src="[% itemtype.image_location %]" alt="" />[% END %]
320                     </td>
321                 </tr>
322             [% END %]
323             <tr><th scope="row">Rental charge</th><td>[% itemtype.rentalcharge | $Price %]</td></tr>
324         </table>
325         <form action="/cgi-bin/koha/admin/itemtypes.pl" method="post">
326             <input type="hidden" name="op" value="delete_confirmed" /><input type="hidden" name="itemtype" value="[% itemtype.itemtype %]" />
327             <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete this item type</button>
328         </form>
329         <form action="/cgi-bin/koha/admin/itemtypes.pl" method="post">
330             <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
331         </form>
332     </div>
333 [% END %]
334
335 [% IF op == 'list' %]
336     <h2>Item types administration</h2>
337     [% IF itemtypes %]
338         <table id="table_item_type">
339           <thead>
340             [% UNLESS Koha.Preference('noItemTypeImages') %]<th>Image</th>[% END %]
341             <th>Code</th>
342             <th>Description</th>
343             <th>Search category</th>
344             <th>Not for loan</th>
345             <th>Hide in OPAC</th>
346             <th>Charge</th>
347             <th>Checkin message</th>
348             <th>Actions</th>
349           </thead>
350           [% FOREACH itemtype IN itemtypes %]
351             <tr>
352            [% UNLESS Koha.Preference('noItemTypeImages') %] <td>[% IF itemtype.image_location %]<img src="[% itemtype.image_location %]" alt="" />[% ELSE %]&nbsp;[% END %]</td>[% END %]
353             <td>
354               <a href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form&amp;itemtype=[% itemtype.itemtype |html %]">
355                 [% itemtype.itemtype %]
356               </a>
357             </td>
358             <td>
359                 [% IF itemtype.translated_descriptions.size %]
360                     [% itemtype.description %] (default)<br/>
361                     [% FOR description IN itemtype.translated_descriptions %]
362                         [% IF description.translation == itemtype.translated_description %]
363                             <b>[% description.translation %]</b>
364                         [% ELSE %]
365                             [% description.translation %] ([% description.lang %])
366                         [% END %]
367                         <br/>
368                     [% END %]
369                 [% ELSE %]
370                     [% itemtype.description %]
371                 [% END %]
372             </td>
373             <td>[% itemtype.searchcategory %]</td>
374             <td>[% IF ( itemtype.notforloan ) %]Yes[% ELSE %]&nbsp;[% END %]</td>
375             <td>[% IF ( itemtype.hideinopac ) %]Yes[% ELSE %]&nbsp;[% END %]</td>
376             <td>
377             [% UNLESS ( itemtype.notforloan ) %]
378               [% itemtype.rentalcharge | $Price %]
379             [% END %]
380             </td>
381             <td>[% itemtype.checkinmsg | html_line_break %]</td>
382             <td class="actions">
383               <a href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form&amp;itemtype=[% itemtype.itemtype |html %]" class="btn btn-mini"><i class="fa fa-pencil"></i> Edit</a>
384               <a href="/cgi-bin/koha/admin/itemtypes.pl?op=delete_confirm&amp;itemtype=[% itemtype.itemtype |html %]" class="btn btn-mini"><i class="fa fa-trash"></i> Delete</a>
385             </td>
386           </tr>
387           [% END %]
388         </table>
389     [% ELSE %]
390         <div class="dialog message">There are no itemtypes defined</div>
391     [% END %]
392 [% END %]
393
394 </div>
395 </div>
396 <div class="yui-b">
397 [% INCLUDE 'admin-menu.inc' %]
398 </div>
399 </div>
400 [% INCLUDE 'intranet-bottom.inc' %]