Permalink
Browse files

[#32469069] Fixing loss of search group limiter in staff adv search

The variable for search groups was not being passed to the staff
advanced search template, so the page never showed search group
options.  Added the variable and also reworded both staff and OPAC
pulldown defaults from "All categories" to "All library search groups"
(or "All libraries" in the OPAC masthead) for clarity.
  • Loading branch information...
1 parent 906a980 commit 9f1a501a3a8ca184431218303c9d0efc5cb1b99e jwt01 committed with ctfliblime Sep 13, 2012
@@ -363,7 +363,7 @@ function expand_sortby(){
<!--TMPL_IF NAME="searchdomainoptions" -->
<div id="searchcategories">
<select name="multibranchlimit">
- <option value="">All categories</option>
+ <option value="">All library search groups</option>
<!-- TMPL_LOOP NAME="searchdomainoptions" -->
<option value="<TMPL_VAR NAME="categorycode">" <TMPL_IF NAME="selected">selected="selected"</TMPL_IF>><TMPL_VAR NAME="categoryname"></option>
<!-- /TMPL_LOOP -->
@@ -70,7 +70,7 @@
<!-- TMPL_IF NAME="searchdomainoptions" -->
<div id="searchcategories_masthead">
<select name="multibranchlimit" class="left">
- <option value="">All categories</option>
+ <option value="">All libraries</option>
<!-- TMPL_LOOP NAME="searchdomainoptions" -->
<option value="<TMPL_VAR NAME="categorycode">" <TMPL_IF NAME="selected">selected="selected"</TMPL_IF>><TMPL_VAR NAME="categoryname"></option>
<!-- /TMPL_LOOP -->
@@ -368,7 +368,7 @@ function expand_sortby(){
<!--TMPL_IF NAME="searchdomainoptions" -->
<div id="searchcategories">
<select name="multibranchlimit">
- <option value="">All categories</option>
+ <option value="">All library search groups</option>
<!-- TMPL_LOOP NAME="searchdomainoptions" -->
<option value="<TMPL_VAR NAME="categorycode">" <TMPL_IF NAME="selected">selected="selected"</TMPL_IF>><TMPL_VAR NAME="categoryname"></option>
<!-- /TMPL_LOOP -->
View
@@ -128,6 +128,16 @@ sub get_template_and_user {
$in->{'type'}
) unless ($in->{'template_name'}=~/maintenance/);
+ my $opacconf
+ = C4::Koha::GetOpacConfigByHostname(\&C4::Koha::CgiOrPlackHostnameFinder);
+ if (my $group = $opacconf->{default_search_limit}{group}) {
+ my $branches = C4::Branch::GetBranchesInCategory($group);
+ my $search_string = join ' or ', map {"branch:$_"} @$branches;
+ $opacconf->{default_search_limit}{content} = $search_string;
+ }
+ my $searchdomainoptions = C4::View::Util::BuildSearchDomainList(
+ $in->{query}->param('multibranchlimit') // $opacconf->{default_search_limit}{group});
+
my $borrowernumber;
my $insecure = C4::Context->preference('insecure');
if ($user or $insecure) {
@@ -332,6 +342,7 @@ sub get_template_and_user {
RefundReturnedLostItem => C4::Context->preference('RefundReturnedLostItem'),
ClearNotForLoan => C4::Context->preference('ClearNotForLoan'),
GetItAcquisitions => C4::Context->preference("GetItAcquisitions"),
+ searchdomainoptions => $searchdomainoptions,
BibliosCataloging => C4::Context->preference("BibliosCataloging"),
);
}
@@ -343,15 +354,6 @@ sub get_template_and_user {
$LibraryNameTitle =~ s/<(?:[^<>'"]|'(?:[^']*)'|"(?:[^"]*)")*>//sg;
# variables passed from CGI: opac_css_override and opac_search_limits.
- my $opacconf
- = C4::Koha::GetOpacConfigByHostname(\&C4::Koha::CgiOrPlackHostnameFinder);
- if (my $group = $opacconf->{default_search_limit}{group}) {
- my $branches = C4::Branch::GetBranchesInCategory($group);
- my $search_string = join ' or ', map {"branch:$_"} @$branches;
- $opacconf->{default_search_limit}{content} = $search_string;
- }
- my $searchdomainoptions = C4::View::Util::BuildSearchDomainList(
- $in->{query}->param('multibranchlimit') // $opacconf->{default_search_limit}{group});
my $opac_search_limit
= ($opacconf->{default_search_limit}{group}) ? '' :

0 comments on commit 9f1a501

Please sign in to comment.