Bugzilla – Attachment 78525 Details for
Bug 20640
Allow migrating a request between backends
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Commit reflecting changes in:
Commit-reflecting-changes-in.patch (text/plain), 6.56 KB, created by
Andrew Isherwood
on 2018-09-07 13:58:42 UTC
(
hide
)
Description:
Commit reflecting changes in:
Filename:
MIME Type:
Creator:
Andrew Isherwood
Created:
2018-09-07 13:58:42 UTC
Size:
6.56 KB
patch
obsolete
>From 67c5f81bf7d74b24adbab3ba7677faba17e15837 Mon Sep 17 00:00:00 2001 >From: Andrew Isherwood <andrew.isherwood@ptfs-europe.com> >Date: Thu, 3 May 2018 10:24:57 +0100 >Subject: [PATCH] Commit reflecting changes in: > >https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=74903&action=diff > >https://bugs.koha-community.org/show_bug.cgi?id=20640 >--- > Koha/Illrequest.pm | 16 ++++++++++++ > ill/ill-requests.pl | 29 ++++++++++++++++++++++ > .../prog/en/modules/ill/ill-requests.tt | 28 +++++++++++++++++++++ > 3 files changed, 73 insertions(+) > >diff --git a/Koha/Illrequest.pm b/Koha/Illrequest.pm >index 99b97bdbe4..fd086f88fe 100644 >--- a/Koha/Illrequest.pm >+++ b/Koha/Illrequest.pm >@@ -515,6 +515,22 @@ sub mark_completed { > }; > } > >+=head2 backend_migrate >+ >+Migrate a request from one backend to another. >+ >+=cut >+ >+sub backend_migrate { >+ my ( $self, $params ) = @_; >+ >+ my $response = $self->_backend->migrate({ >+ request => $self, >+ other => $params, >+ }); >+ return $self->expandTemplate($response); >+} >+ > =head2 backend_confirm > > Confirm a request. The backend handles setting of mandatory fields in the commit stage: >diff --git a/ill/ill-requests.pl b/ill/ill-requests.pl >index 47cfc97050..dde60d572d 100755 >--- a/ill/ill-requests.pl >+++ b/ill/ill-requests.pl >@@ -76,6 +76,28 @@ if ( $backends_available ) { > ); > handle_commit_maybe($backend_result, $request); > >+ } elsif ( $op eq 'migrate' ) { >+ # We're in the process of migrating a request >+ my $request = Koha::Illrequests->find($params->{illrequest_id}); >+ my $backend_result; >+ if ( $params->{backend} ) { >+ my $new_request = Koha::Illrequest->new->load_backend( $params->{backend} ); >+ $backend_result = $new_request->backend_migrate($params); >+ $template->param( >+ whole => $backend_result, >+ request => $new_request >+ ); >+ } >+ else { >+ $request = Koha::Illrequests->find( $params->{illrequest_id} ); >+ $backend_result = $request->backend_migrate($params); >+ $template->param( >+ whole => $backend_result, >+ request => $request >+ ); >+ } >+ handle_commit_maybe( $backend_result, $request ); >+ > } elsif ( $op eq 'confirm' ) { > # Backend 'confirm' method > # confirm requires a specific request, so first, find it. >@@ -265,6 +287,13 @@ sub handle_commit_maybe { > $request->id > ); > exit; >+ } elsif ( $backend_result->{next} eq 'emigrate' ) { >+ # Redirect to a view of the newly created request >+ print $cgi->redirect( >+ '/cgi-bin/koha/ill/ill-requests.pl?method=migrate&stage=emigrate&illrequest_id='. >+ $request->id >+ ); >+ exit; > } else { > # Redirect to a requests list view > redirect_to_list(); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt >index 8bc9268364..9cf7d89207 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt >@@ -494,6 +494,34 @@ > <a title="[% action.ui_method_name | html %]" id="ill-toolbar-btn-[% action.id | lower | html %]" class="btn btn-sm btn-default" href="/cgi-bin/koha/ill/ill-requests.pl?method=[% action.method | html %]&illrequest_id=[% request.illrequest_id | html %]"> > <span class="fa [% action.ui_method_icon | html %]"></span> > [% action.ui_method_name | html %] >+ [% ELSIF action.method == 'migrate' %] >+ [% IF backends.size > 2 %] >+ <div class="dropdown btn-group"> >+ <button class="btn btn-sm btn-default dropdown-toggle" type="button" id="ill-migrate-dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"> >+ <i class="fa [% action.ui_method_icon | html %]"></i> [% action.ui_method_name | html %] <span class="caret"></span> >+ </button> >+ <ul class="dropdown-menu" aria-labelledby="ill-migrate-dropdown"> >+ [% FOREACH backend IN backends %] >+ [% IF backend != request.backend %] >+ <li><a href="/cgi-bin/koha/ill/ill-requests.pl?method=[% action.method | html %]&illrequest_id=[% request.illrequest_id | html %]&backend=[% backend | html%]">[% backend | html %]</a></li> >+ [% END %] >+ [% END %] >+ </ul> >+ </div> >+ [% ELSIF backends.size == 2 %] >+ [% FOREACH backend IN backends %] >+ [% IF backend != request.backend %] >+ <a title="[% action.ui_method_name | html %]" id="ill-toolbar-btn-[% action.id | lower | html %]" class="btn btn-sm btn-default" href="/cgi-bin/koha/ill/ill-requests.pl?method=[% action.method | html %]&illrequest_id=[% request.illrequest_id | html %]"> >+ <span class="fa [% action.ui_method_icon | html %]"></span> >+ [% action.ui_method_name | html %] >+ </a> >+ [% END %] >+ [% END %] >+ [% END %] >+ [% ELSIF action.method != 0 %] >+ <a title="[% action.ui_method_name | html %]" id="ill-toolbar-btn-[% action.id | lower | html %]" class="btn btn-sm btn-default" href="/cgi-bin/koha/ill/ill-requests.pl?method=[% action.method | html %]&illrequest_id=[% request.illrequest_id | html %]"> >+ <span class="fa [% action.ui_method_icon | html %]"></span> >+ [% action.ui_method_name | html %] > </a> > [% END %] > [% END %] >-- >2.11.0
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 20640
:
74903
|
75430
|
75431
|
78525
|
79508
|
79571
|
79597
|
80900
|
81826
|
81827
|
83777
|
83778
|
83779
|
83797
|
83798
|
83799
|
83800
|
83801
|
83803
|
83805
|
83806
|
83807
|
83808
|
83809
|
83810