From 1b4d4f989b1d6c589a08f21ce19a48dca9072ec7 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Fri, 5 May 2017 03:58:49 +0000 Subject: [PATCH] Bug 18545: Remove use of onclick from OPAC cart MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit To test: 1) Apply patch and add one or more items to your cart 2) Confirm that clicking the following things still works as expected: - more details - brief display - send - download - print - select all - clear all - selecting by clicking checkbox - remove title - add title to list - place hold - add tag - empty and close Sponsored-by: Catalyst IT Followed test plan, works as expected. Resolves issue with two print dialogues from Bug 18544. Signed-off-by: Marc Véron Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart --- .../bootstrap/en/modules/opac-basket.tt | 96 +++++++++++++++---- 1 file changed, 80 insertions(+), 16 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt index fa7e496b02..d1b137bd80 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt @@ -18,16 +18,16 @@ [% UNLESS ( print_basket ) %]
[% IF ( verbose ) %] - Brief display + Brief display [% ELSE %] - More details + More details [% END %] [% IF Koha.Preference( 'opacuserlogin' ) == 1 %] - Send + Send [% END %] - Download - Print - Empty and close + Download + Print + Empty and close Hide window
@@ -37,16 +37,16 @@ | Select titles to: - Remove + Remove [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) %] [% IF ( ( Koha.Preference( 'virtualshelves' ) == 1 ) && loggedinusername ) %] - Add to a list + Add to a list [% END %] [% IF ( Koha.Preference( 'RequestOnOpac' ) == 1 ) %] - Place hold + Place hold [% END %] [% IF ( TagsInputEnabled && loggedinusername ) %] - Tag + Tag [% END %] [% END # / IF opacuserlogin %] @@ -54,8 +54,8 @@ [% END %] @@ -70,7 +70,7 @@ [% IF ( BIBLIO_RESULT.subtitle ) %] [% FOREACH subtitl IN BIBLIO_RESULT.subtitle %] [% subtitl.subfield |html %] [% END %][% END %] [% IF ( BIBLIO_RESULT.author ) %] [% BIBLIO_RESULT.author |html %][% END %] [% ELSE %] - + [% BIBLIO_RESULT.title |html %] [% IF ( BIBLIO_RESULT.subtitle ) %] [% FOREACH subtitl IN BIBLIO_RESULT.subtitle %] [% subtitl.subfield |html %] [% END %][% END %] [% IF ( BIBLIO_RESULT.author ) %] [% BIBLIO_RESULT.author |html %][% END %] @@ -259,7 +259,7 @@ [% UNLESS ( print_basket ) %] - + [% END %] @@ -370,6 +370,67 @@ [% END # / TagsInputEnabled && loggedinusername %] $(document).ready(function(){ + $(".brief").click(function(){ + showLess(); + return false; + }); + + $(".detail").click(function(){ + showMore(); + return false; + }); + + $(".send").click(function(){ + sendBasket(); + return false; + }); + + $(".download").click(function(){ + downloadBasket(); + return false; + }); + + $(".print-large").click(function(){ + e.preventDefault(); + printBasket(); + return false; + }); + + $(".empty").click(function(){ + delBasket(); + return false; + }); + + $(".deleteshelf").click(function(){ + delSelRecords(); + return false; + }); + + $(".newshelf").click(function(){ + addSelToShelf(); + return false; + }); + + $(".hold").click(function(){ + holdSel(); + return false; + }); + + $("#tagsel_tag").click(function(){ + tagSelected(); + return false; + }); + + $("#tagsel_button").click(function(){ + tagAdded(); + return false; + }); + + $("#tagsel_cancel").click(function(){ + tagCanceled(); + return false; + }); + $("#CheckAll").click(function(){ var checked = []; $(".checkboxed").checkCheckboxes("*", true).each( @@ -406,10 +467,13 @@ ] })); - $(".cb").click(function(){ + $(".cb").change(function(){ + if ($(this).prop("checked")){ + selRecord($(this).val(), true); + } enableCheckboxActions(); + return false; }); - enableCheckboxActions(); }); function enableCheckboxActions(){ -- 2.39.5