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

(-)a/C4/Auth.pm (-1 / +2 lines)
Lines 1154-1160 sub checkauth { Link Here
1154
                    my $ip = $ENV{'REMOTE_ADDR'};
1154
                    my $ip = $ENV{'REMOTE_ADDR'};
1155
1155
1156
                    # if they specify at login, use that
1156
                    # if they specify at login, use that
1157
                    if ( $query->param('branch') ) {
1157
                    my $patron = Koha::Patrons->find({userid => $userid});
1158
                    if ( $query->param('branch')  && ( haspermission($userid, {  'loggedinlibrary'=> 1 }) || $patron->is_superlibrarian ) ) {
1158
                        $branchcode = $query->param('branch');
1159
                        $branchcode = $query->param('branch');
1159
                        my $library = Koha::Libraries->find($branchcode);
1160
                        my $library = Koha::Libraries->find($branchcode);
1160
                        $branchname = $library? $library->branchname: '';
1161
                        $branchname = $library? $library->branchname: '';
(-)a/installer/data/mysql/atomicupdate/bug_30624_add_userflag.pl (+20 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "30624",
5
    description => "Add loggedinlibrary permission",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
        $dbh->do(q{
10
            INSERT IGNORE INTO userflags (bit, flag, flagdesc, defaulton) VALUES (29, 'loggedinlibrary', 'Allow staff to change logged in library', 0)
11
        });
12
13
        my $IndependentBranches = C4::Context->preference('IndependentBranches');
14
        unless ( $IndependentBranches ) {
15
            $dbh->do(q{
16
                UPDATE borrowers SET flags = flags + (2<<28) WHERE flags & 4;
17
           });
18
        }
19
    },
20
};
(-)a/installer/data/mysql/mandatory/userflags.sql (-1 / +2 lines)
Lines 25-29 INSERT INTO userflags (bit, flag, flagdesc, defaulton) VALUES Link Here
25
(25, 'cash_management', 'Cash management', 0),
25
(25, 'cash_management', 'Cash management', 0),
26
(26, 'problem_reports', 'Manage problem reports', 0),
26
(26, 'problem_reports', 'Manage problem reports', 0),
27
(27, 'recalls', 'Recalls', 0),
27
(27, 'recalls', 'Recalls', 0),
28
(28, 'erm', 'Manage electronic resources', 0)
28
(28, 'erm', 'Manage electronic resources', 0),
29
(29, 'loggedinlibrary', 'Change logged in library', 0)
29
;
30
;
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc (-2 / +1 lines)
Lines 2-8 Link Here
2
[% USE Branches %]
2
[% USE Branches %]
3
<div id="navmenu">
3
<div id="navmenu">
4
    <div id="navmenulist">
4
    <div id="navmenulist">
5
6
        <h5>Circulation</h5>
5
        <h5>Circulation</h5>
7
        <ul>
6
        <ul>
8
            <li>
7
            <li>
Lines 14-20 Link Here
14
            <li>
13
            <li>
15
                <a href="/cgi-bin/koha/circ/renew.pl">Renew</a>
14
                <a href="/cgi-bin/koha/circ/renew.pl">Renew</a>
16
            </li>
15
            </li>
17
            [% UNLESS IndependentBranches %]
16
            [% IF ( CAN_user_superlibrarian || CAN_user_loggedinlibrary ) %]
18
            <li>
17
            <li>
19
                [% IF Koha.Preference('UseCirculationDesks') %]
18
                [% IF Koha.Preference('UseCirculationDesks') %]
20
                <a href="/cgi-bin/koha/circ/set-library.pl">Set library and desk</a>
19
                <a href="/cgi-bin/koha/circ/set-library.pl">Set library and desk</a>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc (-1 / +1 lines)
Lines 157-163 Link Here
157
                        </li>
157
                        </li>
158
                    [% END %]
158
                    [% END %]
159
159
160
                    [% IF !( Koha.Preference('IndependentBranches') && !CAN_user_superlibrarian && !CAN_user_editcatalogue_edit_catalogue ) %]
160
                    [% IF ( CAN_user_superlibrarian || CAN_user_loggedinlibrary ) %]
161
                    <li role="separator" class="loggedin-menu-label divider"></li>
161
                    <li role="separator" class="loggedin-menu-label divider"></li>
162
                    <li>
162
                    <li>
163
                        [% IF Koha.Preference('UseCirculationDesks') && Koha.Preference('UseCashRegisters') %]
163
                        [% IF Koha.Preference('UseCirculationDesks') && Koha.Preference('UseCashRegisters') %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc (+3 lines)
Lines 81-86 Link Here
81
    [%- CASE 'erm' -%]
81
    [%- CASE 'erm' -%]
82
        <span class="main_permission erm_permission">Manage the electronic resources module</span>
82
        <span class="main_permission erm_permission">Manage the electronic resources module</span>
83
        <span class="permissioncode">([% name | html %])</span>
83
        <span class="permissioncode">([% name | html %])</span>
84
    [%- CASE 'loggedinlibrary' -%]
85
        <span class="main_permission loggedinlibrary_permission">Allow staff to change logged in library</span>
86
        <span class="permissioncode">([% name | html %])</span>
84
    [%- END -%]
87
    [%- END -%]
85
[%- END -%]
88
[%- END -%]
86
89
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt (-1 / +1 lines)
Lines 44-50 Link Here
44
                    <li>
44
                    <li>
45
                        <a class="circ-button" href="/cgi-bin/koha/circ/renew.pl"><i class="fa fa-retweet"></i> Renew</a>
45
                        <a class="circ-button" href="/cgi-bin/koha/circ/renew.pl"><i class="fa fa-retweet"></i> Renew</a>
46
                    </li>
46
                    </li>
47
                    [% UNLESS IndependentBranches %]
47
                    [% IF ( CAN_user_superlibrarian || CAN_user_loggedinlibrary ) %]
48
                        <li>
48
                        <li>
49
                            [% IF Koha.Preference('UseCirculationDesks') %]
49
                            [% IF Koha.Preference('UseCirculationDesks') %]
50
                            <a class="circ-button" href="/cgi-bin/koha/circ/set-library.pl"><i class="fa fa-home"></i> Set library and desk</a>
50
                            <a class="circ-button" href="/cgi-bin/koha/circ/set-library.pl"><i class="fa fa-home"></i> Set library and desk</a>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/set-library.tt (-2 / +1 lines)
Lines 84-90 Updated:<ul> Link Here
84
[% ELSE %]
84
[% ELSE %]
85
85
86
<form method="post" action="set-library.pl">
86
<form method="post" action="set-library.pl">
87
[% IF !( Koha.Preference('IndependentBranches') && !CAN_user_superlibrarian && !CAN_user_editcatalogue_edit_catalogue ) %]
87
[% IF ( CAN_user_superlibrarian || CAN_user_loggedinlibrary ) %]
88
<fieldset class="rows">
88
<fieldset class="rows">
89
    <legend>Set library</legend>
89
    <legend>Set library</legend>
90
    <ol>
90
    <ol>
91
- 

Return to bug 30624