Bug 6713, editing matching rules broken
[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 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
22 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.pager.js"></script>
23 <script type="text/javascript" id="js">$(document).ready(function() {
24         // call the tablesorter plugin
25         $("#table_item_type").tablesorter({
26                 sortList: [[1,0]],
27                 headers: { 0: { sorter: false},5: { sorter: false}}
28                                 }).tablesorterPager({container: $("#pagertable_item_type"),positionFixed: false,size: 10});
29         
30 }); </script>
31 <script type="text/javascript">
32 //<![CDATA[
33
34 function isNotNull(f,noalert) {
35         if (f.value.length ==0) {
36                 return false;
37         }
38         return true;
39 }
40
41 function toUC(f) {
42         var x=f.value.toUpperCase();
43         f.value=x;
44         return true;
45 }
46
47 function isNum(v,maybenull) {
48 var n = new Number(v.value);
49 if (isNaN(n)) {
50         return false;
51         }
52 if (maybenull==0 && v.value=='') {
53         return false;
54 }
55 return true;
56 }
57
58 function isDate(f) {
59         var t = Date.parse(f.value);
60         if (isNaN(t)) {
61                 return false;
62         }
63 }
64
65 function Check(f) {
66         var ok=1;
67         var _alertString="";
68         var alertString2;
69         if (f.itemtype.value.length==0) {
70                 _alertString += "\n- " + _("Itemtype missing");
71         }
72         if (!(isNotNull(window.document.Aform.description,1))) {
73                 _alertString += "\n- " + _("Description missing");
74         }
75         if ((!isNum(f.rentalcharge,0)) && f.rentalcharge.value.length > 0) {
76                 _alertString += "\n- " + _("Rental charge is not a number");
77         }
78         if (_alertString.length==0) {
79                 document.Aform.submit();
80         } else {
81                 alertString2  = _("Form not submitted because of the following problem(s)");
82                 alertString2 += "\n------------------------------------------------------------------------------------\n";
83                 alertString2 += _alertString;
84                 alert(alertString2);
85         }
86 }
87      $(document).ready(function() {
88         $('#icons > ul').tabs();
89      });
90 //]]>
91 </script>
92 <style type="text/css">
93         fieldset.rows div.toptabs li { clear:none;margin-right:.5em;padding-bottom:0;width:auto; }
94         fieldset.rows div.toptabs .ui-tabs-nav li.ui-tabs-selected {background-color : transparent; }
95         fieldset.rows .ui-tabs-panel { margin-right : 10px; margin-left : 10px;margin-bottom:10px;}
96 </style>
97 </head>
98 <body>
99 [% INCLUDE 'header.inc' %]
100 [% INCLUDE 'cat-search.inc' %]
101
102 <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 ) %]
103   [% IF ( itemtype ) %]
104 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item Types</a> &rsaquo; Modify Item Type '[% itemtype %]'
105   [% ELSE %]
106 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item Types</a> &rsaquo; Add Item Type
107   [% END %]
108 [% END %]
109 [% IF ( delete_confirm ) %]
110   [% IF ( total ) %]
111 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item Types</a> &rsaquo; Cannot Delete Item Type '[% itemtype %]'
112   [% ELSE %]
113 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item Types</a> &rsaquo; Delete Item Type '[% itemtype %]'?
114   [% END %]
115 [% END %]
116 [% IF ( delete_confirmed ) %]
117 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item Types</a> &rsaquo;Data Deleted
118 [% END %]
119 [% IF ( else ) %]
120 Item Types Administration
121 [% END %]</div>
122
123 <div id="doc3" class="yui-t2">
124    
125    <div id="bd">
126         <div id="yui-main">
127         <div class="yui-b">
128         
129 [% IF ( else ) %]<div id="toolbar">
130         <script type="text/javascript">
131         //<![CDATA[
132
133         // prepare DOM for YUI Toolbar
134
135          $(document).ready(function() {
136             yuiToolbar();
137          });
138
139         // YUI Toolbar Functions
140
141         function yuiToolbar() {
142             new YAHOO.widget.Button("newitemtype");
143         }
144
145         //]]>
146         </script>
147         <ul class="toolbar">
148         <li><a id="newitemtype" href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form">New Item Type</a></li>
149 </ul></div>[% ELSE %]&nbsp;[% END %]
150
151 [% IF ( add_form ) %]
152   [% IF ( itemtype ) %]
153       <h3>Modify Item Type</h3>
154   [% ELSE %]
155       <h3>Add Item Type</h3>
156   [% END %]
157 <form action="[% script_name %]" name="Aform" method="post">
158   <input type="hidden" name="op" value="add_validate" />
159     <input type="hidden" name="checked" value="0" />
160                 
161     <fieldset class="rows">
162         <ol>
163   [% IF ( itemtype ) %]
164       <li>
165           <span class="label">Item type</span> <input type="hidden" name="itemtype" value="[% itemtype %]" />
166           [% itemtype %]
167      </li>
168   [% ELSE %]
169       <li>
170           <label for="itemtype">Item type</label> <input type="text" id="itemtype" name="itemtype" size="10" maxlength="10" onblur="toUC(this)" />
171       </li>
172   [% END %]
173       <li>
174           <label for="description">Description</label><input type="text" id="description" name="description" size="48" value="[% description |html %]" />      </li>
175      [% IF ( noItemTypeImages ) %]
176          <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>
177          [% ELSE %]</ol>
178                 <div id="icons" class="toptabs">
179                 <h5 style="margin-left:10px;">Choose an Icon:</h5>
180                         <ul>
181                                         <li><a href="/cgi-bin/koha/admin/itemtypes.pl#none">None</a></li>
182                                   [% FOREACH imageset IN imagesets %]
183             [% IF ( imageset.imagesetactive ) %]<li class="ui-tabs-selected">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/admin/itemtypes.pl#[% imageset.imagesetname %]">[% imageset.imagesetname %]</a></li>
184                                   [% END %]
185                                   [% IF ( remote_image ) %]<li class="ui-tabs-selected">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/admin/itemtypes.pl#remote">Remote Image</a></li>
186                         </ul>
187                 </div>
188   <div id="none"><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" /></div>
192         
193   [% FOREACH imageset IN imagesets %]
194   <div id="[% imageset.imagesetname %]"><ul>
195   [% FOREACH image IN imageset.images %]
196                         <li style="float: none; display: inline; clear : none; width: auto;">
197             <label> [% IF ( image.StaffImageUrl ) %]
198               <img src="[% image.StaffImageUrl %]" alt="[% image.StaffImageUrl %]" title="[% image.StaffImageUrl %]" />
199         [% ELSE %]
200         [% END %]
201     [% IF ( image.checked ) %]
202               <input type="radio" name="image" value="[% image.KohaImage %]" checked="checked" />
203     [% ELSE %]
204               [% IF ( image.KohaImage ) %] <!-- to delete the radio button if there is no image after -->
205               <input type="radio" name="image" value="[% image.KohaImage %]" />
206               [% END %]
207     [% END %]
208             </label>
209                         </li>
210   [% END %]
211   </ul>
212   <br class="clear" />
213   </div>
214   [% END %]
215 <div id="remote"><ul>
216 <li> <label for="remote_image_check"> Remote image:</label>
217   [% IF ( remote_image ) %]
218             <input type="radio" id="remote_image_check" name="image" value="remoteImage" checked="checked" />
219   [% ELSE %]
220             <input type="radio" id="remote_image_check" name="image" value="remoteImage" />
221   [% END %]<input type="text" name="remoteImage" size="48" maxlength="200" value="[% remote_image %]" onmousedown="document.getElementById('remote_image_check').checked = true;" /> [% IF ( remote_image ) %]
222             <img src="[% remote_image %]" alt="" />
223   [% END %]</li>
224 </ul>
225   <br class="clear" />
226 </div>
227 [% END %]
228 <ol>
229       <li>
230           <label for="notforloan">Not for loan</label>   [% IF ( notforloan ) %]
231                 <input type="checkbox" id="notforloan" name="notforloan" checked="checked" value="1" />
232             [% ELSE %]
233                 <input type="checkbox" id="notforloan" name="notforloan" value="1" />
234             [% END %]
235           (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)
236         
237       </li>
238       <li>
239           <label for="rentalcharge">Rental charge: </label>
240                   <input type="text" id="rentalcharge" name="rentalcharge" size="10" value="[% rentalcharge %]" />
241          </li>
242       <li>
243           <label for="summary">Summary: </label>
244          <textarea id="summary" name="summary" cols="55" rows="5">[% summary %]</textarea>
245           <p>Enter a summary that will overwrite the default one in search results lists. Example, for a website itemtype : </p>
246           <p><b>&lt;a href="[856u]"&gt;open site&lt;/a&gt;</b> will show the link just below the title</p>
247       </li>
248           </ol>
249     </fieldset>
250
251     <fieldset class="action">
252       <input type="button" value="Save Changes" onclick="Check(this.form)" />
253           <a href="/cgi-bin/koha/admin/itemtypes.pl" class="cancel">Cancel</a>
254     </fieldset>
255 </form>
256 [% END %]
257
258 [% IF ( delete_confirm ) %]
259 [% IF ( total ) %]<div class="dialog message">
260 <h3>Cannot Delete Item Type</h3>
261 <p><strong>This record is used [% total %] times</strong>. Deletion is not possible.</p>
262 [% ELSE %]<div class="dialog alert">
263 <h3>Delete Item Type '[% itemtype %]'?</h3>
264 [% END %]
265 <table>
266                 <tr>
267                         <th scope="row">Item type</th>
268                         <td>[% itemtype %]</td>
269                 </tr>
270
271         <tr><th scope="row">Description</th><td>[% description %]</td></tr>
272         <tr><th scope="row">Loan length</th><td>[% loanlength %]</td></tr>
273 <tr><th scope="row">Rental charge</th><td>[% rentalcharge %]</td></tr></table>
274                 <form action="[% script_name %]" method="post">
275                 <input type="hidden" name="op" value="delete_confirmed" /><input type="hidden" name="itemtype" value="[% itemtype %]" />[% IF ( total ) %]
276                 </form>
277                 
278                 <form action="[% script_name %]" method="post"><input type="submit" class="approve" value="OK" /></form>
279         [% ELSE %]
280                 <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>
281         [% END %]
282 </div>
283         
284 [% END %]
285
286 [% IF ( else ) %]
287 <h2>Item Types Administration</h2>
288 [% IF ( loop ) %]<span id="pagertable_item_type" class="pager">
289   <form class="formpager">&nbsp;<strong>page(s)</strong>:&nbsp;
290     <img src="[% interface %]/prog/img/first.png" class="first"/>
291     <img src="[% interface %]/prog/img/prev.png" class="prev"/>
292     <input type="text" size="5" class="pagedisplay"/>
293     <img src="[% interface %]/prog/img/next.png" class="next"/>
294     <img src="[% interface %]/prog/img/last.png" class="last"/>
295     , entries/page:
296     <select class="pagesize">
297           <option selected="selected" value="10">10</option>
298       <option value="20">20</option>
299       <option value="30">30</option>
300       <option value="40">40</option>
301       <option value="50">50</option>
302       <option value="100">100</option>
303     </select>
304   </form>
305 </span>
306 <table id="table_item_type">
307   <thead>
308     [% UNLESS ( noItemTypeImages ) %]<th>Image</th>[% END %]
309     <th>Code</th>
310     <th>Description</th>
311     <th>Not for loan</th>
312     <th>Charge</th>
313     <th>Actions</th>
314   </thead>
315   [% FOREACH loo IN loop %]
316     [% UNLESS ( loop.odd ) %]
317   <tr class="highlight">
318     [% ELSE %]
319   <tr>
320     [% END %]
321    [% UNLESS ( noItemTypeImages ) %] <td>[% IF ( loo.imageurl ) %]<img src="[% loo.imageurl %]" alt="" />[% ELSE %]&nbsp;[% END %]</td>[% END %]
322     <td>
323       <a href="[% loo.script_name %]?op=add_form&amp;itemtype=[% loo.itemtype |html %]">
324         [% loo.itemtype %]
325       </a>
326     </td>
327     <td>[% loo.description %]</td>
328     <td>[% IF ( loo.notforloan ) %]Yes[% ELSE %]&nbsp;[% END %]</td>
329     <td>
330     [% UNLESS ( loo.notforloan ) %]
331       [% loo.rentalcharge %]
332     [% END %]
333     </td>
334     <td>
335       <a href="[% loo.script_name %]?op=add_form&amp;itemtype=[% loo.itemtype |html %]">Edit</a>
336       <a href="[% loo.script_name %]?op=delete_confirm&amp;itemtype=[% loo.itemtype |html %]">Delete</a>
337     </td>
338   </tr>
339   [% END %]
340 </table>[% ELSE %]
341 <div class="dialog message">There are no itemtypes defined</div>
342 [% END %]
343
344 <div class="pages">[% pagination_bar %]</div>
345
346 [% END %]
347
348
349
350 </div>
351 </div>
352 <div class="yui-b">
353 [% INCLUDE 'admin-menu.inc' %]
354 </div>
355 </div>
356 [% INCLUDE 'intranet-bottom.inc' %]