Lines 21-27
use Modern::Perl;
Link Here
|
21 |
use C4::Output; |
21 |
use C4::Output; |
22 |
use C4::Auth; |
22 |
use C4::Auth; |
23 |
use C4::Context; |
23 |
use C4::Context; |
24 |
use C4::RotatingCollections; |
|
|
25 |
|
24 |
|
26 |
use Koha::RotatingCollections; |
25 |
use Koha::RotatingCollections; |
27 |
|
26 |
|
Lines 32-37
my $query = new CGI;
Link Here
|
32 |
my $colId = $query->param('colId'); |
31 |
my $colId = $query->param('colId'); |
33 |
my $toBranch = $query->param('toBranch'); |
32 |
my $toBranch = $query->param('toBranch'); |
34 |
|
33 |
|
|
|
34 |
my $collection = Koha::RotatingCollections->find( $colId ); |
35 |
|
35 |
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
36 |
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
36 |
{ |
37 |
{ |
37 |
template_name => "rotating_collections/transferCollection.tt", |
38 |
template_name => "rotating_collections/transferCollection.tt", |
Lines 44-74
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Link Here
|
44 |
); |
45 |
); |
45 |
|
46 |
|
46 |
## Transfer collection |
47 |
## Transfer collection |
47 |
my ( $success, $errorCode, $errorMessage ); |
|
|
48 |
if ($toBranch) { |
48 |
if ($toBranch) { |
49 |
( $success, $errorCode, $errorMessage ) = |
49 |
my $transferred = eval ( $collection->transfer( $toBranch ) ); |
50 |
TransferCollection( $colId, $toBranch ); |
|
|
51 |
|
50 |
|
52 |
if ($success) { |
51 |
if ( $@ and not $transferred ) { |
|
|
52 |
$template->param( transferFailure => 1 ); |
53 |
} else { |
53 |
$template->param( transferSuccess => 1 ); |
54 |
$template->param( transferSuccess => 1 ); |
54 |
} |
55 |
} |
55 |
else { |
|
|
56 |
$template->param( |
57 |
transferFailure => 1, |
58 |
errorCode => $errorCode, |
59 |
errorMessage => $errorMessage |
60 |
); |
61 |
} |
62 |
} |
56 |
} |
63 |
|
57 |
|
64 |
## Get data about collection |
|
|
65 |
my $collection = Koha::RotatingCollections->find($colId); |
66 |
|
67 |
$template->param( |
58 |
$template->param( |
68 |
colId => $collection->colId, |
59 |
collection => $collection, |
69 |
colTitle => $collection->colTitle, |
|
|
70 |
colDesc => $collection->colDesc, |
71 |
colBranchcode => $collection->colBranchcode, |
72 |
); |
60 |
); |
73 |
|
61 |
|
74 |
output_html_with_http_headers $query, $cookie, $template->output; |
62 |
output_html_with_http_headers $query, $cookie, $template->output; |
75 |
- |
|
|