X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FUnit.pm;h=fc1fa2e9da9247a5f0c173602857e479d061ec96;hb=7718459cd0be728a57d7ca75dd8077316df7d730;hp=72cd5ce71df9e65739fe6708c07a36ff42ac6216;hpb=48963f462b5fff937438ca93bcc537d78e454f30;p=kivitendo-erp.git diff --git a/SL/Controller/Unit.pm b/SL/Controller/Unit.pm index 72cd5ce71..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('1;', { type => 'js', inline => 1 }); + SL::DB::Unit->reorder_list(@{ $::form->{unit_id} || [] }); + + $self->render(\'', { type => 'json' }); } #