Lines 86-91
if ( $backends_available ) {
Link Here
|
86 |
); |
86 |
); |
87 |
handle_commit_maybe($backend_result, $request); |
87 |
handle_commit_maybe($backend_result, $request); |
88 |
|
88 |
|
|
|
89 |
} elsif ( $op eq 'migrate' ) { |
90 |
# We're in the process of migrating a request |
91 |
my $request = Koha::Illrequests->find($params->{illrequest_id}); |
92 |
my $backend_result; |
93 |
if ( $params->{backend} ) { |
94 |
my $new_request = Koha::Illrequest->new->load_backend( $params->{backend} ); |
95 |
$backend_result = $new_request->backend_migrate($params); |
96 |
$template->param( |
97 |
whole => $backend_result, |
98 |
request => $new_request |
99 |
); |
100 |
} |
101 |
else { |
102 |
$request = Koha::Illrequests->find( $params->{illrequest_id} ); |
103 |
$backend_result = $request->backend_migrate($params); |
104 |
$template->param( |
105 |
whole => $backend_result, |
106 |
request => $request |
107 |
); |
108 |
} |
109 |
handle_commit_maybe( $backend_result, $request ); |
110 |
|
89 |
} elsif ( $op eq 'confirm' ) { |
111 |
} elsif ( $op eq 'confirm' ) { |
90 |
# Backend 'confirm' method |
112 |
# Backend 'confirm' method |
91 |
# confirm requires a specific request, so first, find it. |
113 |
# confirm requires a specific request, so first, find it. |
Lines 287-302
output_html_with_http_headers( $cgi, $cookie, $template->output );
Link Here
|
287 |
|
309 |
|
288 |
sub handle_commit_maybe { |
310 |
sub handle_commit_maybe { |
289 |
my ( $backend_result, $request ) = @_; |
311 |
my ( $backend_result, $request ) = @_; |
|
|
312 |
|
290 |
# We need to special case 'commit' |
313 |
# We need to special case 'commit' |
291 |
if ( $backend_result->{stage} eq 'commit' ) { |
314 |
if ( $backend_result->{stage} eq 'commit' ) { |
292 |
if ( $backend_result->{next} eq 'illview' ) { |
315 |
if ( $backend_result->{next} eq 'illview' ) { |
|
|
316 |
|
293 |
# Redirect to a view of the newly created request |
317 |
# Redirect to a view of the newly created request |
294 |
print $cgi->redirect( |
318 |
print $cgi->redirect( '/cgi-bin/koha/ill/ill-requests.pl' |
295 |
'/cgi-bin/koha/ill/ill-requests.pl?method=illview&illrequest_id='. |
319 |
. '?method=illview' |
296 |
$request->id |
320 |
. '&illrequest_id=' |
297 |
); |
321 |
. $request->id ); |
298 |
exit; |
322 |
exit; |
299 |
} else { |
323 |
} |
|
|
324 |
elsif ( $backend_result->{next} eq 'emigrate' ) { |
325 |
|
326 |
# Redirect to a view of the newly created request |
327 |
print $cgi->redirect( '/cgi-bin/koha/ill/ill-requests.pl' |
328 |
. '?method=migrate' |
329 |
. '&stage=emigrate' |
330 |
. '&illrequest_id=' |
331 |
. $request->id ); |
332 |
exit; |
333 |
} |
334 |
else { |
300 |
# Redirect to a requests list view |
335 |
# Redirect to a requests list view |
301 |
redirect_to_list(); |
336 |
redirect_to_list(); |
302 |
} |
337 |
} |