Revision 886954dd
Von Sven Schöling vor fast 8 Jahren hinzugefügt
bin/mozilla/oe.pl | ||
---|---|---|
319 | 319 |
|
320 | 320 |
$TMPL_VAR{oe_obj} = $obj; |
321 | 321 |
} |
322 |
my $warn_save_active_periodic_invoice = $TMPL_VAR{warn_save_active_periodic_invoice}; |
|
322 | 323 |
|
323 | 324 |
$form->{defaultcurrency} = $form->get_default_currency(\%myconfig); |
324 | 325 |
|
... | ... | |
439 | 440 |
|
440 | 441 |
|
441 | 442 |
# original snippets: |
442 |
# 'data-require-transaction-description'=INSTANCE_CONF.get_require_transaction_description_ps |
|
443 |
# data-warn-save-active-periodic-invoice="1" if warn_save_active_periodic_invoice |
|
444 |
# tpca_reminder |
|
445 | 443 |
my $is_sales = scalar ($form->{type} =~ /^sales_/); # these vars are exported, so that the template |
446 | 444 |
my $is_order = scalar ($form->{type} =~ /_order$/); # may determine what to show |
447 | 445 |
my $is_sales_quo = scalar ($form->{type} =~ /sales_quotation$/); |
... | ... | |
449 | 447 |
my $is_sales_ord = scalar ($form->{type} =~ /sales_order$/); |
450 | 448 |
my $is_pur_ord = scalar ($form->{type} =~ /purchase_order$/); |
451 | 449 |
my $allow_invoice = $is_req_quo || $is_pur_ord || ($is_sales_quo && $::instance_conf->get_allow_sales_invoice_from_sales_quotation) || ($is_sales_ord && $::instance_conf->get_allow_sales_invoice_from_sales_order); |
450 |
my @req_trans_desc = qw(kivi.SalesPurchase.check_transaction_description) x!!$::instance_conf->get_require_transaction_description_ps; |
|
451 |
my @warn_p_invoice = qw(kivi.SalesPurchase.oe_warn_save_active_periodic_invoice) x!!$warn_save_active_periodic_invoice; |
|
452 | 452 |
|
453 | 453 |
my $tpca_remainder = 0; |
454 | 454 |
|
... | ... | |
459 | 459 |
$bar->add_actions("combobox"); |
460 | 460 |
$bar->actions->[-1]->add_actions([ t8('Save'), |
461 | 461 |
submit => [ '#form', { action_save => 1 } ], |
462 |
checks => [ qw(kivi.SalesPurchase.check_transaction_description) ],
|
|
462 |
checks => [ @req_trans_desc, @warn_p_invoice ],
|
|
463 | 463 |
confirm => t8('Missing transport cost: #1 Are you sure?', $tpca_remainder), |
464 |
# optional warn_save_active_periodic_invoice, |
|
465 | 464 |
]); |
466 | 465 |
$bar->actions->[-1]->add_actions([ t8('Save as new'), |
467 | 466 |
submit => [ '#form', { action_save_as_new => 1 } ], |
468 |
checks => [ qw(kivi.SalesPurchase.check_transaction_description) ],
|
|
467 |
checks => [ @req_trans_desc ],
|
|
469 | 468 |
disabled => !$::form->{id}, |
470 | 469 |
]); |
471 | 470 |
$bar->actions->[-1]->add_actions([ t8('Save and Close'), |
472 | 471 |
submit => [ '#form', { action_save_and_close => 1 } ], |
473 |
checks => [ qw(kivi.SalesPurchase.check_transaction_description) ],
|
|
472 |
checks => [ @req_trans_desc, @warn_p_invoice ],
|
|
474 | 473 |
confirm => t8('Missing transport cost: #1 Are you sure?', $tpca_remainder), |
475 |
# always, optional warn_save_active_periodic_invoice, |
|
476 | 474 |
]); |
477 | 475 |
$bar->add_actions([ t8('Delete'), |
478 | 476 |
submit => [ '#form', { action_delete => 1 } ], |
... | ... | |
480 | 478 |
|| ($is_sales_ord && !$::instance_conf->get_sales_order_show_delete) |
481 | 479 |
|| ($is_pur_ord && !$::instance_conf->get_purchase_order_show_delete), |
482 | 480 |
]); |
483 |
$bar->add_actions([undef, actions => [] ]); |
|
481 |
$bar->add_actions('separator'); |
|
482 |
$bar->add_actions('combobox'); |
|
483 |
$bar->actions->[-1]->add_actions([ t8('Workflow'), |
|
484 |
disabled => 1, |
|
485 |
]); |
|
484 | 486 |
$bar->actions->[-1]->add_actions([ t8('Sales Order'), |
485 | 487 |
submit => [ '#form', { action_sales_order => 1 } ], |
486 | 488 |
disabled => !$::form->{id}, |
... | ... | |
505 | 507 |
submit => [ '#form', { action_reqest_for_quotation => 1 } ], |
506 | 508 |
disabled => !$::form->{id} |
507 | 509 |
]); |
508 |
$bar->add_actions([ t8('Print'), |
|
510 |
$bar->add_actions('combobox'); |
|
511 |
$bar->actions->[-1]->add_actions([ t8('Export'), |
|
512 |
disabled => 1, |
|
513 |
]); |
|
514 |
$bar->actions->[-1]->add_actions([ t8('Print'), |
|
509 | 515 |
submit => [ '#form', { action_print => 1 } ], |
510 |
checks => [ qw(kivi.SalesPurchase.check_transaction_description) ],
|
|
516 |
checks => [ @req_trans_desc ],
|
|
511 | 517 |
]); |
512 |
$bar->add_actions([ t8('E Mail'), |
|
518 |
$bar->actions->[-1]->add_actions([ t8('E Mail'),
|
|
513 | 519 |
submit => [ '#form', { action_print => 1 } ], |
514 |
checks => [ qw(kivi.SalesPurchase.check_transaction_description) ],
|
|
520 |
checks => [ @req_trans_desc ],
|
|
515 | 521 |
]); |
516 | 522 |
$bar->add_actions([ t8('Ship to'), |
517 | 523 |
submit => [ '#form', { action_ship_to => 1 } ], |
518 | 524 |
]); |
519 |
$bar->add_actions([ t8('History'), |
|
520 |
function => [ 'set_history_window', $::form->{id} * 1, 'id' ], |
|
525 |
$bar->add_actions('combobox'); |
|
526 |
$bar->actions->[-1]->add_actions([ t8('more'), |
|
527 |
disabled => 1, |
|
528 |
]); |
|
529 |
$bar->actions->[-1]->add_actions([ t8('History'), |
|
530 |
call => [ 'set_history_window', $::form->{id} * 1, 'id' ], |
|
521 | 531 |
disabled => !$::form->{id}, |
522 | 532 |
]); |
523 |
$bar->add_actions([ t8('Follow-Up'), |
|
524 |
function => [ 'follow_up_window' ],
|
|
533 |
$bar->actions->[-1]->add_actions([ t8('Follow-Up'),
|
|
534 |
call => [ 'follow_up_window' ],
|
|
525 | 535 |
disabled => !$::form->{id}, |
526 | 536 |
]); |
527 | 537 |
} |
Auch abrufbar als: Unified diff
oe: neue syntax für scriptbuttons und separators