add "and" condition for branch when search is built (in advanced search)
authorbtoumi <btoumi>
Thu, 5 Apr 2007 07:29:27 +0000 (07:29 +0000)
committerbtoumi <btoumi>
Thu, 5 Apr 2007 07:29:27 +0000 (07:29 +0000)
C4/Search.pm

index 3b1fda3..c4eef80 100755 (executable)
@@ -725,8 +725,13 @@ sub buildQuery {
 
         # these are treated as AND
         elsif ($limit_query) {
-            $limit_query       .= " or $limit" if $limit;
-            $limit_search_desc .= " or $limit" if $limit;
+           if ($limit =~ /branch/){
+                       $limit_query       .= " ) and ( $limit" if $limit;
+                       $limit_search_desc .= " ) and ( $limit" if $limit;
+               }else{
+                       $limit_query       .= " or $limit" if $limit;
+                       $limit_search_desc .= " or $limit" if $limit;
+               }
         }
 
         # otherwise, there is nothing but the limit