Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision c7fff13f

Von Moritz Bunkus vor fast 8 Jahren hinzugefügt

  • ID c7fff13f52ed343b751c7ceec575ba584b88e4bd
  • Vorgänger 8631a825
  • Nachfolger 02f6397d

ActionBar: Verwendung bei »Steuern«

Unterschiede anzeigen:

bin/mozilla/am.pl
1110 1110
  $form->{expense}    = 1;
1111 1111
  $form->{costs}      = 1;
1112 1112

  
1113
  setup_am_edit_tax_action_bar();
1113 1114
  $form->header();
1114 1115

  
1115 1116
  my $parameters_ref = {
1116
#    ChartTypeIsAccount         => $ChartTypeIsAccount,
1117 1117
    LANGUAGES => SL::DB::Manager::Language->get_all_sorted,
1118 1118
  };
1119 1119

  
......
1147 1147

  
1148 1148
  $form->{rate} = $form->format_amount(\%myconfig, $form->{rate}, 2);
1149 1149

  
1150
  setup_am_edit_tax_action_bar();
1150 1151
  $form->header();
1151 1152

  
1152 1153
  my $parameters_ref = {
......
1177 1178

  
1178 1179
  $form->{title} = $locale->text('Tax-O-Matic');
1179 1180

  
1181
  setup_am_list_tax_action_bar();
1180 1182
  $form->header();
1181 1183

  
1182
  my $parameters_ref = {
1183
  };
1184

  
1185 1184
  # Ausgabe des Templates
1186
  print($form->parse_html_template('am/list_tax', $parameters_ref));
1185
  print($form->parse_html_template('am/list_tax'));
1187 1186

  
1188 1187
  $main::lxdebug->leave_sub();
1189 1188
}
......
1428 1427
    );
1429 1428
  }
1430 1429
}
1430

  
1431
sub setup_am_list_tax_action_bar {
1432
  my %params = @_;
1433

  
1434
  for my $bar ($::request->layout->get('actionbar')) {
1435
    $bar->add(
1436
      link => [
1437
        t8('Add'),
1438
        link => 'am.pl?action=add_tax',
1439
      ],
1440
    );
1441
  }
1442
}
1443

  
1444
sub setup_am_edit_tax_action_bar {
1445
  my %params = @_;
1446

  
1447
  for my $bar ($::request->layout->get('actionbar')) {
1448
    $bar->add(
1449
      action => [
1450
        t8('Save'),
1451
        submit    => [ '#form', { action => "save_tax" } ],
1452
        accesskey => 'enter',
1453
      ],
1454

  
1455
      action => [
1456
        t8('Delete'),
1457
        submit   => [ '#form', { action => "delete_tax" } ],
1458
        disabled => !$::form->{id}                                      ? t8('The object has not been saved yet.')
1459
                  : !$::form->{orphaned} || $::form->{tax_already_used} ? t8('The object is in use and cannot be deleted.')
1460
                  :                                                       undef,
1461
        confirm  => t8('Do you really want to delete this object?'),
1462
      ],
1463
    );
1464
  }
1465
}
templates/webpages/am/edit_tax.html
4 4
[%- USE LxERP %]
5 5
<h1>[% 'Tax-O-Matic' | $T8 %] [% title %]</h1>
6 6

  
7
 <form method="post" action="am.pl">
7
 <form method="post" action="am.pl" id="form">
8 8
  <input type="hidden" name="id" value="[% HTML.escape(id) %]">
9 9
  <input type="hidden" name="type" value="tax">
10 10

  
......
129 129
  [% END %]
130 130

  
131 131
  <input type="hidden" name="callback" value="[% HTML.escape(callback) %]">
132

  
133
  <input type="submit" class="submit" name="action" value="[% 'Save' | $T8 %]">
134

  
135
  [% IF orphaned AND NOT tax_already_used %]
136
  <input type="submit" class="submit" name="action" value="[% 'Delete' | $T8 %]">
137
  [% END %]
138

  
139 132
</form>
140

  
templates/webpages/am/list_tax.html
25 25
  </tr>
26 26
  [% END %]
27 27
 </table>
28

  
29
 <p>
30
  <a href="am.pl?action=add&type=tax&callback=[% HTML.url(callback) %]">[%- 'Add' | $T8 %]</a>
31
 </p>

Auch abrufbar als: Unified diff