merging 2.2 branch with head. Sorry for not making it before, many many commits done...
[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 </script>
60 <div id="mainbloc">
61 <!-- TMPL_IF NAME="add_form" -->
62         <!-- TMPL_IF NAME="itemtype" -->
63                 <h1 class="parameters">Modify item type</h1>
64         <!-- TMPL_ELSE -->
65                 <h1 class="parameters">Add item type</h1>
66         <!-- /TMPL_IF -->
67         <form action="<!-- TMPL_VAR NAME="script_name" -->" name="Aform" method="post">
68                 <input type="hidden" name="op" value="add_validate">
69                 <input type="hidden" name="checked" value="0">
70                         <!-- TMPL_IF NAME="itemtype" -->
71                                 <p><label class="label100">Item type<label><input type="hidden" name="itemtype" value="<!-- TMPL_VAR NAME="itemtype" -->"><!-- TMPL_VAR NAME="itemtype" --></p>
72                         <!-- TMPL_ELSE -->
73                                 <p><label class="label100">Item type<label><input type="text" name="itemtype" size="6" maxlength="4" onblur="toUC(this)"></p>
74                         <!-- /TMPL_IF -->
75                         <p>
76                                 <label class="label100">Description</label>
77                                 <input type="text" name="description" size="40" maxlength="80" value="<!-- TMPL_VAR NAME="description" escape=HTML -->">
78                         </p>
79                         <p>
80                                 <label class="label100">Not for loan</label>
81                                 <!-- TMPL_IF NAME="notforloan" -->
82                                         <input type="checkbox" name="notforloan" checked value="1">
83                                 <!-- TMPL_ELSE -->
84                                         <input type="checkbox" name="notforloan" value="1">
85                                 <!-- /TMPL_IF -->
86                                 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
87                         </p>
88                         <p>
89                                 <label class="label100" name="renewalsallowed">Number of renewals allowed</label>
90                                 <input type="text" name="renewalsallowed" value="<!-- TMPL_VAR NAME="renewalsallowed" -->">
91                         </p>
92                         <p>
93                                 <label class="label100">Rental charge</label>
94                                 <input type="text" name="rentalcharge" size="10" value="<!-- TMPL_VAR NAME="rentalcharge" -->">
95                         </p>
96                         <p>
97                                 <input type="button" value="OK" class="button" onclick="Check(this.form)">
98                         </p>
99         </form>
100 <!-- /TMPL_IF -->
101
102 <!-- TMPL_IF NAME="delete_confirm" -->
103                 <p><label>Item type</label><!-- TMPL_VAR NAME="itemtype" --></p>
104         <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
105                 <input type="hidden" name="op" value="delete_confirmed"><input type="hidden" name="itemtype" value="<!-- TMPL_VAR NAME="itemtype" -->">
106         <p><label>Description</label><!-- TMPL_VAR NAME="description" --></p>
107         <p><label>Renewals</label><!-- TMPL_IF NAME="renewalsallowed" -->Allowed<!-- TMPL_ELSE -->Not allowed<!-- /TMPL_IF --></p>
108         <p><lable>Rental charge</label><!-- TMPL_VAR NAME="rentalcharge" --></p>
109         <!-- TMPL_IF NAME="total" -->
110                 <p>
111                         <b>This record is used <!-- TMPL_VAR NAME="total" --> times. Deletion not possible</b>
112                 </p>
113                 <p>
114                         </form>
115                         <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post"><input type="submit" value="OK" class="button parameters"></form>
116                 </p>
117         <!-- TMPL_ELSE -->
118                 <p>CONFIRM DELETION</p>
119                 <p>
120                         <input type="submit" value="YES" class="button parameters"></form>
121                         <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post"><input type="submit" value="NO" class="button parameters"></form>
122                 </p>
123         <!-- /TMPL_IF -->
124
125 <!-- /TMPL_IF -->
126
127 <!-- TMPL_IF NAME="else" -->
128 <h1 class="parameters">Item type Admin</h1>
129 <table>
130         <tr>
131                 <th class="parameters">Code</th>
132                 <th class="parameters">Description</th>
133                 <th class="parameters">not for loan</th>
134                 <th class="parameters">Renewable</th>
135                 <th class="parameters">Charge</th>
136                 <th class="parameters">Edit</th>
137                 <th class="parameters">Delete</th>
138         </tr>
139         <!-- TMPL_LOOP NAME="loop" -->
140                 <tr>
141                         <td><!-- TMPL_VAR NAME="itemtype" --></td>
142                         <td><!-- TMPL_VAR NAME="description" --></td>
143                         <td><!-- TMPL_IF NAME="notforloan" -->Yes<!-- /TMPL_IF --></td>
144                         <td><!-- TMPL_UNLESS name="notforloan" -->
145                                         <!-- TMPL_IF NAME="renewalsallowed" -->
146                                                 <!-- TMPL_VAR name="renewalsallowed" --> time(s)
147                                         <!-- TMPL_ELSE -->
148                                                 No
149                                         <!-- /TMPL_IF -->
150                                 <!-- /TMPL_UNLESS -->
151                         </td>
152                         <td><!-- TMPL_UNLESS name="notforloan" --><!-- TMPL_VAR NAME="rentalcharge" --><!-- /TMPL_UNLESS --></td>
153                         <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>
154                         <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>
155                 </tr>
156         <!-- /TMPL_LOOP -->
157 </table>
158 <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
159         <input type="hidden" name="op" value="add_form">
160         <input type="submit" class="button parameters" value="Add item type" title="Add item type" alt="Add item type" >
161         <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>
162         <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>
163 </form>
164 </div>
165 <!-- /TMPL_IF -->
166 <!-- TMPL_INCLUDE NAME="parameters-bottom.inc" -->