Revision 90a1b6fa
Von Werner Hahn vor mehr als 5 Jahren hinzugefügt
SL/Controller/Order.pm | ||
---|---|---|
32 | 32 |
use English qw(-no_match_vars); |
33 | 33 |
use File::Spec; |
34 | 34 |
use Cwd; |
35 |
use Sort::Naturally; |
|
35 | 36 |
|
36 | 37 |
use Rose::Object::MakeMethods::Generic |
37 | 38 |
( |
... | ... | |
909 | 910 |
my $method = $sort_keys{$::form->{order_by}}; |
910 | 911 |
my @to_sort = map { { old_pos => $_->position, order_by => $method->($_) } } @{ $self->order->items_sorted }; |
911 | 912 |
if ($::form->{sort_dir}) { |
912 |
@to_sort = sort { $a->{order_by} cmp $b->{order_by} } @to_sort;
|
|
913 |
@to_sort = sort { Sort::Naturally::ncmp($a->{order_by}, $b->{order_by} ) } @to_sort;
|
|
913 | 914 |
} else { |
914 |
@to_sort = sort { $b->{order_by} cmp $a->{order_by} } @to_sort;
|
|
915 |
@to_sort = sort { Sort::Naturally::ncmp($b->{order_by}, $a->{order_by} ) } @to_sort;
|
|
915 | 916 |
} |
916 | 917 |
$self->js |
917 | 918 |
->run('kivi.Order.redisplay_items', \@to_sort) |
Auch abrufbar als: Unified diff
OrderController: reorder mit Sort::Naturally damit nach Preis ordentlich
sortiert wird