X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FWarehouse.pm;h=3f8b1528a3c5e104a9fab903bc78baeb13094cf9;hb=2b9a68bb2041ebde41a7c52db436efc8dde06350;hp=cfc84a667efc6d993a704275d0bc86cae66e29d9;hpb=ab7fb099670f2a534540661c6bcc2d6ab92599de;p=kivitendo-erp.git diff --git a/SL/Controller/Warehouse.pm b/SL/Controller/Warehouse.pm index cfc84a667..3f8b1528a 100644 --- a/SL/Controller/Warehouse.pm +++ b/SL/Controller/Warehouse.pm @@ -15,14 +15,9 @@ __PACKAGE__->run_before('check_auth'); sub action_reorder { my ($self) = @_; - my @ids = @{ $::form->{warehouse_id} || [] }; - my $result = SL::DB::Warehouse->new->db->do_transaction(sub { - foreach my $idx (0 .. scalar(@ids) - 1) { - SL::DB::Warehouse->new(id => $ids[$idx])->load->update_attributes(sortkey => $idx + 1); - } - }); - - $self->render('1;', { type => 'js', inline => 1 }); + SL::DB::Warehouse->reorder_list(@{ $::form->{warehouse_id} || [] }); + + $self->render(\'', { type => 'json' }); } #