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

(-)a/C4/Auth.pm (-3 / +1 lines)
Lines 145-151 See C<&checkauth> for an explanation of these parameters. Link Here
145
145
146
The C<template_name> is then used to find the correct template for
146
The C<template_name> is then used to find the correct template for
147
the page. The authenticated users details are loaded onto the
147
the page. The authenticated users details are loaded onto the
148
template in the HTML::Template LOOP variable C<USER_INFO>. Also the
148
template in the logged_in_user variable (which is a Koha::Patron object). Also the
149
C<sessionID> is passed to the template. This can be used in templates
149
C<sessionID> is passed to the template. This can be used in templates
150
if cookies are disabled. It needs to be put as and input to every
150
if cookies are disabled. It needs to be put as and input to every
151
authenticated page.
151
authenticated page.
Lines 285-292 sub get_template_and_user { Link Here
285
            );
285
            );
286
        }
286
        }
287
287
288
        $template->param( "USER_INFO" => $patron->unblessed ) if $borrowernumber != 0;
289
290
        my $all_perms = get_all_subpermissions();
288
        my $all_perms = get_all_subpermissions();
291
289
292
        my @flagroots = qw(circulate catalogue parameters borrowers permissions reserveforothers borrow
290
        my @flagroots = qw(circulate catalogue parameters borrowers permissions reserveforothers borrow
(-)a/C4/InstallAuth.pm (-1 / +1 lines)
Lines 96-102 InstallAuth - Authenticates Koha users for Install process Link Here
96
96
97
    The C<template_name> is then used to find the correct template for
97
    The C<template_name> is then used to find the correct template for
98
    the page. The authenticated users details are loaded onto the
98
    the page. The authenticated users details are loaded onto the
99
    template in the HTML::Template LOOP variable C<USER_INFO>. Also the
99
    template in the logged_in_user variable (which is a Koha::Patron object). Also the
100
    C<sessionID> is passed to the template. This can be used in templates
100
    C<sessionID> is passed to the template. This can be used in templates
101
    if cookies are disabled. It needs to be put as and input to every
101
    if cookies are disabled. It needs to be put as and input to every
102
    authenticated page.
102
    authenticated page.
(-)a/admin/aqbudgets.pl (-4 / +1 lines)
Lines 89-97 if ( $budget_period_id ) { Link Here
89
89
90
# ------- get periods stuff ------------------
90
# ------- get periods stuff ------------------
91
91
92
# USED FOR PERMISSION COMPARISON LATER
93
my $borrower_id         = $template->{VARS}->{'USER_INFO'}->{'borrowernumber'};
94
95
$template->param(
92
$template->param(
96
    show_mine   => $show_mine,
93
    show_mine   => $show_mine,
97
    op  => $op,
94
    op  => $op,
Lines 235-241 if ( $op eq 'list' ) { Link Here
235
    );
232
    );
236
233
237
    my @budgets = @{
234
    my @budgets = @{
238
        GetBudgetHierarchy( $$period{budget_period_id}, undef, ( $show_mine ? $borrower_id : 0 ))
235
        GetBudgetHierarchy( $$period{budget_period_id}, undef, ( $show_mine ? $borrowernumber : 0 ))
239
    };
236
    };
240
237
241
    my $period_total = 0;
238
    my $period_total = 0;
(-)a/admin/aqplan.pl (-4 / +8 lines)
Lines 84-91 $template->param( Link Here
84
84
85
# ------- get periods stuff ------------------
85
# ------- get periods stuff ------------------
86
86
87
my $borrower_id         = $template->{VARS}->{'USER_INFO'}->{'borrowernumber'};
87
88
my $borrower_branchcode = $template->{VARS}->{'USER_INFO'}->{'branchcode'};
88
my $borrower_branchcode = my $branch_code = C4::Context->userenv->{'branch'};
89
89
90
my $authcat      = $input->param('authcat');
90
my $authcat      = $input->param('authcat');
91
my $show_active  = $input->param('show_active') // 0;
91
my $show_active  = $input->param('show_active') // 0;
Lines 108-114 $authcat = 'Asort1' if not defined $authcat; # defaults to Asort if no authcat Link Here
108
my $budget_id = $input->param('budget_id');
108
my $budget_id = $input->param('budget_id');
109
my $op        = $input->param("op") // q{};
109
my $op        = $input->param("op") // q{};
110
110
111
my $budgets_ref = GetBudgetHierarchy( $budget_period_id, $show_mine?$template->{VARS}->{'USER_INFO'}->{'branchcode'}:'', $show_mine?$template->{VARS}->{'USER_INFO'}->{'borrowernumber'}:'' );
111
my $budgets_ref = GetBudgetHierarchy(
112
    $budget_period_id,
113
    $show_mine ? $borrower_branchcode : '',
114
    $show_mine ? $borrowernumber      : ''
115
);
112
116
113
# build categories list
117
# build categories list
114
my $sth = $dbh->prepare("select distinct category from authorised_values where category like 'A%' ");
118
my $sth = $dbh->prepare("select distinct category from authorised_values where category like 'A%' ");
Lines 315-321 foreach my $budget (@budgets) { Link Here
315
    if ( $period->{budget_period_locked} == 1 ) {
319
    if ( $period->{budget_period_locked} == 1 ) {
316
        $budget_lock = 1;
320
        $budget_lock = 1;
317
    } elsif ( $budget->{budget_permission} == 1 ) {
321
    } elsif ( $budget->{budget_permission} == 1 ) {
318
        $budget_lock = 1 if $borrower_id != $budget->{'budget_owner_id'};
322
        $budget_lock = 1 if $borrowernumber != $budget->{'budget_owner_id'};
319
    } elsif ( $budget->{budget_permission} == 2 ) {
323
    } elsif ( $budget->{budget_permission} == 2 ) {
320
        $budget_lock = 1 if $borrower_branchcode ne $budget->{budget_branchcode};
324
        $budget_lock = 1 if $borrower_branchcode ne $budget->{budget_branchcode};
321
    }
325
    }
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc (-5 / +5 lines)
Lines 620-626 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
620
            $( sel ).on( event, function (e) {
620
            $( sel ).on( event, function (e) {
621
                e.preventDefault();
621
                e.preventDefault();
622
                handler( e, Preferences.user[pref] );
622
                handler( e, Preferences.user[pref] );
623
                Preferences.Save( [% USER_INFO.borrowernumber %] );
623
                Preferences.Save( [% logged_in_user.borrowernumber %] );
624
                showPreference(pref);
624
                showPreference(pref);
625
            } );
625
            } );
626
        }
626
        }
Lines 645-651 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
645
                $( document ).on( 'change', 'input.search-toggle-server', function() {
645
                $( document ).on( 'change', 'input.search-toggle-server', function() {
646
                    var server_id = $( this ).closest('li').data('server-id');
646
                    var server_id = $( this ).closest('li').data('server-id');
647
                    Preferences.user.selected_search_targets[server_id] = this.checked;
647
                    Preferences.user.selected_search_targets[server_id] = this.checked;
648
                    Preferences.Save( [% USER_INFO.borrowernumber %] );
648
                    Preferences.Save( [% logged_in_user.borrowernumber %] );
649
                } );
649
                } );
650
                break;
650
                break;
651
        }
651
        }
Lines 683-689 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
683
            delete Preferences.user.macros[name];
683
            delete Preferences.user.macros[name];
684
        }
684
        }
