View | Details | Raw Unified | Return to bug 5390
Collapse All | Expand All

(-)a/C4/Auth.pm (-8 / +6 lines)
Lines 337-343 sub get_template_and_user { Link Here
337
            singleBranchMode             => C4::Context->preference("singleBranchMode"),
337
            singleBranchMode             => C4::Context->preference("singleBranchMode"),
338
            XSLTDetailsDisplay           => C4::Context->preference("XSLTDetailsDisplay"),
338
            XSLTDetailsDisplay           => C4::Context->preference("XSLTDetailsDisplay"),
339
            XSLTResultsDisplay           => C4::Context->preference("XSLTResultsDisplay"),
339
            XSLTResultsDisplay           => C4::Context->preference("XSLTResultsDisplay"),
340
            BranchesLoop                 => GetBranchesLoop(),
341
            using_https                  => $in->{'query'}->https() ? 1 : 0,
340
            using_https                  => $in->{'query'}->https() ? 1 : 0,
342
            noItemTypeImages            => C4::Context->preference("noItemTypeImages"),
341
            noItemTypeImages            => C4::Context->preference("noItemTypeImages"),
343
    );
342
    );
Lines 380-396 sub get_template_and_user { Link Here
380
        # variables passed from CGI: opac_css_override and opac_search_limits.
379
        # variables passed from CGI: opac_css_override and opac_search_limits.
381
        my $opac_search_limit = $ENV{'OPAC_SEARCH_LIMIT'};
380
        my $opac_search_limit = $ENV{'OPAC_SEARCH_LIMIT'};
382
        my $opac_limit_override = $ENV{'OPAC_LIMIT_OVERRIDE'};
381
        my $opac_limit_override = $ENV{'OPAC_LIMIT_OVERRIDE'};
383
        my $mylibraryfirst = C4::Context->preference("SearchMyLibraryFirst");
382
        my $opac_name = '';
384
        my $opac_name;
383
        if (($opac_search_limit =~ /branch:(\w+)/ && $opac_limit_override) || $in->{'query'}->param('limit') =~ /branch:(\w+)/){
385
        if($opac_limit_override && ($opac_search_limit =~ /branch:(\w+)/) ){
384
            $opac_name = $1;   # opac_search_limit is a branch, so we use it.
386
             $opac_name = C4::Branch::GetBranchName($1)   # opac_search_limit is a branch, so we use it.
385
        } elsif (C4::Context->preference("SearchMyLibraryFirst") && C4::Context->userenv && C4::Context->userenv->{'branch'}) {
387
        } elsif($mylibraryfirst){
386
            $opac_name = C4::Context->userenv->{'branch'};
388
            $opac_name = C4::Branch::GetBranchName($mylibraryfirst);
389
        }
387
        }
390
        $template->param(
388
        $template->param(
391
            AmazonContent             => "" . C4::Context->preference("AmazonContent"),
389
            AmazonContent             => "" . C4::Context->preference("AmazonContent"),
392
            AnonSuggestions           => "" . C4::Context->preference("AnonSuggestions"),
390
            AnonSuggestions           => "" . C4::Context->preference("AnonSuggestions"),
393
            AuthorisedValueImages     => C4::Context->preference("AuthorisedValueImages"),
391
            AuthorisedValueImages     => C4::Context->preference("AuthorisedValueImages"),
392
            BranchesLoop              => GetBranchesLoop($opac_name),
394
            LibraryName               => "" . C4::Context->preference("LibraryName"),
393
            LibraryName               => "" . C4::Context->preference("LibraryName"),
395
            LibraryNameTitle          => "" . $LibraryNameTitle,
394
            LibraryNameTitle          => "" . $LibraryNameTitle,
396
            LoginBranchname           => C4::Context->userenv?C4::Context->userenv->{"branchname"}:"",
395
            LoginBranchname           => C4::Context->userenv?C4::Context->userenv->{"branchname"}:"",
Lines 408-414 sub get_template_and_user { Link Here
408
            OpacAuthorities           => C4::Context->preference("OpacAuthorities"),
407
            OpacAuthorities           => C4::Context->preference("OpacAuthorities"),
409
            OPACBaseURL               => ($in->{'query'}->https() ? "https://" : "http://") . $ENV{'SERVER_NAME'} .
408
            OPACBaseURL               => ($in->{'query'}->https() ? "https://" : "http://") . $ENV{'SERVER_NAME'} .
410
                   ($ENV{'SERVER_PORT'} eq ($in->{'query'}->https() ? "443" : "80") ? '' : ":$ENV{'SERVER_PORT'}"),
409
                   ($ENV{'SERVER_PORT'} eq ($in->{'query'}->https() ? "443" : "80") ? '' : ":$ENV{'SERVER_PORT'}"),
411
            opac_name             => $opac_name,
412
            opac_css_override           => $ENV{'OPAC_CSS_OVERRIDE'},
410
            opac_css_override           => $ENV{'OPAC_CSS_OVERRIDE'},
413
            opac_search_limit         => $opac_search_limit,
411
            opac_search_limit         => $opac_search_limit,
414
            opac_limit_override       => $opac_limit_override,
412
            opac_limit_override       => $opac_limit_override,
(-)a/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc (-5 / +6 lines)
Lines 84-97 Link Here
84
         <!-- /TMPL_LOOP -->
84
         <!-- /TMPL_LOOP -->
85
      </select>
85
      </select>
86
   <!-- TMPL_ELSE -->
86
   <!-- TMPL_ELSE -->
87
      <!-- TMPL_UNLESS NAME="opac_limit_override" -->
87
      <!-- TMPL_IF NAME="opac_limit_override" -->
88
          <!-- TMPL_IF NAME="opac_search_limit" -->
89
            <input name="limit" value="<!-- TMPL_VAR name="opac_search_limit" -->" type="hidden" />
90
          <!-- /TMPL_IF -->
91
      <!-- TMPL_ELSE -->
88
          <!-- TMPL_IF name="mylibraryfirst" --> 
92
          <!-- TMPL_IF name="mylibraryfirst" --> 
89
               <input name="limit" value="branch:<!-- TMPL_VAR name="mylibraryfirst" -->" type="hidden" />
93
               <input name="limit" value="branch:<!-- TMPL_VAR name="mylibraryfirst" -->" type="hidden" />
90
          <!-- /TMPL_IF -->
94
          <!-- /TMPL_IF -->
91
       <!-- /TMPL_UNLESS -->
95
      <!-- /TMPL_IF -->
92
   <!-- /TMPL_IF -->
93
   <!-- TMPL_IF NAME="opac_search_limit" -->
94
      <input name="limit" value="<!-- TMPL_VAR name="opac_search_limit" -->" type="hidden" />
95
   <!-- /TMPL_IF -->
96
   <!-- /TMPL_IF -->
96
97
97
98
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tmpl (-1 / +1 lines)
Lines 239-245 Link Here
239
        
239
        
240
        <select name="limit" id="branchloop">
240
        <select name="limit" id="branchloop">
241
        <option value="">All libraries</option>
241
        <option value="">All libraries</option>
242
        <!-- TMPL_LOOP NAME="branchloop" -->
242
        <!-- TMPL_LOOP NAME="BranchesLoop" -->
243
        <!--TMPL_IF Name="selected"-->
243
        <!--TMPL_IF Name="selected"-->
244
        <option value="branch:<!-- TMPL_VAR NAME="value" -->" selected="selected"><!-- TMPL_VAR NAME="branchname" --></option>
244
        <option value="branch:<!-- TMPL_VAR NAME="value" -->" selected="selected"><!-- TMPL_VAR NAME="branchname" --></option>
245
        <!--TMPL_ELSE-->    
245
        <!--TMPL_ELSE-->    
(-)a/opac/opac-search.pl (-3 / +1 lines)
Lines 140-149 if (C4::Context->preference('TagsEnabled')) { Link Here
140
#}
140
#}
141
141
142
# load the branches
142
# load the branches
143
my $mybranch = ( C4::Context->preference('SearchMyLibraryFirst') && C4::Context->userenv && C4::Context->userenv->{branch} ) ? C4::Context->userenv->{branch} : '';
143
144
my $branches = GetBranches();   # used later in *getRecords, probably should be internalized by those functions after caching in C4::Branch is established
144
my $branches = GetBranches();   # used later in *getRecords, probably should be internalized by those functions after caching in C4::Branch is established
145
$template->param(
145
$template->param(
146
    branchloop       => GetBranchesLoop($mybranch, 0),
147
    searchdomainloop => GetBranchCategories(undef,'searchdomain'),
146
    searchdomainloop => GetBranchCategories(undef,'searchdomain'),
148
);
147
);
149
148
150
- 

Return to bug 5390