Revision 117fefac
Von Moritz Bunkus vor fast 12 Jahren hinzugefügt
SL/Controller/Unit.pm | ||
---|---|---|
15 | 15 |
sub action_reorder { |
16 | 16 |
my ($self) = @_; |
17 | 17 |
|
18 |
my @ids = @{ $::form->{unit_id} || [] }; |
|
19 |
my $result = SL::DB::Unit->new->db->do_transaction(sub { |
|
20 |
foreach my $idx (0 .. scalar(@ids) - 1) { |
|
21 |
SL::DB::Unit->new(id => $ids[$idx])->load->update_attributes(sortkey => $idx + 1); |
|
22 |
} |
|
23 |
}); |
|
18 |
SL::DB::Unit->reorder_list(@{ $::form->{unit_id} || [] }); |
|
24 | 19 |
|
25 | 20 |
$self->render('1;', { type => 'js', inline => 1 }); |
26 | 21 |
} |
Auch abrufbar als: Unified diff
ActsAsList: Neue Funktion "reorder_list"
Conflicts:
SL/Controller/ProjectType.pm