+sub _setup_form_action_bar {
+ my ($self) = @_;
+
+ my $may_edit = $::auth->assert('part_service_assembly_edit', 'may fail');
+
+ for my $bar ($::request->layout->get('actionbar')) {
+ $bar->add(
+ combobox => [
+ action => [
+ t8('Save'),
+ call => [ 'kivi.Part.save' ],
+ disabled => !$may_edit ? t8('You do not have the permissions to access this function.') : undef,
+ ],
+ action => [
+ t8('Use as new'),
+ call => [ 'kivi.Part.use_as_new' ],
+ 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.')
+ : undef,
+ ],
+ ], # end of combobox "Save"
+
+ action => [
+ t8('Delete'),
+ call => [ 'kivi.Part.delete' ],
+ confirm => t8('Do you really want to delete this object?'),
+ disabled => !$self->part->id ? t8('This object has not been saved yet.')
+ : !$may_edit ? t8('You do not have the permissions to access this function.')
+ : !$self->part->orphaned ? t8('This object has already been used.')
+ : undef,
+ ],
+
+ 'separator',
+
+ action => [
+ t8('History'),
+ call => [ 'kivi.Part.open_history_popup' ],
+ disabled => !$self->part->id ? t8('This object has not been saved yet.')
+ : !$may_edit ? t8('You do not have the permissions to access this function.')
+ : undef,
+ ],
+ );
+ }
+}
+