X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FUnit.pm;h=fc1fa2e9da9247a5f0c173602857e479d061ec96;hb=7bc44f0f59f35d7d3b555e98ff9bb61c8ffbea0b;hp=018a7b387a998e0be7a465e01eb2b3e4e84b57a3;hpb=4791db863d4fa954318024ea1d79e62572ae2eb1;p=kivitendo-erp.git 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' }); } #