From a4c187e895ec22976cda9362f0bb2ba0d6c27a33 Mon Sep 17 00:00:00 2001 From: Joshua Ferraro Date: Tue, 20 Nov 2007 23:31:19 -0600 Subject: [PATCH] more fixes: limit by branch working Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- C4/Search.pm | 9 +++++++-- catalogue/search.pl | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index c9bfa579ce..fde3f36afe 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -823,6 +823,7 @@ sub buildQuery { $limit_cgi .= "&limit=available"; $limit_desc .=""; } + # these are treated as OR elsif ( $this_limit =~ /mc/ ) { $group_OR_limits .= " or " if $group_OR_limits; @@ -830,6 +831,8 @@ sub buildQuery { $limit_cgi .="&limit=$this_limit"; $limit_desc .= " or $this_limit"; } + + # regular old limits else { $limit .= " and " if $limit || $query; $limit .= "$this_limit"; @@ -837,8 +840,10 @@ sub buildQuery { $limit_desc .=" and $this_limit"; } } - $limit.=" and " if ($query && $limit); - $limit.="($group_OR_limits)" if $group_OR_limits; + if ($group_OR_limits) { + $limit.=" and " if ($query || $limit ); + $limit.="($group_OR_limits)"; + } # normalize the strings for ($query, $query_search_desc, $limit, $limit_desc) { $_ =~ s/ / /g; # remove extra spaces diff --git a/catalogue/search.pl b/catalogue/search.pl index 9d59919906..64a020e52e 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -371,7 +371,7 @@ my @limits; @limits = split("\0",$params->{'limit'}) if $params->{'limit'}; if($params->{'multibranchlimit'}) { -push @limits, join(" or ", map { "homebranch: $_ "} @{GetBranchesInCategory($params->{'multibranchlimit'})}) ; +push @limits, join(" or ", map { "branch: $_ "} @{GetBranchesInCategory($params->{'multibranchlimit'})}) ; } my $available; -- 2.39.5