From: Sven Schöling Date: Tue, 17 Dec 2013 13:35:59 +0000 (+0100) Subject: ActsAsList: Neue Funktion "reorder_list" auch für Projekttypen X-Git-Tag: release-3.1.0beta1~22^2~78 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=fbbbc3408edb8fee7e8afaf9c51fcebd8497d6eb;p=kivitendo-erp.git ActsAsList: Neue Funktion "reorder_list" auch für Projekttypen --- diff --git a/SL/Controller/ProjectType.pm b/SL/Controller/ProjectType.pm index facf1a810..89d8c902b 100644 --- a/SL/Controller/ProjectType.pm +++ b/SL/Controller/ProjectType.pm @@ -66,12 +66,7 @@ sub action_destroy { sub action_reorder { my ($self) = @_; - my @ids = @{ $::form->{project_type_id} || [] }; - my $result = SL::DB::ProjectType->new->db->do_transaction(sub { - foreach my $idx (0 .. scalar(@ids) - 1) { - SL::DB::ProjectType->new(id => $ids[$idx])->load->update_attributes(position => $idx + 1); - } - }); + SL::DB::ProjectType->reorder_list(@{ $::form->{project_type_id} || [] }); $self->render('1;', { type => 'js', inline => 1 }); }