From fbbbc3408edb8fee7e8afaf9c51fcebd8497d6eb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Tue, 17 Dec 2013 14:35:59 +0100 Subject: [PATCH] =?utf8?q?ActsAsList:=20Neue=20Funktion=20"reorder=5Flist"?= =?utf8?q?=20auch=20f=C3=BCr=20Projekttypen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Controller/ProjectType.pm | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) 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 }); } -- 2.20.1