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

(-)a/Koha/ILL/Request/Config.pm (+20 lines)
Lines 171-176 sub installed_backends { Link Here
171
    return [ grep { !/Standard/ } @{ $self->available_backends } ];
171
    return [ grep { !/Standard/ } @{ $self->available_backends } ];
172
}
172
}
173
173
174
=head3 opac_available_backends
175
176
Return a list of backends available in the OPAC
177
178
=cut
179
180
sub opac_available_backends {
181
    my ( $self, $loggedinuser ) = @_;
182
    my $reduced  = C4::Context->preference('ILLOpacbackends');
183
    my $backends = $self->available_backends($reduced);
184
    if ( !$loggedinuser && C4::Context->preference('ILLOpacUnauthenticatedRequest') ) {
185
        foreach my $backend ( @{$backends} ) {
186
            my $loaded_b = Koha::ILL::Request->new->load_backend($backend);
187
            @$backends = grep { !/$backend/ } @$backends
188
                if ( $loaded_b->_backend_capability('opac_unauthenticated_ill_requests') == 0 );
189
        }
190
    }
191
    return $backends;
192
}
193
174
=head3 has_branch
194
=head3 has_branch
175
195
176
Return whether a 'branch' block is defined
196
Return whether a 'branch' block is defined
(-)a/opac/opac-illrequests.pl (-4 / +2 lines)
Lines 58-68 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
58
);
58
);
59
59
60
# Are we able to actually work?
60
# Are we able to actually work?
61
my $reduced            = C4::Context->preference('ILLOpacbackends');
61
my $patron             = Koha::Patrons->find($loggedinuser);
62
my $backends           = Koha::ILL::Request::Config->new->available_backends($reduced);
62
my $backends           = Koha::ILL::Request::Config->new->opac_available_backends($patron);
63
my $backends_available = ( scalar @{$backends} > 0 );
63
my $backends_available = ( scalar @{$backends} > 0 );
64
$template->param( backends_available => $backends_available );
64
$template->param( backends_available => $backends_available );
65
my $patron = Koha::Patrons->find($loggedinuser);
66
65
67
my $op = Koha::ILL::Request->get_op_param_deprecation( 'opac', $params );
66
my $op = Koha::ILL::Request->get_op_param_deprecation( 'opac', $params );
68
67
69
- 

Return to bug 36197