X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FPriceFactor.pm;h=5f220cbe520bb8f7374369680371bf5f96dd95d4;hb=9dfd320ff258071e3ad78dd6cf2d76e215efd4f7;hp=31b376d2da7abc4aa204424c49690bec730d5366;hpb=48963f462b5fff937438ca93bcc537d78e454f30;p=kivitendo-erp.git diff --git a/SL/Controller/PriceFactor.pm b/SL/Controller/PriceFactor.pm index 31b376d2d..5f220cbe5 100644 --- a/SL/Controller/PriceFactor.pm +++ b/SL/Controller/PriceFactor.pm @@ -15,14 +15,9 @@ __PACKAGE__->run_before('check_auth'); sub action_reorder { my ($self) = @_; - my @ids = @{ $::form->{price_factor_id} || [] }; - my $result = SL::DB::PriceFactor->new->db->do_transaction(sub { - foreach my $idx (0 .. scalar(@ids) - 1) { - SL::DB::PriceFactor->new(id => $ids[$idx])->load->update_attributes(sortkey => $idx + 1); - } - }); - - $self->render('1;', { type => 'js', inline => 1 }); + SL::DB::PriceFactor->reorder_list(@{ $::form->{price_factor_id} || [] }); + + $self->render(\'', { type => 'json' }); } #