Bugzilla – Attachment 84445 Details for
Bug 21989
JS error in "Add orders from MARC file" - addorderiso2709.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21989: JS error in "Add orders from MARC file" - addorderiso2709.pl
Bug-21989-JS-error-in-Add-orders-from-MARC-file---.patch (text/plain), 9.83 KB, created by
Katrin Fischer
on 2019-01-26 12:44:17 UTC
(
hide
)
Description:
Bug 21989: JS error in "Add orders from MARC file" - addorderiso2709.pl
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2019-01-26 12:44:17 UTC
Size:
9.83 KB
patch
obsolete
>From 7127a7908e6ce1743ad64a23c265a0119fce9ffe Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Mon, 14 Jan 2019 14:17:23 +0000 >Subject: [PATCH] Bug 21989: JS error in "Add orders from MARC file" - > addorderiso2709.pl > >This patch undoes the changes to addorderiso2709.tt introduced by Bug >19753. The item information tab can include embedded JavaScript for >cataloging plugins, and these don't currently work with JS in the >footer. > >To test, apply the patch and test the JavaScript driven features of the >"Add to basket from a staged file" page: > > - Acquisitions -> Vendor -> Basket -> Add to basket from a staged file > - MARC and Card previews, select all/clear all > - Item information tab: Cataloging plugins for fields like date > acquired, barcode > - Default accounting details tab: Show inactive control > >Signed-off-by: Maryse Simard <maryse.simard@inlibro.com> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > .../prog/en/modules/acqui/addorderiso2709.tt | 182 ++++++++++----------- > 1 file changed, 89 insertions(+), 93 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt >index 26c3ecfe57..69264aeac0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt >@@ -2,7 +2,6 @@ > [% USE Asset %] > [% USE KohaDates %] > [% USE Branches %] >-[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Acquisitions › Order staged MARC records > [% IF ( batch_details ) %] >@@ -12,8 +11,96 @@ > [% END %] > </title> > [% Asset.css("css/datatables.css") | $raw %] >-<style type="text/css">#dataPreview { width : 80%; } @media (max-width: 767px) { #dataPreview { margin: 0; width : auto; } }</style> >+<style>@media (max-width: 767px) { #dataPreview { margin: 0; width : auto; } }</style> > [% INCLUDE 'doc-head-close.inc' %] >+ [% Asset.js("js/acquisitions-menu.js") | $raw %] >+ [% 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> >+ $(document).ready(function() { >+ $("#files").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "aoColumnDefs": [ >+ { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }, >+ { "sType": "anti-the", "aTargets" : [ "anti-the" ] }, >+ { "sType": "title-string", "aTargets" : [ "title-string" ] } >+ ], >+ "sPaginationType": "four_button", >+ "aaSorting": [] >+ } ) ); >+ >+ $("#records_to_import fieldset.rows div").hide(); >+ $('input:checkbox[name="import_record_id"]').change(function(){ >+ var container = $(this).parents("fieldset"); >+ if ( $(this).is(':checked') ) { >+ $(container).addClass("selected"); >+ $(container).removeClass("unselected"); >+ $(container).find("div").toggle(true); >+ } else { >+ $(container).addClass("unselected"); >+ $(container).removeClass("selected"); >+ $(container).find("div").toggle(false); >+ } >+ } ); >+ >+ $("input:checkbox").prop("checked", false); >+ $("div.biblio.unselected select").prop('disabled', false); >+ $("div.biblio.unselected input").prop('disabled', false); >+ >+ $("#checkAll").click(function(){ >+ $("#Aform").checkCheckboxes(); >+ $("input:checkbox[name='import_record_id']").change(); >+ return false; >+ }); >+ $("#unCheckAll").click(function(){ >+ $("#Aform").unCheckCheckboxes(); >+ $("input:checkbox[name='import_record_id']").change(); >+ return false; >+ }); >+ >+ $("#Aform").on("submit", function(){ >+ if ( $("input:checkbox[name='import_record_id']:checked").length < 1 ) { >+ alert(_("There is no record selected")); >+ return false; >+ } >+ >+ var error = 0; >+ $("input:checkbox[name='import_record_id']:checked").parents('fieldset').find('input[name="quantity"]').each(function(){ >+ if ( $(this).val().length < 1 || isNaN( $(this).val() ) ) { >+ error++; >+ } >+ }); >+ if ( error > 0 ) { >+ alert(error + " " + _("quantity values are not filled in or are not numbers")); >+ return false; >+ >+ } >+ >+ return disableUnchecked($(this)); >+ }); >+ $('#tabs').tabs(); >+ $(".previewData").on("click", function(e){ >+ e.preventDefault(); >+ var ltitle = $(this).text(); >+ var page = $(this).attr("href"); >+ $("#dataPreviewLabel").text(ltitle); >+ $("#dataPreview .modal-body").load(page + " div"); >+ $('#dataPreview').modal({show:true}); >+ }); >+ $("#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>"); >+ }); >+ }); >+ >+ function disableUnchecked(form){ >+ $("fieldset.biblio.unselected").each(function(){ >+ $(this).remove(); >+ }); >+ return 1; >+ } >+ </script> > </head> > > <body id="acq_addorderiso2709" class="acq"> >@@ -425,95 +512,4 @@ > </div> [% # /div.col-sm-6 %] > </div> [% # /div.row %] > >-[% MACRO jsinclude BLOCK %] >- [% Asset.js("js/acquisitions-menu.js") | $raw %] >-[% 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, { >- "aoColumnDefs": [ >- { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }, >- { "sType": "anti-the", "aTargets" : [ "anti-the" ] }, >- { "sType": "title-string", "aTargets" : [ "title-string" ] } >- ], >- "sPaginationType": "four_button", >- "aaSorting": [] >- } ) ); >- >- $("#records_to_import fieldset.rows div").hide(); >- $('input:checkbox[name="import_record_id"]').change(function(){ >- var container = $(this).parents("fieldset"); >- if ( $(this).is(':checked') ) { >- $(container).addClass("selected"); >- $(container).removeClass("unselected"); >- $(container).find("div").toggle(true); >- } else { >- $(container).addClass("unselected"); >- $(container).removeClass("selected"); >- $(container).find("div").toggle(false); >- } >- } ); >- >- $("input:checkbox").prop("checked", false); >- $("div.biblio.unselected select").prop('disabled', false); >- $("div.biblio.unselected input").prop('disabled', false); >- >- $("#checkAll").click(function(){ >- $("#Aform").checkCheckboxes(); >- $("input:checkbox[name='import_record_id']").change(); >- return false; >- }); >- $("#unCheckAll").click(function(){ >- $("#Aform").unCheckCheckboxes(); >- $("input:checkbox[name='import_record_id']").change(); >- return false; >- }); >- >- $("#Aform").on("submit", function(){ >- if ( $("input:checkbox[name='import_record_id']:checked").length < 1 ) { >- alert(_("There is no record selected")); >- return false; >- } >- >- var error = 0; >- $("input:checkbox[name='import_record_id']:checked").parents('fieldset').find('input[name="quantity"]').each(function(){ >- if ( $(this).val().length < 1 || isNaN( $(this).val() ) ) { >- error++; >- } >- }); >- if ( error > 0 ) { >- alert(error + " " + _("quantity values are not filled in or are not numbers")); >- return false; >- >- } >- >- return disableUnchecked($(this)); >- }); >- $('#tabs').tabs(); >- $(".previewData").on("click", function(e){ >- e.preventDefault(); >- var ltitle = $(this).text(); >- var page = $(this).attr("href"); >- $("#dataPreviewLabel").text(ltitle); >- $("#dataPreview .modal-body").load(page + " div"); >- $('#dataPreview').modal({show:true}); >- }); >- $("#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>"); >- }); >- }); >- >- function disableUnchecked(form){ >- $("fieldset.biblio.unselected").each(function(){ >- $(this).remove(); >- }); >- return 1; >- } >- </script> >-[% END %] >- > [% INCLUDE 'intranet-bottom.inc' %] >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 21989
:
83889
|
84440
| 84445 |
84815