* bugfixes
[wip/koha-chris_n.git] / koha-tmpl / intranet-tmpl / default / en / acqui.simple / addbiblio.tmpl
1 <TMPL_INCLUDE NAME="cat-top.inc">
2
3 <STYLE TYPE="text/css" MEDIA=screen>
4         table { font-family:Arial;
5         font-weight:normal;
6         text-decoration:none;
7         font-size:10pt;}
8 </STYLE>
9
10 <form method="post" name="f">
11 <table width=100% cellspacing=0 cellpadding=5 border=1>
12 <tr background="/images/background-mem.gif">
13         <th>MARC biblio : <TMPL_VAR name="bibid"></th>
14 </tr>
15 <tr>
16         <td>
17         <table width=100% border=0 colspacing=0 cellpadding=0>
18         <tr>
19                 <td width=9% align="center"><a href="javascript:active(0)"><div id="link0">0</div></a></td>
20                 <td width=9% align="center"><a href="javascript:active(1)"><div id="link1">1</div></a></td>
21                 <td width=9% align="center"><a href="javascript:active(2)"><div id="link2">2</div></a></td>
22                 <td width=9% align="center"><a href="javascript:active(3)"><div id="link3">3</div></a></td>
23                 <td width=9% align="center"><a href="javascript:active(4)"><div id="link4">4</div></a></td>
24                 <td width=9% align="center"><a href="javascript:active(5)"><div id="link5">5</div></a></td>
25                 <td width=9% align="center"><a href="javascript:active(6)"><div id="link6">6</div></a></td>
26                 <td width=9% align="center"><a href="javascript:active(7)"><div id="link7">7</div></a></td>
27                 <td width=9% align="center"><a href="javascript:active(8)"><div id="link8">8</div></a></td>
28                 <td width=9% align="center"><a href="javascript:active(9)"><div id="link9">9</div></a></td>
29                 <td width=10% align="center"><input type="hidden" name="op" value="addbiblio">
30                                                                                                 <input type="hidden" name="oldbiblionumber" value="<TMPL_VAR name="oldbiblionumber">">
31                                                                                                 <input type="button" value="items" onClick='Check(this.form)' accesskey="w">
32                 </td>
33         </tr>
34         </table>
35         </td>
36 </tr>
37 </table>
38    <DIV name="0XX" id="0XX" style="position:absolute;left:40px;top:150px;visibility:visible;width:90%">
39     <table width=100%  cellspacing=0 cellpadding=2 border=0>
40         <TMPL_LOOP name="0XX">
41         <tr background="/images/background-mem.gif"><td colspan=4><b><TMPL_VAR name="tag">  <input type="hidden" name="ind_tag" value="<TMPL_VAR name="tag">"><input type="text" name="indicator" size=3 maxlength=2 value="<TMPL_VAR name="indicator">"> - <tmpl_var name="tag_lib"></td></tr>
42         <TMPL_LOOP name="subfield_loop">
43         <tr>
44                 <td width="3%">&nbsp;</td>
45                 <td width="2%"><b><TMPL_VAR name="subfield"></b></td>
46                 <td width="55%" align="right"><TMPL_IF name="mandatory"><b></TMPL_IF><TMPL_VAR name="marc_lib"><TMPL_IF name="mandatory"></b></TMPL_IF></td>
47                 <td width="40%">
48                         <TMPL_VAR name="marc_value">
49                         <input type="hidden" name="tag" value="<TMPL_VAR name="tag">">
50                         <input type="hidden" name="subfield" value="<TMPL_VAR name="subfield">">
51                         <input type="hidden" name="mandatory" value="<TMPL_VAR name="mandatory">">
52                         <input type="hidden" name="tag_mandatory" value="<TMPL_VAR name="tag_mandatory">">
53                 </td>
54         </tr>
55         </tmpl_loop>
56         </tmpl_loop>
57                 </table>
58                 </DIV>
59
60         <DIV name="1XX" id="1XX" style="position:absolute;left:40px;top:150px;visibility:hidden;width:90%">
61         <table width=100%  cellspacing=0 cellpadding=1 border=0>
62         <TMPL_LOOP name="1XX">
63         <tr background="/images/background-mem.gif"><td colspan=4><b><TMPL_VAR name="tag">  <input type="hidden" name="ind_tag" value="<TMPL_VAR name="tag">"><input type="text" name="indicator" size=3 maxlength=2 value="<TMPL_VAR name="indicator">"> - <tmpl_var name="tag_lib"></td></tr>
64         <TMPL_LOOP name="subfield_loop">
65         <tr>
66                 <td width="3%">&nbsp;</td>
67                 <td width="2%"><b><TMPL_VAR name="subfield"></b></td>
68                 <td width="55%" align="right"><TMPL_IF name="mandatory"><b></TMPL_IF><TMPL_VAR name="marc_lib"><TMPL_IF name="mandatory"></b></TMPL_IF></td>
69                 <td width="40%">
70                         <TMPL_VAR name="marc_value">
71                         <input type="hidden" name="tag" value="<TMPL_VAR name="tag">">
72                         <input type="hidden" name="subfield" value="<TMPL_VAR name="subfield">">
73                         <input type="hidden" name="mandatory" value="<TMPL_VAR name="mandatory">">
74                         <input type="hidden" name="tag_mandatory" value="<TMPL_VAR name="tag_mandatory">">
75                 </td>
76         </tr>
77         </TMPL_LOOP>
78         </TMPL_LOOP>
79      </table>
80      </DIV>
81
82         <DIV name="2XX" id="2XX" style="position:absolute;left:40px;top:150px;visibility:hidden;width:90%">
83         <table width=100% cellspacing=0 cellpadding=2  border=0>
84         <TMPL_LOOP name="2XX">
85         <tr background="/images/background-mem.gif"><td colspan=4><b><TMPL_VAR name="tag">  <input type="hidden" name="ind_tag" value="<TMPL_VAR name="tag">"><input type="text" name="indicator" size=3 maxlength=2 value="<TMPL_VAR name="indicator">"> - <tmpl_var name="tag_lib"></td></tr>
86         <TMPL_LOOP name="subfield_loop">
87         <tr>
88                 <td width="3%">&nbsp;</td>
89                 <td width="2%"><b><TMPL_VAR name="subfield"></b></td>
90                 <td width="55%" align="right"><TMPL_IF name="mandatory"><b></TMPL_IF><TMPL_VAR name="marc_lib"><TMPL_IF name="mandatory"></b></TMPL_IF></td>
91                 <td width="40%">
92                         <TMPL_VAR name="marc_value">
93                         <input type="hidden" name="tag" value="<TMPL_VAR name="tag">">
94                         <input type="hidden" name="subfield" value="<TMPL_VAR name="subfield">">
95                         <input type="hidden" name="mandatory" value="<TMPL_VAR name="mandatory">">
96                         <input type="hidden" name="tag_mandatory" value="<TMPL_VAR name="tag_mandatory">">
97                 </td>
98        </tr>
99         </TMPL_LOOP>
100         </TMPL_LOOP>
101         </table>
102         </DIV>
103
104         <DIV name="3XX" id="3XX" style="position:absolute;left:40px;top:150px;visibility:hidden;width:90%">
105         <table width=100% cellspacing=0 cellpadding=2  border=0>
106         <TMPL_LOOP name="3XX">
107         <tr background="/images/background-mem.gif"><td colspan=4><b><TMPL_VAR name="tag">  <input type="hidden" name="ind_tag" value="<TMPL_VAR name="tag">"><input type="text" name="indicator" size=3 maxlength=2 value="<TMPL_VAR name="indicator">"> - <tmpl_var name="tag_lib"></td></tr>
108         <TMPL_LOOP name="subfield_loop">
109         <tr>
110                 <td width="3%">&nbsp;</td>
111                 <td width="2%"><b><TMPL_VAR name="subfield"></b></td>
112                 <td width="55%" align="right"><TMPL_IF name="mandatory"><b></TMPL_IF><TMPL_VAR name="marc_lib"><<TMPL_IF name="mandatory"></b></TMPL_IF>/td>
113                 <td width="40%">
114                         <TMPL_VAR name="marc_value">
115                         <input type="hidden" name="tag" value="<TMPL_VAR name="tag">">
116                         <input type="hidden" name="subfield" value="<TMPL_VAR name="subfield">">
117                         <input type="hidden" name="mandatory" value="<TMPL_VAR name="mandatory">">
118                         <input type="hidden" name="tag_mandatory" value="<TMPL_VAR name="tag_mandatory">">
119                 </td>
120                 </tr>
121         </TMPL_LOOP>
122         </TMPL_LOOP>
123         </table>
124         </DIV>
125
126         <DIV name="4XX" id="4XX" style="position:absolute;left:40px;top:150px;visibility:hidden;width:90%">
127         <table width=100%  cellspacing=0 cellpadding=2 border=0>
128         <TMPL_LOOP name="4XX">
129         <tr background="/images/background-mem.gif"><td colspan=4><b><TMPL_VAR name="tag">  <input type="hidden" name="ind_tag" value="<TMPL_VAR name="tag">"><input type="text" name="indicator" size=3 maxlength=2 value="<TMPL_VAR name="indicator">"> - <tmpl_var name="tag_lib"></td></tr>
130         <TMPL_LOOP name="subfield_loop">
131         <tr>
132                 <td width="3%">&nbsp;</td>
133                 <td width="2%"><b><TMPL_VAR name="subfield"></b></td>
134                 <td width="55%" align="right"><TMPL_IF name="mandatory"><b></TMPL_IF><TMPL_VAR name="marc_lib"><TMPL_IF name="mandatory"></b></TMPL_IF></td>
135                 <td width="40%">
136                         <TMPL_VAR name="marc_value">
137                         <input type="hidden" name="tag" value="<TMPL_VAR name="tag">">
138                         <input type="hidden" name="subfield" value="<TMPL_VAR name="subfield">">
139                         <input type="hidden" name="mandatory" value="<TMPL_VAR name="mandatory">">
140                         <input type="hidden" name="tag_mandatory" value="<TMPL_VAR name="tag_mandatory">">
141                 </td>
142         </tr>
143         </TMPL_LOOP>
144         </TMPL_LOOP>
145         </table>
146         </DIV>
147
148         <DIV name="5XX" id="5XX" style="position:absolute;left:40px;top:150px;visibility:hidden;width:90%">
149         <table width=100% cellspacing=0 cellpadding=2  border=0>
150         <TMPL_LOOP name="5XX">
151         <tr background="/images/background-mem.gif"><td colspan=4><b><TMPL_VAR name="tag">  <input type="hidden" name="ind_tag" value="<TMPL_VAR name="tag">"><input type="text" name="indicator" size=3 maxlength=2 value="<TMPL_VAR name="indicator">"> - <tmpl_var name="tag_lib"></td></tr>
152         <TMPL_LOOP name="subfield_loop">
153         <tr>
154                 <td width="3%">&nbsp;</td>
155                 <td width="2%"><b><TMPL_VAR name="subfield"></b></td>
156                 <td width="55%" align="right"><TMPL_IF name="mandatory"><b></TMPL_IF><TMPL_VAR name="marc_lib"><TMPL_IF name="mandatory"></b></TMPL_IF></td>
157                 <td width="40%">
158                         <TMPL_VAR name="marc_value">
159                         <input type="hidden" name="tag" value="<TMPL_VAR name="tag">">
160                         <input type="hidden" name="subfield" value="<TMPL_VAR name="subfield">">
161                         <input type="hidden" name="mandatory" value="<TMPL_VAR name="mandatory">">
162                         <input type="hidden" name="tag_mandatory" value="<TMPL_VAR name="tag_mandatory">">
163                 </td>
164         </tr>
165         </TMPL_LOOP>
166         </TMPL_LOOP>
167         </table>
168         </DIV>
169
170         <DIV name="6XX" id="6XX" style="position:absolute;left:40px;top:150px;visibility:hidden;width:90%">
171         <table width=90% cellspacing=0 cellpadding=2  border=0>
172         <TMPL_LOOP name="6XX">
173         <tr background="/images/background-mem.gif"><td colspan=4><b><TMPL_VAR name="tag">  <input type="hidden" name="ind_tag" value="<TMPL_VAR name="tag">"><input type="text" name="indicator" size=3 maxlength=2 value="<TMPL_VAR name="indicator">"> - <tmpl_var name="tag_lib"></td></tr>
174         <TMPL_LOOP name="subfield_loop">
175         <tr>
176                 <td width="3%">&nbsp;</td>
177                 <td width="2%"><b><TMPL_VAR name="subfield"></b></td>
178                 <td width="55%" align="right"><TMPL_IF name="mandatory"><b></TMPL_IF><TMPL_VAR name="marc_lib"><TMPL_IF name="mandatory"></b></TMPL_IF></td>
179                 <td width="40%">
180                         <TMPL_VAR name="marc_value">
181                         <input type="hidden" name="tag" value="<TMPL_VAR name="tag">">
182                         <input type="hidden" name="subfield" value="<TMPL_VAR name="subfield">">
183                         <input type="hidden" name="mandatory" value="<TMPL_VAR name="mandatory">">
184                         <input type="hidden" name="tag_mandatory" value="<TMPL_VAR name="tag_mandatory">">
185                 </td>
186         </tr>
187         </TMPL_LOOP>
188         </TMPL_LOOP>
189         </table>
190         </DIV>
191
192         <DIV name="7XX" id="7XX" style="position:absolute;left:40px;top:150px;visibility:hidden;width:90%">
193         <table width=100%  cellspacing=0 cellpadding=2 border=0>
194         <TMPL_LOOP name="7XX">
195         <tr background="/images/background-mem.gif"><td colspan=4><b><TMPL_VAR name="tag">  <input type="hidden" name="ind_tag" value="<TMPL_VAR name="tag">"><input type="text" name="indicator" size=3 maxlength=2 value="<TMPL_VAR name="indicator">"> - <tmpl_var name="tag_lib"></td></tr>
196         <TMPL_LOOP name="subfield_loop">
197         <tr>
198                 <td width="3%">&nbsp;</td>
199                 <td width="2%"><b><TMPL_VAR name="subfield"></b></td>
200                 <td width="55%" align="right"><TMPL_IF name="mandatory"><b></TMPL_IF><TMPL_VAR name="marc_lib"><TMPL_IF name="mandatory"></b></TMPL_IF></td>
201                 <td width="40%">
202                         <TMPL_VAR name="marc_value">
203                         <input type="hidden" name="tag" value="<TMPL_VAR name="tag">">
204                         <input type="hidden" name="subfield" value="<TMPL_VAR name="subfield">">
205                         <input type="hidden" name="mandatory" value="<TMPL_VAR name="mandatory">">
206                         <input type="hidden" name="tag_mandatory" value="<TMPL_VAR name="tag_mandatory">">
207                 </td>
208         </tr>
209         </TMPL_LOOP>
210         </TMPL_LOOP>
211         </table>
212         </DIV>
213
214         <DIV name="8XX" id="8XX" style="position:absolute;left:40px;top:150px;visibility:hidden;width:90%">
215         <table width=100% cellspacing=0 cellpadding=2  border=0>
216         <TMPL_LOOP name="8XX">
217         <tr background="/images/background-mem.gif"><td colspan=4><b><TMPL_VAR name="tag">  <input type="hidden" name="ind_tag" value="<TMPL_VAR name="tag">"><input type="text" name="indicator" size=3 maxlength=2 value="<TMPL_VAR name="indicator">"> - <tmpl_var name="tag_lib"></td></tr>
218         <TMPL_LOOP name="subfield_loop">
219         <tr>
220                 <td width="3%">&nbsp;</td>
221                 <td width="2%"><b><TMPL_VAR name="subfield"></b></td>
222                 <td width="55%" align="right"><TMPL_IF name="mandatory"><b></TMPL_IF><TMPL_VAR name="marc_lib"><TMPL_IF name="mandatory"></b></TMPL_IF></td>
223                 <td width="40%">
224                         <TMPL_VAR name="marc_value">
225                         <input type="hidden" name="tag" value="<TMPL_VAR name="tag">">
226                         <input type="hidden" name="subfield" value="<TMPL_VAR name="subfield">">
227                         <input type="hidden" name="mandatory" value="<TMPL_VAR name="mandatory">">
228                         <input type="hidden" name="tag_mandatory" value="<TMPL_VAR name="tag_mandatory">">
229                 </td>
230         </tr>
231         </TMPL_LOOP>
232         </TMPL_LOOP>
233         </table>
234         </DIV>
235
236         <DIV name="9XX" id="9XX" style="position:absolute;left:40px;top:150px;visibility:hidden;width:90%">
237         <table width=90% cellspacing=0 cellpadding=2  border=0>
238         <TMPL_LOOP name="9XX">
239         <tr background="/images/background-mem.gif"><td colspan=4><b><TMPL_VAR name="tag">  <input type="hidden" name="ind_tag" value="<TMPL_VAR name="tag">"><input type="text" name="indicator" size=3 maxlength=2 value="<TMPL_VAR name="indicator">"> - <tmpl_var name="tag_lib"></td></tr>
240         <TMPL_LOOP name="subfield_loop">
241         <tr>
242                 <td width="3%">&nbsp;</td>
243                 <td width="2%"><b><TMPL_VAR name="subfield"></b></td>
244                 <td width="55%" align="right"><TMPL_IF name="mandatory"><b></TMPL_IF><TMPL_VAR name="marc_lib"><TMPL_IF name="mandatory"></b></TMPL_IF></td>
245                 <td width="40%">
246                         <TMPL_VAR name="marc_value">
247                         <input type="hidden" name="tag" value="<TMPL_VAR name="tag">">
248                         <input type="hidden" name="subfield" value="<TMPL_VAR name="subfield">">
249                         <input type="hidden" name="mandatory" value="<TMPL_VAR name="mandatory">">
250                         <input type="hidden" name="tag_mandatory" value="<TMPL_VAR name="tag_mandatory">">
251                 </td>
252         </tr>
253         </TMPL_LOOP>
254         </TMPL_LOOP>
255         </table>
256         </DIV>
257
258         <DIV name="hidden" id="hidden" style="position:absolute;left:40px;top:150px;visibility:hidden;width:90%">
259         <table width=90% cellspacing=0 cellpadding=2  border=0>
260         <TMPL_LOOP name="hidden_loop">
261         <tr>
262                 <td width="3%">&nbsp;</td>
263                 <td width="2%"><b><TMPL_VAR name="subfield"></b></td>
264                 <td width="55%" align="right"><TMPL_IF name="mandatory"><b></TMPL_IF><TMPL_VAR name="marc_lib"><TMPL_IF name="mandatory"></b></TMPL_IF></td>
265                 <td width="40%">
266                         <TMPL_VAR name="marc_value">
267                         <input type="hidden" name="tag" value="<TMPL_VAR name="tag">">
268                         <input type="hidden" name="subfield" value="<TMPL_VAR name="subfield">">
269                         <input type="hidden" name="mandatory" value="<TMPL_VAR name="mandatory">">
270                         <input type="hidden" name="tag_mandatory" value="<TMPL_VAR name="tag_mandatory">">
271                 </td>
272         </tr>
273         </TMPL_LOOP>
274         </table>
275         </DIV>
276         <TMPL_IF name="oldbiblionumtagfield">
277                 <input type="hidden" name="tag" value="<TMPL_VAR name="oldbiblionumtagfield">">
278                 <input type="hidden" name="subfield" value="<TMPL_VAR name="oldbiblionumtagsubfield">">
279                 <input type="hidden" name="field_value" value="<TMPL_VAR name="oldbiblionumber">">
280                 <input type="hidden" name="mandatory" value="0">
281                 <input type="hidden" name="tag" value="<TMPL_VAR name="oldbiblioitemnumtagfield">">
282                 <input type="hidden" name="subfield" value="<TMPL_VAR name="oldbiblioitemnumtagsubfield">">
283                 <input type="hidden" name="field_value" value="<TMPL_VAR name="oldbiblioitemnumber">">
284                 <input type="hidden" name="mandatory" value="0">
285                         <input type="hidden" name="tag_mandatory" value="<TMPL_VAR name="tag_mandatory">">
286         </TMPL_IF>
287 </form>
288
289
290 <script LANGUAGE="JavaScript">
291 function active(numlayer)
292 {
293         for (i=0; i < 10 ; i++ ) {
294                 ong = i+"XX";
295                         link = "link"+i;
296                 if (numlayer==i) {
297                         document.getElementById(ong).style.visibility="visible";
298                         document.getElementById(link).style.backgroundColor="#11AA11";
299                         document.getElementById(link).style.backgroundImage="url(/images/background-mem.gif)";
300                 } else {
301                         document.getElementById(ong).style.visibility="hidden";
302                         document.getElementById(link).style.backgroundColor="#FFFFFF";
303                         document.getElementById(link).style.backgroundImage="";
304                 }
305         }
306 }
307 function Check(f) {
308         // Scan for nonempty fields
309         var field_is_nonempty_p = new Array();
310         for (i=0 ; i<f.field_value.length ; i++) {
311             field_is_nonempty_p[f.tag[i].value] = 0;
312         }
313         for (i=0 ; i<f.field_value.length ; i++) {
314             if (f.field_value[i].value.length != 0) {
315                 field_is_nonempty_p[f.tag[i].value] += 1;
316             }
317         }
318
319         // Scan for missing mandatory subfields
320         var total_missing_mandatory_subfields = 0;
321         for (i=0 ; i<f.field_value.length-2 ; i++) {
322                 if (f.field_value[i].value.length==0 && f.mandatory[i].value==1) {
323                     // We should not flag an error unless the tag is also
324                     // mandatory, or if something else in the tag is entered
325
326                     if (f.tag_mandatory[i].value == 1 || field_is_nonempty_p[f.tag[i].value]) {
327                         document.getElementById("error"+i).style.backgroundColor="#FF0000";
328                         total_missing_mandatory_subfields++;
329                     }
330                 } else {
331                         document.getElementById("error"+i).style.backgroundColor="#FFFFFF";
332                 }
333         }
334
335         // Scan for missing mandatory tags
336         var total_missing_mandatory_tags = 0;
337         var seen_mandatory_tag_p = new Array();
338         for (i=0 ; i<f.field_value.length ; i++) {
339             var j = f.tag[i].value;
340             if (!field_is_nonempty_p[j] && f.tag_mandatory[i].value == 1) {
341                 if (seen_mandatory_tag_p[j] != 1) {
342                     seen_mandatory_tag_p[j] = 1;
343                     total_missing_mandatory_tags++;
344                 }
345                 document.getElementById("error"+i).style.backgroundColor="#ffff00";
346             }
347         }
348
349         var total_errors = total_missing_mandatory_tags + total_missing_mandatory_subfields;
350         var alertString2;
351         if (total_errors!=0) {
352                 alertString2 = "Form not submitted because of the following problem(s)\n";
353                 alertString2 += "------------------------------------------------------------------------------------\n\n";
354                 alertString2 += "- "+ total_missing_mandatory_tags +" mandatory tags empty\n";
355                 alertString2 += "- "+ total_missing_mandatory_subfields +" mandatory fields empty (see bold subfields)";
356                 alert(alertString2);
357         } else {
358                 document.f.submit();
359         }
360 }
361 function Dopop(link,i) {
362         defaultvalue=document.forms[0].field_value[i].value;
363         newin=window.open(link+"&result="+defaultvalue,"value builder",'width=500,height=400,toolbar=false,scrollbars=yes');
364 }
365
366 </script>
367 </body>
368 </html>