From e1af07839b700832f653c8570dd7d3d192eeff3e Mon Sep 17 00:00:00 2001 From: Hector Castro Date: Fri, 24 Jun 2016 15:55:40 -0600 Subject: [PATCH] Bug 16812: Remove multiple onclick events for all z3950_search.tt z3950_auth_search.tt has various onclick events used in links. Also fix: acqui/z3950_search.tt and cataloguing/z3950_search.tt This patch propose to triger event via JQuery .on() Also add Font Awesome Icons to "Select/Clear all" and "Clear search form" links To test: 1-Apply patch 2-Go to Authorities > click New from Z39.50 3-Fill some fields and click in "Clear search form" link 4-Search under "Dalton" or another author that launch too many headings 5-Clic in some heading and notice the dialog open, test to "Import" and close the dialog "X". Use the "Import" from table too. Go to Cataloging > New from Z39.50/SRU Repeat steps 1 to 5. But this time with bib records. Go to Adquisition > Open or Create a basket and choose to "Add to basket" button. A modal appear, chose the option "Order from external source" Repeat steps 1 to 5. But this thime with bib records. NOTE: The icon trash for "Clear search form" has been selected according with module "Advanced search" there is an icon trash with link "Clear fields" that has the same fuctionality. Sponsored-by: Universidad de El Salvador --- .../prog/en/modules/acqui/z3950_search.tt | 29 +++++++++--- .../en/modules/cataloguing/z3950_auth_search.tt | 51 +++++++++++++++------ .../prog/en/modules/cataloguing/z3950_search.tt | 52 ++++++++++++++++------ 3 files changed, 99 insertions(+), 33 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt index ebb18df..17b18fd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt @@ -28,6 +28,7 @@ }); $("#closemenu").click(function(e){ + e.preventDefault(); $(".linktools").hide(); $("tr").removeClass("selected"); }); @@ -64,6 +65,22 @@ $("#dataPreviewLabel").html(""); $("#dataPreview .modal-body").html("
\"\" "+_("Loading")+"
"); }); + $( ".submit" ).on( "click", function() { + $( "body" ).css( "cursor", "wait" ); + }); + $( "[name='changepage_prev']" ).on( "click", function() { + var data_current_page_prev = $( this ).data( "currentpage" ); + $( '#current_page' ).val( data_current_page_prev - 1 ); + $( '#page_form' ).submit(); + }); + $( "[name='changepage_next']" ).on( "click", function() { + var data_current_page_next = $( this ).data( "currentpage" ); + $( '#current_page' ).val( data_current_page_next + 1 ); + $( '#page_form' ).submit(); + }); + $( "[name='changepage_goto']" ).on( "click", function() { + return validate_goto_page(); + }); }); [% IF ( total_pages ) %] @@ -128,15 +145,15 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : [% END %] +
  • Clear search form
  • -

    Clear search form

    -

    Search targets Select allClear all

    +

    Search targets Select all | Clear all

    [% FOREACH serverloo IN serverloop %]

    @@ -153,7 +170,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :

    -
    Cancel
    +
    Cancel
    @@ -233,13 +250,13 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : [% END %] [% IF ( show_prevbutton ) %] - + [% END %] Page [% current_page %] / [% total_pages %] [% IF ( show_nextbutton ) %] - + [% END %] -
    Go to page : +
    Go to page : [% ELSE %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt index bb21b5b..ff5bfda 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt @@ -12,11 +12,6 @@ function Import(Breeding,AuthType,authid) { return false; } -function closemenu(){ - $(".linktools").hide(); - $("tr").removeClass("selected"); -} - $(document).ready(function(){ $("#CheckAll").click(function(){ $(".checkboxed").checkCheckboxes(); @@ -73,6 +68,36 @@ $(document).ready(function(){ $("#marcPreviewLabel").html(""); $("#marcPreview .modal-body").html("
    \"\" "+_("Loading")+"
    "); }); + $( ".submit" ).on( "click", function() { + $( "body" ).css( "cursor", "wait" ); + }); + $( ".import_auth_record" ).on( "click", function(e) { + e.preventDefault(); + var data_breedingid = $( this ).data( "breedingid" ); + var data_headingcode = $( this ).data( "heading_code" ); + var data_authid = $( this ).data( "authid" ); + Import(data_breedingid, data_headingcode, data_authid ); + return false; + }); + $( "#close_menu" ).on( "click", function(e) { + e.preventDefault(); + $(".linktools").hide(); + $("tr").removeClass("selected"); + return false; + }); + $( "[name='changepage_prev']" ).on( "click", function() { + var data_current_page_prev = $( this ).data( "currentpage" ); + $( '#current_page' ).val( data_current_page_prev - 1 ); + $( '#page_form' ).submit(); + }); + $( "[name='changepage_next']" ).on( "click", function() { + var data_current_page_next = $( this ).data( "currentpage" ); + $( '#current_page' ).val( data_current_page_next + 1 ); + $( '#page_form' ).submit(); + }); + $( "[name='changepage_goto']" ).on( "click", function() { + return validate_goto_page(); + }); }); [% IF ( total_pages ) %] @@ -139,12 +164,12 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
  • +
  • Clear search form
  • -

    Clear search form

    -

    Search targets Select allClear all

    +

    Search targets Select all | Clear all

    [% FOREACH serverloo IN serverloop %]

    @@ -158,7 +183,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : [% END %]

    -
    Cancel
    +
    Cancel
    [% ELSE %]

    Results for Authority Records

    @@ -174,11 +199,11 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : [% FOREACH breeding_loo IN breeding_loop %] [% IF ( breeding_loo.breedingid ) %] - [% breeding_loo.server %]
    Preview MARC Import X
    + [% breeding_loo.server %]
    Preview MARC Import X
    [% breeding_loo.heading %] [% breeding_loo.heading_code %] MARC - Import + Import [% END %] [% END %] @@ -215,13 +240,13 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : [% END %] [% IF ( show_prevbutton ) %] - + [% END %] Page [% current_page %] / [% total_pages %] [% IF ( show_nextbutton ) %] - + [% END %] -
    Go to page : +
    Go to page :

    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt index e5f82c5..328ada6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt @@ -12,11 +12,6 @@ function Import(GetThisOne,biblionumber) { return false; } -function closemenu(){ - $(".linktools").hide(); - $("tr").removeClass("selected"); -} - $(document).ready(function(){ $("#CheckAll").click(function(){ $(".checkboxed").checkCheckboxes(); @@ -74,7 +69,36 @@ $(document).ready(function(){ $("#dataPreviewLabel").html(""); $("#dataPreview .modal-body").html("
    \"\" "+_("Loading")+"
    "); }); - + $( ".submit" ).on( "click", function() { + $( "body" ).css( "cursor", "wait" ); + }); + $( ".import_auth_record" ).on( "click", function(e) { + e.preventDefault(); + var data_breedingid = $( this ).data( "breedingid" ); + var data_headingcode = $( this ).data( "heading_code" ); + var data_authid = $( this ).data( "authid" ); + Import(data_breedingid, data_headingcode, data_authid ); + return false; + }); + $( "#close_menu" ).on( "click", function(e) { + e.preventDefault(); + $(".linktools").hide(); + $("tr").removeClass("selected"); + return false; + }); + $( "[name='changepage_prev']" ).on( "click", function() { + var data_current_page_prev = $( this ).data( "currentpage" ); + $( '#current_page' ).val( data_current_page_prev - 1 ); + $( '#page_form' ).submit(); + }); + $( "[name='changepage_next']" ).on( "click", function() { + var data_current_page_next = $( this ).data( "currentpage" ); + $( '#current_page' ).val( data_current_page_next + 1 ); + $( '#page_form' ).submit(); + }); + $( "[name='changepage_goto']" ).on( "click", function() { + return validate_goto_page(); + }); }); [% IF ( total_pages ) %] @@ -135,13 +159,13 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
  • +
  • Clear search form
  • -

    Clear search form

    -

    Search targets Select allClear all

    +

    Search targets Select all | Clear all

    [% FOREACH serverloo IN serverloop %]

    @@ -156,7 +180,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : [% END %]

    -
    Cancel
    +
    Cancel
    @@ -206,7 +230,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : [% IF ( breeding_loo.breedingid ) %] - [% breeding_loo.server %]
    Preview MARC Preview card Import X
    + [% breeding_loo.server %]
    Preview MARC Preview card Import X
    [% breeding_loo.title |html %] [% breeding_loo.author %] [% breeding_loo.date %] @@ -215,7 +239,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : [% breeding_loo.lccn %] MARC Card - Import + Import [% END %] [% END %] @@ -253,13 +277,13 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : [% END %] [% IF ( show_prevbutton ) %] - + [% END %] Page [% current_page %] / [% total_pages %] [% IF ( show_nextbutton ) %] - + [% END %] -
    Go to page : +
    Go to page : [% ELSE %] -- 2.1.4