From: Sven Schöling Date: Fri, 21 Oct 2016 11:51:34 +0000 (+0200) Subject: is: actionbar implementiert. X-Git-Tag: release-3.5.4~1395 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=70d63c049b073f55f9cfb4176926db326f1952ae;p=kivitendo-erp.git is: actionbar implementiert. Änderungen: - post_and_[print/mail] sind wie geplant raus. - zurück ist raus - confirm bei mark as paid eingefügt - show_delete als Bedingung für post sieht falsch aus --- diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 00b99a774..b5ce917f9 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -359,6 +359,98 @@ sub form_header { $TMPL_VAR{payment_terms_obj} = get_payment_terms_for_invoice(); $form->{duedate} = $TMPL_VAR{payment_terms_obj}->calc_date(reference_date => $form->{invdate}, due_date => $form->{duedate})->to_kivitendo if $TMPL_VAR{payment_terms_obj}; + my @req_trans_desc = qw(kivi.SalesPurchase.check_transaction_description) x!!$::instance_conf->get_require_transaction_description_ps; + my $show_delete = ($::instance_conf->get_is_changeable == 2 && $form->current_date(\%myconfig) eq $form->{gldate}) + || $::instance_conf->get_is_changeable == 1; + + for my $bar ($::request->layout->get('actionbar')) { + $bar->add_actions([ t8('Update'), + submit => [ '#form', { action_update => 1 } ], + disabled => !$::form->{id} && $::form->{locked}, + ]); + $bar->add_actions("combobox"); + $bar->actions->[-1]->add_actions([ t8('Post'), + submit => [ '#form', { action_post => 1 } ], + checks => [ @req_trans_desc ], + disabled => (!$::form->{id} && $::form->{locked}) || !$show_delete || $::form->{storno}, + ]); + $bar->actions->[-1]->add_actions([ t8('Post Payment'), + submit => [ '#form', { action_post_payment => 1 } ], + checks => [ @req_trans_desc ], + disabled => !$::form->{id}, + ]); + $bar->actions->[-1]->add_actions([ t8('mark as paid'), + submit => [ '#form', { action_mark_as_paid => 1 } ], + confirm => t8('This will remove the invoice from showing as unpaid even if the unpaid amount does not match the amount. Proceed?'), + disabled => !$::form->{id}, + ]) if $::instance_conf->get_is_show_mark_as_paid; + + $bar->add_actions("combobox"); + $bar->actions->[-1]->add_actions([ t8('Storno'), + submit => [ '#form', { action_storno => 1 } ], + confirm => t8('Do you really want to cancel this invoice?'), + checks => [ @req_trans_desc ], + disabled => !$::form->{id}, + ]); + $bar->actions->[-1]->add_actions([ t8('Delete'), + submit => [ '#form', { action_delete => 1 } ], + confirm => t8('Do you really want to delete this object?'), + checks => [ @req_trans_desc ], + disabled => !$::form->{id}, + ]); + $bar->add_actions('separator'); + + $bar->add_actions('combobox'); + $bar->actions->[-1]->add_actions([ t8('Workflow'), + disabled => 1, + ]); + $bar->actions->[-1]->add_actions([ t8('Use As New'), + submit => [ '#form', { action_use_as_new => 1 } ], + disabled => !$::form->{id}, + ]); + $bar->actions->[-1]->add_actions([ t8('Credit Note'), + submit => [ '#form', { action_credit_note => 1 } ], + checks => [ @req_trans_desc ], + disabled => !$::form->{id} || $form->{type} eq "credit_note", + ]); + $bar->actions->[-1]->add_actions([ t8('Sales Order'), + submit => [ '#form', { action_sales_order => 1 } ], + disabled => !$::form->{id}, + ]); + + $bar->add_actions('combobox'); + $bar->actions->[-1]->add_actions([ t8('Export'), + disabled => 1, + ]); + $bar->actions->[-1]->add_actions([ ($::form->{id} ? t8('Print') : t8('Preview')), + submit => [ '#form', { action_print => 1 } ], + checks => [ @req_trans_desc ], + disabled => !$::form->{id} && $::form->{locked}, + ]); + $bar->actions->[-1]->add_actions([ t8('E Mail'), + submit => [ '#form', { action_print => 1 } ], + checks => [ @req_trans_desc ], + disabled => !$::form->{id}, + ]); + $bar->add_actions('combobox'); + $bar->actions->[-1]->add_actions([ t8('more'), + disabled => 1, + ]); + $bar->actions->[-1]->add_actions([ t8('History'), + call => [ 'set_history_window', $::form->{id} * 1, 'id' ], + disabled => !$::form->{id}, + ]); + $bar->actions->[-1]->add_actions([ t8('Follow-Up'), + call => [ 'follow_up_window' ], + disabled => !$::form->{id}, + ]); + $bar->actions->[-1]->add_actions([ t8('Drafts'), + call => [ 'kivi.Draft.popup', 'is', 'invoice', $::form->{draft_id}, $::form->{draft_description} ], + disabled => $::form->{id} || $::form->{locked}, + ]); + + } + $form->header(); print $form->parse_html_template("is/form_header", \%TMPL_VAR); diff --git a/templates/webpages/is/form_footer.html b/templates/webpages/is/form_footer.html index 1cb4a1836..80376da35 100644 --- a/templates/webpages/is/form_footer.html +++ b/templates/webpages/is/form_footer.html @@ -148,57 +148,6 @@

[% print_options %]

-
- - - [% IF id %] - - - - -[% IF show_storno %] - [% L.submit_tag("action_storno", LxERP.t8("Storno"), "data-require-transaction-description"=INSTANCE_CONF.get_require_transaction_description_ps, confirm=LxERP.t8('Do you really want to cancel this invoice?')) %] -[% END %] - - - -[% IF id && !is_type_credit_note %] - -[% END %] -[% IF show_delete && (!storno || storno_id) %] - [% L.submit_tag("action_delete", LxERP.t8("Delete"), confirm=LxERP.t8('Do you really want to delete this invoice?')) %] -[% END %] -[% IF show_delete && !storno %] - -[% END %] - - - - [% ELSE # no id %] - [% UNLESS locked %] - - - - - - - [% L.button_tag('kivi.Draft.popup("is", "invoice", "' _ draft_id _ '", "' _ draft_description _ '")', LxERP.t8('Drafts')) %] - [%- END %] - [% END # id %] - - [% IF id %] - [%#- button for saving history %] - - [% IF INSTANCE_CONF.get_is_show_mark_as_paid %] - [% L.submit_tag("action_mark_as_paid", LxERP.t8('mark as paid'), confirm=LxERP.t8('This will remove the invoice from showing as unpaid even if the unpaid amount does not match the amount. Proceed?')) %] - [% END %] - [% END %] - - [% IF callback %] - [% 'back' | $T8 %] - [% END %] -
- [% P.hidden_tag('draft_id', draft_id) %] diff --git a/templates/webpages/is/form_header.html b/templates/webpages/is/form_header.html index 1f8963991..18d6fb5d4 100644 --- a/templates/webpages/is/form_header.html +++ b/templates/webpages/is/form_header.html @@ -8,7 +8,7 @@ -
+ [%- FOREACH key = HIDDENS %] @@ -74,6 +74,7 @@ [% shiptos = [ [ "", LxERP.t8("No/individual shipping address") ] ] ; L.select_tag('shipto_id', shiptos.import(ALL_SHIPTO), default=shipto_id, value_key='shipto_id', title_key='displayable_id', style='width: 250px') %] + [%- END %]