Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 4a1b6455

Von Moritz Bunkus vor mehr als 7 Jahren hinzugefügt

  • ID 4a1b6455ee26aa2514c29b83f18e81febfd77418
  • Vorgänger a6cf76a2
  • Nachfolger fdbdd0b1

ActionBar: Verwendung in Berichtsfunktion in ar.pl

Unterschiede anzeigen:

bin/mozilla/ar.pl
909 909
  $main::lxdebug->leave_sub();
910 910
}
911 911

  
912
sub setup_ar_search_action_bar {
913
  my %params = @_;
914

  
915
  for my $bar ($::request->layout->get('actionbar')) {
916
    $bar->add(
917
      action => [
918
        $::locale->text('Search'),
919
        submit    => [ '#form' ],
920
        accesskey => 'enter',
921
      ],
922
    );
923
  }
924
}
925

  
926
sub setup_ar_transactions_action_bar {
927
  my %params = @_;
928

  
929
  for my $bar ($::request->layout->get('actionbar')) {
930
    $bar->add(
931
      action => [
932
        $::locale->text('Print'),
933
        call     => [ 'kivi.MassInvoiceCreatePrint.showMassPrintOptionsOrDownloadDirectly' ],
934
        disabled => !$params{num_rows} ? $::locale->text('The report doesn\'t contain entries.') : undef,
935
      ],
936

  
937
      combobox => [
938
        action => [ $::locale->text('Create new') ],
939
        action => [
940
          $::locale->text('AR Transaction'),
941
          submit => [ '#create_new_form', { action => 'ar_transaction' } ],
942
        ],
943
        action => [
944
          $::locale->text('Sales Invoice'),
945
          submit => [ '#create_new_form', { action => 'sales_invoice' } ],
946
        ],
947
      ], # end of combobox "Create new"
948
    );
949
  }
950
}
951

  
912 952
sub search {
913 953
  $main::lxdebug->enter_sub();
914 954

  
......
936 976

  
937 977
  $::request->layout->add_javascripts("autocomplete_project.js");
938 978

  
979
  setup_ar_search_action_bar();
980

  
939 981
  $form->header;
940 982
  print $form->parse_html_template('ar/search', { %myconfig });
941 983

  
......
1202 1244
  $report->add_separator();
1203 1245
  $report->add_data(create_subtotal_row(\%totals, \@columns, \%column_alignment, \@subtotal_columns, 'listtotal'));
1204 1246

  
1205
  $report->generate_with_headers();
1247
  $::request->layout->add_javascripts('kivi.MassInvoiceCreatePrint.js');
1248
  setup_ar_transactions_action_bar(num_rows => scalar(@{ $form->{AR} }));
1249

  
1250
  $report->generate_with_headers(action_bar => 1);
1206 1251

  
1207 1252
  $main::lxdebug->leave_sub();
1208 1253
}
js/kivi.MassInvoiceCreatePrint.js
12 12
    alert(kivi.t8('No delivery orders have been selected.'));
13 13
    return false;
14 14
  };
15

  
15 16
  this.checkInvoiceSelection = function() {
16 17
    if ($("[data-checkall=1]:checked").size() > 0)
17 18
      return true;
......
78 79
  this.setup = function() {
79 80
    $('#create_button').click(kivi.MassInvoiceCreatePrint.submitMassCreationForm);
80 81
    $('#create_print_all_button').click(kivi.MassInvoiceCreatePrint.createPrintAllInitialize);
81
    $('#action_print').click(kivi.MassInvoiceCreatePrint.checkInvoiceSelection);
82
  };
83

  
84
  ns.showMassPrintOptions = function() {
85
    $('#printer_options_printer_id').val($('#printer_id').val());
86

  
87
    kivi.popup_dialog({
88
      id: 'print_options',
89
      dialog: {
90
        title: kivi.t8('Print options'),
91
        width:  600,
92
        height: 200
93
      }
94
    });
95

  
96
    return true;
97
  };
98

  
99
  ns.showMassPrintOptionsOrDownloadDirectly = function() {
100
    if (!kivi.MassInvoiceCreatePrint.checkInvoiceSelection())
101
      return false;
102

  
103
    if ($('#print_options_printer_id').length === 0)
104
      return kivi.MassInvoiceCreatePrint.massPrint();
105
    return kivi.MassInvoiceCreatePrint.showMassPrintOptions();
106
  };
107

  
108
  ns.massPrint = function() {
109
    $('#print_options').dialog('close');
110

  
111
    $('#printer_id').val($('#print_options_printer_id').val());
112
    $('#action').val('MassInvoiceCreatePrint/print');
113

  
114
    $('#report_form').submit();
115

  
116
    return true;
82 117
  };
83 118
});
84 119

  
locale/de/all
3071 3071
  'The recipient, subject or body is missing.' => 'Der Empfäger, der Betreff oder der Text ist leer.',
