Revision 117fefac
Von Moritz Bunkus vor fast 12 Jahren hinzugefügt
SL/Controller/Warehouse.pm | ||
---|---|---|
15 | 15 |
sub action_reorder { |
16 | 16 |
my ($self) = @_; |
17 | 17 |
|
18 |
my @ids = @{ $::form->{warehouse_id} || [] }; |
|
19 |
my $result = SL::DB::Warehouse->new->db->do_transaction(sub { |
|
20 |
foreach my $idx (0 .. scalar(@ids) - 1) { |
|
21 |
SL::DB::Warehouse->new(id => $ids[$idx])->load->update_attributes(sortkey => $idx + 1); |
|
22 |
} |
|
23 |
}); |
|
18 |
SL::DB::Warehouse->reorder_list(@{ $::form->{warehouse_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