From: Moritz Bunkus Date: Fri, 13 Jan 2017 10:34:06 +0000 (+0100) Subject: ActionBar: Verwendung im Mahnprozess X-Git-Tag: release-3.5.4~1321 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=8a8629cf302fba798e79ed34e12853edc0e87ba4;p=kivitendo-erp.git ActionBar: Verwendung im Mahnprozess --- diff --git a/bin/mozilla/dn.pl b/bin/mozilla/dn.pl index c6c520e66..0ba9d3960 100644 --- a/bin/mozilla/dn.pl +++ b/bin/mozilla/dn.pl @@ -105,6 +105,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 +152,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 +309,7 @@ sub search { $form->{title} = $locale->text('Dunnings'); + setup_dn_search_action_bar(); $form->header(); print $form->parse_html_template("dunning/search"); @@ -449,8 +452,8 @@ sub show_dunning { $report->set_options_from_form(); - $::request->layout->add_javascripts("kivi.Dunning.js"); - $report->generate_with_headers(); + setup_dn_show_dunning_action_bar(); + $report->generate_with_headers(action_bar => 1); $main::lxdebug->leave_sub(); @@ -559,4 +562,71 @@ 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('Continue'), + 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('Continue'), + 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('Continue'), + 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!'), + ], + ); + } +} + # end of main diff --git a/js/kivi.Dunning.js b/js/kivi.Dunning.js index 6467ce463..6c05df91b 100644 --- a/js/kivi.Dunning.js +++ b/js/kivi.Dunning.js @@ -1,11 +1,5 @@ namespace('kivi.Dunning', function(ns) { - ns.check_invoice_selection = function() { - if ($('[name^=active_]:checked').length > 0) - return true; - - alert(kivi.t8('No invoices have been selected.')); - return false; - }; + "use strict"; ns.enable_disable_language_id = function() { $('select[name="language_id"]').prop('disabled', !$('#force_lang').prop('checked')); diff --git a/locale/de/all b/locale/de/all index 45bc4a31e..551a651b3 100755 --- a/locale/de/all +++ b/locale/de/all @@ -2969,7 +2969,6 @@ $self->{texts} = { 'The document has been changed by another user. No mail was sent. Please reopen it in another window and copy the changes to the new window' => 'Die Daten wurden bereits von einem anderen Benutzer verändert. Deshalb ist das Dokument ungültig und es wurde keine E-Mail verschickt. Bitte öffnen Sie das Dokument erneut in einem extra Fenster und übertragen Sie die Daten', 'The document has been changed by another user. Please reopen it in another window and copy the changes to the new window' => 'Die Daten wurden bereits von einem anderen Benutzer verändert. Deshalb ist das Dokument ungültig. Bitte öffnen Sie das Dokument erneut in einem extra Fenster und übertragen Sie die Daten', 'The documents have been sent to the printer \'#1\'.' => 'Die Dokumente sind zum Drucker \'#1\' geschickt', - 'The dunning process started' => 'Der Mahnprozess ist gestartet.', 'The dunnings have been printed.' => 'Die Mahnung(en) wurden gedruckt.', 'The email has been sent.' => 'Die E-Mail wurde verschickt.', 'The employee is missing.' => 'Der Bearbeiter fehlt.', diff --git a/templates/webpages/dunning/add.html b/templates/webpages/dunning/add.html index d4a18df54..ab1c44a28 100644 --- a/templates/webpages/dunning/add.html +++ b/templates/webpages/dunning/add.html @@ -2,7 +2,7 @@ [% USE HTML %]

[% title %]

-
+ @@ -60,10 +60,4 @@
- - - -
- -
diff --git a/templates/webpages/dunning/search.html b/templates/webpages/dunning/search.html index c70809493..b57bddb37 100644 --- a/templates/webpages/dunning/search.html +++ b/templates/webpages/dunning/search.html @@ -5,7 +5,7 @@ [% PROCESS 'common/flash.html' %] -
+ @@ -101,11 +101,4 @@
- - - -
- - -
diff --git a/templates/webpages/dunning/show_dunning_bottom.html b/templates/webpages/dunning/show_dunning_bottom.html index 135de5c1e..8f0632794 100644 --- a/templates/webpages/dunning/show_dunning_bottom.html +++ b/templates/webpages/dunning/show_dunning_bottom.html @@ -1,14 +1,2 @@ -[%- USE T8 %] -[%- USE HTML %] -[%- USE LxERP %] -[%- USE L %] - -

- [% 'Dunnings' | $T8 %]
- [% L.hidden_tag('action', 'dispatcher') %] - - [% L.submit_tag('action_delete', LxERP.t8('Delete'), confirm=LxERP.t8('This resets the dunning process for the selected invoices. Posted dunning invoices will not be changed!')) %] -

- diff --git a/templates/webpages/dunning/show_dunning_top.html b/templates/webpages/dunning/show_dunning_top.html index fbc7cfd47..403d832d9 100644 --- a/templates/webpages/dunning/show_dunning_top.html +++ b/templates/webpages/dunning/show_dunning_top.html @@ -1,5 +1,5 @@ [% USE HTML %][%- USE LxERP -%][%- USE L -%] -
+

[% LxERP.t8("Print options") %]

diff --git a/templates/webpages/dunning/show_invoices.html b/templates/webpages/dunning/show_invoices.html index db49d7e59..51fbb32b6 100644 --- a/templates/webpages/dunning/show_invoices.html +++ b/templates/webpages/dunning/show_invoices.html @@ -88,11 +88,4 @@ - - - - - -