Bug 29809: (follow-up) Update tests and rename variable
[srvgit] / tools / stockrotation.pl
index da23c83..04ff184 100755 (executable)
 use Modern::Perl;
 use CGI;
 
-use C4::Auth;
+use C4::Auth qw( get_template_and_user );
 use C4::Context;
-use C4::Output;
+use C4::Output qw( output_html_with_http_headers );
 
 use Koha::Libraries;
 use Koha::StockRotationRotas;
 use Koha::StockRotationItems;
 use Koha::StockRotationStages;
 use Koha::Item;
-use Koha::Util::StockRotation qw(:ALL);
+use Koha::Util::StockRotation qw( get_branches get_stages move_to_next_stage toggle_indemand remove_from_stage add_items_to_rota get_barcodes_status );
 
-my $input = new CGI;
+my $input = CGI->new;
 
 unless (C4::Context->preference('StockRotation')) {
     # redirect to Intranet home if self-check is not enabled
@@ -55,7 +55,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
             tools => '*',
             stockrotation => '*',
         },
-        authnotrequired => 0
     }
 );
 
@@ -253,7 +252,7 @@ if (!defined $op) {
 
     # Get all items on this rota, for each prefetch their
     # stage and biblio objects
-    my $items = Koha::StockRotationItems->search(
+    my $sritems = Koha::StockRotationItems->search(
         { 'stage.rota_id' => $params{rota_id} },
         {
             prefetch => {
@@ -269,7 +268,7 @@ if (!defined $op) {
     $template->param(
         rota_id  => $params{rota_id},
         error    => $params{error},
-        items    => $items,
+        sritems  => $sritems,
         branches => get_branches(),
         stages   => get_stages($rota),
         rota     => $rota,