ActionBar: Verkaufsrechnungen: Drucken über Dialog implementiert
authorMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 11 Jan 2017 15:54:47 +0000 (16:54 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 28 Feb 2017 09:43:59 +0000 (10:43 +0100)
bin/mozilla/is.pl
js/kivi.SalesPurchase.js
templates/webpages/is/form_footer.html

index 4f7e9e4..6eae18e 100644 (file)
@@ -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,
         ],
index 0b09beb..3eae14e 100644 (file)
@@ -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: {
index 837cd46..23646f1 100644 (file)
 </script>
 
 <div id="shipto_dialog" class="hidden"></div>
+<div id="print_dialog" class="hidden">
+ [%- PROCESS 'common/_print_dialog.html' %]
+</div>