new feature : image for itemtypes.
[koha.git] / koha-tmpl / intranet-tmpl / default / en / parameters / itemtypes.tmpl
1 <!-- TMPL_INCLUDE NAME="parameters-top.inc" -->
2
3 <script language="javascript" type="text/javascript">
4 function _(s) { return s } // dummy function for gettext
5 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
6 function isNotNull(f,noalert) {
7         if (f.value.length ==0) {
8                 return false;
9         }
10         return true;
11 }
12 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
13 function toUC(f) {
14         var x=f.value.toUpperCase();
15         f.value=x;
16         return true;
17 }
18 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
19 function isNum(v,maybenull) {
20 var n = new Number(v.value);
21 if (isNaN(n)) {
22         return false;
23         }
24 if (maybenull==0 && v.value=='') {
25         return false;
26 }
27 return true;
28 }
29 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
30 function isDate(f) {
31         var t = Date.parse(f.value);
32         if (isNaN(t)) {
33                 return false;
34         }
35 }
36 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
37 function Check(f) {
38         var ok=1;
39         var _alertString="";
40         var alertString2;
41         if (f.itemtype.value.length==0) {
42                 _alertString += "\n- " + _("Itemtype missing");
43         }
44         if (!(isNotNull(window.document.Aform.description,1))) {
45                 _alertString += "\n- " + _("Description missing");
46         }
47         if ((!isNum(f.rentalcharge,0)) && f.rentalcharge.value.length > 0) {
48                 _alertString += "\n- " + _("Rental charge is not a number");
49         }
50         if (_alertString.length==0) {
51                 document.Aform.submit();
52         } else {
53                 alertString2  = _("Form not submitted because of the following problem(s)");
54                 alertString2 += "\n------------------------------------------------------------------------------------\n";
55                 alertString2 += _alertString;
56                 alert(alertString2);
57         }
58 }
59
60 function report_itemtype(value_to_report) {
61         Aform.imageurl.value=value_to_report;
62 }
63 </script>
64 <div id="mainbloc">
65 <!-- TMPL_IF NAME="add_form" -->
66         <!-- TMPL_IF NAME="itemtype" -->
67                 <h1 class="parameters">Modify item type</h1>
68         <!-- TMPL_ELSE -->
69                 <h1 class="parameters">Add item type</h1>
70         <!-- /TMPL_IF -->
71         <form action="<!-- TMPL_VAR NAME="script_name" -->" name="Aform" method="post">
72                 <input type="hidden" name="op" value="add_validate">
73                 <input type="hidden" name="checked" value="0">
74                         <!-- TMPL_IF NAME="itemtype" -->
75                                 <p><label class="label100">Item type<label><input type="hidden" name="itemtype" value="<!-- TMPL_VAR NAME="itemtype" -->"><!-- TMPL_VAR NAME="itemtype" --></p>
76                         <!-- TMPL_ELSE -->
77                                 <p><label class="label100">Item type<label><input type="text" name="itemtype" size="6" maxlength="4" onblur="toUC(this)"></p>
78                         <!-- /TMPL_IF -->
79                         <p>
80                                 <label class="label100">Description</label>
81                                 <input type="text" name="description" size="40" maxlength="80" value="<!-- TMPL_VAR NAME="description" escape=HTML -->">
82                         </p>
83                         <p>
84                                 <label class="label100">Image</label>
85                                 <input type="text" name="imageurl" value="<!-- TMPL_VAR name="imageurl" -->" size="40" maxlength="80">
86                                 <!-- TMPL_LOOP NAME="IMAGESLOOP" -->
87                                          <a href="javascript:report_itemtype('<!-- TMPL_VAR name="KohaImage" -->')"><img src="/opac-tmpl/<!-- TMPL_VAR name="opacthemes" -->/itemtypeimg/<!-- TMPL_VAR name="KohaImage" -->"></a>
88                                 <!-- /TMPL_LOOP -->
89                         </p>
90                         <p>
91                                 <label class="label100">Not for loan</label>
92                                 <!-- TMPL_IF NAME="notforloan" -->
93                                         <input type="checkbox" name="notforloan" checked value="1">
94                                 <!-- TMPL_ELSE -->
95                                         <input type="checkbox" name="notforloan" value="1">
96                                 <!-- /TMPL_IF -->
97                                 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
98                         </p>
99                         <p>
100                                 <label class="label100" name="renewalsallowed">Number of renewals allowed</label>
101                                 <input type="text" name="renewalsallowed" value="<!-- TMPL_VAR NAME="renewalsallowed" -->">
102                         </p>
103                         <p>
104                                 <label class="label100">Rental charge</label>
105                                 <input type="text" name="rentalcharge" size="10" value="<!-- TMPL_VAR NAME="rentalcharge" -->">
106                         </p>
107                         <p>
108                                 <input type="button" value="OK" class="button" onclick="Check(this.form)">
109                         </p>
110         </form>
111 <!-- /TMPL_IF -->
112
113 <!-- TMPL_IF NAME="delete_confirm" -->
114                 <p><label>Item type</label><!-- TMPL_VAR NAME="itemtype" --></p>
115         <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
116                 <input type="hidden" name="op" value="delete_confirmed"><input type="hidden" name="itemtype" value="<!-- TMPL_VAR NAME="itemtype" -->">
117         <p><label>Description</label><!-- TMPL_VAR NAME="description" --></p>
118         <p><label>Renewals</label><!-- TMPL_IF NAME="renewalsallowed" -->Allowed<!-- TMPL_ELSE -->Not allowed<!-- /TMPL_IF --></p>
119         <p><lable>Rental charge</label><!-- TMPL_VAR NAME="rentalcharge" --></p>
120         <!-- TMPL_IF NAME="total" -->
121                 <p>
122                         <b>This record is used <!-- TMPL_VAR NAME="total" --> times. Deletion not possible</b>
123                 </p>
124                 <p>
125                         </form>
126                         <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post"><input type="submit" value="OK" class="button parameters"></form>
127                 </p>
128         <!-- TMPL_ELSE -->
129                 <p>CONFIRM DELETION</p>
130                 <p>
131                         <input type="submit" value="YES" class="button parameters"></form>
132                         <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post"><input type="submit" value="NO" class="button parameters"></form>
133                 </p>
134         <!-- /TMPL_IF -->
135
136 <!-- /TMPL_IF -->
137
138 <!-- TMPL_IF NAME="else" -->
139 <h1 class="parameters">Item type Admin</h1>
140 <table>
141         <tr>
142                 <th class="parameters">Code</th>
143                 <th class="parameters">Description</th>
144                 <th class="parameters">not for loan</th>
145                 <th class="parameters">Renewable</th>
146                 <th class="parameters">Charge</th>
147                 <th class="parameters">Edit</th>
148                 <th class="parameters">Delete</th>
149         </tr>
150         <!-- TMPL_LOOP NAME="loop" -->
151                 <tr>
152                         <td>
153                                 <!-- TMPL_IF name="imageurl" -->
154                                         <!-- TMPL_IF name="absoluteurl" -->
155                                                 <img src="<!-- TMPL_VAR name="imageurl" -->">
156                                         <!-- TMPL_ELSE -->
157                                                 <img src="/opac-tmpl/<!-- TMPL_VAR name="opacthemes" -->/itemtypeimg/<!-- TMPL_VAR name="imageurl" -->">
158                                         <!-- /TMPL_IF -->
159                                 <!-- /TMPL_IF -->
160                                 <!-- TMPL_VAR NAME="itemtype" -->
161                         </td>
162                         <td><!-- TMPL_VAR NAME="description" --></td>
163                         <td><!-- TMPL_IF NAME="notforloan" -->Yes<!-- /TMPL_IF --></td>
164                         <td><!-- TMPL_UNLESS name="notforloan" -->
165                                         <!-- TMPL_IF NAME="renewalsallowed" -->
166                                                 <!-- TMPL_VAR name="renewalsallowed" --> time(s)
167                                         <!-- TMPL_ELSE -->
168                                                 No
169                                         <!-- /TMPL_IF -->
170                                 <!-- /TMPL_UNLESS -->
171                         </td>
172                         <td><!-- TMPL_UNLESS name="notforloan" --><!-- TMPL_VAR NAME="rentalcharge" --><!-- /TMPL_UNLESS --></td>
173                         <td><a href="<!-- TMPL_VAR NAME="script_name" -->?op=add_form&itemtype=<!-- TMPL_VAR NAME="itemtype" escape="HTML" -->"><img src="<!-- TMPL_VAR NAME="interface" -->/<!-- TMPL_VAR NAME="theme" -->/images/fileopen.png"  width="32" hspace="0" vspace="0" border="0"></a></td>
174                         <td><a href="<!-- TMPL_VAR NAME="script_name" -->?op=delete_confirm&itemtype=<!-- TMPL_VAR NAME="itemtype" escape="HTML" -->"><img src="<!-- TMPL_VAR NAME="interface" -->/<!-- TMPL_VAR NAME="theme" -->/images/edittrash.png" width="32" hspace="0" vspace="0" border="0"></a></td>
175                 </tr>
176         <!-- /TMPL_LOOP -->
177 </table>
178 <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
179         <input type="hidden" name="op" value="add_form">
180         <input type="submit" class="button parameters" value="Add item type" title="Add item type" alt="Add item type" >
181         <td width="33%"><!-- TMPL_IF NAME="previous" --><a href="<!-- TMPL_VAR NAME="previous" -->"><input type="image" src="<!-- TMPL_VAR NAME="interface" -->/<!-- TMPL_VAR NAME="theme" -->/images/1leftarrow.png" title="previous" alt="previous" border="0"></a><!-- /TMPL_IF --></td>
182         <td width="33%"><!-- TMPL_IF NAME="next" --><a href="<!-- TMPL_VAR NAME="next" -->"><input type="image" src="<!-- TMPL_VAR NAME="interface" -->/<!-- TMPL_VAR NAME="theme" -->/images/1rightarrow.png" title="next" alt="next" border="0"></a><!-- /TMPL_IF --></td>
183 </form>
184 </div>
185 <!-- /TMPL_IF -->
186 <!-- TMPL_INCLUDE NAME="parameters-bottom.inc" -->