|
Lines 76-81
if ( $backends_available ) {
Link Here
|
| 76 |
); |
76 |
); |
| 77 |
handle_commit_maybe($backend_result, $request); |
77 |
handle_commit_maybe($backend_result, $request); |
| 78 |
|
78 |
|
|
|
79 |
} elsif ( $op eq 'migrate' ) { |
| 80 |
# We're in the process of migrating a request |
| 81 |
my $request = Koha::Illrequests->find($params->{illrequest_id}); |
| 82 |
my $backend_result; |
| 83 |
if ( $params->{backend} ) { |
| 84 |
my $new_request = Koha::Illrequest->new->load_backend( $params->{backend} ); |
| 85 |
$backend_result = $new_request->backend_migrate($params); |
| 86 |
$template->param( |
| 87 |
whole => $backend_result, |
| 88 |
request => $new_request |
| 89 |
); |
| 90 |
} |
| 91 |
else { |
| 92 |
$request = Koha::Illrequests->find( $params->{illrequest_id} ); |
| 93 |
$backend_result = $request->backend_migrate($params); |
| 94 |
$template->param( |
| 95 |
whole => $backend_result, |
| 96 |
request => $request |
| 97 |
); |
| 98 |
} |
| 99 |
handle_commit_maybe( $backend_result, $request ); |
| 100 |
|
| 79 |
} elsif ( $op eq 'confirm' ) { |
101 |
} elsif ( $op eq 'confirm' ) { |
| 80 |
# Backend 'confirm' method |
102 |
# Backend 'confirm' method |
| 81 |
# confirm requires a specific request, so first, find it. |
103 |
# confirm requires a specific request, so first, find it. |
|
Lines 256-271
output_html_with_http_headers( $cgi, $cookie, $template->output );
Link Here
|
| 256 |
|
278 |
|
| 257 |
sub handle_commit_maybe { |
279 |
sub handle_commit_maybe { |
| 258 |
my ( $backend_result, $request ) = @_; |
280 |
my ( $backend_result, $request ) = @_; |
|
|
281 |
|
| 259 |
# We need to special case 'commit' |
282 |
# We need to special case 'commit' |
| 260 |
if ( $backend_result->{stage} eq 'commit' ) { |
283 |
if ( $backend_result->{stage} eq 'commit' ) { |
| 261 |
if ( $backend_result->{next} eq 'illview' ) { |
284 |
if ( $backend_result->{next} eq 'illview' ) { |
|
|
285 |
|
| 262 |
# Redirect to a view of the newly created request |
286 |
# Redirect to a view of the newly created request |
| 263 |
print $cgi->redirect( |
287 |
print $cgi->redirect( '/cgi-bin/koha/ill/ill-requests.pl' |
| 264 |
'/cgi-bin/koha/ill/ill-requests.pl?method=illview&illrequest_id='. |
288 |
. '?method=illview' |
| 265 |
$request->id |
289 |
. '&illrequest_id=' |
| 266 |
); |
290 |
. $request->id ); |
| 267 |
exit; |
291 |
exit; |
| 268 |
} else { |
292 |
} |
|
|
293 |
elsif ( $backend_result->{next} eq 'emigrate' ) { |
| 294 |
|
| 295 |
# Redirect to a view of the newly created request |
| 296 |
print $cgi->redirect( '/cgi-bin/koha/ill/ill-requests.pl' |
| 297 |
. '?method=migrate' |
| 298 |
. '&stage=emigrate' |
| 299 |
. '&illrequest_id=' |
| 300 |
. $request->id ); |
| 301 |
exit; |
| 302 |
} |
| 303 |
else { |
| 269 |
# Redirect to a requests list view |
304 |
# Redirect to a requests list view |
| 270 |
redirect_to_list(); |
305 |
redirect_to_list(); |
| 271 |
} |
306 |
} |