From 847bf18dad562a58991aefb4113640877b93f7a2 Mon Sep 17 00:00:00 2001 From: Paul POULAIN Date: Tue, 16 Oct 2007 16:02:45 -0500 Subject: [PATCH] SearchMyLibraryFirst : reintroducing behaviour (from 2.2) If the SearchMyLibraryFirst is set, then a logged user will automatically limit the search to it's own library. I also did some code cleaning Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- C4/Auth.pm | 3 +- .../opac-tmpl/prog/en/includes/masthead.inc | 6 ++- opac/opac-main.pl | 38 ------------------- 3 files changed, 7 insertions(+), 40 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index 6d792eaaf3..0d4e825fdc 100755 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -260,7 +260,7 @@ sub get_template_and_user { ); } else { - warn "template type should be OPAC, here it is=[" . $in->{'type'} . "]" unless ( $in->{'type'} eq 'opac' ); + warn "template type should be OPAC, here it is=[" . $in->{'type'} . "]" unless ( $in->{'type'} eq 'opac' ); my $LibraryNameTitle = C4::Context->preference("LibraryName"); $LibraryNameTitle =~ s/<(?:\/?)(?:br|p)\s*(?:\/?)>/ /sgi; $LibraryNameTitle =~ s/<(?:[^<>'"]|'(?:[^']*)'|"(?:[^"]*)")*>//sg; @@ -297,6 +297,7 @@ sub get_template_and_user { reviewson => C4::Context->preference("reviewson"), hide_marc => C4::Context->preference("hide_marc"), patronimages => C4::Context->preference("patronimages"), + mylibraryfirst => C4::Context->preference("SearchMyLibraryFirst"), "BiblioDefaultView".C4::Context->preference("BiblioDefaultView") => 1, ); } diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc index b375e2ccbc..1d4408b2f5 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc @@ -11,8 +11,12 @@