X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/fa515ecf51805775440941fa6d2b8fa55db772f0..7647d46:/SL/Controller/Unit.pm diff --git a/SL/Controller/Unit.pm b/SL/Controller/Unit.pm index 018a7b387..fc1fa2e9d 100644 --- a/SL/Controller/Unit.pm +++ b/SL/Controller/Unit.pm @@ -15,14 +15,9 @@ __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); - } - }); - - $self->render(type => 'js', inline => '1;'); + SL::DB::Unit->reorder_list(@{ $::form->{unit_id} || [] }); + + $self->render(\'', { type => 'json' }); } #