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

(-)a/C4/Context.pm (-2 / +11 lines)
Lines 1035-1040 sub mybranch { Link Here
1035
    C4::Context->userenv           or return '';
1035
    C4::Context->userenv           or return '';
1036
    return C4::Context->userenv->{branch} || '';
1036
    return C4::Context->userenv->{branch} || '';
1037
}
1037
}
1038
1039
=head2 only_my_library
1040
1041
    my $test = C4::Context->only_my_library;
1042
1043
    Returns true if you enabled IndependentBranches and the current user
1044
    does not have superlibrarian permissions.
1045
1046
=cut
1047
1038
sub only_my_library {
1048
sub only_my_library {
1039
    return
1049
    return
1040
         C4::Context->preference('IndependentBranches')
1050
         C4::Context->preference('IndependentBranches')
Lines 1043-1051 sub only_my_library { Link Here
1043
      && C4::Context->userenv->{branch};
1053
      && C4::Context->userenv->{branch};
1044
}
1054
}
1045
1055
1046
1047
1048
1;
1056
1;
1057
1049
__END__
1058
__END__
1050
1059
1051
=head1 ENVIRONMENT
1060
=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