synch'ing 2.2 and head
[koha.git] / koha-tmpl / intranet-tmpl / default / en / acqui.simple / additem.tmpl
1 <!-- TMPL_INCLUDE NAME="cat-top.inc" -->
2 <div id="mainbloc">
3         <form method="post" action="additem.pl" name="f">
4         <input type="hidden" name="op" value="<!-- TMPL_VAR NAME="op" -->">
5         <input type="hidden" name="bibid" value="<!-- TMPL_VAR NAME="bibid" -->">
6         <div class="tabbed">
7                 <h1 class="catalogue"><!-- TMPL_VAR name="title" --> (<!-- TMPL_VAR name="author" --> biblionumber #<!-- TMPL_VAR NAME="biblionumber" -->)</h1>
8                 <a href="addbiblio.pl?oldbiblionumber=<!-- TMPL_VAR NAME="biblionumber" -->" class="button catalogue">
9                         Edit biblio
10                 </a>
11                 <a href="../MARCdetail.pl?bib=<!-- TMPL_VAR NAME="biblionumber" -->" class="button catalogue">
12                         MARC
13                 </a>
14                 <a href="../detail.pl?bib=<!-- TMPL_VAR NAME="biblionumber" -->" class="button catalogue">
15                         Normal
16                 </a>
17                 <a href="../ISBDdetail.pl?bib=<!-- TMPL_VAR NAME="biblionumber" -->" class="button catalogue">
18                         ISBD
19                 </a>
20         </div>
21         <!-- TMPL_IF name="item_loop" -->
22                 <div id="bloc25">
23                         <div name="10XX" id="10XX">
24                         <h2 class="catalogue">Existing items</h2>
25                         <table>
26                                 <tr>
27                                         <!-- TMPL_LOOP NAME="item_header_loop" -->
28                                                 <th class="catalogue">
29                                                         <TMPL_VAR NAME="header_value">
30                                                 </th>
31                                         <!-- /TMPL_LOOP -->
32                                         <th colspan="2" class="catalogue">&nbsp;</th>
33                                 </tr>
34                                         <!-- TMPL_LOOP NAME="item_loop" -->
35                                         <tr>
36                                                 <!-- TMPL_VAR NAME="item_value" -->
37                                                 <td><a href="additem.pl?op=edititem&amp;bibid=<!-- TMPL_VAR NAME="bibid" -->&amp;itemnum=<!-- TMPL_VAR NAME="itemnum" -->"><img src="<!-- TMPL_VAR NAME="interface" -->/<!-- TMPL_VAR NAME="theme" -->/images/fileopen.png" border="0"></a></td>
38                                                 <td><a href="javascript:confirm_deletion(<!-- TMPL_VAR NAME="bibid" -->,<!-- TMPL_VAR NAME="itemnum" -->)"><img src="<!-- TMPL_VAR NAME="interface" -->/<!-- TMPL_VAR NAME="theme" -->/images/edittrash.png" border="0"></a></td>
39                                         </tr>
40                                         <!-- /TMPL_LOOP -->
41                         </table>
42                         </div>
43                 </div>
44         <!-- /TMPL_IF -->
45         <div id="bloc25">
46         <!-- TMPL_IF name="opisadd" -->
47                 <h2 class="catalogue">New Item</h2>
48         <!-- TMPL_ELSE -->
49                 <h2 class="catalogue">Modify Item</h2>
50         <!-- /TMPL_IF -->       
51                 <!-- TMPL_LOOP NAME="item" -->
52                         <p>
53                                         <label><!-- TMPL_VAR NAME="subfield" --> - <!-- TMPL_IF name="mandatory" --><b><!-- /TMPL_IF --><!-- TMPL_VAR NAME="marc_lib" --><!-- TMPL_IF name="mandatory" --> *</b><!-- /TMPL_IF --></label>
54                                         <!-- TMPL_VAR NAME="marc_value" -->
55                                         <input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="tag" -->">
56                                         <input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="subfield" -->">
57                                         <input type="hidden" name="mandatory" value="<!-- TMPL_VAR NAME="mandatory" -->">
58                         </p>
59                 <!-- /tmpl_loop -->
60         <input type="hidden" name="itemnum" value="<!-- TMPL_VAR NAME="itemnum" -->">
61         <!-- TMPL_IF name="barcode_not_unique" -->
62                 <div id="problem"><b>ERROR : Barcode already exists !<b></div>
63         <!-- /TMPL_IF -->
64         <!-- TMPL_IF name="opisadd" -->
65         <input type="button" value="Add item" onClick="Check(this.form)" accesskey="w" class="button catalogue">
66         <!-- TMPL_ELSE -->
67         <input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="itemtagfield" -->">
68         <input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="itemtagsubfield" -->">
69         <input type="hidden" name="field_value" value="<!-- TMPL_VAR NAME="itemnum" -->">
70         <input type="button" value="Modify item" onClick="Check(this.form)" accesskey="w" class="button catalogue">
71         <!-- /TMPL_IF -->
72         </center>
73         </form>
74 </div>
75 <script LANGUAGE="JavaScript">
76 function _(s) { return s } // dummy function for gettext
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(<!-- TMPL_VAR NAME="themelang" -->/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)");
110                 alertString2 += "\n------------------------------------------------------------------------------------\n";
111                 alertString2 += "\n- "+ 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 function confirm_deletion(bibid,itemnum) {
120         var is_confirmed = confirm(_('Do you confirm item deletion?'));
121         if (is_confirmed) {
122         window.location = "additem.pl?op=delitem&bibid="+bibid+"&itemnum="+itemnum;
123         }
124 }
125 </script>
126 </body>
127 </html>