Revision fbbbc340
Von Sven Schöling vor fast 11 Jahren hinzugefügt
SL/Controller/ProjectType.pm | ||
---|---|---|
66 | 66 |
sub action_reorder { |
67 | 67 |
my ($self) = @_; |
68 | 68 |
|
69 |
my @ids = @{ $::form->{project_type_id} || [] }; |
|
70 |
my $result = SL::DB::ProjectType->new->db->do_transaction(sub { |
|
71 |
foreach my $idx (0 .. scalar(@ids) - 1) { |
|
72 |
SL::DB::ProjectType->new(id => $ids[$idx])->load->update_attributes(position => $idx + 1); |
|
73 |
} |
|
74 |
}); |
|
69 |
SL::DB::ProjectType->reorder_list(@{ $::form->{project_type_id} || [] }); |
|
75 | 70 |
|
76 | 71 |
$self->render('1;', { type => 'js', inline => 1 }); |
77 | 72 |
} |
Auch abrufbar als: Unified diff
ActsAsList: Neue Funktion "reorder_list" auch für Projekttypen