Bugzilla – Attachment 3388 Details for
Bug 5390
library choice not remaining when searching opac
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Signed-off patch
bug_5390.patch (text/plain), 9.03 KB, created by
Jared Camins-Esakov
on 2011-03-21 21:46:44 UTC
(
hide
)
Description:
Signed-off patch
Filename:
MIME Type:
Creator:
Jared Camins-Esakov
Created:
2011-03-21 21:46:44 UTC
Size:
9.03 KB
patch
obsolete
>Delivered-To: jcamins@cpbibliography.com >Received: by 10.43.69.79 with SMTP id yb15cs86043icb; > Mon, 21 Mar 2011 14:18:43 -0700 (PDT) >Received: by 10.204.82.224 with SMTP id c32mr4168851bkl.161.1300742322540; > Mon, 21 Mar 2011 14:18:42 -0700 (PDT) >Return-Path: <koha-patches-bounces@lists.koha-community.org> >Received: from eliot.biblibre.com (eliot.biblibre.com [188.165.204.78]) > by mx.google.com with ESMTPS id v10si18124833bku.90.2011.03.21.14.18.40 > (version=TLSv1/SSLv3 cipher=OTHER); > Mon, 21 Mar 2011 14:18:41 -0700 (PDT) >Received-SPF: neutral (google.com: 188.165.204.78 is neither permitted nor denied by best guess record for domain of koha-patches-bounces@lists.koha-community.org) client-ip=188.165.204.78; >Authentication-Results: mx.google.com; spf=neutral (google.com: 188.165.204.78 is neither permitted nor denied by best guess record for domain of koha-patches-bounces@lists.koha-community.org) smtp.mail=koha-patches-bounces@lists.koha-community.org >Received: from eliot.biblibre.com (localhost.localdomain [127.0.0.1]) > by eliot.biblibre.com (Postfix) with ESMTP id 4021646DD8; > Mon, 21 Mar 2011 22:18:40 +0100 (CET) >X-Original-To: koha-patches@lists.koha-community.org >Delivered-To: koha-patches_lists.koha-community.org@eliot.biblibre.com >Received: from dev.bywatersolutions.com (dev.bywatersolutions.com > [174.143.239.187]) > by eliot.biblibre.com (Postfix) with ESMTP id 5E36E467F4 > for <koha-patches@lists.koha-community.org>; > Mon, 21 Mar 2011 22:18:37 +0100 (CET) >Received: by dev.bywatersolutions.com (Postfix, from userid 1000) > id E7C7D3008A; Mon, 21 Mar 2011 17:18:36 -0400 (EDT) >From: Ian Walls <ian.walls@bywatersolutions.com> >To: koha-patches@lists.koha-community.org >Date: Mon, 21 Mar 2011 17:18:36 -0400 >Message-Id: <1300742316-19575-1-git-send-email-ian.walls@bywatersolutions.com> >X-Mailer: git-send-email 1.5.6.5 >Cc: Jared Camins-Esakov <jcamins@bywatersolutions.com> >Subject: [Koha-patches] [PATCH] Bug 5390: OPAC loses library selection >X-BeenThere: koha-patches@lists.koha-community.org >X-Mailman-Version: 2.1.11 >Precedence: list >List-Id: Patches submitted to Koha <koha-patches.lists.koha-community.org> >List-Unsubscribe: <http://lists.koha-community.org/cgi-bin/mailman/options/koha-patches>, > <mailto:koha-patches-request@lists.koha-community.org?subject=unsubscribe> >List-Archive: </pipermail/koha-patches> >List-Post: <mailto:koha-patches@lists.koha-community.org> >List-Help: <mailto:koha-patches-request@lists.koha-community.org?subject=help> >List-Subscribe: <http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches>, > <mailto:koha-patches-request@lists.koha-community.org?subject=subscribe> >MIME-Version: 1.0 >Content-Type: text/plain; charset="us-ascii" >Content-Transfer-Encoding: 7bit >Sender: koha-patches-bounces@lists.koha-community.org >Errors-To: koha-patches-bounces@lists.koha-community.org > >From: Jared Camins-Esakov <jcamins@bywatersolutions.com> > >This patch ensures that the OPAC library selection masthead will always default >to the branch that is currently being searched. This only applies to systems >with multiple branches and OpacAddMastheadLibraryPulldown turned on. > >To test: do a search in the OPAC, limiting by branch. The search results will >still have that branch selected in the masthead dropdown. > >This patch also fixes bug 5852 and bug 3778. > >Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com> >--- > C4/Auth.pm | 14 ++++++-------- > koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc | 11 ++++++----- > .../opac-tmpl/prog/en/modules/opac-advsearch.tmpl | 2 +- > opac/opac-search.pl | 3 +-- > 4 files changed, 14 insertions(+), 16 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index 06806ff..fecdf85 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -337,7 +337,6 @@ sub get_template_and_user { > singleBranchMode => C4::Context->preference("singleBranchMode"), > XSLTDetailsDisplay => C4::Context->preference("XSLTDetailsDisplay"), > XSLTResultsDisplay => C4::Context->preference("XSLTResultsDisplay"), >- BranchesLoop => GetBranchesLoop(), > using_https => $in->{'query'}->https() ? 1 : 0, > noItemTypeImages => C4::Context->preference("noItemTypeImages"), > ); >@@ -380,17 +379,17 @@ sub get_template_and_user { > # variables passed from CGI: opac_css_override and opac_search_limits. > my $opac_search_limit = $ENV{'OPAC_SEARCH_LIMIT'}; > my $opac_limit_override = $ENV{'OPAC_LIMIT_OVERRIDE'}; >- my $mylibraryfirst = C4::Context->preference("SearchMyLibraryFirst"); >- my $opac_name; >- if($opac_limit_override && ($opac_search_limit =~ /branch:(\w+)/) ){ >- $opac_name = C4::Branch::GetBranchName($1) # opac_search_limit is a branch, so we use it. >- } elsif($mylibraryfirst){ >- $opac_name = C4::Branch::GetBranchName($mylibraryfirst); >+ my $opac_name = ''; >+ if (($opac_search_limit =~ /branch:(\w+)/ && $opac_limit_override) || $in->{'query'}->param('limit') =~ /branch:(\w+)/){ >+ $opac_name = $1; # opac_search_limit is a branch, so we use it. >+ } elsif (C4::Context->preference("SearchMyLibraryFirst") && C4::Context->userenv && C4::Context->userenv->{'branch'}) { >+ $opac_name = C4::Context->userenv->{'branch'}; > } > $template->param( > AmazonContent => "" . C4::Context->preference("AmazonContent"), > AnonSuggestions => "" . C4::Context->preference("AnonSuggestions"), > AuthorisedValueImages => C4::Context->preference("AuthorisedValueImages"), >+ BranchesLoop => GetBranchesLoop($opac_name), > LibraryName => "" . C4::Context->preference("LibraryName"), > LibraryNameTitle => "" . $LibraryNameTitle, > LoginBranchname => C4::Context->userenv?C4::Context->userenv->{"branchname"}:"", >@@ -408,7 +407,6 @@ sub get_template_and_user { > OpacAuthorities => C4::Context->preference("OpacAuthorities"), > OPACBaseURL => ($in->{'query'}->https() ? "https://" : "http://") . $ENV{'SERVER_NAME'} . > ($ENV{'SERVER_PORT'} eq ($in->{'query'}->https() ? "443" : "80") ? '' : ":$ENV{'SERVER_PORT'}"), >- opac_name => $opac_name, > opac_css_override => $ENV{'OPAC_CSS_OVERRIDE'}, > opac_search_limit => $opac_search_limit, > opac_limit_override => $opac_limit_override, >diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc >index 6db1552..310e7b8 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc >+++ b/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc >@@ -84,14 +84,15 @@ > <!-- /TMPL_LOOP --> > </select> > <!-- TMPL_ELSE --> >- <!-- TMPL_UNLESS NAME="opac_limit_override" --> >+ <!-- TMPL_IF NAME="opac_limit_override" --> >+ <!-- TMPL_IF NAME="opac_search_limit" --> >+ <input name="limit" value="<!-- TMPL_VAR name="opac_search_limit" -->" type="hidden" /> >+ <!-- /TMPL_IF --> >+ <!-- TMPL_ELSE --> > <!-- TMPL_IF name="mylibraryfirst" --> > <input name="limit" value="branch:<!-- TMPL_VAR name="mylibraryfirst" -->" type="hidden" /> > <!-- /TMPL_IF --> >- <!-- /TMPL_UNLESS --> >- <!-- /TMPL_IF --> >- <!-- TMPL_IF NAME="opac_search_limit" --> >- <input name="limit" value="<!-- TMPL_VAR name="opac_search_limit" -->" type="hidden" /> >+ <!-- /TMPL_IF --> > <!-- /TMPL_IF --> > > >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tmpl >index 3a478ff..f7c2adf 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tmpl >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tmpl >@@ -239,7 +239,7 @@ > > <select name="limit" id="branchloop"> > <option value="">All libraries</option> >- <!-- TMPL_LOOP NAME="branchloop" --> >+ <!-- TMPL_LOOP NAME="BranchesLoop" --> > <!--TMPL_IF Name="selected"--> > <option value="branch:<!-- TMPL_VAR NAME="value" -->" selected="selected"><!-- TMPL_VAR NAME="branchname" --></option> > <!--TMPL_ELSE--> >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index 4bfcd0b..bf4e0db 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -140,10 +140,9 @@ if (C4::Context->preference('TagsEnabled')) { > #} > > # load the branches >-my $mybranch = ( C4::Context->preference('SearchMyLibraryFirst') && C4::Context->userenv && C4::Context->userenv->{branch} ) ? C4::Context->userenv->{branch} : ''; >+ > my $branches = GetBranches(); # used later in *getRecords, probably should be internalized by those functions after caching in C4::Branch is established > $template->param( >- branchloop => GetBranchesLoop($mybranch, 0), > searchdomainloop => GetBranchCategories(undef,'searchdomain'), > ); > >-- >1.5.6.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 5390
: 3388