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

(-)a/C4/Context.pm (-2 / +11 lines)
Lines 1145-1150 sub mybranch { Link Here
1145
    C4::Context->userenv           or return '';
1145
    C4::Context->userenv           or return '';
1146
    return C4::Context->userenv->{branch} || '';
1146
    return C4::Context->userenv->{branch} || '';
1147
}
1147
}
1148
1149
=head2 only_my_library
1150
1151
    my $test = C4::Context->only_my_library;
1152
1153
    Returns true if you enabled IndependentBranches and the current user
1154
    does not have superlibrarian permissions.
1155
1156
=cut
1157
1148
sub only_my_library {
1158
sub only_my_library {
1149
    return
1159
    return
1150
         C4::Context->preference('IndependentBranches')
1160
         C4::Context->preference('IndependentBranches')
Lines 1153-1161 sub only_my_library { Link Here
1153
      && C4::Context->userenv->{branch};
1163
      && C4::Context->userenv->{branch};
1154
}
1164
}
1155
1165
1156
1157
1158
1;
1166
1;
1167
1159
__END__
1168
__END__
1160
1169
1161
=head1 ENVIRONMENT
1170
=head1 ENVIRONMENT
(-)a/Koha/Template/Plugin/Branches.pm (-4 lines)
Lines 55-64 sub GetURL { Link Here
55
    return $b->{branchurl};
55
    return $b->{branchurl};
56
}
56
}
57
57
58
sub OnlyMine {
59
    return C4::Branch::onlymine;
60
}
61
62
sub all {
58
sub all {
63
    my ( $self, $params ) = @_;
59
    my ( $self, $params ) = @_;
64
    my $selected = $params->{selected};
60
    my $selected = $params->{selected};
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt (-1 / +1 lines)
Lines 60-66 Link Here
60
   <div id="bd">
60
   <div id="bd">
61
    <div id="yui-main">
61
    <div id="yui-main">
62
    <div class="yui-b">
62
    <div class="yui-b">
63
[% IF !Branches.OnlyMine %]
63
[% IF !OnlyMine %]
64
    <form method="get" action="/cgi-bin/koha/tools/cleanborrowers.pl" id="selectlibrary">
64
    <form method="get" action="/cgi-bin/koha/tools/cleanborrowers.pl" id="selectlibrary">
65
    Select a library :
65
    Select a library :
66
        <select name="branch" id="branch" style="width:20em;">
66
        <select name="branch" id="branch" style="width:20em;">
(-)a/tools/cleanborrowers.pl (-1 / +1 lines)
Lines 80-85 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
80
80
81
my $branch = $params->{ branch } || '*';
81
my $branch = $params->{ branch } || '*';
82
$template->param( current_branch => $branch );
82
$template->param( current_branch => $branch );
83
$template->param( OnlyMine => C4::Context->only_my_library );
83
84
84
if ( $step == 2 ) {
85
if ( $step == 2 ) {
85
86
86
- 

Return to bug 15758