Revision fbbbc340
Von Sven Schöling vor mehr als 11 Jahren hinzugefügt
SL/Controller/ProjectType.pm | ||
---|---|---|
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 });
|
||
}
|
Auch abrufbar als: Unified diff
ActsAsList: Neue Funktion "reorder_list" auch für Projekttypen