@@ -, +, @@
---
.../opac-tmpl/bootstrap/en/includes/masthead.inc | 37 +++++++++++++++++++
opac/opac-setbranch.pl | 41 ++++++++++++++++++++++
2 files changed, 78 insertions(+)
create mode 100755 opac/opac-setbranch.pl
--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc
+++ a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc
@@ -76,6 +76,43 @@
[% END # / IF virtualshelves %]
+
+ [% IF Koha.Preference('SearchMyLibraryFirst') %]
+
+
+
+
+
+
+ [% END %]
+
+
[% IF Koha.Preference( 'virtualshelves' ) == 1 %][% END %]
[% IF Koha.Preference( 'opacuserlogin' ) == 1 || opaclanguagesdisplay || EnableOpacSearchHistory %]
--- a/opac/opac-setbranch.pl
+++ a/opac/opac-setbranch.pl
@@ -0,0 +1,41 @@
+#!/usr/bin/perl
+
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 3 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA 02111-1307 USA
+
+use Modern::Perl;
+
+use CGI;
+use C4::Auth qw/:DEFAULT get_session/;
+
+my $input = new CGI;
+
+my $cookie =~ m/CGISESSID=(\w*);.*/;
+my $sessionID = $1;
+my $session = get_session($sessionID);
+
+if ( $input->param('newbranch') ) {
+ $session->param( 'mylibraryfirst', $input->param('newbranch') );
+ $session->param( 'branch', $input->param('newbranch') );
+}
+else {
+ $session->param( 'mylibraryfirst', undef );
+ $session->param( 'branch', undef );
+}
+
+$session->flush;
+
+print $input->redirect('/cgi-bin/koha/opac-main.pl');
+
--