addorderiso2709
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / addorderiso2709.tmpl
1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2 <title>Koha &rsaquo; Acquisitions &rsaquo; Order Staged MARC Records
3 <!-- TMPL_IF name="batch_details" -->
4  &rsaquo; Batch <!-- TMPL_VAR name="import_batch_id" -->
5 <!-- TMPL_ELSE -->
6  &rsaquo; Batch List
7 <!-- /TMPL_IF -->
8 </title>
9 <!-- <script type="text/javascript" src="<!-- TMPL_VAR NAME='themelang' -->/js/additem.js"></script> -->
10 <script type="text/javascript">
11 //need to override cloneItemBlock to not generate a random itemid
12 function cloneItemBlock(index) {    
13     var original = document.getElementById('itemblock-' + index); //original <div>
14     var clone = original.cloneNode(true);
15     var random = Math.floor(Math.random()*100000); // get a random itemid.
16     // set the attribute for the new 'div' subfields
17     clone.setAttribute('id','itemblock-' + index + '-' + random);//set another id.
18     var NumTabIndex;
19     NumTabIndex = parseInt(original.getAttribute('tabindex'));
20     if(isNaN(NumTabIndex)) NumTabIndex = 0;
21     clone.setAttribute('tabindex',NumTabIndex+1);
22     var CloneButtonPlus;
23     var CloneButtonMinus;
24         CloneButtonPlus = clone.getElementsByTagName('a')[0];
25         CloneButtonPlus.setAttribute('onclick',"cloneItemBlock('" + index  + '-' +  random + "')");
26     CloneButtonMinus = clone.getElementsByTagName('a')[1];
27     CloneButtonMinus.setAttribute('onclick',"deleteItemBlock('" + index + '-' + random + "')");
28     CloneButtonMinus.setAttribute('style',"display:inline");
29     // change itemids of the clone
30     var elems = clone.getElementsByTagName('input');
31     for( i = 0 ; elems[i] ; i++ )
32     {
33         if(elems[i].name.match(/^itemid/)) {
34             elems[i].value += "-" + random;
35         }
36     }
37     var itemid = index.split("-");
38     itemid=itemid[0];
39     original.parentNode.insertBefore(clone,original.nextSibling);
40     var quantityrec = document.getElementById('quantityrec-' + itemid);
41     quantityrec.setAttribute('value',parseFloat(quantityrec.getAttribute('value'))+1);
42 }
43 function deleteItemBlock(index) {
44     var aDiv = document.getElementById('itemblock-' + index);
45     var elems = aDiv.getElementsByTagName('input');
46     var itemid = index.split("-");
47     itemid=itemid[0];
48     aDiv.parentNode.removeChild(aDiv);
49     var quantityrec = document.getElementById('quantityrec-' + itemid);
50     quantityrec.setAttribute('value',parseFloat(quantityrec.getAttribute('value'))-1);
51 }
52 </script>
53 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
54 <body>
55 <!-- TMPL_INCLUDE NAME="header.inc" -->
56 <!-- TMPL_INCLUDE NAME="acquisitions-search.inc" -->
57 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo;<a href="/cgi-bin/koha/acqui/supplier.pl?supplierid=<!-- TMPL_VAR NAME="booksellerid" -->"><!-- TMPL_VAR NAME="booksellername" --></a> &rsaquo; <a href="/cgi-bin/koha/acqui/basket.pl?basketno=<!-- TMPL_VAR name="basketno" -->">Basket #<!-- TMPL_VAR name="basketno" --></a> &rsaquo;  Add orders from iso2709 file</div>
58 <div id="doc3" class="yui-t2">
59    <div id="bd">
60        <div id="yui-main">
61            <div class="yui-b">
62              <h1>Add orders from iso2709 file</h1>
63              <!-- TMPL_IF name="batch_details" -->
64                <h2>From batch id <!-- TMPL_VAR name="import_batch_id" --></h2>
65                <div>
66                      <dl>
67                        <dd><strong>File name</strong><!-- TMPL_VAR name="file_name" --></dd>
68                        <dd><strong>Comments</strong><!-- TMPL_VAR name="comments" --></dd>
69                        <dd><strong>Staged</strong><!-- TMPL_VAR name="upload_timestamp" --></dd>
70                      </dl>
71                </div>
72                <div>
73                    <form action="<!--TMPL_VAR name="scriptname" -->" method="post" name="import_biblios">
74                      <table>
75                      <tr>
76                          <th>#</th>
77                          <th>Citation</th>
78                          <th>Match?</th>
79                          <th>Order?</th>
80                        </tr>
81                        <!-- TMPL_LOOP name="biblio_list" -->
82                          <tr>
83                              <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=<!-- TMPL_VAR name="import_record_id" -->" rel="gb_page_center[600,500]"><!-- TMPL_VAR name="record_sequence"--></a></td>
84                              <td>
85                                 <!-- TMPL_VAR name="citation"-->
86                                     <!-- TMPL_IF name="items" -->
87                                     <fieldset class="rows">
88                                         <label>Itemtype</label>
89                                         <select id="itemtype-<!-- TMPL_VAR name="import_record_id" -->" name="itemtype-<!-- TMPL_VAR name="import_record_id" -->" >
90                                             <!-- TMPL_LOOP name="itemtypes" -->
91                                                 <option value="<!-- TMPL_VAR name="itemtype" -->"><!-- TMPL_VAR name="description" --></option>
92                                             <!-- /TMPL_LOOP -->
93                                         </select>
94                                         <!-- TMPL_LOOP NAME="items" -->
95                                         <div id="outeritemblock">
96                                         <div id="itemblock-<!-- TMPL_VAR name="import_record_id" -->">
97                                             <ol><!-- TMPL_LOOP NAME="iteminformation" --><li>
98                                                 <div class="subfield_line" style="<!-- TMPL_VAR NAME='hidden' -->;" id="subfield<!-- TMPL_VAR NAME='serialid' --><!-- TMPL_VAR NAME='countitems' --><!-- TMPL_VAR NAME='subfield' --><!-- TMPL_VAR name="random" -->">
99                                                     <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>
100                                                     <!-- TMPL_VAR NAME="marc_value" -->
101                                                     <input type="hidden" name="itemid" value="<!-- TMPL_VAR name="import_record_id" -->" />
102                                                     <input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->" />
103                                                     <input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="tag" -->" />
104                                                     <input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="subfield" -->" />
105                                                     <input type="hidden" name="mandatory" value="<!-- TMPL_VAR NAME="mandatory" -->" />
106                                                     <!-- TMPL_IF NAME="ITEM_SUBFIELDS_ARE_NOT_REPEATABLE" -->
107                                                         <span class="buttonPlus" onclick="CloneSubfield('subfield<!-- TMPL_VAR NAME='serialid' --><!-- TMPL_VAR NAME='countitems' --><!-- TMPL_VAR NAME='subfield' --><!-- TMPL_VAR name="random" -->')">+</span>
108                                                     <!-- /TMPL_IF -->
109                                                 </div></li>
110                                             <!-- /TMPL_LOOP-->
111                                             </ol>
112                                             <a style="cursor: pointer; color: grey; font-size: 180%;" onclick="cloneItemBlock('<!-- TMPL_VAR name="import_record_id" -->')">+</a>
113                                             <a style="display:none; cursor: pointer; color: grey; font-size: 180%;" onclick="deleteItemBlock('itemblock-<!-- TMPL_VAR name="import_record_id" -->')">-</a>
114                                         </div><!-- /iteminformation -->
115                                         </div>
116                                         
117                                         <input type="hidden" name="moditem" value="" /> 
118                                         <input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="itemtagfield" -->" />
119                                         <input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="itemtagsubfield" -->" />
120                                         <input type="hidden" name="serial" value="<!-- TMPL_VAR NAME="serialid" -->" />
121                                         <input type="hidden" name="bibnum" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
122                                         <input type="hidden" name="itemid" value="<!-- TMPL_VAR name="import_record_id" -->" />
123                                         <input type="hidden" name="field_value" value="<!-- TMPL_VAR NAME="itemnumber" -->" />
124                                         <input type="hidden" name="quantityrec-<!-- TMPL_VAR name="import_record_id" -->" id="quantityrec-<!-- TMPL_VAR name="import_record_id" -->" value="1" />
125                                         <!--/TMPL_LOOP--> <!-- /items -->
126                                     </fieldset>
127                                     <!-- /TMPL_IF --> <!-- items -->
128
129                              </td>
130                              <td><!-- TMPL_VAR name="overlay_status"--></td>
131                              <td><input type="checkbox" name="order-<!-- TMPL_VAR name="import_record_id" -->" value="1" checked /></td>
132                          </tr>
133                          <!-- TMPL_IF name="match_biblionumber" -->
134                            <tr>
135                              <td />
136                              <td class="highlight" colspan="3">Matches biblio <!-- TMPL_VAR name="match_biblionumber" --> (score = <!-- TMPL_VAR name="match_score" -->): <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR name="match_biblionumber" -->"><!-- TMPL_VAR name="match_citation" --></a></td>
137                            </tr>
138                          <!-- /TMPL_IF -->
139                        <!-- /TMPL_LOOP -->
140                      </table>
141                      <input type="hidden" name="op" value="import_records" />
142                      <input type="hidden" name="import_batch_id" value="<!-- TMPL_VAR name="import_batch_id" -->" />
143                      <input type="hidden" name="basketno" value="<!-- TMPL_VAR name="basketno" -->" />
144                      <input type="button" value="Save" onclick="this.form.submit()" />
145                    </form>
146                </div>
147               <!-- TMPL_IF name="pages" -->
148                 <div class="pages">
149                 Page 
150                   <!-- TMPL_LOOP name="pages" -->
151                     <!-- TMPL_IF name="current_page" -->
152                       <span class="current"><!-- TMPL_VAR name="page_number" --></span>
153                     <!-- TMPL_ELSE -->
154                       <a class="nav" href="<!-- TMPL_VAR name="script_name" -->?import_batch_id=<!-- TMPL_VAR name="import_batch_id" -->&offset=<!-- TMPL_VAR name="offset" -->"><!-- TMPL_VAR name="page_number" --></a>
155                     <!-- /TMPL_IF -->
156                   <!-- /TMPL_LOOP -->
157               <!-- /TMPL_IF -->
158              <!-- TMPL_ELSE -->
159                <div>
160                    <table>
161                      <tr>
162                        <th>#</th>
163                        <th>File name</th>
164                        <th>Comments</th>
165                        <th>Status</th>
166                        <th>Staged</th>
167                        <th># Bibs</th>
168                        <th># Items</th>
169                      </tr>
170                      <!-- TMPL_LOOP name="batch_list" -->
171                      <tr>
172                        <td><a href="<!-- TMPL_VAR name="scriptname" -->?import_batch_id=<!-- TMPL_VAR name="import_batch_id" -->&basketno=<!-- TMPL_VAR name="basketno" -->"><!-- TMPL_VAR name="import_batch_id" --></a></td>
173                        <td><!-- TMPL_VAR name="file_name" --></td>
174                        <td><!-- TMPL_VAR name="comments" --></td>
175                        <td><!-- TMPL_VAR name="import_status" --></td>
176                        <td><!-- TMPL_VAR name="upload_timestamp" --></td>
177                        <td><!-- TMPL_VAR name="num_biblios" --></td>
178                        <td><!-- TMPL_VAR name="num_items" --></td>
179                      </tr>
180                      <!-- /TMPL_LOOP -->
181                    </table>
182                </div>
183              <!-- /TMPL_IF -->
184            </div>
185        </div>
186    </div>
187 </div>
188 </body>
189 </html>