+ $bar->add(
+ action => [
+ t8('Update'),
+ submit => [ '#form', { action => "update" } ],
+ id => 'update_button',
+ checks => [ 'kivi.validate_form' ],
+ accesskey => 'enter',
+ ],
+
+ combobox => [
+ action => [
+ t8('Save'),
+ submit => [ '#form', { action => "save" } ],
+ checks => [ 'kivi.validate_form', @req_trans_cost_art, @warn_p_invoice ],
+ ],
+ action => [
+ t8('Save as new'),
+ submit => [ '#form', { action => "save_as_new" } ],
+ checks => [ 'kivi.validate_form', @req_trans_cost_art ],
+ disabled => !$form->{id} ? t8('This record has not been saved yet.') : undef,
+ ],
+ action => [
+ t8('Save and Close'),
+ submit => [ '#form', { action => "save_and_close" } ],
+ checks => [ 'kivi.validate_form', @req_trans_cost_art, @warn_p_invoice ],
+ ],
+ action => [
+ t8('Delete'),
+ submit => [ '#form', { action => "delete" } ],
+ confirm => t8('Do you really want to delete this object?'),
+ disabled => !$form->{id} ? t8('This record has not been saved yet.')
+ : ( ($params{is_sales_ord} && !$::instance_conf->get_sales_order_show_delete)
+ || ($params{is_pur_ord} && !$::instance_conf->get_purchase_order_show_delete)) ? t8('Deleting this type of record has been disabled in the configuration.')
+ : undef,
+ ],
+ ], # end of combobox "Save"
+
+ 'separator',
+
+ combobox => [
+ action => [ t8('Workflow') ],
+ action => [
+ t8('Sales Order'),
+ submit => [ '#form', { action => "sales_order" } ],
+ disabled => !$form->{id} ? t8('This record has not been saved yet.') : undef,
+ checks => [ 'kivi.validate_form' ],
+ only_if => $params{is_sales_quo} || $params{is_pur_ord},
+ ],
+ action => [
+ t8('Purchase Order'),
+ submit => [ '#form', { action => "purchase_order" } ],
+ disabled => !$form->{id} ? t8('This record has not been saved yet.') : undef,
+ checks => [ 'kivi.validate_form' ],
+ only_if => $params{is_sales_ord} || $params{is_req_quo},
+ ],
+ action => [
+ t8('Delivery Order'),
+ submit => [ '#form', { action => "delivery_order" } ],
+ disabled => !$form->{id} ? t8('This record has not been saved yet.') : undef,
+ checks => [ 'kivi.validate_form' ],
+ only_if => $params{is_sales_ord} || $params{is_pur_ord},
+ ],
+ action => [
+ t8('Invoice'),
+ submit => [ '#form', { action => "invoice" } ],
+ disabled => !$form->{id} ? t8('This record has not been saved yet.') : undef,
+ checks => [ 'kivi.validate_form' ],
+ only_if => $allow_invoice,
+ ],
+ action => [
+ t8('Quotation'),
+ submit => [ '#form', { action => "quotation" } ],
+ disabled => !$form->{id} ? t8('This record has not been saved yet.') : undef,
+ checks => [ 'kivi.validate_form' ],
+ only_if => $params{is_sales_ord},
+ ],
+ action => [
+ t8('Request for Quotation'),
+ submit => [ '#form', { action => "request_for_quotation" } ],
+ disabled => !$form->{id} ? t8('This record has not been saved yet.') : undef,
+ checks => [ 'kivi.validate_form' ],
+ only_if => $params{is_pur_ord},
+ ],
+ ], # end of combobox "Workflow"
+
+ combobox => [
+ action => [ t8('Export') ],
+ action => [
+ t8('Print'),
+ call => [ 'kivi.SalesPurchase.show_print_dialog' ],
+ checks => [ 'kivi.validate_form' ],
+ ],
+ action => [
+ t8('E Mail'),
+ call => [ 'kivi.SalesPurchase.show_email_dialog' ],
+ checks => [ 'kivi.validate_form' ],
+ ],
+ action => [
+ t8('Download attachments of all parts'),
+ call => [ 'kivi.File.downloadOrderitemsFiles', $::form->{type}, $::form->{id} ],
+ disabled => !$form->{id} ? t8('This record has not been saved yet.') : undef,
+ only_if => $::instance_conf->get_doc_storage,
+ ],
+ ], #end of combobox "Export"
+
+ combobox => [
+ action => [ t8('more') ],
+ action => [
+ t8('History'),
+ call => [ 'set_history_window', $form->{id} * 1, 'id' ],
+ disabled => !$form->{id} ? t8('This record has not been saved yet.') : undef,
+ ],
+ action => [
+ t8('Follow-Up'),
+ call => [ 'follow_up_window' ],
+ disabled => !$form->{id} ? t8('This record has not been saved yet.') : undef,
+ ],
+ ], # end of combobox "more"
+ );
+ }
+ $::request->layout->add_javascripts('kivi.Validator.js');
+}