3072 3072
  'The record template \'#1\' has been loaded.' => 'Die Belegvorlage »#1« wurde geladen.',
3073 3073
  'The record template \'#1\' has been saved.' => 'Die Belegvorlage »#1« wurde gespeichert.',
3074
  'The report doesn\'t contain entries.' => 'Der Bericht enthält keine Einträge.',
3074 3075
  'The required information consists of the IBAN and the BIC.' => 'Die benötigten Informationen bestehen aus der IBAN und der BIC. Zusätzlich wird die SEPA-Kreditoren-Identifikation aus der Mandantenkonfiguration benötigt.',
3075 3076
  'The required information consists of the IBAN, the BIC, the mandator ID and the mandate\'s date of signature.' => 'Die benötigten Informationen bestehen aus IBAN, BIC, Mandanten-ID und dem Unterschriftsdatum des Mandates. Zusätzlich wird die SEPA-Kreditoren-Identifikation aus der Mandantenkonfiguration benötigt.',
3076 3077
  'The requirement spec has been deleted.' => 'Das Pflichtenheft wurde gelöscht.',
templates/webpages/ar/ar_transactions_bottom.html
1 1
[% USE T8 %][% USE HTML %][%- USE LxERP -%][%- USE L -%]
2 2

  
3
  [% IF ALL_PRINTERS.size %]
4
   <p>
5
    [% LxERP.t8("Print destination") %]:
6
    [% SET  printers = [ { description=LxERP.t8("Download PDF, do not print") } ] ;
7
       CALL printers.import(ALL_PRINTERS);
8
       L.select_tag("printer_id", printers, title_key="description", default=printer_id) %]
9
   </p>
10
  [% END %]
11

  
12
  <p>
13
   [% L.hidden_tag("action", "MassInvoiceCreatePrint/dispatch") %]
14
   [% L.submit_tag("action_print", LxERP.t8("Print")) %]
15
  </p>
3
  [% L.hidden_tag("action", "MassInvoiceCreatePrint/dispatch") %]
4
  [% L.hidden_tag("printer_id") %]
16 5
 </form>
17 6

  
18
 <form method="post" action="dispatcher.pl?M=ar">
19

  
20
  <input name="callback" type="hidden" value="[% callback %]">
21

  
22
  [% 'Create new' | $T8 %]<br>
7
 <form method="post" action="ar.pl" id="create_new_form">
8
  [% L.hidden_tag("callback", callback) %]
9
 </form>
23 10

  
24
  <input class="submit" type="submit" name="A_ar_transaction" value="[%- 'AR Transaction' | $T8 %]">
25
  <input class="submit" type="submit" name="A_sales_invoice" value="[%- 'Sales Invoice' | $T8 %]">
11
[% IF ALL_PRINTERS.size %]
12
 <div id="print_options" class="hidden">
13
  <p>
14
  [% LxERP.t8("Print destination") %]:
15
  [% SET  printers = [ { description=LxERP.t8("Download PDF, do not print") } ] ;
16
     CALL printers.import(ALL_PRINTERS);
17
     L.select_tag("", printers, id="print_options_printer_id", title_key="description", default=printer_id) %]
18
  </p>
26 19

  
27
 </form>
20
  <p>
21
   [% L.button_tag("kivi.MassInvoiceCreatePrint.massPrint()", LxERP.t8('Print')) %]
22
  </p>
23
 </div>
24
[% END %]
templates/webpages/ar/ar_transactions_header.html
1
<form method="post" action="controller.pl">
1
<form method="post" action="controller.pl" id="report_form">
templates/webpages/ar/search.html
3 3
[%- SET style="width: 250px" %]
4 4
<h1>[% title %]</h1>
5 5

  
6
 <form method=post name="search" action=[% script %]>
6
 <form method=post name="search" id="form" action=[% script %]>
7
  [% L.hidden_tag("action", nextsub) %]
7 8

  
8 9
  <table width=100% border="0">
9 10
  <tr>
......
206 207
      </table>
207 208
     </td>
208 209
    </tr>
209
    <tr>
210
     <td><hr size=3 noshade></td>
211
    </tr>
212 210
   </table>
213
   <input type=hidden name=nextsub value=[% nextsub %]>
214
   <br>
215
   <input class=submit type=submit name=action id="continue" value="[% 'Continue' | $T8 %]">
216 211
  </form>

Auch abrufbar als: Unified diff