Bug 21526: Use the 'url' filter when needed
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / addorderiso2709.tt
index 7911662..54a7011 100644 (file)
@@ -19,8 +19,7 @@
 <body id="acq_addorderiso2709" class="acq">
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'acquisitions-search.inc' %]
-<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 iso2709 file</div>
-
+<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>
     <div class="container-fluid">
         <div class="row">
             <div class="col-sm-6 col-sm-offset-3 col-md-8 col-md-offset-2">
@@ -89,7 +88,7 @@
                               <span class="citation">[% biblio.citation | html %]</span>
                             </label>
                             <span class="links" style="font-weight: normal;">
-                              ( <a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% biblio.import_record_id | html %]" 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> )
+                              ( <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> )
                             </span>
                           </legend>
                           <div style="float:left">
                                     [% biblio_lis.overlay_status | html %]
                                 [% END %]
                                 [% IF ( biblio.match_biblionumber ) %]
-                                  Matches biblio [% biblio.match_biblionumber | html %] (score = [% biblio.match_score | html %]): <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.match_biblionumber | html %]">[% biblio.match_citation | html %]</a>
+                                  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>
                                 [% END %]
                               </span>
                             </li>
                         <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 %]">
                         <option value="">Select a fund</option>
                         [% FOREACH budget_loo IN budget_loop %]
-                            [% IF ( budget_loo.b_code ) == ( item.budget_code ) %]<option value="[% budget_loo.b_id | html %]" selected="selected">[% budget_loo.b_txt | html %]</option>
+                            [% IF ( budget_loo.b_id ) == ( item.budget_id ) %]<option value="[% budget_loo.b_id | html %]" selected="selected">[% budget_loo.b_txt | html %]</option>
                             [% ELSE %]<option value="[% budget_loo.b_id | html %]">[% budget_loo.b_txt | html %]</option>
                             [% END %]
                         [% END %]
                                             [% END %]
                                             </select>
                                         [% ELSE %]
-                                        [% iteminformatio.marc_value | html %]
+                                        [% iteminformatio.marc_value | $raw %]
                                         [% END %]
                                         <input type="hidden" name="itemid" value="1" />
                                         <input type="hidden" name="kohafield" value="[% iteminformatio.kohafield | html %]" />
                             <legend>Accounting details</legend>
                             <ol>
                                 <li>
