]> wagnertech.de Git - kivitendo-erp.git/commitdiff
ActionBar: Verwendung im Mahnprozess
authorMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 13 Jan 2017 10:34:06 +0000 (11:34 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 28 Feb 2017 09:44:00 +0000 (10:44 +0100)
bin/mozilla/dn.pl
js/kivi.Dunning.js
locale/de/all
templates/webpages/dunning/add.html
templates/webpages/dunning/search.html
templates/webpages/dunning/show_dunning_bottom.html
templates/webpages/dunning/show_dunning_top.html
templates/webpages/dunning/show_invoices.html

index c6c520e66d980764deca4738480215f7a88f635c..0ba9d3960b91fad8c52f9764416eb50ef46faf13 100644 (file)
@@ -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
index 6467ce463c4bbfc5a7f42ef306d401b1e8a5bc8c..6c05df91b364933536ce1fb4f7eb8a3ddfd3bb4f 100644 (file)
@@ -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'));
index 45bc4a31ea1b911e7e681c774ff64754f555acff..551a651b34bd587793c32257996ef9d2a8d40d35 100755 (executable)
@@ -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.',
index d4a18df5405c7b517dda2d0dc595fbc7a747854d..ab1c44a28476d3a700a62617d60d2dc67c70d3c3 100644 (file)
@@ -2,7 +2,7 @@
 [% USE HTML %]<script type="text/javascript" src="js/common.js"></script>
 <h1>[% title %]</h1>
 
- <form method="post" name="search" action="dn.pl">
+ <form method="post" name="search" action="dn.pl" id="form">
 
   <table>
    <tr>
     <td><input type="checkbox" value="1" id="l_include_direct_debit" name="l_include_direct_debit"></td>
    </tr>
   </table>
-
-  <input type="hidden" name="nextsub" value="show_invoices">
-
-  <br>
-  <input class="submit" type="submit" name="action" value="[% 'Continue' | $T8 %]">
-
  </form>
index c70809493cbe6c41a39d89b15915bd11306d1bdb..b57bddb37dd0027981b8d9e1315acda97c980b9d 100644 (file)
@@ -5,7 +5,7 @@
 
 [% PROCESS 'common/flash.html' %]
 
- <form method="post" name="search" action="dn.pl">
+ <form method="post" name="search" action="dn.pl" id="form">
 
   <table width="100%">
    <tr>
     </td>
    </tr>
   </table>
-
-  <input type="hidden" name="nextsub" value="show_dunning">
-
-  <br>
-
-  <input class="submit" type="submit" name="action" value="[% 'Continue' | $T8 %]">
-
  </form>
index 135de5c1e5ef31da7b6e550068052e8b621a17be..8f06327948ca22379adf0d5bdb9d8cefad33e934 100644 (file)
@@ -1,14 +1,2 @@
-[%- USE T8 %]
-[%- USE HTML %]
-[%- USE LxERP %]
-[%- USE L %]
 <input type="hidden" name="rowcount" value="[% rowcount %]">
-
-  <p>
-   [% 'Dunnings' | $T8 %]<br>
-   [% L.hidden_tag('action', 'dispatcher') %]
-   <input type="submit" class="submit" name='action_print_multiple' value="[%- 'Print' | $T8 %]">
-   [% 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!')) %]
-  </p>
-
  </form>
index fbc7cfd4708420ac555ebef0d54f4e79b9ae1f93..403d832d94f9fd0975440682435763a70791852f 100644 (file)
@@ -1,5 +1,5 @@
 [% USE HTML %][%- USE LxERP -%][%- USE L -%]
- <form method="post" action="dn.pl">
+ <form method="post" action="dn.pl" id="form">
 
   <h2>[% LxERP.t8("Print options") %]</h2>
 
index db49d7e59deaed72f1ce16fd1c3b615968666ab1..51fbb32b6af192e5746f0292f87c14d657d58dc0 100644 (file)
   <input name="groupinvoices" type="hidden" value="[% HTML.escape(groupinvoices) %]">
 
   <input name="callback" type="hidden" value="[% HTML.escape(callback) %]">
-  <input name="nextsub" type="hidden" value="save_dunning">
-
-  <input type="hidden" name="action" value="[% 'Continue' | $T8 %]">
-
-  <input type="submit" name="dummy" value="[% 'Continue' | $T8 %]"
-         [% UNLESS DEBUG_DUNNING %]onclick="this.disabled=true; this.value='[% 'The dunning process started' | $T8 %]'; document.Form.submit()"[% END %]>
-
  </form>