X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/ab7fb099670f2a534540661c6bcc2d6ab92599de..c75d178e3cb42a605b4498cc498532f007a7f0d7:/SL/Controller/Warehouse.pm diff --git a/SL/Controller/Warehouse.pm b/SL/Controller/Warehouse.pm index cfc84a667..33c8bfcdc 100644 --- a/SL/Controller/Warehouse.pm +++ b/SL/Controller/Warehouse.pm @@ -15,12 +15,7 @@ __PACKAGE__->run_before('check_auth'); sub action_reorder { my ($self) = @_; - my @ids = @{ $::form->{warehouse_id} || [] }; - my $result = SL::DB::Warehouse->new->db->do_transaction(sub { - foreach my $idx (0 .. scalar(@ids) - 1) { - SL::DB::Warehouse->new(id => $ids[$idx])->load->update_attributes(sortkey => $idx + 1); - } - }); + SL::DB::Warehouse->reorder_list(@{ $::form->{warehouse_id} || [] }); $self->render('1;', { type => 'js', inline => 1 }); }