projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Druckvorlagen Marei: Angezahlte Rechnungen nur bei der Schlußrechnung anzeigen
[kivitendo-erp.git]
/
SL
/
Controller
/
Part.pm
diff --git
a/SL/Controller/Part.pm
b/SL/Controller/Part.pm
index
70ff2f5
..
d2638fb
100644
(file)
--- a/
SL/Controller/Part.pm
+++ b/
SL/Controller/Part.pm
@@
-41,6
+41,9
@@
use Rose::Object::MakeMethods::Generic (
__PACKAGE__->run_before(sub { $::auth->assert('part_service_assembly_edit') },
except => [ qw(ajax_autocomplete part_picker_search part_picker_result) ]);
__PACKAGE__->run_before(sub { $::auth->assert('part_service_assembly_edit') },
except => [ qw(ajax_autocomplete part_picker_search part_picker_result) ]);
+__PACKAGE__->run_before(sub { $::auth->assert('developer') },
+ only => [ qw(test_page) ]);
+
__PACKAGE__->run_before('check_part_id', only => [ qw(edit delete) ]);
# actions for editing parts
__PACKAGE__->run_before('check_part_id', only => [ qw(edit delete) ]);
# actions for editing parts
@@
-125,11
+128,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 {
# $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(
$self->part->save(cascade => 1);
SL::DB::History->new(
@@
-162,9
+160,12
@@
sub action_save {
}
}
}
}
-sub action_
save_as_new
{
+sub action_
abort
{
my ($self) = @_;
my ($self) = @_;
- $self->action_save(save_as_new=>1);
+
+ if ( $::form->{callback} ) {
+ $self->redirect_to($::form->unescape($::form->{callback}));
+ }
}
sub action_delete {
}
sub action_delete {
@@
-708,7
+709,7
@@
sub add {
sub _set_javascript {
my ($self) = @_;
sub _set_javascript {
my ($self) = @_;
- $::request->layout->use_javascript("${_}.js") for qw(kivi.Part kivi.File kivi.PriceRule ckeditor/ckeditor ckeditor/adapters/jquery kivi.ShopPart);
+ $::request->layout->use_javascript("${_}.js") for qw(kivi.Part kivi.File kivi.PriceRule ckeditor/ckeditor ckeditor/adapters/jquery kivi.ShopPart
kivi.Validator
);
$::request->layout->add_javascripts_inline("\$(function(){kivi.PriceRule.load_price_rules_for_part(@{[ $self->part->id ]})});") if $self->part->id;
}
$::request->layout->add_javascripts_inline("\$(function(){kivi.PriceRule.load_price_rules_for_part(@{[ $self->part->id ]})});") if $self->part->id;
}
@@
-1099,7
+1100,7
@@
sub init_all_price_factors {
}
sub init_all_pricegroups {
}
sub init_all_pricegroups {
- SL::DB::Manager::Pricegroup->get_all_sorted;
+ SL::DB::Manager::Pricegroup->get_all_sorted
(query => [ obsolete => 0 ])
;
}
# model used to filter/display the parts in the multi-items dialog
}
# model used to filter/display the parts in the multi-items dialog
@@
-1334,6
+1335,7
@@
sub _setup_form_action_bar {
t8('Save'),
call => [ 'kivi.Part.save' ],
disabled => !$may_edit ? t8('You do not have the permissions to access this function.') : undef,
t8('Save'),
call => [ 'kivi.Part.save' ],
disabled => !$may_edit ? t8('You do not have the permissions to access this function.') : undef,
+ checks => ['kivi.validate_form'],
],
action => [
t8('Use as new'),
],
action => [
t8('Use as new'),
@@
-1344,6
+1346,12
@@
sub _setup_form_action_bar {
],
], # end of combobox "Save"
],
], # end of combobox "Save"
+ action => [
+ t8('Abort'),
+ submit => [ '#ic', { action => "Part/abort" } ],
+ only_if => !!$::form->{show_abort},
+ ],
+
action => [
t8('Delete'),
call => [ 'kivi.Part.delete' ],
action => [
t8('Delete'),
call => [ 'kivi.Part.delete' ],