Bugzilla – Attachment 52872 Details for
Bug 16812
Revise JS script for z3950_search.tts and remove onclick events
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16812: Remove multiple onclick events for all z3950_search.tt
Bug-16812-Remove-multiple-onclick-events-for-all-z.patch (text/plain), 21.01 KB, created by
Héctor Eduardo Castro Avalos
on 2016-06-25 05:41:15 UTC
(
hide
)
Description:
Bug 16812: Remove multiple onclick events for all z3950_search.tt
Filename:
MIME Type:
Creator:
Héctor Eduardo Castro Avalos
Created:
2016-06-25 05:41:15 UTC
Size:
21.01 KB
patch
obsolete
>From 2411c15ee274ded140251692b3538b5dc13c7b9e Mon Sep 17 00:00:00 2001 >From: Hector Castro <hector.hecaxmmx@gmail.com> >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 bug 1660 on top >2-Apply patch >3-Go to Authorities > click New from Z39.50 >4-Fill some fields and click in "Clear search form" link >5-Search under "Dalton" or another author that launch too many headings >6-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 3 to 6. 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 3 to 6. 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("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/loading-small.gif\" alt=\"\" /> "+_("Loading")+"</div>"); > }); >+ $( ".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 %] > </select> > </li> >+ <li><a id="resetZ3950Search" href="#"><i class="fa fa-trash"></i> Clear search form</a></li> > </ol> >- <p><a id="resetZ3950Search" href="#">Clear search form</a></p> > </fieldset> > <input type="hidden" name="biblionumber" value="[% biblionumber %]" /> > <input type="hidden" name="basketno" value="[% basketno %]" /> > <input type="hidden" name="booksellerid" value="[% booksellerid %]" /> > </div> > <div class="yui-u second"> >-<h2>Search targets <span style="display: inline; font-size: 70%; padding-left: 1em;"><span class="checkall"><a id="CheckAll" href="#">Select all</a></span><span class="clearall"><a id="CheckNone" href="#">Clear all</a></span></span></h2> >+<h2>Search targets <span style="display: inline; font-size: 70%; padding-left: 1em;"><span class="checkall"><a id="CheckAll" href="#"><i class="fa fa-check"></i> Select all</a></span> | <span class="clearall"><a id="CheckNone" href="#"><i class="fa fa-remove"></i> Clear all</a></span></span></h2> > <div id="z3950_search_targets_acq"> > [% FOREACH serverloo IN serverloop %] > <p> >@@ -153,7 +170,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : > </div> > </div> > >- <fieldset class="action"><input type="submit" class="submit" value="Search" onclick="cursor :'wait'"/> <a class="cancel" href="/cgi-bin/koha/acqui/basket.pl?booksellerid=[% booksellerid %]&basketno=[% basketno %]">Cancel</a></fieldset> >+ <fieldset class="action"><input type="submit" class="submit" value="Search" /> <a class="cancel" href="/cgi-bin/koha/acqui/basket.pl?booksellerid=[% booksellerid %]&basketno=[% basketno %]">Cancel</a></fieldset> > </form> > > >@@ -233,13 +250,13 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : > [% END %] > > [% IF ( show_prevbutton ) %] >- <input type="button" name="changepage_prev" value="Previous Page" onclick="$('#current_page').val([% current_page %]-1);$('#page_form').submit();" /> >+ <input type="button" name="changepage_prev" value="Previous page" data-currentpage="[% current_page %]" /> > [% END %] > Page [% current_page %] / [% total_pages %] > [% IF ( show_nextbutton ) %] >- <input type="button" name="changepage_next" value="Next Page" onclick="$('#current_page').val([% current_page %]+1);$('#page_form').submit();" /> >+ <input type="button" name="changepage_next" value="Next page" data-currentpage="[% current_page %]" /> > [% END %] >- <br />Go to page : <input id="goto_page" name="goto_page" value="[% current_page %]" size="4" /><input type="submit" name="changepage_goto" onclick="return validate_goto_page();" value="Go" /> >+ <br />Go to page : <input id="goto_page" name="goto_page" value="[% current_page %]" size="4" /><input type="submit" name="changepage_goto" value="Go" /> > </form> > > [% 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("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/loading-small.gif\" alt=\"\" /> "+_("Loading")+"</div>"); > }); >+ $( ".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 : > <li><label for="subjectsubdiv">Subject sub-division: </label> <input type="text" id="subjectsubdiv" name="subjectsubdiv" value="" /></li> > <li><label for="title">Title (any): </label> <input type="text" id="title" name="title" value="[% title | html %]" /></li> > <li><label for="uniformtitle">Title (uniform): </label> <input type="text" id="uniformtitle" name="uniformtitle" value="[% uniformtitle | html %]" /></li> >+ <li><a id="resetZ3950Search" href="#"><i class="fa fa-trash"></i> Clear search form</a></li> > </ol> >- <p><a id="resetZ3950Search" href="#">Clear search form</a></p> > </fieldset> > </div> > <div class="yui-g"> >- <h2>Search targets <span style="display: inline; font-size: 70%; padding-left: 1em;"><span class="checkall"><a id="CheckAll" href="#">Select all</a></span><span class="clearall"><a id="CheckNone" href="#">Clear all</a></span></span></h2> >+ <h2>Search targets <span style="display: inline; font-size: 70%; padding-left: 1em;"><span class="checkall"><a id="CheckAll" href="#"><i class="fa fa-check"></i> Select all</a></span> | <span class="clearall"><a id="CheckNone" href="#"><i class="fa fa-remove"></i> Clear all</a></span></span></h2> > <div id="z3950_search_targets_auth"> > [% FOREACH serverloo IN serverloop %] > <p> >@@ -158,7 +183,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : > [% END %] > </div> > </div> >- <fieldset class="action"><input type="submit" class="submit" value="Search" onclick="cursor :'wait'"/> <a class="cancel close" href="#">Cancel</a></fieldset> >+ <fieldset class="action"><input type="submit" class="submit" value="Search"/> <a class="cancel close" href="#">Cancel</a></fieldset> > </form> > [% ELSE %] > <h2>Results for Authority Records</h2> >@@ -174,11 +199,11 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : > <tbody>[% FOREACH breeding_loo IN breeding_loop %] > [% IF ( breeding_loo.breedingid ) %] > <tr id="row[% breeding_loo.breedingid %]"> >- <td>[% breeding_loo.server %] <div class="linktools"><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid %]" class="previewMARC">Preview MARC</a> <a href="#" onclick="Import([% breeding_loo.breedingid %],'[% breeding_loo.heading_code %]','[% breeding_loo.authid %]'); return false">Import</a><a href="#" onclick="closemenu();return false;" title="Close this menu"> X </a></div> </td> >+ <td>[% breeding_loo.server %] <div class="linktools"><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid %]" class="previewMARC">Preview MARC</a> <a href="#" class="import_auth_record" data-breedingid="[% breeding_loo.breedingid %]" data-heading_code="[% breeding_loo.heading_code %]" data-authid="[% breeding_loo.authid %]">Import</a><a href="#" id="close_menu" title="Close this menu"> X </a></div> </td> > <td>[% breeding_loo.heading %]</td> > <td>[% breeding_loo.heading_code %]</td> > <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid %]" class="previewMARC">MARC</a></td> >- <td><a href="#" onclick="Import([% breeding_loo.breedingid %],'[% breeding_loo.heading_code %]','[% breeding_loo.authid %]'); return false">Import</a></td> >+ <td><a href="#" class="import_auth_record" data-breedingid="[% breeding_loo.breedingid %]" data-heading_code="[% breeding_loo.heading_code %]" data-authid="[% breeding_loo.authid %]">Import</a></td> > </tr> > [% END %] > [% END %]</tbody> >@@ -215,13 +240,13 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : > [% END %] > > [% IF ( show_prevbutton ) %] >- <input type="button" name="changepage_prev" value="Previous page" onclick="$('#current_page').val([% current_page %]-1);$('#page_form').submit();" /> >+ <input type="button" name="changepage_prev" value="Previous page" data-currentpage="[% current_page %]" /> > [% END %] > Page [% current_page %] / [% total_pages %] > [% IF ( show_nextbutton ) %] >- <input type="button" name="changepage_next" value="Next page" onclick="$('#current_page').val([% current_page %]+1);$('#page_form').submit();" /> >+ <input type="button" name="changepage_next" value="Next page" data-currentpage="[% current_page %]" /> > [% END %] >- <br />Go to page : <input id="goto_page" name="goto_page" value="[% current_page %]" size="4" /><input type="submit" name="changepage_goto" onclick="return validate_goto_page();" value="Go" /> >+ <br />Go to page : <input id="goto_page" name="goto_page" value="[% current_page %]" size="4" /><input type="submit" name="changepage_goto" value="Go" /> > </form> > > <p><form method="get" action="/cgi-bin/koha/cataloguing/z3950_auth_search.pl"><input type="hidden" name="authid" value="[% authid %]" /><input type="submit" value="Try another search"/></form></p> >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("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/loading-small.gif\" alt=\"\" /> "+_("Loading")+"</div>"); > }); >- >+ $( ".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 : > <li><label for="controlnumber">Control no.: </label> <input type="text" id="controlnumber" name="controlnumber" value="" /></li> > <li><label for="dewey">Dewey: </label> <input type="text" id="dewey" name="dewey" value="" /></li> > <li><label for="stdid">Standard ID: </label> <input type="text" id="stdid" name="stdid" value="" /></li> >+ <li><a id="resetZ3950Search" href="#"><i class="fa fa-trash"></i> Clear search form</a></li> > </ol> >- <p><a id="resetZ3950Search" href="#">Clear search form</a></p> > <input type="hidden" name="biblionumber" value="[% biblionumber %]" /> > <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" /> > </div> > <div class="yui-g"> >- <h2>Search targets <span style="display: inline; font-size: 70%; padding-left: 1em;"><span class="checkall"><a id="CheckAll" href="#">Select all</a></span><span class="clearall"><a id="CheckNone" href="#">Clear all</a></span></span></h2> >+ <h2>Search targets <span style="display: inline; font-size: 70%; padding-left: 1em;"><span class="checkall"><a id="CheckAll" href="#"><i class="fa fa-check"></i> Select all</a></span> | <span class="clearall"><a id="CheckNone" href="#"><i class="fa fa-remove"></i> Clear all</a></span></span></h2> > <div id="z3950_search_targets"> > [% FOREACH serverloo IN serverloop %] > <p> >@@ -156,7 +180,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : > [% END %] > </div> > </div> >- <fieldset class="action"><input type="submit" class="submit" value="Search" onclick="cursor :'wait'"/> <a class="cancel close" href="#">Cancel</a></fieldset> >+ <fieldset class="action"><input type="submit" class="submit" value="Search" /> <a class="cancel close" href="#">Cancel</a></fieldset> > </form> > > >@@ -206,7 +230,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : > [% IF ( breeding_loo.breedingid ) %] > > <tr id="row[% breeding_loo.breedingid %]"> >- <td>[% breeding_loo.server %] <div class="linktools"><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid %]" class="previewData">Preview MARC</a> <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&importid=[% breeding_loo.breedingid %]" class="previewData">Preview card</a> <a href="#" onclick="Import([% breeding_loo.breedingid %],[% breeding_loo.biblionumber %]); return false">Import</a><a href="#" onclick="closemenu();return false;" title="Close this menu"> X </a></div> </td> >+ <td>[% breeding_loo.server %] <div class="linktools"><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid %]" class="previewData">Preview MARC</a> <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&importid=[% breeding_loo.breedingid %]" class="previewData">Preview card</a> <a href="#" class="import_auth_record" data-breedingid="[% breeding_loo.breedingid %]" data-heading_code="[% breeding_loo.heading_code %]" data-authid="[% breeding_loo.authid %]">Import</a><a href="#" id="close_menu" title="Close this menu"> X </a></div> </td> > <td>[% breeding_loo.title |html %]</td> > <td>[% breeding_loo.author %]</td> > <td>[% breeding_loo.date %]</td> >@@ -215,7 +239,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : > <td>[% breeding_loo.lccn %]</td> > <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid %]" class="previewData">MARC</a></td> > <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&importid=[% breeding_loo.breedingid %]" class="previewData">Card</a></td> >- <td><a href="#" onclick="Import([% breeding_loo.breedingid %],[% breeding_loo.biblionumber %]); return false">Import</a></td> >+ <td><a href="#" class="import_auth_record" data-breedingid="[% breeding_loo.breedingid %]" data-heading_code="[% breeding_loo.heading_code %]" data-authid="[% breeding_loo.authid %]">Import</a></td> > </tr> > [% END %] > [% END %]</tbody> >@@ -253,13 +277,13 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : > [% END %] > > [% IF ( show_prevbutton ) %] >- <input type="button" name="changepage_prev" value="Previous Page" onclick="$('#current_page').val([% current_page %]-1);$('#page_form').submit();" /> >+ <input type="button" name="changepage_prev" value="Previous page" data-currentpage="[% current_page %]" /> > [% END %] > Page [% current_page %] / [% total_pages %] > [% IF ( show_nextbutton ) %] >- <input type="button" name="changepage_next" value="Next Page" onclick="$('#current_page').val([% current_page %]+1);$('#page_form').submit();" /> >+ <input type="button" name="changepage_next" value="Next page" data-currentpage="[% current_page %]" /> > [% END %] >- <br />Go to page : <input id="goto_page" name="goto_page" value="[% current_page %]" size="4" /><input type="submit" name="changepage_goto" onclick="return validate_goto_page();" value="Go" /> >+ <br />Go to page : <input id="goto_page" name="goto_page" value="[% current_page %]" size="4" /><input type="submit" name="changepage_goto" value="Go" /> > </form> > > [% ELSE %] >-- >2.1.4
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 16812
:
52868
|
52871
|
52872
|
52873
|
52885
|
52886
|
53005
|
53006
|
53308
|
53348