Revision 662b757f
Von Moritz Bunkus vor mehr als 13 Jahren hinzugefügt
SL/Controller/PaymentTerm.pm | ||
---|---|---|
64 | 64 |
$self->redirect_to(action => 'list'); |
65 | 65 |
} |
66 | 66 |
|
67 |
sub action_move_up {
|
|
67 |
sub action_reorder {
|
|
68 | 68 |
my ($self) = @_; |
69 |
$self->{payment_term}->move_position_up; |
|
70 |
$self->redirect_to(action => 'list'); |
|
71 |
} |
|
72 | 69 |
|
73 |
sub action_move_down { |
|
74 |
my ($self) = @_; |
|
75 |
$self->{payment_term}->move_position_down; |
|
76 |
$self->redirect_to(action => 'list'); |
|
70 |
my @ids = @{ $::form->{payment_term_id} || [] }; |
|
71 |
my $result = SL::DB::PaymentTerm->new->db->do_transaction(sub { |
|
72 |
foreach my $idx (0 .. scalar(@ids) - 1) { |
|
73 |
SL::DB::PaymentTerm->new(id => $ids[$idx])->load->update_attributes(sortkey => $idx + 1); |
|
74 |
} |
|
75 |
}); |
|
76 |
|
|
77 |
$self->render(type => 'js', inline => '1;'); |
|
77 | 78 |
} |
78 | 79 |
|
79 | 80 |
# |
Auch abrufbar als: Unified diff
Verwaltung von Zahlungsbedingungen auf Drag & Drop mit AJAX und jQuery UI Sortable umgestellt