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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc (+37 lines)
Lines 76-81 Link Here
76
                                </ul> <!-- / .dropdown-menu -->
76
                                </ul> <!-- / .dropdown-menu -->
77
                            </li> <!-- / .dropdown -->
77
                            </li> <!-- / .dropdown -->
78
                        [% END # / IF virtualshelves %]
78
                        [% END # / IF virtualshelves %]
79
80
                        [% IF Koha.Preference('SearchMyLibraryFirst') %]
81
                            <li class="divider-vertical set-search-first-library"></li>
82
                            <li class="dropdown set-search-first-library">
83
                                <a id="listmenu" class="dropdown-toggle" role="button" data-toggle="dropdown" href="#"</a>
84
                                    <i class="icon-home icon-white"></i>
85
                                    <span class="listslabel">
86
                                        [% IF ( mylibraryfirst ) %]
87
                                            [% FOREACH BranchesLoo IN BranchesLoop %]
88
                                                [% IF (BranchesLoo.selected) %]
89
                                                    [% BranchesLoo.branchname %]
90
                                                [% END %]
91
                                            [% END %]
92
                                        [% ELSE %]
93
                                            <span id="set-library-label-default">Libraries</span>
94
                                        [% END %]
95
                                    </span>
96
                                    <b class="caret"></b>
97
                                </a>
98
99
                                <ul class="dropdown-menu" role="menu">
100
                                    [% FOREACH BranchesLoo IN BranchesLoop %]
101
                                            [% IF (BranchesLoo.selected) %]<li class="active" role="presentation">[% ELSE %]<li role="presentation">[% END %]
102
                                                <a role="menuitem" tabindex="-1" href="/cgi-bin/koha/opac-setbranch.pl?newbranch=[% BranchesLoo.value %]">
103
                                                    [% BranchesLoo.branchname %]
104
                                                </a>
105
                                            </li>
106
                                    [% END %]
107
                                    <li role="presentation">
108
                                        <a role="menuitem" tabindex="-1" href="/cgi-bin/koha/opac-setbranch.pl" class="set-search-first-library-clear">
109
                                            <i class="icon-remove-circle"></i> Clear selection
110
                                        </a>
111
                                </ul>
112
                            </li>
113
                        [% END %]
114
115
79
                    </ul> <!-- / .nav -->
116
                    </ul> <!-- / .nav -->
80
                    [% IF Koha.Preference( 'virtualshelves' ) == 1 %]<div id="listsDetails"></div>[% END %]
117
                    [% IF Koha.Preference( 'virtualshelves' ) == 1 %]<div id="listsDetails"></div>[% END %]
81
                    [% IF Koha.Preference( 'opacuserlogin' ) == 1 || opaclanguagesdisplay || EnableOpacSearchHistory %]
118
                    [% IF Koha.Preference( 'opacuserlogin' ) == 1 || opaclanguagesdisplay || EnableOpacSearchHistory %]
(-)a/opac/opac-setbranch.pl (-1 / +41 lines)
Line 0 Link Here
0
- 
1
#!/usr/bin/perl
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it under the
6
# terms of the GNU General Public License as published by the Free Software
7
# Foundation; either version 3 of the License, or (at your option) any later
8
# version.
9
#
10
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License along with
15
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
16
# Suite 330, Boston, MA  02111-1307 USA
17
18
use Modern::Perl;
19
20
use CGI;
21
use C4::Auth qw/:DEFAULT get_session/;
22
23
my $input = new CGI;
24
25
my $cookie =~ m/CGISESSID=(\w*);.*/;
26
my $sessionID = $1;
27
my $session   = get_session($sessionID);
28
29
if ( $input->param('newbranch') ) {
30
    $session->param( 'mylibraryfirst', $input->param('newbranch') );
31
    $session->param( 'branch',         $input->param('newbranch') );
32
}
33
else {
34
    $session->param( 'mylibraryfirst', undef );
35
    $session->param( 'branch',         undef );
36
}
37
38
$session->flush;
39
40
print $input->redirect('/cgi-bin/koha/opac-main.pl');
41

Return to bug 15749