685
685
686
        Preferences.Save( [% USER_INFO.borrowernumber %] );
686
        Preferences.Save( [% logged_in_user.borrowernumber %] );
687
    }
687
    }
688
688
689
    function showSavedMacros( macros ) {
689
    function showSavedMacros( macros ) {
Lines 980-986 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
980
        $( '#switch-editor' ).click( function() {
980
        $( '#switch-editor' ).click( function() {
981
            if ( !confirm( _("Any changes will not be saved. Continue?") ) ) return;
981
            if ( !confirm( _("Any changes will not be saved. Continue?") ) ) return;
982
982
983
            $.cookie( 'catalogue_editor_[% USER_INFO.borrowernumber %]', 'basic', { expires: 365, path: '/' } );
983
            $.cookie( 'catalogue_editor_[% logged_in_user.borrowernumber %]', 'basic', { expires: 365, path: '/' } );
984
984
985
            if ( state.backend == 'catalog' ) {
985
            if ( state.backend == 'catalog' ) {
986
                window.location = '/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=' + state.recordID;
986
                window.location = '/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=' + state.recordID;
Lines 1093-1099 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
1093
        };
1093
        };
1094
1094
1095
        // Start editor
1095
        // Start editor
1096
        Preferences.Load( [% USER_INFO.borrowernumber || 0 %] );
1096
        Preferences.Load( [% logged_in_user.borrowernumber || 0 %] );
1097
        displayPreferences(editor);
1097
        displayPreferences(editor);
1098
        makeAuthorisedValueWidgets( '' );
1098
        makeAuthorisedValueWidgets( '' );
1099
        Search.Init( {
1099
        Search.Init( {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt (-1 / +1 lines)
Lines 111-117 Link Here
111
111
112
            if ( !confirm( breedingid ? _("This record cannot be transferred to the advanced editor. Continue?") : _("Any changes will not be saved. Continue?") ) ) return false;
112
            if ( !confirm( breedingid ? _("This record cannot be transferred to the advanced editor. Continue?") : _("Any changes will not be saved. Continue?") ) ) return false;
113
113
114
            $.cookie( 'catalogue_editor_[% USER_INFO.borrowernumber %]', 'advanced', { expires: 365, path: '/' } );
114
            $.cookie( 'catalogue_editor_[% logged_in_user.borrowernumber %]', 'advanced', { expires: 365, path: '/' } );
115
115
116
            var biblionumber = [% biblionumber || "null" %];
116
            var biblionumber = [% biblionumber || "null" %];
117
117
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt (-1 / +1 lines)
Lines 236-242 Link Here
236
            });
236
            });
237
237
238
            $("#useadvanced").click(function(){
238
            $("#useadvanced").click(function(){
239
                $.cookie( 'catalogue_editor_[% USER_INFO.borrowernumber %]', 'advanced', { expires: 365, path: '/' } );
239
                $.cookie( 'catalogue_editor_[% logged_in_user.borrowernumber %]', 'advanced', { expires: 365, path: '/' } );
240
                return true;
240
                return true;
241
            });
241
            });
242
242
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc (-1 / +1 lines)
Lines 103-109 Link Here
103
                                        [% END %]
103
                                        [% END %]
104
                                    [% END %]
104
                                    [% END %]
105
                                    [% IF ( loggedinusername ) %]
105
                                    [% IF ( loggedinusername ) %]
106
                                        <li><p class="members navbar-text">Welcome, <a class="login-link" href="/cgi-bin/koha/opac-user.pl"><span class="loggedinusername" data-borrowernumber="[% USER_INFO.borrowernumber %]" data-branchcode="[% USER_INFO.branchcode %]" >[% USER_INFO.title %] [% USER_INFO.firstname %] [% USER_INFO.surname %]</span></a></p></li>
106
                                        <li><p class="members navbar-text">Welcome, <a class="login-link" href="/cgi-bin/koha/opac-user.pl"><span class="loggedinusername" data-borrowernumber="[% logged_in_user.borrowernumber %]" data-branchcode="[% logged_in_user.branchcode %]" >[% INCLUDE 'patron-title.inc' patron = logged_in_user no_html = 1 %]</span></a></p></li>
107
                                        <li class="divider-vertical"></li>
107
                                        <li class="divider-vertical"></li>
108
                                    [% END %]
108
                                    [% END %]
109
                                [% END %]
109
                                [% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadshelf.tt (-2 / +2 lines)
Lines 9-16 Link Here
9
        <div class="main">
9
        <div class="main">
10
            <ul class="breadcrumb">
10
            <ul class="breadcrumb">
11
                <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
11
                <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
12
                [% IF ( loggedinusername ) %]
12
                [% IF ( logged_in_user ) %]
13
                    <li><a href="/cgi-bin/koha/opac-user.pl">[% USER_INFO.title %] [% USER_INFO.firstname %] [% USER_INFO.surname %]</a> <span class="divider">&rsaquo;</span></li>
13
                    <li><a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a> <span class="divider">&rsaquo;</span></li>
14
                [% END %]
14
                [% END %]
15
                <li>
15
                <li>
16
                    [% IF shelf.category == 1 %]
16
                    [% IF shelf.category == 1 %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt (-2 / +2 lines)
Lines 16-23 Link Here
16
<div class="main">
16
<div class="main">
17
    <ul class="breadcrumb noprint">
17
    <ul class="breadcrumb noprint">
18
        <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
18
        <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
19
        [% IF ( loggedinusername ) %]
19
        [% IF ( logged_in_user ) %]
20
            <li><a href="/cgi-bin/koha/opac-user.pl">[% USER_INFO.title %] [% USER_INFO.firstname %] [% USER_INFO.surname %]</a> <span class="divider">&rsaquo;</span></li>
20
            <li><a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE patron-title.inc patron = logged_in_user %]</a> <span class="divider">&rsaquo;</span></li>
21
        [% END %]
21
        [% END %]
22
22
23
        [% IF method != 'list' %]
23
        [% IF method != 'list' %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt (-1 / +1 lines)
Lines 145-151 Link Here
145
                    [% ELSE %]
145
                    [% ELSE %]
146
                        [% IF Koha.Preference('OPACUserSummary') && dashboard_info %]
146
                        [% IF Koha.Preference('OPACUserSummary') && dashboard_info %]
147
                            <div id="user_summary">
147
                            <div id="user_summary">
148
                                <h3>Welcome, <a href="/cgi-bin/koha/opac-user.pl"><span class="loggedinusername">[% USER_INFO.title %] [% USER_INFO.firstname %] [% USER_INFO.surname %]</span></a></h3>
148
                                <h3>Welcome, <a href="/cgi-bin/koha/opac-user.pl"><span class="loggedinusername">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</span></a></h3>
149
                                <ul id="user_summary_shortcuts">
149
                                <ul id="user_summary_shortcuts">
150
                                    [% IF checkouts && checkouts > 0 %]
150
                                    [% IF checkouts && checkouts > 0 %]
151
                                        <li><a href="/cgi-bin/koha/opac-user.pl#opac-user-checkouts"><span class="user_checkouts_count count_label">[% checkouts %]</span> checkout(s)</a></li>
151
                                        <li><a href="/cgi-bin/koha/opac-user.pl#opac-user-checkouts"><span class="user_checkouts_count count_label">[% checkouts %]</span> checkout(s)</a></li>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt (-1 / +1 lines)
Lines 123-129 Link Here
123
123
124
                    [% UNLESS ( message ) %]
124
                    [% UNLESS ( message ) %]
125
                        [% UNLESS ( none_available ) %]
125
                        [% UNLESS ( none_available ) %]
126
                            <h3>Confirm holds for:[% USER_INFO.firstname %] [% USER_INFO.surname %] ([% USER_INFO.cardnumber %])</h3>
126
                            <h3>Confirm holds for:[% INCLUDE 'patron-title.inc' patron = logged_in_user %] ([% logged_in_user.cardnumber %])</h3>
127
                        [% END # / UNLESS none_available %]
127
                        [% END # / UNLESS none_available %]
128
128
129
                        [% IF (RESERVE_CHARGE) %]
129
                        [% IF (RESERVE_CHARGE) %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-search-history.tt (-1 / +1 lines)
Lines 13-19 Link Here
13
    <ul class="breadcrumb">
13
    <ul class="breadcrumb">
14
        <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
14
        <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
15
        [% IF ( loggedinusername ) %]
15
        [% IF ( loggedinusername ) %]
16
            <li><a href="/cgi-bin/koha/opac-user.pl">[% USER_INFO.firstname %] [% USER_INFO.surname %]</a> <span class="divider">&rsaquo;</span></li>
16
            <li><a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a> <span class="divider">&rsaquo;</span></li>
17
            <li><a href="#">Your search history</a></li>
17
            <li><a href="#">Your search history</a></li>
18
        [% ELSE %]
18
        [% ELSE %]
19
            <li><a href="#">Search history</a></li>
19
            <li><a href="#">Search history</a></li>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shareshelf.tt (-1 / +1 lines)
Lines 11-17 Link Here
11
    <ul class="breadcrumb">
11
    <ul class="breadcrumb">
12
        <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
12
        <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
13
        [% IF ( loggedinusername ) %]
13
        [% IF ( loggedinusername ) %]
14
            <li><a href="/cgi-bin/koha/opac-user.pl">[% USER_INFO.title %] [% USER_INFO.firstname %] [% USER_INFO.surname %]</a> <span class="divider">&rsaquo;</span></li>
14
            <li><a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a> <span class="divider">&rsaquo;</span></li>
15
        [% END %]
15
        [% END %]
16
        <li><a href="/cgi-bin/koha/opac-shelves.pl">Lists</a> <span class="divider">&rsaquo;</span></li>
16
        <li><a href="/cgi-bin/koha/opac-shelves.pl">Lists</a> <span class="divider">&rsaquo;</span></li>
17
        <li>Share a list</li>
17
        <li>Share a list</li>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt (-1 / +1 lines)
Lines 36-42 Link Here
36
    <ul class="breadcrumb noprint">
36
    <ul class="breadcrumb noprint">
37
        <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
37
        <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
38
        [% IF ( loggedinusername ) %]
38
        [% IF ( loggedinusername ) %]
39
            <li><a href="/cgi-bin/koha/opac-user.pl">[% USER_INFO.title %] [% USER_INFO.firstname %] [% USER_INFO.surname %]</a> <span class="divider">&rsaquo;</span></li>
39
            <li><a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a> <span class="divider">&rsaquo;</span></li>
40
        [% END %]
40
        [% END %]
41
41
42
        [% IF op != 'list' %]
42
        [% IF op != 'list' %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt (-2 / +1 lines)
Lines 16-22 Link Here
16
    <div class="main">
16
    <div class="main">
17
        <ul class="breadcrumb">
17
        <ul class="breadcrumb">
18
            <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
18
            <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
19
            <li><a href="/cgi-bin/koha/opac-user.pl">[% USER_INFO.title %] [% USER_INFO.firstname %] [% USER_INFO.surname %]</a> <span class="divider">&rsaquo;</span></li>
19
            <li><a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a> <span class="divider">&rsaquo;</span></li>
20
            <li><a href="#">Your purchase suggestions</a></li>
20
            <li><a href="#">Your purchase suggestions</a></li>
21
        </ul>
21
        </ul>
22
22
23
- 

Return to bug 21137