more fixes: limit by branch working
authorJoshua Ferraro <jmf@liblime.com>
Wed, 21 Nov 2007 05:31:19 +0000 (23:31 -0600)
committerJoshua Ferraro <jmf@liblime.com>
Wed, 21 Nov 2007 20:12:51 +0000 (14:12 -0600)
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Search.pm
catalogue/search.pl

index c9bfa57..fde3f36 100644 (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
index 9d59919..64a020e 100755 (executable)
@@ -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;