adding bookshelf features :
[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                 <h2 class="catalogue">
7                         MARC biblio : <!-- TMPL_VAR NAME="biblionumber" -->
8                 </h2>
9         <div id="bloc25">
10                 <div name="10XX" id="10XX">
11                 <h2 class="catalogue">Existing items</h2>
12                 <table>
13                         <tr>
14                                 <!-- TMPL_LOOP NAME="item_header_loop" -->
15                                         <th class="catalogue">
16                                                 <TMPL_VAR NAME="header_value">
17                                         </th>
18                                 <!-- /TMPL_LOOP -->
19                                 <th colspan="2" class="catalogue">&nbsp;</th>
20                         </tr>
21                                 <!-- TMPL_LOOP NAME="item_loop" -->
22                                 <tr>
23                                         <!-- TMPL_VAR NAME="item_value" -->
24                                         <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>
25                                         <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>
26                                 </tr>
27                                 <!-- /TMPL_LOOP -->
28                 </table>
29                 </div>
30         </div>
31         <div id="bloc100">
32         <!-- TMPL_IF name="opisadd" -->
33                 <h2 class="catalogue">New Item</h2>
34         <!-- TMPL_ELSE -->
35                 <h2 class="catalogue">Modify Item</h2>
36         <!-- /TMPL_IF -->       
37                 <!-- TMPL_LOOP NAME="item" -->
38                         <p>
39                                         <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>
40                                         <!-- TMPL_VAR NAME="marc_value" -->
41                                         <input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="tag" -->">
42                                         <input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="subfield" -->">
43                                         <input type="hidden" name="mandatory" value="<!-- TMPL_VAR NAME="mandatory" -->">
44                         </p>
45                 <!-- /tmpl_loop -->
46         <input type="hidden" name="itemnum" value="<!-- TMPL_VAR NAME="itemnum" -->">
47         <!-- TMPL_IF name="barcode_not_unique" -->
48                 <div id="problem"><b>ERROR : Barcode already exists !<b></div>
49         <!-- /TMPL_IF -->
50         <!-- TMPL_IF name="opisadd" -->
51         <input type="button" value="Add item" onClick="Check(this.form)" accesskey="w" class="button catalogue">
52         <!-- TMPL_ELSE -->
53         <input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="itemtagfield" -->">
54         <input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="itemtagsubfield" -->">
55         <input type="hidden" name="field_value" value="<!-- TMPL_VAR NAME="itemnum" -->">
56         <input type="button" value="Modify item" onClick="Check(this.form)" accesskey="w" class="button catalogue">
57         <!-- /TMPL_IF -->
58         </center>
59         </form>
60 </div>
61 <script LANGUAGE="JavaScript">
62 function _(s) { return s } // dummy function for gettext
63 function active(numlayer)
64 {
65         for (i=10; i < 11 ; i++ ) {
66                 ong = i+"XX";
67                         link = "link"+i;
68                 if (numlayer==i) {
69                         document.getElementById(ong).style.visibility="visible";
70                         document.getElementById(link).style.backgroundColor="#11AA11";
71                         document.getElementById(link).style.backgroundImage="url(<!-- TMPL_VAR NAME="themelang" -->/images/background-mem.gif)";
72                 } else {
73                         document.getElementById(ong).style.visibility="hidden";
74                         document.getElementById(link).style.backgroundColor="#FFFFFF";
75                         document.getElementById(link).style.backgroundImage="";
76                 }
77         }
78 }
79 function Check(f) {
80         var total_errors=0;
81 //      alert(f.field_value.length);
82         for (i=0 ; i<f.field_value.length ; i++) {
83 //      alert (f.field_value[i].value);
84                 if (f.field_value[i].value.length==0 && f.mandatory[i].value==1) {
85                         document.getElementById("error"+i).style.backgroundColor="#FF0000";
86                         total_errors++;
87                 } else {
88 //                      document.getElementById("error"+i).style.backgroundColor="#FFFFFF";
89                 }
90         }
91         var alertString2;
92         if (total_errors==0) {
93                 document.f.submit();
94         } else {
95                 alertString2  = _("Form not submitted because of the following problem(s)");
96                 alertString2 += "\n------------------------------------------------------------------------------------\n";
97                 alertString2 += "\n- "+ total_errors+_(" mandatory fields empty (see bold subfields)");
98                 alert(alertString2);
99         }
100 }
101 function Dopop(link,i) {
102         defaultvalue=document.forms[0].field_value[i].value;
103         newin=window.open(link+"&result="+defaultvalue,"value builder",'width=500,height=400,toolbar=false,scrollbars=yes');
104 }
105 function confirm_deletion(bibid,itemnum) {
106         var is_confirmed = confirm(_('Do you confirm item deletion?'));
107         if (is_confirmed) {
108         window.location = "additem.pl?op=delitem&bibid="+bibid+"&itemnum="+itemnum;
109         }
110 }
111 </script>
112 </body>
113 </html>