X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/c4ba4f3e7cd337939308b57eee799b201bd78cb9..117fefacdfaf457a502b32bae2f0e10fd0e11414:/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 }); }