more fixes: limit by branch working

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Joshua Ferraro 2007-11-20 23:31:19 -06:00
parent fc60b7f731
commit a4c187e895
2 changed files with 8 additions and 3 deletions

View File

@ -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

View File

@ -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;