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