X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FPart.pm;h=061a532b5f60f73852eaedd16eeca06c7f2f87e8;hb=afd5395bfad1a84a590d567f8cb2d4e4967b16e3;hp=d2638fb7e53e437a0ff3d802f7a2ef4f493bdffc;hpb=2644d2a93d051b4040354c87c0410ebf494a15df;p=kivitendo-erp.git diff --git a/SL/Controller/Part.pm b/SL/Controller/Part.pm index d2638fb7e..061a532b5 100644 --- a/SL/Controller/Part.pm +++ b/SL/Controller/Part.pm @@ -160,6 +160,19 @@ sub action_save { } } +sub action_save_and_purchase_order { + my ($self) = @_; + + delete $::form->{previousform}; + $::form->{callback} = $self->url_for( + controller => 'Order', + action => 'return_from_create_part', + type => 'purchase_order', + ); + + $self->_run_action('save'); +} + sub action_abort { my ($self) = @_; @@ -1346,10 +1359,24 @@ sub _setup_form_action_bar { ], ], # end of combobox "Save" + combobox => [ + action => [ t8('Workflow') ], + action => [ + t8('Save and Purchase Order'), + submit => [ '#ic', { action => "Part/save_and_purchase_order" } ], + checks => ['kivi.validate_form'], + disabled => !$self->part->id ? t8('The object has not been saved yet.') + : !$may_edit ? t8('You do not have the permissions to access this function.') + : !$::auth->assert('purchase_order_edit', 'may fail') ? t8('You do not have the permissions to access this function.') + : undef, + only_if => !$::form->{inline_create}, + ], + ], + action => [ t8('Abort'), submit => [ '#ic', { action => "Part/abort" } ], - only_if => !!$::form->{show_abort}, + only_if => !!$::form->{inline_create}, ], action => [