Bug 15503 [QA Followup] - Use Koha::AuthorisedValues and fetch notforloan values.
[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>
374                         <label for="notforloan_item_[% item.item_id %]">notforloan</label><select id="notforloan_item_[% item.item_id %]" name="notforloan_[% item.biblio_count %]">
375                         [% FOREACH n IN notforloanloop %]
376                           [% IF n.code == item.notforloan %]
377                             <option value="[% n.code %]" selected="selected">[% n.description %]</option>
378                           [% ELSE %]
379                             <option value="[% n.code %]">[% n.description %]</option>
380                           [% END %]
381                         [% END %]
382                         </select>
383                         </li>
384                         <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>
385                         <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>
386                         <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 %]">
387                         <option value="">Select a fund</option>
388                         [% FOREACH budget_loo IN budget_loop %]
389                             [% IF ( budget_loo.b_code ) == ( item.budget_code ) %]<option value="[% budget_loo.b_id %]" selected="selected">[% budget_loo.b_txt %]</option>
390                             [% ELSE %]<option value="[% budget_loo.b_id %]">[% budget_loo.b_txt %]</option>
391                             [% END %]
392                         [% END %]
393                         </select>
394                         </li>
395                         <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>
396                         <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>
397                         <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>
398                         </ol>
399                         </fieldset>
400                         [% END %]
401                         </div>
402                         </fieldset>
403                             <div id="dataPreview" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="dataPreviewLabel" aria-hidden="true">
404                                 <div class="modal-dialog">
405                                 <div class="modal-content">
406                                 <div class="modal-header">
407                                     <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
408                                     <h3 id="dataPreviewLabel">MARC preview</h3>
409                                 </div>
410                                 <div class="modal-body">
411                                     <div id="loading"> <img src="[% interface %]/[% theme %]/img/spinner-small.gif" alt="" /> Loading </div>
412                                 </div>
413                                 <div class="modal-footer">
414                                     <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
415                                 </div>
416                                 </div>
417                                 </div>
418                             </div>
419                         [% END %]
420                       </div>
421                       <div id="items_info">
422                         <h2>Item information</h2>
423                         <p>Import all the checked items in the basket with the following parameters:</p>
424
425                         [% IF ( items ) %]
426                         <fieldset class="rows" style="float:none;">
427                             <legend>Item</legend>
428                             [% IF ( NoACQframework ) %]
429                                 <div class="dialog message">No ACQ framework, using default. You should create a framework with code ACQ, the items framework would be used</div>
430                             [% END %]
431                             [% FOREACH item IN items %]
432                             <div id="outeritemblock">
433                             <div id="itemblock">
434                                 <ol>
435                                 [% FOREACH iteminformatio IN item.iteminformation %]<li style="[% iteminformatio.hidden %];">
436                                     <div class="subfield_line" id="subfield[% iteminformatio.serialid %][% iteminformatio.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]">
437                                         [% IF (iteminformatio.mandatory) %]
438                                             <label class="required">[% iteminformatio.subfield %] - [% iteminformatio.marc_lib %]</label>
439                                         [% ELSE %]
440                                             <label>[% iteminformatio.subfield %] - [% iteminformatio.marc_lib %]</label>
441                                         [% END %]
442
443                                         [% IF ( iteminformatio.marc_value.type == 'select' ) %]
444                                             <select name="field_value" size="1">
445                                             [% FOREACH value IN iteminformatio.marc_value.values %]
446                                                 [% IF ( value == iteminformatio.marc_value.default ) %]
447                                                     <option value="[% value %]" selected="selected">[% iteminformatio.marc_value.labels.$value %]</option>
448                                                 [% ELSE %]
449                                                     <option value="[% value %]">[% iteminformatio.marc_value.labels.$value %]</option>
450                                                 [% END %]
451                                             [% END %]
452                                             </select>
453                                         [% ELSE %]
454                                         [% iteminformatio.marc_value %]
455                                         [% END %]
456                                         <input type="hidden" name="itemid" value="1" />
457                                         <input type="hidden" name="kohafield" value="[% iteminformatio.kohafield %]" />
458                                         <input type="hidden" name="tag" value="[% iteminformatio.tag %]" />
459                                         <input type="hidden" name="subfield" value="[% iteminformatio.subfield %]" />
460                                         <input type="hidden" name="mandatory" value="[% iteminformatio.mandatory %]" />
461                                         [% IF ( iteminformatio.mandatory ) %] <span class="required">Required</span>[% END %]
462                                     </div></li>
463                                 [% END %]
464                                 </ol>
465                             </div><!-- /iteminformation -->
466                             </div>
467                             [% END %] <!-- /items -->
468                         </fieldset>
469                         [% END %] <!-- items -->
470                       </div>
471                       <div id="accounting_details">
472                         <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>
473                         <fieldset class="rows" style="float:none;">
474                             <legend>Accounting details</legend>
475                             <ol>
476                                 <li>
477                                     <!-- origquantityrec only here for javascript compatibility (additem.js needs it, useless here, usefull when receiveing an order -->
478                                     <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="1" />
479                                 </li>
480                                 <li>
481                                     [% IF ( close ) %]
482                                         <span class="label">Fund: </span>
483                                         <input type="hidden" size="20" name="budget_id" id="budget_id" value="[% budget_id %]" />[% Budget_name %]
484                                     [% ELSE %]
485                                         <li>
486                                             <label for="all_currency">Currency:</label>
487                                             <select name="all_currency" id="all_currency">
488                                             [% FOREACH currency IN currencies %]
489                                                 [% IF currency.currency == bookseller.listprice %]
490                                                     <option value="[% currency.currency %]" selected="selected">[% currency.currency %]</option>
491                                                 [% ELSIF not currency.archived %]
492                                                     <option value="[% currency.currency %]">[% currency.currency %]</option>
493                                                 [% END %]
494                                             [% END %]
495                                             </select>
496                                         </li>
497                                         <li>
498                                             <label for="all_budget_id">Fund: </label>
499                                             <select id="all_budget_id" size="1" name="all_budget_id">
500                                               <option value="">Select a fund</option>
501                                             [% FOREACH budget_loo IN budget_loop %]
502                                                 [% 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>
503                                                 [% 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>
504                                                 [% END %]
505                                             [% END %]
506                                             </select>
507                                             <label for="all_showallbudgets" style="float:none;width:auto;">&nbsp;Show inactive:</label>
508                                             <input type="checkbox" id="all_showallbudgets" />
509                                         </li>
510                                     [% END %]
511                                 </li>
512                                 <li>
513                                     <label for="all_order_internalnote">Internal note: </label>
514                                     <textarea id="all_order_internalnote" cols="30" rows="3" name="all_order_internalnote"></textarea>
515                                 </li>
516                                 <li>
517                                     <label for="all_order_vendornote">Vendor note: </label>
518                                     <textarea id="all_order_vendornote" cols="30" rows="3" name="all_order_vendornote"></textarea>
519                                 </li>
520                                 <li>
521                                     <div class="hint">The 2 following fields are available for your own usage. They can be useful for statistical purposes</div>
522                                     <label for="all_sort1">Statistic 1: </label>
523                                     <input type="text" id="all_sort1" size="20" name="all_sort1" value="" />
524                                 </li>
525                                 <li>
526                                     <label for="all_sort2">Statistic 2: </label>
527                                     <input type="text" id="all_sort2" size="20" name="all_sort2" value="" />
528                                 </li>
529                             </ol>
530                         </fieldset>
531                       </div>
532                       </div>
533
534                       <fieldset class="action">
535                           <input type="submit" value="Save" /><a class="cancel" href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]">Cancel</a>
536                       </fieldset>
537                     </form>
538                 [% ELSE %]
539                 <div>
540                   <h1>Choose the file to add to the basket</h1>
541                   <table id="files">
542                     <thead>
543                       <tr>
544                         <th>File name</th>
545                         <th>Comments</th>
546                         <th>Status</th>
547                         <th class="title-string">Staged</th>
548                         <th># Bibs</th>
549                         <th class="NoSort">&nbsp;</th>
550                       </tr>
551                     </thead>
552                     <tbody>
553                       [% FOREACH batch_lis IN batch_list %]
554                       <tr>
555                         <td>[% batch_lis.file_name %]</td>
556                         <td>[% batch_lis.comments %]</td>
557                         <td>
558                           [% IF ( batch_lis.import_status == 'cleaned' ) %]
559                             Cleaned
560                           [% ELSIF ( batch_lis.import_status == 'imported' ) %]
561                             Imported
562                           [% ELSIF ( batch_lis.import_status == 'importing' ) %]
563                             Importing
564                           [% ELSIF ( batch_lis.import_status == 'reverted' ) %]
565                             Reverted
566                           [% ELSIF ( batch_lis.import_status == 'reverting' ) %]
567                             Reverting
568                           [% ELSIF ( batch_lis.import_status == 'staged' ) %]
569                             Staged
570                           [% ELSE %]
571                             [% batch_lis.import_status %]
572                           [% END %]
573                         </td>
574                         <td><span title="[% batch_lis.staged_date %]">[% batch_lis.staged_date | $KohaDates with_hours => 1 %]</span></td>
575                         <td>[% batch_lis.num_records %]</td>
576                         <td><a href="[% batch_lis.scriptname %]?import_batch_id=[% batch_lis.import_batch_id %]&amp;basketno=[% basketno %]&amp;booksellerid=[% booksellerid %]">Add orders</a></td>
577                       </tr>
578                       [% END %]
579                     </tbody>
580                   </table>
581                 </div>
582                 [% END %]
583            </div>
584        </div>
585    </div>
586 </div>
587 </body>
588 </html>