Bug 15503 [QA Followup] - Set itype and ccode properly
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / addorderiso2709.tt
1 [% USE KohaDates %]
2 [% USE Branches %]
3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>Koha &rsaquo; Acquisitions &rsaquo; Order staged MARC records
5 [% IF ( batch_details ) %]
6  &rsaquo; Batch [% import_batch_id %]
7 [% ELSE %]
8  &rsaquo; Batch list
9 [% END %]
10 </title>
11 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
12 <style type="text/css">#dataPreview { width : 80%; } @media (max-width: 767px) { #dataPreview { margin: 0; width : auto; } }</style>
13 [% INCLUDE 'doc-head-close.inc' %]
14 [% INCLUDE 'datatables.inc' %]
15 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
16 <script type="text/javascript" src="[% interface %]/[% theme %]/js/acq.js"></script>
17 <script type="text/JavaScript">
18 //<![CDATA[
19     $(document).ready(function() {
20         $("#files").dataTable($.extend(true, {}, dataTablesDefaults, {
21             "aoColumnDefs": [
22                 { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
23                 { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
24                 { "sType": "title-string", "aTargets" : [ "title-string" ] }
25             ],
26             "sPaginationType": "four_button",
27             "aaSorting": []
28         } ) );
29
30         // keep copy of the inactive budgets
31         disabledBudgetsCopy = $("select[name='all_budget_id']").html();
32         $("select[name='all_budget_id'] .b_inactive").remove();
33         $("select[name='budget_id'] .b_inactive").remove();
34
35         $("#showallbudgets").click(function() {
36             if ($(this).is(":checked")) {
37                 $("select[name='budget_id']").html(disabledBudgetsCopy)
38             }
39             else {
40                 $("select[name='budget_id'] .b_inactive").remove();
41             }
42         });
43
44         $("#all_showallbudgets").click(function() {
45             if ($(this).is(":checked")) {
46                 $("select[name='all_budget_id']").html(disabledBudgetsCopy);
47             }
48             else {
49                 $("select[name='all_budget_id'] .b_inactive").remove();
50             }
51         });
52
53         $("select[name='budget_id']").change(function(){
54             var sort1_authcat = $(this).find("option:selected").attr('data-sort1-authcat');
55             var sort2_authcat = $(this).find("option:selected").attr('data-sort2-authcat');
56             var destination_sort1 = $(this).parents('fieldset').find('li.sort1').find('input[name="sort1"]');
57             var sort1 = $(destination_sort1).val() || "";
58             if ( destination_sort1.length < 1 ) {
59                 destination_sort1 = $(this).parents('fieldset').find('li.sort1 > select[name="sort1"]');
60             }
61             var destination_sort2 = $(this).parents('fieldset').find('li.sort2').find('input[name="sort2"]');
62             var sort2 = $(destination_sort2).val() || "";
63             if ( destination_sort2.length < 1 ) {
64                 destination_sort2 = $(this).parents('fieldset').find('li.sort2').find('select[name="sort2"]');
65             }
66             getAuthValueDropbox( 'sort1', sort1_authcat, destination_sort1, sort1 );
67
68             getAuthValueDropbox( 'sort2', sort2_authcat, destination_sort2, sort2 );
69         } );
70
71         $("select[name='budget_id']").change();
72
73         $("select[name='all_budget_id']").change(function(){
74             var sort1_authcat = $(this).find("option:selected").attr('data-sort1-authcat');
75             var sort2_authcat = $(this).find("option:selected").attr('data-sort2-authcat');
76             var destination_sort1 = $(this).parent().siblings('li').find('input[name="all_sort1"]');
77             if ( destination_sort1.length < 1 ) {
78                 destination_sort1 = $(this).parent().siblings('li').find('select[name="all_sort1"]');
79             }
80             var destination_sort2 = $(this).parent().siblings('li').find('input[name="all_sort2"]');
81             if ( destination_sort2.length < 1 ) {
82                 destination_sort2 = $(this).parent().siblings('li').find('select[name="all_sort2"]');
83             }
84             getAuthValueDropbox( 'sort1', sort1_authcat, destination_sort1 );
85             getAuthValueDropbox( 'sort2', sort2_authcat, destination_sort2 );
86             $(this).parent().siblings('li').find('select[name="sort1"]').attr('name', 'all_sort1');
87             $(this).parent().siblings('li').find('input[name="sort1"]').attr('name', 'all_sort1');
88             $(this).parent().siblings('li').find('select[name="sort2"]').attr('name', 'all_sort2');
89             $(this).parent().siblings('li').find('input[name="sort2"]').attr('name', 'all_sort2');
90         } );
91
92         $("select[name='all_budget_id']").change();
93
94         $("#records_to_import fieldset.rows div").hide();
95         $('input:checkbox[name="import_record_id"]').change(function(){
96             var container = $(this).parents("fieldset");
97             if ( $(this).is(':checked') ) {
98                 $(container).addClass("selected");
99                 $(container).removeClass("unselected");
100                 $(container).find("div").toggle(true);
101             } else {
102                 $(container).addClass("unselected");
103                 $(container).removeClass("selected");
104                 $(container).find("div").toggle(false);
105             }
106         } );
107
108         $("input:checkbox").prop("checked", false);
109         $("div.biblio.unselected select").prop('disabled', false);
110         $("div.biblio.unselected input").prop('disabled', false);
111
112         $("#checkAll").click(function(){
113             $("#Aform").checkCheckboxes();
114             $("input:checkbox[name='import_record_id']").change();
115             return false;
116         });
117         $("#unCheckAll").click(function(){
118             $("#Aform").unCheckCheckboxes();
119             $("input:checkbox[name='import_record_id']").change();
120             return false;
121         });
122
123         $("#Aform").on("submit", function(){
124             if ( $("input:checkbox[name='import_record_id']:checked").length < 1 ) {
125                 alert(_("There is no record selected"));
126                 return false;
127             }
128
129             var error = 0;
130             $("input:checkbox[name='import_record_id']:checked").parents('fieldset').find('input[name="quantity"]').each(function(){
131                 if ( $(this).val().length < 1 || isNaN( $(this).val() ) ) {
132                     error++;
133                 }
134             });
135             if ( error > 0 ) {
136                 alert(error + " " + _("quantity values are not filled in or are not numbers"));
137                 return false;
138
139             }
140             var error = 0;
141             $("select[name='budget_code']").each(function() {
142                 if (!$(this).val()) {
143                     error++;
144                 }
145             });
146             if ( error > 0 ) {
147                 alert(_("Some budgets are not defined in item records"));
148                 return false;
149             }
150
151             return disableUnchecked($(this));
152         });
153         $('#tabs').tabs();
154         $(".previewData").on("click", function(e){
155             e.preventDefault();
156             var ltitle = $(this).text();
157             var page = $(this).attr("href");
158             $("#dataPreviewLabel").text(ltitle);
159             $("#dataPreview .modal-body").load(page + " div");
160             $('#dataPreview').modal({show:true});
161         });
162         $("#dataPreview").on("hidden", function(){
163             $("#dataPreviewLabel").html("");
164             $("#dataPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
165         });
166     });
167
168     function disableUnchecked(form){
169         $("fieldset.biblio.unselected").each(function(){
170             $(this).remove();
171         });
172         return 1;
173     }
174 //]]>
175 </script>
176 </head>
177 <body id="acq_addorderiso2709" class="acq">
178 [% INCLUDE 'header.inc' %]
179 [% INCLUDE 'acquisitions-search.inc' %]
180 <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?booksellerid=[% booksellerid %]">[% booksellername %]</a> &rsaquo; <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]">Basket [% basketno %]</a> &rsaquo;  Add orders from iso2709 file</div>
181 <div id="doc3" class="yui-t2">
182    <div id="bd">
183        <div id="yui-main">
184            <div class="yui-b">
185              [% IF ( allmatch ) %]<div class="dialog alert">
186               <h4>No records imported</h4>
187              No record have been imported because they all match an existing record in your catalog.<br />You'll have to treat them individually.
188              </div>
189              [% END %]
190
191              [% IF ( batch_details ) %]
192                 <h1>Add orders from [% comments %]
193                     ([% file_name %] staged on [% upload_timestamp | $KohaDates with_hours => 1 %])
194                 </h1>
195                 <form action="/cgi-bin/koha/acqui/addorderiso2709.pl" method="post" id="Aform">
196                 <div id="tabs" class="toptabs">
197                   <ul>
198                     <li><a href="#records_to_import">Select to import</a></li>
199                     <li><a href="#items_info" class="items_info">Item information</a></li>
200                     <li><a href="#accounting_details">Default accounting details</a></li>
201                   </ul>
202
203                   <div id="records_to_import">
204                     <div id="searchheader">
205                         <div>
206                             <span class="checkall"><a id="checkAll" href="#">Select all</a></span>
207                             |
208                             <span class="uncheckall"><a id="unCheckAll" href="#">Clear all</a></span>
209                             |
210                             <span>
211                                 <label for="matcher_id">Matching:</label>
212                                     <select name="matcher_id" id="matcher_id">
213                                         <option value="_TITLE_AUTHOR_">Title and author</option>
214                                         <option value="">Do not look for matching records</option>
215                                         [% FOREACH available_matcher IN available_matchers %]
216                                             [% IF ( available_matcher.code == current_matcher_code ) %]
217                                                 <option value="[% available_matcher.matcher_id %]" selected="selected">
218                                                     [% available_matcher.code %] ([% available_matcher.description %])
219                                                 </option>
220                                             [% ELSE %]
221                                                 <option value="[% available_matcher.matcher_id %]">
222                                                     [% available_matcher.code %] ([% available_matcher.description %])
223                                                 </option>
224                                             [% END %]
225                                         [% END %]
226                                     </select>
227                             </span>
228                             |
229                             <span>
230                                 <label for="showallbudgets" style="float:none;width:auto;">&nbsp;Show inactive funds:</label>
231                                 <input type="checkbox" id="showallbudgets" />
232                             </span>
233                         </div>
234                     </div>
235
236                         <input type="hidden" name="op" value="import_records"/>
237                         <input type="hidden" name="basketno" value="[% basketno %]" />
238                         <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
239                         <input type="hidden" name="import_batch_id" value="[%import_batch_id %]" />
240                         <input type="hidden" name="ordernumber" value="[% ordernumber %]" />
241
242                         [% FOREACH biblio IN biblio_list %]
243                         <fieldset class="biblio unselected rows" style="float:none;">
244                           <legend>
245                             <label for="record_[% biblio.import_record_id %]" style="width:auto;">
246                               <input type="checkbox" name="import_record_id" id="record_[% biblio.import_record_id %]" value="[% biblio.import_record_id %]" />
247                               <span class="citation">[% biblio.citation %]</span>
248                             </label>
249                             <span class="links" style="font-weight: normal;">
250                               ( <a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% biblio.import_record_id %]" class="previewData">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;importid=[% biblio.import_record_id %]" class="previewData">Card</a> | <a href="/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]&amp;breedingid=[% biblio.import_record_id %]&amp;import_batch_id=[% biblio.import_batch_id %]&amp;biblionumber=[% biblio.match_biblionumber %]">Add order</a> )
251                             </span>
252                           </legend>
253                           <div style="float:left">
254                           <ol>
255                             <li class="status">
256                               <span class="match">
257                                 [% IF ( biblio_lis.overlay_status == 'no_match' ) %]
258                                     No match
259                                 [% ELSIF ( biblio_lis.overlay_status == 'match_applied' ) %]
260                                     Match applied
261                                 [% ELSIF ( biblio_lis.overlay_status == 'auto_match' ) %]
262                                     Match found
263                                 [% ELSE %]
264                                     [% biblio_lis.overlay_status %]
265                                 [% END %]
266                                 [% IF ( biblio.match_biblionumber ) %]
267                                   Matches biblio [% biblio.match_biblionumber %] (score = [% biblio.match_score %]): <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.match_biblionumber %]">[% biblio.match_citation %]</a>
268                                 [% END %]
269                               </span>
270                             </li>
271                             <li class="quantity">
272                                 <label for="quantity_record_[% biblio.import_record_id %]" class="required">Quantity: </label>
273                                 <input id="quantity_record_[% biblio.import_record_id %]" type="text" value="[% biblio.quantity.length ? biblio.quantity : 1 %]" name="quantity" />
274                             </li>
275                             <li class="price">
276                                 <label for="price_record_[% biblio.import_record_id %]">Price: </label>
277                                 <input id="price_record_[% biblio.import_record_id %]" type="text" value="[% biblio.price %]" name="price" />
278                             </li>
279                             <li class="discount">
280                                 <label for="discount_record_[% biblio.import_record_id %]">Discount: </label>
281                                 <input id="discount_record_[% biblio.import_record_id %]" type="text" value="[% biblio.discount %]" name="discount" size="6" /> %
282                                 (If empty, discount rate from vendor will be used)
283                             </li>
284                             <li class="budget">
285                                 <label for="fund_record_[% biblio.import_record_id %]">Fund: </label>
286                                 [% IF ( close ) %]
287                                   <input type="hidden" size="20" name="budget_id" value="[% budget_id %]" />[% Budget_name %]
288                                 [% ELSE %]
289                                   <select id="fund_record_[% biblio.import_record_id %]" size="1" name="budget_id">
290                                     <option value="">Select a fund</option>
291                                     [% FOREACH budget IN budget_loop %]
292                                         [% IF ( budget.b_id == biblio.budget_id ) %]
293                                           [% IF budget.b_active %]
294                                             <option value="[% budget.b_id %]" data-sort1-authcat="[% budget.b_sort1_authcat %]" data-sort2-authcat="[% budget.b_sort2_authcat %]" selected="selected">[% budget.b_txt %]</option>
295                                           [% ELSE %]
296                                             <option value="[% budget.b_id %]" data-sort1-authcat="[% budget.b_sort1_authcat %]" data-sort2-authcat="[% budget.b_sort2_authcat %]" selected="selected">[% budget.b_txt %] (inactive)</option>
297                                           [% END %]
298                                         [% ELSE %]
299                                             [% IF budget.b_active %]<option value="[% budget.b_id %]" data-sort1-authcat="[% budget.b_sort1_authcat %]" data-sort2-authcat="[% budget.b_sort2_authcat %]">[% budget.b_txt %]</option>
300                                             [% ELSE %]<option value="[% budget.b_id %]" class="b_inactive" data-sort1-authcat="[% budget.b_sort1_authcat %]" data-sort2-authcat="[% budget.b_sort2_authcat %]">[% budget.b_txt %] (inactive)</option>
301                                             [% END %]
302                                         [% END %]
303                                     [% END %]
304                                   </select>
305                                 [% END %]
306                             </li>
307                             <li class="sort1">
308                                 <label for="sort1_record_[% biblio.import_record_id %]">Statistic 1: </label>
309                                 <input id="sort1_record_[% biblio.import_record_id %]" type="text" id="sort1" size="20" name="sort1" value="[% biblio.sort1 %]" />
310                             </li>
311                             <li class="sort2">
312                                 <label for="sort2_record_[% biblio.import_record_id %]">Statistic 2: </label>
313                                 <input id="sort2_record_[% biblio.import_record_id %]" type="text" id="sort2" size="20" name="sort2" value="[% biblio.sort2 %]" />
314                             </li>
315                           </ol>
316                         </div>
317                         <div style="float:right">
318                         [% IF biblio.item_error %]Item records could not be processed because the number of item fields was uneven.[% END %]
319                         [% FOREACH item IN biblio.iteminfos %]
320                         <fieldset>
321                         <legend>Item Record [% item.item_id %]</legend>
322                         <ol>
323                         <li>
324                         <label for="homebranch_item_[% item.item_id %]">homebranch</label><select id="homebranch_item_[% item.item_id %]" name="homebranch_[% item.biblio_count %]">
325                         [% FOREACH l IN libraries %]
326                           [% IF l.branchcode == item.homebranch %]
327                             <option value="[% l.branchcode %]" selected="selected">[% l.branchname %]</option>
328                           [% ELSE %]
329                             <option value="[% l.branchcode %]">[% l.branchname %]</option>
330                           [% END %]
331                         [% END %]
332                         </select>
333                         </li>
334
335                         <li><label for="holdingbranch_item_[% item.item_id %]">holdingbranch</label><select id="holdingbranch_item_[% item.item_id %]" name="holdingbranch_[% item.biblio_count %]">
336                         [% FOREACH l IN libraries %]
337                           [% IF l.branchcode == item.holdingbranch %]
338                             <option value="[% l.branchcode %]" selected="selected">[% l.branchname %]</option>
339                           [% ELSE %]
340                             <option value="[% l.branchcode %]">[% l.branchname %]</option>
341                           [% END %]
342                         [% END %]
343                         </select>
344                         </li>
345                         <li><label for="itype_item_[% item.item_id %]">itype</label><select id="itype_item_[% item.item_id %]" name="itype_[% item.biblio_count %]">
346                         [% FOREACH itypeloo IN itypeloop %]
347                           [% IF ( itypeloo.itemtype ) == ( item.itype ) %]
348                             <option value="[% itypeloo.itemtype %]" selected="selected">[% itypeloo.description |html %]</option>
349                           [% ELSE %]
350                             <option value="[% itypeloo.itemtype %]">[% itypeloo.description |html %]</option>
351                           [% END %]
352                         [% END %]
353                         </select>
354                         </li>
355
356                         <li><label for="nonpublic_note_item_[% item.item_id %]">nonpublic_note</label><input type="text" id="nonpublic_note_item_[% item.item_id %]" name="nonpublic_note_[% item.biblio_count %]" value="[% item.nonpublic_note %]"></li>
357                         <li><label for="public_note_item_[% item.item_id %]">public_note</label><input type="text" id="public_note_item_[% item.item_id %]" name="public_note_[% item.biblio_count %]" value="[% item.public_note %]"></li>
358                         <li><label for="loc_item_[% item.item_id %]">loc</label><select id="loc_item_[% item.item_id %]" name="loc_[% item.biblio_count %]">
359                         <option value=""> </option>
360                         [% FOREACH locationloo IN locationloop %]
361                             [% IF ( locationloo.code ) == (item.loc) %]<option value="[% locationloo.code %]" selected="selected">[% locationloo.description %]</option>[% ELSE %]<option value="[% locationloo.code %]">[% locationloo.description %]</option>[% END %]
362                         [% END %]
363                        </select>
364                         </li>
365
366                         <li><label for="ccode_item_[% item.item_id %]">ccode</label><select id="ccode_item_[% item.item_id %]" name="ccode_[% item.biblio_count %]">
367                         [% FOREACH ccodeloo IN ccodeloop %]
368                             [% IF ( ccodeloo.code ) == (item.ccode) %]<option value="[% ccodeloo.code %]" selected="selected">[% ccodeloo.description %]</option>[% ELSE %]<option value="[% ccodeloo.code %]">[% ccodeloo.description %]</option>[% END %]
369                         [% END %]
370                         </select>
371                         </li>
372
373                         <li><label for="notforloan_item_[% item.item_id %]">notforloan</label><input type="text" id="notforloan_item_[% item.item_id %]" name="notforloan_[% item.biblio_count %]" value="[% item.notforloan %]"></li>
374                         <li><label for="uri_item_[% item.item_id %]">uri</label><input type="text" id="uri_item_[% item.item_id %]" name="uri_[% item.biblio_count %]" value="[% item.uri %]"></li>
375                         <li><label for="copyno_item_[% item.item_id %]">copyno</label><input type="text" id="copyno_item_[% item.item_id %]" name="copyno_[% item.biblio_count %]" value="[% item.copyno %]"></li>
376                         <li><label for="budget_code_item_[% item.item_id %]">budget_code</label><select id="budget_code_item_[% item.item_id %]" name="budget_code_[% item.biblio_count %]">
377                         <option value="">Select a fund</option>
378                         [% FOREACH budget_loo IN budget_loop %]
379                             [% IF ( budget_loo.b_code ) == ( item.budget_code ) %]<option value="[% budget_loo.b_id %]" selected="selected">[% budget_loo.b_txt %]</option>
380                             [% ELSE %]<option value="[% budget_loo.b_id %]">[% budget_loo.b_txt %]</option>
381                             [% END %]
382                         [% END %]
383                         </select>
384                         </li>
385                         <li><label for="price_item_[% item.item_id %]">price</label><input type="text" id="price_item_[% item.item_id %]" name="itemprice_[% item.biblio_count %]" value="[% item.itemprice %]"></li>
386                         <li><label for="replacementprice_item_[% item.item_id %]">replacement price</label><input type="text" id="replacementprice_item_[% item.item_id %]" name="replacementprice_[% item.biblio_count %]" value="[% item.replacementprice %]"></li>
387                         <li><label for="callnumber_item_[% item.item_id %]">callnumber</label><input type="text" id="callnumber_item_[% item.item_id %]" name="itemcallnumber_[% item.biblio_count %]" value="[% item.itemcallnumber %]"></li>
388                         </ol>
389                         </fieldset>
390                         [% END %]
391                         </div>
392                         </fieldset>
393                             <div id="dataPreview" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="dataPreviewLabel" aria-hidden="true">
394                                 <div class="modal-dialog">
395                                 <div class="modal-content">
396                                 <div class="modal-header">
397                                     <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
398                                     <h3 id="dataPreviewLabel">MARC preview</h3>
399                                 </div>
400                                 <div class="modal-body">
401                                     <div id="loading"> <img src="[% interface %]/[% theme %]/img/spinner-small.gif" alt="" /> Loading </div>
402                                 </div>
403                                 <div class="modal-footer">
404                                     <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
405                                 </div>
406                                 </div>
407                                 </div>
408                             </div>
409                         [% END %]
410                       </div>
411                       <div id="items_info">
412                         <h2>Item information</h2>
413                         <p>Import all the checked items in the basket with the following parameters:</p>
414
415                         [% IF ( items ) %]
416                         <fieldset class="rows" style="float:none;">
417                             <legend>Item</legend>
418                             [% IF ( NoACQframework ) %]
419                                 <div class="dialog message">No ACQ framework, using default. You should create a framework with code ACQ, the items framework would be used</div>
420                             [% END %]
421                             [% FOREACH item IN items %]
422                             <div id="outeritemblock">
423                             <div id="itemblock">
424                                 <ol>
425                                 [% FOREACH iteminformatio IN item.iteminformation %]<li style="[% iteminformatio.hidden %];">
426                                     <div class="subfield_line" id="subfield[% iteminformatio.serialid %][% iteminformatio.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]">
427                                         [% IF (iteminformatio.mandatory) %]
428                                             <label class="required">[% iteminformatio.subfield %] - [% iteminformatio.marc_lib %]</label>
429                                         [% ELSE %]
430                                             <label>[% iteminformatio.subfield %] - [% iteminformatio.marc_lib %]</label>
431                                         [% END %]
432
433                                         [% IF ( iteminformatio.marc_value.type == 'select' ) %]
434                                             <select name="field_value" size="1">
435                                             [% FOREACH value IN iteminformatio.marc_value.values %]
436                                                 [% IF ( value == iteminformatio.marc_value.default ) %]
437                                                     <option value="[% value %]" selected="selected">[% iteminformatio.marc_value.labels.$value %]</option>
438                                                 [% ELSE %]
439                                                     <option value="[% value %]">[% iteminformatio.marc_value.labels.$value %]</option>
440                                                 [% END %]
441                                             [% END %]
442                                             </select>
443                                         [% ELSE %]
444                                         [% iteminformatio.marc_value %]
445                                         [% END %]
446                                         <input type="hidden" name="itemid" value="1" />
447                                         <input type="hidden" name="kohafield" value="[% iteminformatio.kohafield %]" />
448                                         <input type="hidden" name="tag" value="[% iteminformatio.tag %]" />
449                                         <input type="hidden" name="subfield" value="[% iteminformatio.subfield %]" />
450                                         <input type="hidden" name="mandatory" value="[% iteminformatio.mandatory %]" />
451                                         [% IF ( iteminformatio.mandatory ) %] <span class="required">Required</span>[% END %]
452                                     </div></li>
453                                 [% END %]
454                                 </ol>
455                             </div><!-- /iteminformation -->
456                             </div>
457                             [% END %] <!-- /items -->
458                         </fieldset>
459                         [% END %] <!-- items -->
460                       </div>
461                       <div id="accounting_details">
462                         <p>Import all the checked items in the basket with the following accounting details (used only if no information is filled for the item):</p>
463                         <fieldset class="rows" style="float:none;">
464                             <legend>Accounting details</legend>
465                             <ol>
466                                 <li>
467                                     <!-- origquantityrec only here for javascript compatibility (additem.js needs it, useless here, usefull when receiveing an order -->
468                                     <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="1" />
469                                 </li>
470                                 <li>
471                                     [% IF ( close ) %]
472                                         <span class="label">Fund: </span>
473                                         <input type="hidden" size="20" name="budget_id" id="budget_id" value="[% budget_id %]" />[% Budget_name %]
474                                     [% ELSE %]
475                                         <li>
476                                             <label for="all_currency">Currency:</label>
477                                             <select name="all_currency" id="all_currency">
478                                             [% FOREACH currency IN currencies %]
479                                                 [% IF currency.currency == bookseller.listprice %]
480                                                     <option value="[% currency.currency %]" selected="selected">[% currency.currency %]</option>
481                                                 [% ELSIF not currency.archived %]
482                                                     <option value="[% currency.currency %]">[% currency.currency %]</option>
483                                                 [% END %]
484                                             [% END %]
485                                             </select>
486                                         </li>
487                                         <li>
488                                             <label for="all_budget_id">Fund: </label>
489                                             <select id="all_budget_id" size="1" name="all_budget_id">
490                                               <option value="">Select a fund</option>
491                                             [% FOREACH budget_loo IN budget_loop %]
492                                                 [% IF ( budget_loo.b_active ) %]<option value="[% budget_loo.b_id %]" data-sort1-authcat="[% budget_loo.b_sort1_authcat %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat %]">[% budget_loo.b_txt %]</option>
493                                                 [% ELSE %]<option value="[% budget_loo.b_id %]" class="b_inactive" data-sort1-authcat="[% budget_loo.b_sort1_authcat %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat %]">[% budget_loo.b_txt %] (inactive)</option>
494                                                 [% END %]
495                                             [% END %]
496                                             </select>
497                                             <label for="all_showallbudgets" style="float:none;width:auto;">&nbsp;Show inactive:</label>
498                                             <input type="checkbox" id="all_showallbudgets" />
499                                         </li>
500                                     [% END %]
501                                 </li>
502                                 <li>
503                                     <label for="all_order_internalnote">Internal note: </label>
504                                     <textarea id="all_order_internalnote" cols="30" rows="3" name="all_order_internalnote"></textarea>
505                                 </li>
506                                 <li>
507                                     <label for="all_order_vendornote">Vendor note: </label>
508                                     <textarea id="all_order_vendornote" cols="30" rows="3" name="all_order_vendornote"></textarea>
509                                 </li>
510                                 <li>
511                                     <div class="hint">The 2 following fields are available for your own usage. They can be useful for statistical purposes</div>
512                                     <label for="all_sort1">Statistic 1: </label>
513                                     <input type="text" id="all_sort1" size="20" name="all_sort1" value="" />
514                                 </li>
515                                 <li>
516                                     <label for="all_sort2">Statistic 2: </label>
517                                     <input type="text" id="all_sort2" size="20" name="all_sort2" value="" />
518                                 </li>
519                             </ol>
520                         </fieldset>
521                       </div>
522                       </div>
523
524                       <fieldset class="action">
525                           <input type="submit" value="Save" /><a class="cancel" href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]">Cancel</a>
526                       </fieldset>
527                     </form>
528                 [% ELSE %]
529                 <div>
530                   <h1>Choose the file to add to the basket</h1>
531                   <table id="files">
532                     <thead>
533                       <tr>
534                         <th>File name</th>
535                         <th>Comments</th>
536                         <th>Status</th>
537                         <th class="title-string">Staged</th>
538                         <th># Bibs</th>
539                         <th class="NoSort">&nbsp;</th>
540                       </tr>
541                     </thead>
542                     <tbody>
543                       [% FOREACH batch_lis IN batch_list %]
544                       <tr>
545                         <td>[% batch_lis.file_name %]</td>
546                         <td>[% batch_lis.comments %]</td>
547                         <td>
548                           [% IF ( batch_lis.import_status == 'cleaned' ) %]
549                             Cleaned
550                           [% ELSIF ( batch_lis.import_status == 'imported' ) %]
551                             Imported
552                           [% ELSIF ( batch_lis.import_status == 'importing' ) %]
553                             Importing
554                           [% ELSIF ( batch_lis.import_status == 'reverted' ) %]
555                             Reverted
556                           [% ELSIF ( batch_lis.import_status == 'reverting' ) %]
557                             Reverting
558                           [% ELSIF ( batch_lis.import_status == 'staged' ) %]
559                             Staged
560                           [% ELSE %]
561                             [% batch_lis.import_status %]
562                           [% END %]
563                         </td>
564                         <td><span title="[% batch_lis.staged_date %]">[% batch_lis.staged_date | $KohaDates with_hours => 1 %]</span></td>
565                         <td>[% batch_lis.num_records %]</td>
566                         <td><a href="[% batch_lis.scriptname %]?import_batch_id=[% batch_lis.import_batch_id %]&amp;basketno=[% basketno %]&amp;booksellerid=[% booksellerid %]">Add orders</a></td>
567                       </tr>
568                       [% END %]
569                     </tbody>
570                   </table>
571                 </div>
572                 [% END %]
573            </div>
574        </div>
575    </div>
576 </div>
577 </body>
578 </html>