From 58b8eb0b4da87e3ecea1e8275fb2f7ee532131b6 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 6 Aug 2021 13:48:42 +0000 Subject: [PATCH] Bug 10902: (QA follow-up) Show library name instead of code This patch modifies the patron search autocomplete so that library name is shown instead of library code. Signed-off-by: David Nind --- circ/ysearch.pl | 3 +++ koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/circ/ysearch.pl b/circ/ysearch.pl index abde83855c..f008452d74 100755 --- a/circ/ysearch.pl +++ b/circ/ysearch.pl @@ -30,6 +30,7 @@ use C4::Context; use C4::Auth qw( check_cookie_auth ); use Koha::Patrons; use Koha::DateUtils qw( format_sqldatetime ); +use Koha::Libraries; use JSON qw( to_json ); @@ -79,6 +80,7 @@ my $borrowers_rs = Koha::Patrons->search_limited( my @borrowers; while ( my $b = $borrowers_rs->next ) { + my $library = Koha::Libraries->find( $b->branchcode ); push @borrowers, { borrowernumber => $b->borrowernumber, surname => $b->surname // '', @@ -91,6 +93,7 @@ while ( my $b = $borrowers_rs->next ) { zipcode => $b->zipcode // '', country => $b->country // '', branchcode => $b->branchcode // '', + branchname => $library->branchname // '', }; } 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 c96ba49118..3246c8de71 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc @@ -105,7 +105,7 @@ + ( item.zipcode ? item.zipcode.escapeHtml() : "" ) + " " + ( item.country ? item.country.escapeHtml() : "" ) + ""; - itemString += " " + item.branchcode + " " + ""; + itemString += " " + item.branchname + " " + ""; return $( "
  • " ) .addClass( loggedInClass ) .data( "ui-autocomplete-item", item ) -- 2.20.1