Bugzilla – Attachment 193122 Details for
Bug 41040
Empty patron search from the header should not trigger a patron search
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41040: (follow-up) Move JS to global JS file
Bug-41040-follow-up-Move-JS-to-global-JS-file.patch (text/plain), 4.13 KB, created by
Lucas Gass (lukeg)
on 2026-02-13 16:48:23 UTC
(
hide
)
Description:
Bug 41040: (follow-up) Move JS to global JS file
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2026-02-13 16:48:23 UTC
Size:
4.13 KB
patch
obsolete
>From e904295e447550eb3d9d8dc3c0b88b46ef815385 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 13 Feb 2026 11:31:30 -0500 >Subject: [PATCH] Bug 41040: (follow-up) Move JS to global JS file > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >--- > .../prog/en/includes/member-search-box.inc | 20 +------------ > .../intranet-tmpl/prog/js/staff-global.js | 30 ++++++++++++++++++- > 2 files changed, 30 insertions(+), 20 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/member-search-box.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/member-search-box.inc >index dbd3889a644..54ed623f1ae 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/member-search-box.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/member-search-box.inc >@@ -6,25 +6,7 @@ > [% IF CAN_user_borrowers_edit_borrowers || CAN_user_borrowers_list_borrowers %] > [%- SET searchtype = searchtype || Koha.Preference('DefaultPatronSearchMethod') -%] > [% WRAPPER tab_panel tabname="patron_search" bt_active= bs_tab_active %] >- <form method="get" action="/cgi-bin/koha/members/member.pl" onsubmit="return validatePatronSearch(this);"> >- <script> >- function validatePatronSearch(form) { >- const searchTerm = form.searchmember.value.trim(); >- const branchSelected = form.branchcode_filter && form.branchcode_filter.value !== ""; >- const categorySelected = form.categorycode_filter && form.categorycode_filter.value !== ""; >- >- if (!searchTerm && !branchSelected && !categorySelected) { >- $(form.searchmember) >- .tooltip({ trigger: "manual", placement: "bottom", title: _("Please enter a card number or name") }) >- .tooltip("show"); >- $(document).on("click", function () { >- $(form.searchmember).tooltip("hide"); >- }); >- return false; >- } >- return true; >- } >- </script> >+ <form id="patron_header_search" method="get" action="/cgi-bin/koha/members/member.pl"> > <input type="hidden" name="quicksearch" value="1" /> > > <div class="form-title"> >diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >index 264ad54f716..bfac800c53f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >@@ -1,5 +1,5 @@ > /* global shortcut delBasket AUDIO_ALERT_PATH Cookies */ >-/* exported addBibToContext delBibToContext escape_str escape_price openWindow _ removeFocus toUC confirmDelete confirmClone playSound */ >+/* exported addBibToContext delBibToContext escape_str escape_price openWindow _ removeFocus toUC confirmDelete confirmClone playSound validatePatronSearch */ > if (KOHA === undefined) var KOHA = {}; > > function _(s) { >@@ -477,6 +477,11 @@ $(document).ready(function () { > e.preventDefault(); > togglePanel($(this)); > }); >+ >+ $("#patron_header_search").on("submit", function (e) { >+ e.preventDefault(); >+ validatePatronSearch($(this)[0]); >+ }); > }); > > function removeLastBorrower() { >@@ -1066,3 +1071,26 @@ function getScrollto(target, elemid) { > } > return yoffset.top - elem_height - 20; > } >+ >+function validatePatronSearch(form) { >+ const searchTerm = form.searchmember.value.trim(); >+ const branchSelected = >+ form.branchcode_filter && form.branchcode_filter.value !== ""; >+ const categorySelected = >+ form.categorycode_filter && form.categorycode_filter.value !== ""; >+ >+ if (!searchTerm && !branchSelected && !categorySelected) { >+ $(form.searchmember) >+ .tooltip({ >+ trigger: "manual", >+ placement: "bottom", >+ title: __("Please enter a card number or name"), >+ }) >+ .tooltip("show"); >+ $(document).on("click", function () { >+ $(form.searchmember).tooltip("hide"); >+ }); >+ return false; >+ } >+ return true; >+} >-- >2.39.5
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 41040
:
188062
|
189016
|
189017
|
189018
|
189197
|
189198
|
189199
|
189508
|
189509
|
189510
|
189511
|
189517
|
189518
|
189519
|
189520
|
193117
|
193118
|
193119
|
193120
|
193121
| 193122