Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 6a75dc1c

Von Moritz Bunkus vor mehr als 7 Jahren hinzugefügt

  • ID 6a75dc1c3ddda3e78d77bc95ebdd72dbe5d858b1
  • Vorgänger d5b1d0b1
  • Nachfolger 461b3caf

ActionBar: Verwendung beim Massendruck von Lieferscheinen

Unterschiede anzeigen:

bin/mozilla/do.pl
376 376
    $bar->add(
377 377
      action => [
378 378
        t8('New invoice'),
379
        submit    => [ '#orders_form' ],
380
        checks    => [ [ 'kivi.check_if_entries_selected', '#orders_form tbody input[type=checkbox]' ] ],
379
        submit    => [ '#form', { action => 'invoice_multi' } ],
380
        checks    => [ [ 'kivi.check_if_entries_selected', '#form tbody input[type=checkbox]' ] ],
381 381
        accesskey => 'enter',
382 382
      ],
383
      action => [
384
        t8('Print'),
385
        call   => [ 'kivi.SalesPurchase.show_print_dialog', 'js:kivi.MassDeliveryOrderPrint.submitMultiOrders' ],
386
        checks => [ [ 'kivi.check_if_entries_selected', '#form tbody input[type=checkbox]' ] ],
387
      ],
383 388
    );
384 389
  }
385 390
}
......
659 664
  my $locale   = $main::locale;
660 665
  my $cgi      = $::request->{cgi};
661 666

  
662
  $::request->{layout}->use_javascript(map { "${_}.js" } qw(kivi.MassDeliveryOrderPrint));
667
  $::request->{layout}->use_javascript(map { "${_}.js" } qw(kivi.MassDeliveryOrderPrint kivi.SalesPurchase));
663 668
  ($form->{ $form->{vc} }, $form->{"$form->{vc}_id"}) = split(/--/, $form->{ $form->{vc} });
664 669

  
665 670
  report_generator_set_default_sort('transdate', 1);
......
801 806
      $form->{printer_id} = $pr->id;
802 807
  }
803 808

  
809
  my $print_options = SL::Helper::PrintOptions->get_print_options(
810
    options => {
811
      hide_language_id => 1,
812
      show_bothsided   => 1,
813
      show_headers     => 1,
814
    },
815
  );
816

  
804 817
  $report->set_options('top_info_text'        => join("\n", @options),
805 818
                       'raw_top_info_text'    => $form->parse_html_template('do/orders_top'),
806
                       'raw_bottom_info_text' => $form->parse_html_template('do/orders_bottom', { print_options => print_options(inline => 1,hide_language_id => 1) }),
819
                       'raw_bottom_info_text' => $form->parse_html_template('do/orders_bottom', { print_options => $print_options }),
807 820
                       'output_format'        => 'HTML',
808 821
                       'title'                => $form->{title},
809 822
                       'attachment_basename'  => $attachment_basename . strftime('_%Y%m%d', localtime time),
js/kivi.MassDeliveryOrderPrint.js
1 1
namespace('kivi.MassDeliveryOrderPrint', function(ns) {
2
    
2
  "use strict";
3

  
3 4
  ns.massConversionFinishProcess = function() {
4 5
    $('#mass_print_dialog').dialog('close');
5 6
  };
......
30 31
  };
31 32

  
32 33
  ns.submitMultiOrders = function () {
33
      $("#old_table_id").remove();
34
      var checkboxes = $('input[type=checkbox]').filter(function () { return  $(this).prop('checked'); });
35
      if (checkboxes.size() == 0) {
36
          alert(kivi.t8("No delievery orders selected, please set one checkbox!"));
37
          return false;
38
      }
39
      
40
      var tmpform = $("#report_table_id").clone();
41
      tmpform.hide();
42
      tmpform.attr('id',"old_table_id");
43
      tmpform.appendTo("#print_multi_id");
44
      return kivi.submit_ajax_form('controller.pl?action=MassDeliveryOrderPrint/mass_mdo_print',$('#print_multi_id'));
45
  };
46

  
47
  ns.setup = function() {
48
    $('#multi_all').checkall("input[name^='multi_id']");
49
    $('#print_multi_button').click(kivi.MassDeliveryOrderPrint.submitMultiOrders);
34
    return kivi.submit_ajax_form('controller.pl?action=MassDeliveryOrderPrint/mass_mdo_print', $('#form'));
50 35
  };
51 36
});
52

  
53
$(kivi.MassDeliveryOrderPrint.setup);
js/kivi.SalesPurchase.js
311 311
  this.print_record = function() {
312 312
    $('#print_dialog').dialog('close');
313 313

  
314
    kivi.submit_form_with_action('#form', $('#form').data('print-action'));
314
    var action = $('#form').data('print-action');
315
    if (action.match("^js:"))
316
      return kivi.run(action.substring(3));
317

  
318
    kivi.submit_form_with_action('#form', action);
315 319
  };
