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