From a6cf76a2874a723b04d508c99b30f7fd5a4f6573 Mon Sep 17 00:00:00 2001
From: Moritz Bunkus
Date: Fri, 11 Nov 2016 12:51:18 +0100
Subject: [PATCH] ActionBar: Verwendung in Berichtsfunktion in do.pl
---
bin/mozilla/do.pl | 37 +++++++++++++++++++++++-
js/kivi.DeliveryOrder.js | 10 +++++++
js/locale/de.js | 1 +
locale/de/all | 1 -
templates/webpages/do/orders_bottom.html | 11 ++-----
templates/webpages/do/orders_top.html | 2 +-
templates/webpages/do/search.html | 10 ++-----
7 files changed, 53 insertions(+), 19 deletions(-)
create mode 100644 js/kivi.DeliveryOrder.js
diff --git a/bin/mozilla/do.pl b/bin/mozilla/do.pl
index 778b816b5..8d57f0118 100644
--- a/bin/mozilla/do.pl
+++ b/bin/mozilla/do.pl
@@ -350,6 +350,35 @@ sub setup_do_action_bar {
}
}
+sub setup_do_search_action_bar {
+ my %params = @_;
+
+ for my $bar ($::request->layout->get('actionbar')) {
+ $bar->add(
+ action => [
+ t8('Search'),
+ submit => [ '#form' ],
+ accesskey => 'enter',
+ ],
+ );
+ }
+}
+
+sub setup_do_orders_action_bar {
+ my %params = @_;
+
+ for my $bar ($::request->layout->get('actionbar')) {
+ $bar->add(
+ action => [
+ t8('New invoice'),
+ submit => [ '#orders_form' ],
+ checks => [ 'kivi.DeliveryOrder.multi_invoice_check_delivery_orders_selected' ],
+ accesskey => 'enter',
+ ],
+ );
+ }
+}
+
sub form_header {
$main::lxdebug->enter_sub();
@@ -606,6 +635,8 @@ sub search {
$form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all;
$form->{title} = $locale->text('Delivery Orders');
+ setup_do_search_action_bar();
+
$form->header();
print $form->parse_html_template('do/search');
@@ -807,7 +838,11 @@ sub orders {
$idx++;
}
- $report->generate_with_headers();
+ $::request->layout->add_javascripts('kivi.DeliveryOrder.js');
+
+ setup_do_orders_action_bar();
+
+ $report->generate_with_headers(action_bar => 1);
$main::lxdebug->leave_sub();
}
diff --git a/js/kivi.DeliveryOrder.js b/js/kivi.DeliveryOrder.js
new file mode 100644
index 000000000..171b30e4d
--- /dev/null
+++ b/js/kivi.DeliveryOrder.js
@@ -0,0 +1,10 @@
+namespace('kivi.DeliveryOrder', function(ns) {
+ ns.multi_invoice_check_delivery_orders_selected = function() {
+ if ($('#orders_form tbody input[type=checkbox]:checked').length > 0)
+ return true;
+
+ alert(kivi.t8('You have not selected any delivery order.'));
+
+ return false;
+ };
+});
diff --git a/js/locale/de.js b/js/locale/de.js
index 8400ce1ea..113a5fa98 100644
--- a/js/locale/de.js
+++ b/js/locale/de.js
@@ -117,6 +117,7 @@ namespace("kivi").setupLocale({
"Update quotation/order":"Auftrag/Angebot aktualisieren",
"Version actions":"Aktionen für Versionen",
"Yes":"Ja",
+"You have not selected any delivery order.":"Sie haben keinen Lieferschein ausgewählt.",
"filename has not uploadable characters ":"Bitte Dateinamen ändern. Er hat für den Upload nicht verwendbare Sonderzeichen ",
"filesize too big: ":"Datei zu groÃ: ",
"flat-rate position":"Pauschalposition",
diff --git a/locale/de/all b/locale/de/all
index d056dd061..c1a3845e8 100755
--- a/locale/de/all
+++ b/locale/de/all
@@ -1297,7 +1297,6 @@ $self->{texts} = {
'Export Stammdaten' => 'Export Stammdaten',
'Export as CSV' => 'Als CSV exportieren',
'Export as PDF' => 'Als PDF exportieren',
- 'Export as PDF with attachments' => 'Als PDF mit Anhängen exportieren',
'Export date' => 'Exportdatum',
'Export date from' => 'Exportdatum von',
'Export date to' => 'Exportdatum bis',
diff --git a/templates/webpages/do/orders_bottom.html b/templates/webpages/do/orders_bottom.html
index be56ee235..be524f84e 100644
--- a/templates/webpages/do/orders_bottom.html
+++ b/templates/webpages/do/orders_bottom.html
@@ -1,15 +1,10 @@
-[%- USE T8 %]
-[% USE HTML %]
-
+
-
-
-
-
+
-
-
-
--
2.20.1