316 320

  
317 321
  this.show_print_dialog = function(print_action) {
js/locale/de.js
69 69
"More than one file selected, please set only one checkbox!":"Mehr als ein Element selektiert, bitte nur eine Box anklicken",
70 70
"No":"Nein",
71 71
"No article has been selected yet.":"Es wurde noch kein Artikel ausgewählt.",
72
"No delievery orders selected, please set one checkbox!":"Kein Lieferschein selektiert, bitte eine Box anklicken!",
73 72
"No delivery orders have been selected.":"Es wurden keine Lieferscheine ausgewählt.",
74 73
"No entries have been selected.":"Es wurden keine Einträge ausgewählt.",
75 74
"No file selected, please set one checkbox!":"Kein Element selektiert,bitte eine Box anklicken",
locale/de/all
1857 1857
  'No customer has been selected yet.' => 'Es wurde noch kein Kunde ausgewählt.',
1858 1858
  'No data was found.'          => 'Es wurden keine Daten gefunden.',
1859 1859
  'No default currency'         => 'Keine Standardwährung',
1860
  'No delievery orders selected, please set one checkbox!' => 'Kein Lieferschein selektiert, bitte eine Box anklicken!',
1861 1860
  'No delivery orders have been selected.' => 'Es wurden keine Lieferscheine ausgewählt.',
1862 1861
  'No delivery term has been created yet.' => 'Es wurden noch keine Lieferbedingungen angelegt',
1863 1862
  'No dunnings have been selected for printing.' => 'Es wurden keine Mahnungen zum Drucken ausgewählt.',
......
2218 2217
  'Print list'                  => 'Liste ausdrucken',
2219 2218
  'Print options'               => 'Druckoptionen',
2220 2219
  'Print record'                => 'Beleg drucken',
2221
  'Print selected'              => 'Drucken',
2222
  'Print selected delivery orders both sided' => 'Ausgewählte Lieferscheine (ggf beidseitig)',
2223 2220
  'Print template base file name' => 'Druckvorlagen-Basisdateiname',
2224 2221
  'Print templates'             => 'Druckvorlagen',
2225 2222
  'Print templates to use'      => 'Zu verwendende Druckvorlagen',
templates/webpages/do/orders_bottom.html
1
[% USE HTML %][%- USE T8 -%]
2
 <input type="hidden" name="action" value="invoice_multi">
3
 <input type="hidden" name="type" value="[% HTML.escape(type) %]">
4
 <input type="hidden" name="vc" value="[% HTML.escape(vc) %]">
5
 <input type="hidden" name="callback" value="[% HTML.escape(callback) %]">
6
 <input type="hidden" name="rowcount" value="[% HTML.escape(rowcount) %]">
1
[% USE HTML %][%- USE T8 -%][%- USE LxERP -%][%- USE P -%]
2
 [% P.hidden_tag("type", type) %]
3
 [% P.hidden_tag("vc", vc) %]
4
 [% P.hidden_tag("rowcount", rowcount) %]
5
 [% P.hidden_tag("callback", callback) %]
6

  
7
 <div id="print_options" class="hidden">
8
  [% print_options %]
9
 </div>
7 10
</form>
8
<form method="post" id="print_multi_id">
9
[% print_options %]
11

  
12
<div id="print_dialog" class="hidden">
13
 [%- PROCESS 'common/_print_dialog.html' %]
14
</div>
10 15
<div id="mass_print_dialog" style="display: none"></div>
11
<table  width="100%">
12
  <tr><td width="300px" align="right">[% 'Print selected delivery orders both sided' | $T8 %]</td>
13
      <td><input type="checkbox" name="bothsided" value="1">
14
<input type="hidden" name="type" value="[% HTML.escape(type) %]">
15
<input type="hidden" name="rowcount" value="[% HTML.escape(rowcount) %]">
16
<input class="submit" type="button" name="action" id="print_multi_button" value="[% 'Print selected' | $T8 %]">
17
</td><td></td></tr></table></form>
templates/webpages/do/orders_top.html
1 1
[%- INCLUDE 'common/flash.html' %]
2
<form method="post" action="do.pl" id="orders_form">
2
<form method="post" action="do.pl" id="form">
templates/webpages/generic/print_options.html
46 46
      <input name="[%- name_prefix %]groupitems" id="[% id_prefix %]groupitems" type="checkbox" class="checkbox" [% groupitems_checked %]>
47 47
     </td>
48 48
     [%- END %]
49
     [%- IF display_bothsided %]
50
     <td id="print_options_input_bothsided">[%- IF !show_headers %][% 'Both-sided' | $T8 %][%- END %]
51
      <input name="[%- name_prefix %]bothsided" id="[% id_prefix %]bothsided" type="checkbox" class="checkbox" [% bothsided_checked %]>
52
     </td>
53
     [%- END %]
49 54
     [%- IF display_remove_draft %]
50 55
     <td id="print_options_input_remove_draft">[%- IF !show_headers %][% 'Remove Draft' | $T8 %][%- END %]
51 56
      <input name="[%- name_prefix %]remove_draft" id="[% id_prefix %]remove_draft" type="checkbox" class="checkbox" [% remove_draft_checked %]>

Auch abrufbar als: Unified diff