Bug 3629 : search limit by group is not OK
authorPaul POULAIN <paul.poulain@biblibre.com>
Sat, 26 Mar 2011 22:24:19 +0000 (18:24 -0400)
committerChris Cormack <chrisc@catalyst.net.nz>
Tue, 29 Mar 2011 23:37:50 +0000 (12:37 +1300)
MT4491 : limitation by library group

- the group list was not displayed in OPAC (even if everything else was here
- the group limit was not working due to a missing ()

author=jean et group=droit" resulted in:
author=jean and branch=b1 or branch=b2 or branch=b3
that is wrong (executed from left to right)

the fix add () to have :
author=jean and (branch=b1 or branch=b2 or branch=b3)
that is OK

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
catalogue/search.pl
koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tmpl
opac/opac-search.pl

index b22837a..968f2a1 100755 (executable)
@@ -396,7 +396,7 @@ my @limits;
 @limits = split("\0",$params->{'limit'}) if $params->{'limit'};
 
 if($params->{'multibranchlimit'}) {
-push @limits, join(" or ", map { "branch: $_ "}  @{GetBranchesInCategory($params->{'multibranchlimit'})}) ;
+    push @limits, '('.join( " or ", map { "branch: $_ " } @{ GetBranchesInCategory( $params->{'multibranchlimit'} ) } ).')';
 }
 
 my $available;
index f7c2adf..bd0752c 100644 (file)
         <!--/TMPL_IF-->    
         <!-- /TMPL_LOOP -->
         </select>
-        
+        <!-- TMPL_IF NAME="searchdomainloop" -->
+            <p>OR</p> <!-- should addjs to grey out group pulldown if a library is selected. -->
+                <label for="categoryloop">Groups of Libraries</label><select name="multibranchlimit" id="categoryloop">
+                <option value=""> -- none -- </option>
+                <!-- TMPL_LOOP NAME="searchdomainloop" -->
+                <option value="<!-- TMPL_VAR NAME="categorycode" -->"><!-- TMPL_VAR NAME="categoryname" --></option>
+                <!-- /TMPL_LOOP -->
+                </select>
+        <!-- /TMPL_IF -->        
         <div style="margin-top:.4em"><label for="available-items"><input type="checkbox" id="available-items" name="limit" value="available" /> Only items currently available for loan or reference</label></div>
     </fieldset></div>
     <!-- /TMPL_UNLESS -->
index d22049f..c145729 100755 (executable)
@@ -317,7 +317,7 @@ my @limits;
 @limits = split("\0",$params->{'limit'}) if $params->{'limit'};
 
 if($params->{'multibranchlimit'}) {
-push @limits, join(" or ", map { "branch: $_ "}  @{GetBranchesInCategory($params->{'multibranchlimit'})}) ;
+    push @limits, '('.join( " or ", map { "branch: $_ " } @{ GetBranchesInCategory( $params->{'multibranchlimit'} ) } ).')';
 }
 
 my $available;