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

(-)a/ill/ill-requests.pl (-25 / +20 lines)
Lines 86-99 if ( $backends_available ) { Link Here
86
        # Does this backend enable us to insert an availability stage and should
86
        # Does this backend enable us to insert an availability stage and should
87
        # we? If not, proceed as normal.
87
        # we? If not, proceed as normal.
88
        if (
88
        if (
89
            C4::Context->preference("ILLCheckAvailability") &&
90
            $request->_backend_capability(
91
                'should_display_availability',
92
                $params
93
            ) &&
94
            # If the user has elected to continue with the request despite
89
            # If the user has elected to continue with the request despite
95
            # having viewed availability info, this flag will be set
90
            # having viewed availability info, this flag will be set
96
            !$params->{checked_availability}
91
            C4::Context->preference("ILLCheckAvailability")
92
              && !$params->{checked_availability}
93
              && $request->_backend_capability( 'should_display_availability', $params )
97
        ) {
94
        ) {
98
            # Establish which of the installed availability providers
95
            # Establish which of the installed availability providers
99
            # can service our metadata
96
            # can service our metadata
Lines 292-316 if ( $backends_available ) { Link Here
292
289
293
            # Prepare availability searching, if required
290
            # Prepare availability searching, if required
294
            # Get the definition for the z39.50 plugin
291
            # Get the definition for the z39.50 plugin
295
            my $availability = Koha::Illrequest::Availability->new($request->metadata);
292
            if ( C4::Context->preference('ILLCheckAvailability') ) {
296
            my $services = $availability->get_services({
293
                my $availability = Koha::Illrequest::Availability->new($request->metadata);
297
                ui_context => 'partners',
294
                my $services = $availability->get_services({
298
                metadata => {
295
                    ui_context => 'partners',
299
                    name => 'ILL availability - z39.50'
296
                    metadata => {
297
                        name => 'ILL availability - z39.50'
298
                    }
299
                });
300
                # Only pass availability searching stuff to the template if
301
                # appropriate
302
                if ( scalar @{$services} > 0 ) {
303
                    my $metadata = $availability->prep_metadata($request->metadata);
304
                    $template->param( metadata => $metadata );
305
                    $template->param(
306
                        services_json => scalar encode_json($services)
307
                    );
308
                    $template->param( services => $services );
300
                }
309
                }
301
            });
302
            # Only pass availability searching stuff to the template if
303
            # appropriate
304
            if (
305
                C4::Context->preference('ILLCheckAvailability') &&
306
                scalar @{$services} > 0
307
            ) {
308
                my $metadata = $availability->prep_metadata($request->metadata);
309
                $template->param( metadata => $metadata );
310
                $template->param(
311
                    services_json => scalar encode_json($services)
312
                );
313
                $template->param( services => $services );
314
            }
310
            }
315
311
316
            $template->param( error => $params->{error} )
312
            $template->param( error => $params->{error} )
317
- 

Return to bug 23173