From 54e949b8e046ddd24257d904618f79a81a1f03c1 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 18 May 2016 21:23:14 -0400 Subject: [PATCH] Bug 16549 - Remove the use of "onclick" from header search forms MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This patch removes the use of "onclick" from all header search forms for the purpose of triggering the "keep_text" function. This behavior is now handled in the globally-included JS file. To test, apply the patch and clear your cache if necessary. - Enter text in any header search form field. Click to each other tab in the header and confirm that your text is copied to each. - Test the behavior of the header search form on at least one page where each is included: - The staff client home page - The advanced search page - The authorities home page - The administration home page - The cataloging home page - The checkin page - The circulation home page - The patrons home page - Acquisitions -> Vendor -> Contracts - Administration -> Cities - Administration -> Currencies and exchange rates - Administration -> Patron categories - Administration -> Printers (why is this page still around?) - Administration -> System preferences - Administration -> Z39.50/SRU servers - Tools -> Notices & slips This patch modifies does not fix the existing (unreported) bug which prevents the keep text function from working in the include file used on these pages: - Acquisitions -> Vendor -> Basket -> New order from suggestion - Administration -> Budgets - The serials home page Signed-off-by: Claire Gravely Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall (cherry picked from commit 6524e6d95726c70b7ff6088b31692216a1956110) Signed-off-by: Frédéric Demians --- .../intranet-tmpl/prog/en/includes/adv-search.inc | 8 ++++---- .../prog/en/includes/authorities-search.inc | 8 ++++---- .../prog/en/includes/budgets-admin-search.inc | 6 +++--- .../intranet-tmpl/prog/en/includes/cat-search.inc | 8 ++++---- .../prog/en/includes/cataloging-search.inc | 10 +++++----- .../intranet-tmpl/prog/en/includes/checkin-search.inc | 6 +++--- .../intranet-tmpl/prog/en/includes/circ-search.inc | 8 ++++---- .../prog/en/includes/cities-admin-search.inc | 6 +++--- .../prog/en/includes/contracts-admin-search.inc | 6 +++--- .../prog/en/includes/currencies-admin-search.inc | 6 +++--- .../intranet-tmpl/prog/en/includes/home-search.inc | 10 +++++----- .../intranet-tmpl/prog/en/includes/letters-search.inc | 6 +++--- .../intranet-tmpl/prog/en/includes/patron-search.inc | 10 +++++----- .../prog/en/includes/patrons-admin-search.inc | 6 +++--- .../prog/en/includes/prefs-admin-search.inc | 6 +++--- .../prog/en/includes/printers-admin-search.inc | 6 +++--- .../intranet-tmpl/prog/en/includes/serials-search.inc | 4 ++-- .../prog/en/includes/suggestions-add-search.inc | 4 ++-- .../prog/en/includes/z3950-admin-search.inc | 6 +++--- koha-tmpl/intranet-tmpl/prog/js/staff-global.js | 6 +++++- 20 files changed, 70 insertions(+), 66 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/adv-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/adv-search.inc index 30731d69b6..4bce9c463e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/adv-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/adv-search.inc @@ -34,16 +34,16 @@
    [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %] -
  • Check out
  • +
  • Check out
  • [% END %] [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %] -
  • Check in
  • +
  • Check in
  • [% END %] [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %] -
  • Renew
  • +
  • Renew
  • [% END %] [% IF ( CAN_user_borrowers ) %] -
  • Search patrons
  • +
  • Search patrons
  • [% END %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search.inc index d410dcc588..45517c8d37 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search.inc @@ -241,10 +241,10 @@ diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/budgets-admin-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/budgets-admin-search.inc index 9bf4e70a43..be36c7e597 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/budgets-admin-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/budgets-admin-search.inc @@ -33,9 +33,9 @@ [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-search.inc index 1e06e69af7..6cc5cd14fd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-search.inc @@ -32,10 +32,10 @@ [% END %]
    - [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
  • Check out
  • [% END %] - [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
  • Check in
  • [% END %] - [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
  • Renew
  • [% END %] - [% IF ( CAN_user_catalogue ) %]
  • Search the catalog
  • [% END %] + [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
  • Check out
  • [% END %] + [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
  • Check in
  • [% END %] + [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
  • Renew
  • [% END %] + [% IF ( CAN_user_catalogue ) %]
  • Search the catalog
  • [% END %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cataloging-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cataloging-search.inc index 872c86e0c3..da1e2df240 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cataloging-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cataloging-search.inc @@ -39,11 +39,11 @@
    -
  • Cataloging search
  • - [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
  • Check out
  • [% END %] - [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
  • Check in
  • [% END %] - [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
  • Renew
  • [% END %] -
  • Search the catalog
  • +
  • Cataloging search
  • + [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
  • Check out
  • [% END %] + [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
  • Check in
  • [% END %] + [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
  • Renew
  • [% END %] +
  • Search the catalog
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/checkin-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/checkin-search.inc index fdc1d2e4a9..de271c3b28 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/checkin-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/checkin-search.inc @@ -22,9 +22,9 @@ [% END %]
    - [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
  • Check out
  • [% END %] - [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
  • Renew
  • [% END %] - [% IF ( CAN_user_catalogue ) %]
  • Search the catalog
  • [% END %] + [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
  • Check out
  • [% END %] + [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
  • Renew
  • [% END %] + [% IF ( CAN_user_catalogue ) %]
  • Search the catalog
  • [% END %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-search.inc index 92a0685e7d..4a5dc97989 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-search.inc @@ -30,10 +30,10 @@ [% END %]
    - [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
  • Check out
  • [% END %] - [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
  • Check in
  • [% END %] - [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
  • Renew
  • [% END %] - [% IF ( CAN_user_catalogue ) %]
  • Search the catalog
  • [% END %] + [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
  • Check out
  • [% END %] + [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
  • Check in
  • [% END %] + [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
  • Renew
  • [% END %] + [% IF ( CAN_user_catalogue ) %]
  • Search the catalog
  • [% END %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cities-admin-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cities-admin-search.inc index 3b11479094..2b85c95397 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cities-admin-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cities-admin-search.inc @@ -20,9 +20,9 @@ [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/contracts-admin-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/contracts-admin-search.inc index c173cc4420..eae3335509 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/contracts-admin-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/contracts-admin-search.inc @@ -22,9 +22,9 @@ [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/currencies-admin-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/currencies-admin-search.inc index 759a0e2cf0..6983b2266a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/currencies-admin-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/currencies-admin-search.inc @@ -18,9 +18,9 @@ [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/home-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/home-search.inc index 8c9a3b7450..08902d284a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/home-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/home-search.inc @@ -39,11 +39,11 @@ [% END %]
    - [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
  • Check out
  • [% END %] - [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
  • Check in
  • [% END %] - [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
  • Renew
  • [% END %] - [% IF ( CAN_user_borrowers ) %]
  • Search patrons
  • [% END %] - [% IF ( CAN_user_catalogue ) %]
  • Search the catalog
  • [% END %] + [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
  • Check out
  • [% END %] + [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
  • Check in
  • [% END %] + [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
  • Renew
  • [% END %] + [% IF ( CAN_user_borrowers ) %]
  • Search patrons
  • [% END %] + [% IF ( CAN_user_catalogue ) %]
  • Search the catalog
  • [% END %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/letters-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/letters-search.inc index dbcb0f4548..815903d536 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/letters-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/letters-search.inc @@ -18,9 +18,9 @@ [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc index e12ccd0d43..d1deca7419 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc @@ -146,11 +146,11 @@ [% END %]
    -
  • Search patrons
  • - [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
  • Check out
  • [% END %] - [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
  • Check in
  • [% END %] - [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
  • Renew
  • [% END %] - [% IF ( CAN_user_catalogue ) %]
  • Search the catalog
  • [% END %] +
  • Search patrons
  • + [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
  • Check out
  • [% END %] + [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
  • Check in
  • [% END %] + [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
  • Renew
  • [% END %] + [% IF ( CAN_user_catalogue ) %]
  • Search the catalog
  • [% END %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patrons-admin-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patrons-admin-search.inc index 88215b4797..72cb127dec 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patrons-admin-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patrons-admin-search.inc @@ -19,9 +19,9 @@ [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-admin-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-admin-search.inc index f8c70aca1e..9b82c4b2f7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-admin-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-admin-search.inc @@ -21,9 +21,9 @@ [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/printers-admin-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/printers-admin-search.inc index 7d75a71b4b..f3c9aaaf93 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/printers-admin-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/printers-admin-search.inc @@ -19,9 +19,9 @@ [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/serials-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/serials-search.inc index a22ff0f6ca..e8b2493f18 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/serials-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/serials-search.inc @@ -29,8 +29,8 @@ [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/suggestions-add-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/suggestions-add-search.inc index 802853a2d0..3928e25055 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/suggestions-add-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/suggestions-add-search.inc @@ -25,8 +25,8 @@ [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/z3950-admin-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/z3950-admin-search.inc index d78b35870a..d81f60fa6c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/z3950-admin-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/z3950-admin-search.inc @@ -21,9 +21,9 @@ [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js index 599a3bd982..5f9ed72177 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js +++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js @@ -52,6 +52,10 @@ $.fn.selectTabByID = function (tabID) { $("body").on("keypress", ".noEnterSubmit", function(e){ return checkEnter(e); }); + $(".keep_text").on("click",function(){ + var field_index = $(this).parent().index(); + keep_text( field_index ); + }); }); // http://jennifermadden.com/javascript/stringEnterKeyDetector.html @@ -158,4 +162,4 @@ function keep_text(clicked_index) { for (i = 0; i < searchboxes.length; i++) { searchboxes[i].value = persist; } -} \ No newline at end of file +} -- 2.39.5