diff --git a/ill/ill-requests.pl b/ill/ill-requests.pl index 5902a68883..b388edadd0 100755 --- a/ill/ill-requests.pl +++ b/ill/ill-requests.pl @@ -170,6 +170,25 @@ if ($backends_available) { } elsif ( $op eq 'migrate' ) { # We're in the process of migrating a request + if ( $params->{auto_migrate} ) { + + my $confirm_auto = Koha::ILL::Request::Workflow::ConfirmAuto->new( $params, 'staff' ); + my $illrequest = Koha::ILL::Requests->find( $params->{illrequest_id} ); + my $extended_attributes_hash = + { map { $_->type => $_->value } $illrequest->extended_attributes->search->as_list }; + my $new_params = { %{ $illrequest->unblessed }, %$extended_attributes_hash }; + + $template->param( $confirm_auto->confirm_auto_template_params($new_params) ); + $template->param( + op => 'confirmautoill', + auto_migrate => 1, + request => $illrequest, + ); + + output_html_with_http_headers( $cgi, $cookie, $template->output ); + exit; + } + my $request = Koha::ILL::Requests->find( $params->{illrequest_id} ); my $backend_result; if ( $params->{backend} ) { 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 8912f21e61..aefc8642dd 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 @@ -503,7 +503,17 @@ [% END %] [% NEXT IF has_prefs_count < needs_prefs.size || has_perms_count < needs_perms.size || has_all_count < needs_all.size %] [% IF action.method == 'migrate' %] - [% IF backends.size > 2 %] + [% IF Koha.Preference('AutoILLBackendPriority') && backends.size > 1 %] + + + [% action.ui_method_name | html %] + + [% ELSIF backends.size > 2 %]