X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fdn.pl;h=c16f6c34c27464b94dea1f931d65422686cf1cf8;hb=8e99e751c3617f03dbbca3210b1bf127aceabb40;hp=c6c520e66d980764deca4738480215f7a88f635c;hpb=f3f2ec384d905c686df842ac7175d48792273487;p=kivitendo-erp.git diff --git a/bin/mozilla/dn.pl b/bin/mozilla/dn.pl index c6c520e66..c16f6c34c 100644 --- a/bin/mozilla/dn.pl +++ b/bin/mozilla/dn.pl @@ -84,6 +84,8 @@ sub edit_config { $form->{title} = $locale->text('Edit Dunning Process Config'); $form->{callback} ||= build_std_url("action=edit_config"); + setup_dn_edit_config_action_bar(); + $form->header(); print $form->parse_html_template("dunning/edit_config"); @@ -105,6 +107,8 @@ sub add { $form->{SHOW_DEPARTMENT_SELECTION} = $form->{all_departments} && scalar @{ $form->{all_departments} || [] }; $form->{title} = $locale->text('Start Dunning Process'); + + setup_dn_add_action_bar(); $form->header(); print $form->parse_html_template("dunning/add"); @@ -150,7 +154,7 @@ sub show_invoices { 'no_html' => 1, 'no_opendocument' => 1,); - $::request->layout->add_javascripts("kivi.Dunning.js"); + setup_dn_show_invoices_action_bar(); $form->header(); print $form->parse_html_template("dunning/show_invoices"); @@ -307,6 +311,7 @@ sub search { $form->{title} = $locale->text('Dunnings'); + setup_dn_search_action_bar(); $form->header(); print $form->parse_html_template("dunning/search"); @@ -449,7 +454,7 @@ sub show_dunning { $report->set_options_from_form(); - $::request->layout->add_javascripts("kivi.Dunning.js"); + setup_dn_show_dunning_action_bar(); $report->generate_with_headers(); $main::lxdebug->leave_sub(); @@ -559,4 +564,85 @@ sub dispatcher { $::form->error($::locale->text('No action defined.')); } + +sub setup_dn_add_action_bar { + my %params = @_; + + for my $bar ($::request->layout->get('actionbar')) { + $bar->add( + action => [ + t8('Search'), + submit => [ '#form', { action => "show_invoices" } ], + accesskey => 'enter', + ], + ); + } +} + +sub setup_dn_show_invoices_action_bar { + my %params = @_; + + for my $bar ($::request->layout->get('actionbar')) { + $bar->add( + action => [ + t8('Create'), + submit => [ '#form', { action => "save_dunning" } ], + checks => [ [ 'kivi.check_if_entries_selected', '[name^=active_]' ] ], + accesskey => 'enter', + only_once => 1, + ], + ); + } +} + +sub setup_dn_search_action_bar { + my %params = @_; + + for my $bar ($::request->layout->get('actionbar')) { + $bar->add( + action => [ + t8('Search'), + submit => [ '#form', { action => "show_dunning" } ], + accesskey => 'enter', + ], + ); + } +} + +sub setup_dn_show_dunning_action_bar { + my %params = @_; + + for my $bar ($::request->layout->get('actionbar')) { + $bar->add( + action => [ + t8('Print'), + submit => [ '#form', { action => "print_multiple" } ], + checks => [ [ 'kivi.check_if_entries_selected', '[name^=selected_]' ] ], + accesskey => 'enter', + ], + + action => [ + t8('Delete'), + submit => [ '#form', { action => "delete" } ], + checks => [ [ 'kivi.check_if_entries_selected', '[name^=selected_]' ] ], + confirm => $::locale->text('This resets the dunning process for the selected invoices. Posted dunning invoices will not be changed!'), + ], + ); + } +} + +sub setup_dn_edit_config_action_bar { + my %params = @_; + + for my $bar ($::request->layout->get('actionbar')) { + $bar->add( + action => [ + t8('Save'), + submit => [ '#form', { action => "save" } ], + accesskey => 'enter', + ], + ); + } +} + # end of main