X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/8893354909b940b99cb05e85e1964bfc5e805baa..90a1b6fad6aeeab84fc96d6511fdf42fff315df5:/SL/Controller/PriceFactor.pm diff --git a/SL/Controller/PriceFactor.pm b/SL/Controller/PriceFactor.pm index 31f0e46f1..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(type => 'js', inline => '1;'); + SL::DB::PriceFactor->reorder_list(@{ $::form->{price_factor_id} || [] }); + + $self->render(\'', { type => 'json' }); } #