From 2026c28797b1e80b02abd089d3f0a6c29cc1c7a7 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Wed, 25 Feb 2009 13:29:41 -0600 Subject: [PATCH] display library name instead of code in limit description The OPAC and staff search results page will now display the library name instead of the library code in the limit part of the search description, e.g., "kw,wrdl: cat branch:Centerville" instead of "kw,wrdl: cat branch:CPL" Signed-off-by: Galen Charlton --- C4/Search.pm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/C4/Search.pm b/C4/Search.pm index c3b715aa1a..8bcf2389e1 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -26,6 +26,7 @@ use C4::Search::PazPar2; use XML::Simple; use C4::Dates qw(format_date); use C4::XSLT; +use C4::Branch; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $DEBUG); @@ -1125,7 +1126,17 @@ sub buildQuery { $limit .= " and " if $limit || $query; $limit .= "$this_limit"; $limit_cgi .= "&limit=$this_limit"; - $limit_desc .= " $this_limit"; + if ($this_limit =~ /^branch:(.+)/) { + my $branchcode = $1; + my $branchname = GetBranchName($branchcode); + if (defined $branchname) { + $limit_desc .= " branch:$branchname"; + } else { + $limit_desc .= " $this_limit"; + } + } else { + $limit_desc .= " $this_limit"; + } } } if ($group_OR_limits) { -- 2.39.5