Auth: DBUtils nicht den namespace vollmüllen lassen
[kivitendo-erp.git] / SL / Controller / ProjectType.pm
index facf1a8..e986924 100644 (file)
@@ -66,14 +66,9 @@ 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);
-    }
-  });
-
-  $self->render('1;', { type => 'js', inline => 1 });
+  SL::DB::ProjectType->reorder_list(@{ $::form->{project_type_id} || [] });
+
+  $self->render(\'', { type => 'json' });
 }
 
 #