X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FPaymentTerm.pm;h=b504bb7ad0897e5518c9cdfe53c881936ec45cc2;hb=95fde3c0a3871b0b9a4d9feaa10ae24b88bbb006;hp=631428edbe0a9d9dbbaa77678f144744edbeae03;hpb=5fd2cf413e611047a3b8d667378a258a7955941e;p=kivitendo-erp.git diff --git a/SL/Controller/PaymentTerm.pm b/SL/Controller/PaymentTerm.pm index 631428edb..b504bb7ad 100644 --- a/SL/Controller/PaymentTerm.pm +++ b/SL/Controller/PaymentTerm.pm @@ -13,7 +13,8 @@ use Rose::Object::MakeMethods::Generic scalar => [ qw(payment_term languages) ], ); -__PACKAGE__->run_before('load_payment_term', only => [ qw( edit update destroy move_up move_down) ]); +__PACKAGE__->run_before('check_auth'); +__PACKAGE__->run_before('load_payment_term', only => [ qw( edit update destroy) ]); __PACKAGE__->run_before('load_languages', only => [ qw(new list edit create update) ]); # @@ -64,16 +65,20 @@ sub action_destroy { $self->redirect_to(action => 'list'); } -sub action_move_up { +sub action_reorder { my ($self) = @_; - $self->{payment_term}->move_position_up; - $self->redirect_to(action => 'list'); + + SL::DB::PaymentTerm->reorder_list(@{ $::form->{payment_term_id} || [] }); + + $self->render(\'', { type => 'json' }); } -sub action_move_down { - my ($self) = @_; - $self->{payment_term}->move_position_down; - $self->redirect_to(action => 'list'); +# +# filters +# + +sub check_auth { + $::auth->assert('config'); } #