Bugzilla – Attachment 66629 Details for
Bug 18837
Add an unmediated Interlibrary Loans workflow
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Introduce delegation to backends for unmediated workflows.
Introduce-delegation-to-backends-for-unmediated-wo.patch (text/plain), 2.48 KB, created by
Alex Sassmannshausen
on 2017-08-30 15:43:32 UTC
(
hide
)
Description:
Introduce delegation to backends for unmediated workflows.
Filename:
MIME Type:
Creator:
Alex Sassmannshausen
Created:
2017-08-30 15:43:32 UTC
Size:
2.48 KB
patch
obsolete
>From 53a20e3afbace8750258fc2110fa5c8b3b355f82 Mon Sep 17 00:00:00 2001 >From: Alex Sassmannshausen <alex.sassmannshausen@ptfs-europe.com> >Date: Wed, 21 Jun 2017 17:02:09 +0200 >Subject: [PATCH] Introduce delegation to backends for unmediated workflows. > >* Koha/Illrequest.pm (backend_create): Add dispatch. > >https://bugs.koha-community.org/show_bug.cgi?id=18837 >--- > Koha/Illrequest.pm | 33 ++++++++++++++------------------- > 1 file changed, 14 insertions(+), 19 deletions(-) > >diff --git a/Koha/Illrequest.pm b/Koha/Illrequest.pm >index d91be8e5b1..b2df69df40 100644 >--- a/Koha/Illrequest.pm >+++ b/Koha/Illrequest.pm >@@ -171,13 +171,15 @@ passing $args along with the invocation, and return its return value. > sub _backend_capability { > my ( $self, $name, $args ) = @_; > my $capability = 0; >+ # See if capability is defined in backend. > try { > $capability = $self->_backend->capabilities($name); > } catch { > return 0; > }; >- if ( $capability ) { >- return $capability($args); >+ # Try to invoke it. >+ if ( $capability && ref($capability) eq 'CODE' ) { >+ return &{$capability}($args); > } else { > return 0; > } >@@ -538,23 +540,16 @@ sub backend_create { > # ...Updating status! > $self->status('QUEUED')->store unless ( $permitted ); > >- # FIXME: Fix Unmediated ILLs! >- # Handle Unmediated ILLs >- # if ( C4::Context->preference("UnmediatedILL") && $permitted >- # # XXX: Why && result manual? >- # && $result->{manual} ) { >- # # FIXME: Also carry out privilege checks >- # my ( $response, $new_rq ) = $self->place_request; # WTF? >- # if ( $response ) { >- # $result->{value}->{request} = $new_rq; >- # return $result; >- # } else { >- # die "Placing the request failed."; >- # } >- # } else { >- # $result->{value}->{request} = $request; >- # return $result; >- # } >+ ## Handle Unmediated ILLs >+ >+ # For the unmediated workflow we only need to delegate to our backend. If >+ # that backend supports unmediateld_ill, it will do its thing and return a >+ # proper response. If it doesn't then _backend_capability returns 0, so >+ # we keep the current result. >+ if ( C4::Context->preference("ILLModuleUnmediated") && $permitted ) { >+ my $unmediated_result = $self->_backend_capability('unmediated_ill', $args); >+ $result = $unmediated_result if $unmediated_result; >+ } > > return $self->expandTemplate($result); > } >-- >2.13.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18837
:
66628
|
66629
|
74874
|
74875
|
79542
|
79543
|
82158
|
82159
|
82508
|
82509
|
86188
|
86189
|
86236
|
86237
|
86238
|
86371
|
86372
|
86373
|
86374
|
86375
|
86422
|
86423
|
86424
|
86425
|
86426