8 use C4::RotatingCollections;
15 my $colId = $query->param('colId');
16 my $toBranch = $query->param('toBranch');
18 my ($template, $loggedinuser, $cookie)
19 = get_template_and_user({template_name => "rotating_collections/transferCollection.tmpl",
23 flagsrequired => {parameters => 1},
27 ## Transfer collection
28 my ( $success, $errorCode, $errorMessage );
30 ( $success, $errorCode, $errorMessage ) = TransferCollection( $colId, $toBranch );
33 $template->param( transferSuccess => 1 );
35 $template->param( transferFailure => 1,
36 errorCode => $errorCode,
37 errorMessage => $errorMessage
42 ## Set up the toBranch select options
43 my $branches = GetBranches();
45 foreach my $br (keys %$branches) {
48 $branch{name}=$branches->{$br}->{'branchname'};
49 push (@branchoptionloop, \%branch);
52 ## Get data about collection
53 my ( $colId, $colTitle, $colDesc, $colBranchcode ) = GetCollection( $colId );
55 intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
56 intranetstylesheet => C4::Context->preference("intranetstylesheet"),
57 IntranetNav => C4::Context->preference("IntranetNav"),
60 colTitle => $colTitle,
62 colBranchcode => $colBranchcode,
63 branchoptionloop => \@branchoptionloop
66 output_html_with_http_headers $query, $cookie, $template->output;