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