From ed9e78f9df812346be37f1540cc5438a8177618f 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 | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index e02fa88e57..b1cec730f3 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); @@ -1093,12 +1094,20 @@ sub buildQuery { # Regular old limits else { - if ($this_limit){ - $limit .= " and " if $limit || $query; - $limit .= "$this_limit"; - $limit_cgi .= "&limit=$this_limit"; + $limit .= " and " if $limit || $query; + $limit .= "$this_limit"; + $limit_cgi .= "&limit=$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