From 10852277fadcc965e883724a6e9b6fefc5026d8c Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 11 Jan 2017 16:54:47 +0100 Subject: [PATCH] =?utf8?q?ActionBar:=20Verkaufsrechnungen:=20Drucken=20?= =?utf8?q?=C3=BCber=20Dialog=20implementiert?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- bin/mozilla/is.pl | 2 +- js/kivi.SalesPurchase.js | 6 ++++-- templates/webpages/is/form_footer.html | 3 +++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 4f7e9e410..6eae18e39 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -339,7 +339,7 @@ sub setup_is_action_bar { action => [ t8('Export') ], action => [ ($form->{id} ? t8('Print') : t8('Preview')), - submit => [ '#form', { action => "print" } ], + call => [ 'kivi.SalesPurchase.show_print_dialog', $form->{id} ? 'print' : 'preview' ], checks => [ @req_trans_desc ], disabled => !$form->{id} && $form->{locked} ? t8('The billing period has already been locked.') : undef, ], diff --git a/js/kivi.SalesPurchase.js b/js/kivi.SalesPurchase.js index 0b09bebf8..3eae14e94 100644 --- a/js/kivi.SalesPurchase.js +++ b/js/kivi.SalesPurchase.js @@ -303,10 +303,12 @@ namespace('kivi.SalesPurchase', function(ns) { this.print_record = function() { $('#print_dialog').dialog('close'); - kivi.submit_form_with_action('#form', 'print'); + kivi.submit_form_with_action('#form', $('#form').data('print-action')); }; - this.show_print_dialog = function() { + this.show_print_dialog = function(print_action) { + $('#form').data('print-action', print_action || 'print'); + kivi.popup_dialog({ id: 'print_dialog', dialog: { diff --git a/templates/webpages/is/form_footer.html b/templates/webpages/is/form_footer.html index 837cd46dc..23646f105 100644 --- a/templates/webpages/is/form_footer.html +++ b/templates/webpages/is/form_footer.html @@ -166,3 +166,6 @@ + -- 2.20.1