X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/f01ed5d1c0d1bed1d04005e004a785c6cf047233..a38da2a1b6f6a99dc5ccc19741b8ea2ae53027ae:/SL/Controller/Part.pm diff --git a/SL/Controller/Part.pm b/SL/Controller/Part.pm index 5a2d01233..3f7409e8b 100644 --- a/SL/Controller/Part.pm +++ b/SL/Controller/Part.pm @@ -125,11 +125,6 @@ sub action_save { # $self->part has been loaded, parsed and validated without errors and is ready to be saved $self->part->db->with_transaction(sub { - if ( $params{save_as_new} ) { - $self->part( $self->part->clone_and_reset_deep ); - $self->part->partnumber(undef); # will be assigned by _before_save_set_partnumber - }; - $self->part->save(cascade => 1); SL::DB::History->new( @@ -151,7 +146,6 @@ sub action_save { 1; }) or return $self->js->error(t8('The item couldn\'t be saved!') . " " . $self->part->db->error )->render; - ; flash_later('info', $is_new ? t8('The item has been created.') . " " . $self->part->displayable_name : t8('The item has been saved.')); if ( $::form->{callback} ) { @@ -163,9 +157,12 @@ sub action_save { } } -sub action_save_as_new { +sub action_abort { my ($self) = @_; - $self->action_save(save_as_new=>1); + + if ( $::form->{callback} ) { + $self->redirect_to($::form->unescape($::form->{callback})); + } } sub action_delete { @@ -1345,6 +1342,12 @@ sub _setup_form_action_bar { ], ], # end of combobox "Save" + action => [ + t8('Abort'), + submit => [ '#ic', { action => "Part/abort" } ], + only_if => !!$::form->{show_abort}, + ], + action => [ t8('Delete'), call => [ 'kivi.Part.delete' ],