* bugfixes
[wip/koha-chris_n.git] / koha-tmpl / intranet-tmpl / default / en / acqui.simple / additem.tmpl
1 <TMPL_INCLUDE NAME="cat-top.inc">
2 <STYLE TYPE="text/css" MEDIA=screen>
3         table { font-family:Arial;
4         font-weight:normal;
5         text-decoration:none;
6         font-size:10pt;}
7 </STYLE>
8 <br /><br />
9 <form method="post" action="additem.pl" name="f">
10 <input type="hidden" name="op" value="<TMPL_VAR name="op">">
11 <input type="hidden" name="bibid" value="<TMPL_VAR name="bibid">">
12 <table width="80%" align="center" cellspacing=0 cellpadding=5 border=1>
13 <tr background="/images/background-mem.gif">
14         <td>
15         <table width="100%" border=0 cellpadding=0 cellspacing=0>
16                 <tr>
17                         <td width=8%><a href="addbiblio.pl?oldbiblionumber=<TMPL_VAR name="biblionumber">"><img border="0" src="<TMPL_VAR name="interface">/<TMPL_VAR name="theme">/images/fileopen.png"></td>
18                         <td width=8%><a href="../detail.pl?bib=<TMPL_VAR name="biblionumber">">Normal</a></td>
19                         <td align="center"><b>MARC biblio : <TMPL_VAR name="bibid"></b></td>
20                 </tr>
21         </table>
22         </td>
23 </tr>
24 </table>
25 <br />
26 <center>
27 <DIV name="10XX" id="10XX">
28 <table border=1 cellspacing=0 cellpadding=5 width=80%>
29         <tr  background="/images/background-mem.gif">
30                 <th>Existing items</th>
31         </tr>
32 </table>
33 <table border=1 cellspacing=0 cellpadding=0 width=80%>
34         <tr  background="/images/background-mem.gif">
35                 <TMPL_LOOP name="item_header_loop"><th><tmpl_var name="header_value"></th></TMPL_LOOP><th colspan=2>&nbsp;</th>
36         </tr>
37                 <TMPL_LOOP name="item_loop">
38                 <tr>
39                         <TMPL_VAR name="item_value">
40                         <td><a href="additem.pl?op=edititem&bibid=<TMPL_VAR name="bibid">&itemnum=<TMPL_VAR name="itemnum">">Edit</a></td>
41                 </tr>
42                 </TMPL_LOOP>
43 </table>
44 </DIV>
45 <br /><br />
46 <table border=1 cellspacing=0 cellpadding=5 width=80%>
47         <tr  background="/images/background-mem.gif">
48                 <th>New Item</th>
49         </tr>
50 </table><table width=80%  cellspacing=0 cellpadding=1 border=0>
51         <TMPL_LOOP name="item">
52         <tr>
53                 <td width="3%">&nbsp;</td>
54                 <td width="2%"><TMPL_VAR name="subfield"></td>
55                 <td width="55%"><TMPL_IF name="mandatory"><b></TMPL_IF><TMPL_VAR name="marc_lib"><TMPL_IF name="mandatory"></b></TMPL_IF></td>
56                 <td width="40%">
57                         <TMPL_VAR name="marc_value">
58                         <input type="hidden" name="tag" value="<TMPL_VAR name="tag">">
59                         <input type="hidden" name="subfield" value="<TMPL_VAR name="subfield">">
60                         <input type="hidden" name="mandatory" value="<TMPL_VAR name="mandatory">">
61                 </td>
62         </tr>
63         </tmpl_loop>
64 </table>
65 <input type="hidden" name="itemnum" value="<TMPL_VAR name="itemnum">">
66 <TMPL_IF name="opisadd">
67 <input type="button" value="Add item" onClick='Check(this.form)' accesskey="w">
68 <TMPL_ELSE>
69 <input type="hidden" name="tag" value="<TMPL_VAR name="itemtagfield">">
70 <input type="hidden" name="subfield" value="<TMPL_VAR name="itemtagsubfield">">
71 <input type="hidden" name="field_value" value="<TMPL_VAR name="itemnum">">
72 <input type="button" value="Modify item" onClick='Check(this.form)' accesskey="w">
73 </TMPL_IF>
74 </center>
75 </form>
76 <script LANGUAGE="JavaScript">
77 function active(numlayer)
78 {
79         for (i=10; i < 11 ; i++ ) {
80                 ong = i+"XX";
81                         link = "link"+i;
82                 if (numlayer==i) {
83                         document.getElementById(ong).style.visibility="visible";
84                         document.getElementById(link).style.backgroundColor="#11AA11";
85                         document.getElementById(link).style.backgroundImage="url(/images/background-mem.gif)";
86                 } else {
87                         document.getElementById(ong).style.visibility="hidden";
88                         document.getElementById(link).style.backgroundColor="#FFFFFF";
89                         document.getElementById(link).style.backgroundImage="";
90                 }
91         }
92 }
93 function Check(f) {
94         var total_errors=0;
95 //      alert(f.field_value.length);
96         for (i=0 ; i<f.field_value.length ; i++) {
97 //      alert (f.field_value[i].value);
98                 if (f.field_value[i].value.length==0 && f.mandatory[i].value==1) {
99                         document.getElementById("error"+i).style.backgroundColor="#FF0000";
100                         total_errors++;
101                 } else {
102 //                      document.getElementById("error"+i).style.backgroundColor="#FFFFFF";
103                 }
104         }
105         var alertString2;
106         if (total_errors==0) {
107                 document.f.submit();
108         } else {
109                 alertString2 = "Form not submitted because of the following problem(s)\n";
110                 alertString2 += "------------------------------------------------------------------------------------\n\n";
111                 alertString2 += "- "+ total_errors+" mandatory fields empty (see bold subfields)";
112                 alert(alertString2);
113         }
114 }
115 function Dopop(link,i) {
116         defaultvalue=document.forms[0].field_value[i].value;
117         newin=window.open(link+"&result="+defaultvalue,"value builder",'width=500,height=400,toolbar=false,scrollbars=yes');
118 }
119 </script>
120 </body>
121 </html>