Bug 10986: add system preference to limit the list of languages in advanced search
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / itemtypes.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Administration &rsaquo; Item types [% IF ( add_form ) %]&rsaquo;
3   [% IF ( itemtype ) %]
4 Modify item type '[% itemtype %]'
5   [% ELSE %]
6 Add item type
7   [% END %]
8 [% END %]
9 [% IF ( delete_confirm ) %]&rsaquo; 
10   [% IF ( total ) %]
11 Cannot delete item type '[% itemtype %]'
12   [% ELSE %]
13 Delete item type '[% itemtype %]'?
14   [% END %]
15 [% END %]
16 [% IF ( delete_confirmed ) %]&rsaquo; 
17 Data deleted
18 [% END %]
19 </title>
20 [% INCLUDE 'doc-head-close.inc' %]
21 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
22 [% INCLUDE 'datatables.inc' %]
23 <script type="text/javascript">
24 //<![CDATA[
25      $(document).ready(function() {
26         $('#icons').tabs();
27         $("#table_item_type").dataTable($.extend(true, {}, dataTablesDefaults, {
28             "aoColumnDefs": [
29                 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
30             ],
31             "aaSorting": [[ 2, "asc" ]],
32             "iDisplayLength": 10
33         }));
34         $( "#itemtypeentry" ).validate({
35             rules: {
36                 itemtype: { required: true },
37                 description: { required: true },
38                 rentalcharge: { number: true }
39             }
40         });
41      });
42 //]]>
43 </script>
44 <style type="text/css">
45         fieldset.rows div.toptabs li { clear:none;margin-right:.5em;padding-bottom:0;width:auto; }
46   fieldset.rows div.toptabs .ui-tabs-nav li.ui-tabs-selected {background-color : #F4F8F9; }
47         fieldset.rows .ui-tabs-panel { margin-right : 10px; margin-left : 10px;margin-bottom:10px;}
48   fieldset.rows .ui-tabs-nav { margin-left : 10px; }
49 </style>
50 </head>
51 <body id="admin_itemtypes" class="admin">
52 [% INCLUDE 'header.inc' %]
53 [% INCLUDE 'cat-search.inc' %]
54
55 <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 ( add_form ) %]
56   [% IF ( itemtype ) %]
57 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> &rsaquo; Modify item type '[% itemtype %]'
58   [% ELSE %]
59 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> &rsaquo; Add item type
60   [% END %]
61 [% END %]
62 [% IF ( delete_confirm ) %]
63   [% IF ( total ) %]
64 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> &rsaquo; Cannot delete item type '[% itemtype %]'
65   [% ELSE %]
66 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> &rsaquo; Delete item type '[% itemtype %]'?
67   [% END %]
68 [% END %]
69 [% IF ( delete_confirmed ) %]
70 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> &rsaquo;Data deleted
71 [% END %]
72 [% IF ( else ) %]
73 Item types administration
74 [% END %]</div>
75
76 <div id="doc3" class="yui-t2">
77    
78    <div id="bd">
79         <div id="yui-main">
80         <div class="yui-b">
81         
82 [% IF ( else ) %]<div id="toolbar" class="btn-toolbar">
83     <a class="btn btn-small" id="newitemtype" href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form"><i class="icon-plus"></i> New item type</a>
84 </div>[% END %]
85
86 [% IF ( add_form ) %]
87   [% IF ( itemtype ) %]
88       <h3>Modify item type</h3>
89   [% ELSE %]
90       <h3>Add item type</h3>
91   [% END %]
92 <form action="[% script_name %]" name="Aform" method="post" id="itemtypeentry">
93   <input type="hidden" name="op" value="add_validate" />
94     <input type="hidden" name="checked" value="0" />
95                 
96     <fieldset class="rows">
97         <ol>
98   [% IF ( itemtype ) %]
99       <li>
100           <span class="label">Item type: </span> <input type="hidden" name="itemtype" value="[% itemtype %]" />
101           [% itemtype %]
102      </li>
103   [% ELSE %]
104       <li>
105           <label for="itemtype" class="required">Item type: </label> <input type="text" id="itemtype" name="itemtype" size="10" maxlength="10" onblur="toUC(this)" required="required" /> <span class="required">Required</span>
106       </li>
107   [% END %]
108       <li>
109           <label for="description" class="required">Description: </label><input type="text" id="description" name="description" size="48" value="[% description |html %]" required="required" /> <span class="required">Required</span></li>
110      [% IF ( noItemTypeImages ) %]
111          <li><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></li></ol>
112          [% ELSE %]</ol>
113     <div id="icons" class="toptabs" style="clear:both">
114         <h5 style="margin-left:10px;">Choose an icon:</h5>
115                         <ul>
116           <li><a href="#none">None</a></li>
117                                   [% FOREACH imageset IN imagesets %]
118             [% IF ( imageset.imagesetactive ) %]<li class="ui-tabs-selected">[% ELSE %]<li>[% END %]<a href="#[% imageset.imagesetname %]">[% imageset.imagesetname %]</a></li>
119                                   [% END %]
120                   [% IF ( remote_image ) %]<li class="ui-tabs-selected">[% ELSE %]<li>[% END %]<a href="#remote">Remote image</a></li>
121                         </ul>
122   <div id="none"><ul>
123   <li><label for="noimage">No image: </label><input type="radio" name="image" id="noimage" value="removeImage" /></li>
124   </ul>
125   <br class="clear" /></div>
126
127   [% FOREACH imageset IN imagesets %]
128   <div id="[% imageset.imagesetname %]"><ul>
129   [% FOREACH image IN imageset.images %]
130                         <li style="float: none; display: inline-block; clear : none; width: auto;">
131             <label> [% IF ( image.StaffImageUrl ) %]
132               <img src="[% image.StaffImageUrl %]" alt="[% image.StaffImageUrl %]" title="[% image.StaffImageUrl %]" />
133         [% ELSE %]
134         [% END %]
135     [% IF ( image.checked ) %]
136               <input type="radio" name="image" value="[% image.KohaImage %]" checked="checked" />
137     [% ELSE %]
138               [% IF ( image.KohaImage ) %] <!-- to delete the radio button if there is no image after -->
139               <input type="radio" name="image" value="[% image.KohaImage %]" />
140               [% END %]
141     [% END %]
142             </label>
143                         </li>
144   [% END %]
145   </ul>
146   <br class="clear" />
147   </div>
148   [% END %]
149 <div id="remote"><ul>
150 <li> <label for="remote_image_check"> Remote image:</label>
151   [% IF ( remote_image ) %]
152             <input type="radio" id="remote_image_check" name="image" value="remoteImage" checked="checked" />
153   [% ELSE %]
154             <input type="radio" id="remote_image_check" name="image" value="remoteImage" />
155   [% END %]<input type="text" name="remoteImage" size="48" maxlength="200" value="[% remote_image %]" onmousedown="document.getElementById('remote_image_check').checked = true;" /> [% IF ( remote_image ) %]
156             <img src="[% remote_image %]" alt="" />
157   [% END %]</li>
158 </ul>
159   <br class="clear" />
160 </div>
161 </div>
162 [% END %]
163 <ol>
164       <li>
165           <label for="notforloan">Not for loan: </label>   [% IF ( notforloan ) %]
166                 <input type="checkbox" id="notforloan" name="notforloan" checked="checked" value="1" />
167             [% ELSE %]
168                 <input type="checkbox" id="notforloan" name="notforloan" value="1" />
169             [% END %]
170           (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)
171         
172       </li>
173       <li>
174           <label for="rentalcharge">Rental charge: </label>
175                   <input type="text" id="rentalcharge" name="rentalcharge" size="10" value="[% rentalcharge %]" />
176          </li>
177       <li>
178           <label for="checkinmsg">Checkin message: </label>
179           <textarea id="checkinmsg" name="checkinmsg" cols="55" rows="5">[% checkinmsg %]</textarea>
180       </li>
181       <li>
182           <label for="checkinmsgtype">Checkin message type: </label>
183           <select type="text" id="checkinmsgtype" name="checkinmsgtype">
184               [% IF ( checkinmsgtype == 'message' ) %]
185               <option value="message" selected="selected">Message</option>
186               [% ELSE %]
187                  <option value="message">Message</option>
188               [% END %]
189               [% IF ( checkinmsgtype == 'alert' ) %]
190               <option value="alert" selected="selected">Alert</option>
191               [% ELSE %]
192                   <option value="alert">Alert</option>
193               [% END %]
194           </select>
195       </li>
196       <li>
197           <label for="summary">Summary: </label>
198          <textarea id="summary" name="summary" cols="55" rows="5">[% summary %]</textarea>
199           <p>Enter a summary that will overwrite the default one in search results lists. Example, for a website itemtype : </p>
200           <p><b>&lt;a href="[856u]"&gt;open site&lt;/a&gt;</b> will show the link just below the title</p>
201       </li>
202           </ol>
203     </fieldset>
204
205     <fieldset class="action">
206       <input type="submit" value="Save changes" />
207           <a href="/cgi-bin/koha/admin/itemtypes.pl" class="cancel">Cancel</a>
208     </fieldset>
209 </form>
210 [% END %]
211
212 [% IF ( delete_confirm ) %]
213 [% IF ( total ) %]<div class="dialog message">
214 <h3>Cannot delete item type</h3>
215 <p><strong>This record is used [% total %] times</strong>. Deletion is not possible.</p>
216 [% ELSE %]<div class="dialog alert">
217 <h3>Delete item type '[% itemtype %]'?</h3>
218 [% END %]
219 <table>
220                 <tr>
221                         <th scope="row">Item type</th>
222                         <td>[% itemtype %]</td>
223                 </tr>
224
225         <tr><th scope="row">Description</th><td>[% description %]</td></tr>
226         <tr><th scope="row">Loan length</th><td>[% loanlength %]</td></tr>
227 <tr><th scope="row">Rental charge</th><td>[% rentalcharge %]</td></tr></table>
228                 <form action="[% script_name %]" method="post">
229                 <input type="hidden" name="op" value="delete_confirmed" /><input type="hidden" name="itemtype" value="[% itemtype %]" />[% IF ( total ) %]
230                 </form>
231                 
232                 <form action="[% script_name %]" method="post"><input type="submit" class="approve" value="OK" /></form>
233         [% ELSE %]
234                 <input type="submit" class="approve" value="Delete this Item Type" /></form> <form action="[% script_name %]" method="post"><input type="submit" class="deny" value="Do Not Delete" /></form>
235         [% END %]
236 </div>
237         
238 [% END %]
239
240 [% IF ( else ) %]
241 <h2>Item types administration</h2>
242 [% IF ( loop ) %]
243 <table id="table_item_type">
244   <thead>
245     [% UNLESS ( noItemTypeImages ) %]<th>Image</th>[% END %]
246     <th>Code</th>
247     <th>Description</th>
248     <th>Not for loan</th>
249     <th>Charge</th>
250     <th>Checkin message</th>
251     <th>Actions</th>
252   </thead>
253   [% FOREACH loo IN loop %]
254     [% UNLESS ( loop.odd ) %]
255   <tr class="highlight">
256     [% ELSE %]
257   <tr>
258     [% END %]
259    [% UNLESS ( noItemTypeImages ) %] <td>[% IF ( loo.imageurl ) %]<img src="[% loo.imageurl %]" alt="" />[% ELSE %]&nbsp;[% END %]</td>[% END %]
260     <td>
261       <a href="[% loo.script_name %]?op=add_form&amp;itemtype=[% loo.itemtype |html %]">
262         [% loo.itemtype %]
263       </a>
264     </td>
265     <td>[% loo.description %]</td>
266     <td>[% IF ( loo.notforloan ) %]Yes[% ELSE %]&nbsp;[% END %]</td>
267     <td>
268     [% UNLESS ( loo.notforloan ) %]
269       [% loo.rentalcharge %]
270     [% END %]
271     </td>
272     <td>[% loo.checkinmsg | html_line_break %]</td>
273     <td>
274       <a href="[% loo.script_name %]?op=add_form&amp;itemtype=[% loo.itemtype |html %]">Edit</a>
275       <a href="[% loo.script_name %]?op=delete_confirm&amp;itemtype=[% loo.itemtype |html %]">Delete</a>
276     </td>
277   </tr>
278   [% END %]
279 </table>[% ELSE %]
280 <div class="dialog message">There are no itemtypes defined</div>
281 [% END %]
282
283 <div class="pages">[% pagination_bar %]</div>
284
285 [% END %]
286
287
288
289 </div>
290 </div>
291 <div class="yui-b">
292 [% INCLUDE 'admin-menu.inc' %]
293 </div>
294 </div>
295 [% INCLUDE 'intranet-bottom.inc' %]