-                                    <!-- origquantityrec only here for javascript compatibility (additem.js needs it, useless here, usefull when receiveing an order -->
+                                    <!-- origquantityrec only here for javascript compatibility (additem.js needs it, useless here, useful when receiveing an order -->
                                     <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="1" />
                                 </li>
                                 <li>
                         <th>Comments</th>
                         <th>Status</th>
                         <th class="title-string">Staged</th>
-                        <th># Bibs</th>
+                        <th># Bibliographic records</th>
                         <th class="NoSort">&nbsp;</th>
                       </tr>
                     </thead>
                         </td>
                         <td><span title="[% batch_lis.staged_date | html %]">[% batch_lis.staged_date | $KohaDates with_hours => 1 | html %]</span></td>
                         <td>[% batch_lis.num_records | html %]</td>
-                        <td><a href="[% batch_lis.scriptname | html %]?import_batch_id=[% batch_lis.import_batch_id | html %]&amp;basketno=[% basketno | html %]&amp;booksellerid=[% booksellerid | html %]">Add orders</a></td>
+                        <td><a href="[% batch_lis.scriptname | url %]?import_batch_id=[% batch_lis.import_batch_id | uri %]&amp;basketno=[% basketno | uri %]&amp;booksellerid=[% booksellerid | uri %]">Add orders</a></td>
                       </tr>
                       [% END %]
                     </tbody>
 [% INCLUDE 'datatables.inc' %]
     [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
     [% Asset.js("js/acq.js") | $raw %]
+    [% Asset.js("js/funds_sorts.js") | $raw %]
     <script type="text/JavaScript">
         $(document).ready(function() {
             $("#files").dataTable($.extend(true, {}, dataTablesDefaults, {
                 "aaSorting": []
             } ) );
 
-            // keep copy of the inactive budgets
-            disabledBudgetsCopy = $("select[name='all_budget_id']").html();
-            $("select[name='all_budget_id'] .b_inactive").remove();
-            $("select[name='budget_id'] .b_inactive").remove();
-
-            $("#showallbudgets").click(function() {
-                if ($(this).is(":checked")) {
-                    $("select[name='budget_id']").html(disabledBudgetsCopy)
-                }
-                else {
-                    $("select[name='budget_id'] .b_inactive").remove();
-                }
-            });
-
-            $("#all_showallbudgets").click(function() {
-                if ($(this).is(":checked")) {
-                    $("select[name='all_budget_id']").html(disabledBudgetsCopy);
-                }
-                else {
-                    $("select[name='all_budget_id'] .b_inactive").remove();
-                }
-            });
-
-            $("select[name='budget_id']").change(function(){
-                var sort1_authcat = $(this).find("option:selected").attr('data-sort1-authcat');
-                var sort2_authcat = $(this).find("option:selected").attr('data-sort2-authcat');
-                var destination_sort1 = $(this).parents('fieldset').find('li.sort1').find('input[name="sort1"]');
-                var sort1 = $(destination_sort1).val() || "";
-                if ( destination_sort1.length < 1 ) {
-                    destination_sort1 = $(this).parents('fieldset').find('li.sort1 > select[name="sort1"]');
-                }
-                var destination_sort2 = $(this).parents('fieldset').find('li.sort2').find('input[name="sort2"]');
-                var sort2 = $(destination_sort2).val() || "";
-                if ( destination_sort2.length < 1 ) {
-                    destination_sort2 = $(this).parents('fieldset').find('li.sort2').find('select[name="sort2"]');
-                }
-                getAuthValueDropbox( 'sort1', sort1_authcat, destination_sort1, sort1 );
-
-                getAuthValueDropbox( 'sort2', sort2_authcat, destination_sort2, sort2 );
-            } );
-
-            $("select[name='budget_id']").change();
-
-            $("select[name='all_budget_id']").change(function(){
-                var sort1_authcat = $(this).find("option:selected").attr('data-sort1-authcat');
-                var sort2_authcat = $(this).find("option:selected").attr('data-sort2-authcat');
-                var destination_sort1 = $(this).parent().siblings('li').find('input[name="all_sort1"]');
-                if ( destination_sort1.length < 1 ) {
-                    destination_sort1 = $(this).parent().siblings('li').find('select[name="all_sort1"]');
-                }
-                var destination_sort2 = $(this).parent().siblings('li').find('input[name="all_sort2"]');
-                if ( destination_sort2.length < 1 ) {
-                    destination_sort2 = $(this).parent().siblings('li').find('select[name="all_sort2"]');
-                }
-                getAuthValueDropbox( 'sort1', sort1_authcat, destination_sort1 );
-                getAuthValueDropbox( 'sort2', sort2_authcat, destination_sort2 );
-                $(this).parent().siblings('li').find('select[name="sort1"]').attr('name', 'all_sort1');
-                $(this).parent().siblings('li').find('input[name="sort1"]').attr('name', 'all_sort1');
-                $(this).parent().siblings('li').find('select[name="sort2"]').attr('name', 'all_sort2');
-                $(this).parent().siblings('li').find('input[name="sort2"]').attr('name', 'all_sort2');
-            } );
-
-            $("select[name='all_budget_id']").change();
-
             $("#records_to_import fieldset.rows div").hide();
             $('input:checkbox[name="import_record_id"]').change(function(){
                 var container = $(this).parents("fieldset");
                 $("#dataPreview .modal-body").load(page + " div");
                 $('#dataPreview').modal({show:true});
             });
-            $("#dataPreview").on("hidden", function(){
+            $("#dataPreview").on("hidden.bs.modal", function(){
                 $("#dataPreviewLabel").html("");
                 $("#dataPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
             });