From 2d774ccad5e3a07c936e5ba38b42a3dc9a2ad484 Mon Sep 17 00:00:00 2001 From: CJ Lynce Date: Mon, 13 Oct 2025 22:20:35 +0000 Subject: [PATCH] Bug 40245: Show firstname in patron search results when different than preferred_name This patch shows the patron's firstname in patron search results and autosuggestions when the patrons preferred_name is different than their first name. Requires that the ShowPatronFirstnameIfDifferentThanPreferredname system preference is enabled. Test plan: 0. Apply patches and login to the staff interface. 1. Edit a patron to give a different preferred name than firstname. 2. Return to home page and search for the patron in the quick-search bar. 3. Verify patron shows up in autosuggest list, showing preferred name only. 4. Verify patron shows up in regular list (member.pl) with preferred name showing only. 5. Change syspref ShowFirstIfDifferentThanPreferred to "Show" and save. 6. Return to home page and search for the patron in the quick-search bar. 7. Verify patron shows up in autosuggest list, showing preferred name, and firstname in brackets. 8. Verify patron shows up in regular list (member.pl) with preferred name, and firstname in brackets. Sponsored-by: Westlake Porter Public Library Signed-off-by: Andrew Fuerste Henry --- .../intranet-tmpl/prog/en/includes/js_includes.inc | 1 + .../intranet-tmpl/prog/en/includes/patron-search.inc | 5 +++-- koha-tmpl/intranet-tmpl/prog/js/patron-format.js | 12 +++++++++++- koha-tmpl/intranet-tmpl/prog/js/staff-global.js | 2 ++ 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc index 75ca87955c3..189a2687c9c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc @@ -75,6 +75,7 @@ var extendedPatronAttributes = "[% Koha.Preference('ExtendedPatronAttributes') | html %]"; var loggedInLibrary = '[% Branches.GetLoggedInBranchcode | html %]'; var singleBranchMode = '[% singleBranchMode | html %]'; + var showPatronFirstnameIfDifferentThanPreferredname = [% Koha.Preference('ShowPatronFirstnameIfDifferentThanPreferredname') ? 1 : 0 | html %]; [% IF ( PatronAutoComplete ) %]