Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 5efcb494

Von Moritz Bunkus vor etwa 7 Jahren hinzugefügt

  • ID 5efcb49405b1caa362cd214b52c9314b66d569da
  • Vorgänger 6e6e6849
  • Nachfolger 036d1ca4

ActionBar: Verwendung bei »System« → »Lager«

Unterschiede anzeigen:

bin/mozilla/am.pl
34 34

  
35 35
use utf8;
36 36

  
37
use List::MoreUtils qw(any);
38

  
37 39
use SL::Auth;
38 40
use SL::Auth::PasswordPolicy;
39 41
use SL::AM;
......
1290 1292
  $form->{title}      = $locale->text('Add Warehouse');
1291 1293
  $form->{callback} ||= build_std_url('action=add_warehouse');
1292 1294

  
1295
  setup_am_edit_warehouse_action_bar();
1296

  
1293 1297
  $form->header();
1294 1298
  print $form->parse_html_template('am/edit_warehouse');
1295 1299

  
......
1312 1316
  $form->{title}      = $locale->text('Edit Warehouse');
1313 1317
  $form->{callback} ||= build_std_url('action=list_warehouses');
1314 1318

  
1319
  setup_am_edit_warehouse_action_bar(id => $::form->{id}, in_use => any { $_->{in_use} } @{ $::form->{BINS} });
1320

  
1315 1321
  $form->header();
1316 1322
  print $form->parse_html_template('am/edit_warehouse');
1317 1323

  
1318 1324
  $main::lxdebug->leave_sub();
1319 1325
}
1320 1326

  
1327
sub edit_bins {
1328
  $::auth->assert('config');
1329

  
1330
  AM->get_warehouse(\%::myconfig, $::form);
1331

  
1332
  $::form->{title}      = $::locale->text('Edit Bins for Warehouse \'#1\'', $::form->{description});
1333
  $::form->{callback} ||= build_std_url('action=list_warehouses');
1334

  
1335
  setup_am_edit_bins_action_bar(id => $::form->{id});
1336

  
1337
  $::form->header;
1338
  print $::form->parse_html_template('am/edit_bins');
1339
}
1340

  
1321 1341
sub list_warehouses {
1322 1342
  $main::lxdebug->enter_sub();
1323 1343

  
......
1333 1353
  $form->{title}    = $locale->text('Warehouses');
1334 1354
  $form->{url_base} = build_std_url('callback');
1335 1355

  
1356
  setup_am_list_warehouses_action_bar();
1357

  
1336 1358
  $form->header();
1337 1359
  print $form->parse_html_template('am/list_warehouses');
1338 1360

  
......
1370 1392

  
1371 1393
  $main::auth->assert('config');
1372 1394

  
1373
  if (!$form->{confirmed}) {
1374
    $form->{title} = $locale->text('Confirmation');
1375

  
1376
    $form->header();
1377
    print $form->parse_html_template('am/confirm_delete_warehouse');
1378
    $::dispatcher->end_request;
1379
  }
1380

  
1381 1395
  if (AM->delete_warehouse(\%myconfig, $form)) {
1382 1396
    $form->{callback} .= '&saved_message=' . E($locale->text('Warehouse deleted.')) if ($form->{callback});
1383 1397
    $form->redirect($locale->text('Warehouse deleted.'));
......
1531 1545
    );
1532 1546
  }
1533 1547
}
1548

  
1549
sub setup_am_list_warehouses_action_bar {
1550
  my %params = @_;
1551

  
1552
  for my $bar ($::request->layout->get('actionbar')) {
1553
    $bar->add(
1554
      link => [
1555
        t8('Add'),
1556
        link      => 'am.pl?action=add&type=warehouse&callback=' . E($::form->{callback}),
1557
        accesskey => 'enter',
1558
      ],
1559
    );
1560
  }
1561
}
1562

  
1563
sub setup_am_edit_warehouse_action_bar {
1564
  my %params = @_;
1565

  
1566
  for my $bar ($::request->layout->get('actionbar')) {
1567
    $bar->add(
1568
      action => [
1569
        t8('Save'),
1570
        submit    => [ '#form', { action => 'save_warehouse' } ],
1571
        accesskey => 'enter',
1572
      ],
1573

  
1574
      action => [
1575
        t8('Delete'),
1576
        submit   => [ '#form', { action => 'delete_warehouse' } ],
1577
        disabled => !$params{id}    ? t8('The object has not been saved yet.')
1578
                  : $params{in_use} ? t8('The object is in use and cannot be deleted.')
1579
                  :                   undef,
1580
        confirm  => t8('Do you really want to delete this object?'),
1581
      ],
1582

  
1583
      'separator',
1584

  
1585
      link => [
1586
        t8('Bins'),
1587
        link    => 'am.pl?action=edit_bins&id=' . E($params{id}),
1588
        only_if => $params{id},
1589
      ],
1590

  
1591
      link => [
1592
        t8('Abort'),
1593
        link => $::form->{callback} || 'am.pl?action=list_warehouses',
1594
      ],
1595
    );
1596
  }
1597
}
1598

  
1599
sub setup_am_edit_bins_action_bar {
1600
  my %params = @_;
1601

  
1602
  for my $bar ($::request->layout->get('actionbar')) {
1603
    $bar->add(
1604
      action => [
1605
        t8('Save'),
1606
        submit    => [ '#form', { action => 'save_bin' } ],
1607
        accesskey => 'enter',
1608
      ],
1609

  
1610
      'separator',
1611

  
1612
      link => [
1613
        t8('Abort'),
1614
        link => 'am.pl?action=edit_warehouse&id=' . E($params{id}),
1615
      ],
1616
    );
1617
  }
1618
}
locale/de/all
437 437
  'Bin List'                    => 'Lagerliste',
438 438
  'Bin To'                      => 'Ziellagerplatz',
439 439
  'Binding to the LDAP server as "#1" failed. Please check config/kivitendo.conf.' => 'Die Anmeldung am LDAP-Server als "#1" schlug fehl. Bitte überprüfen Sie die Angaben in config/kivitendo.conf.',
440
  'Bins'                        => 'Lagerplätze',
440 441
  'Bins saved.'                 => 'Lagerplätze gespeichert.',
441 442
  'Bins that have been used in the past cannot be deleted anymore. For these bins there\'s no checkbox in the "Delete" column.' => 'Lagerplätze, die bereits benutzt wurden, können nicht mehr gelöscht werden. Deswegen fehlt bei ihnen die Checkbox in der Spalte "Löschen".',
442 443
  'Birthday'                    => 'Geburtstag',
......
990 991
  'Do you really want to delete this draft?' => 'Wollen Sie diesen Entwurf wirklich löschen?',
991 992
  'Do you really want to delete this object?' => 'Wollen Sie dieses Objekt wirklich löschen?',
992 993
  'Do you really want to delete this record template?' => 'Wollen Sie diese Belegvorlage wirklich löschen?',
993
  'Do you really want to delete this warehouse?' => 'Wollen Sie dieses Lager wirklich löschen?',
994 994
  'Do you really want to revert to this version?' => 'Wollen Sie wirklich auf diese Version zurücksetzen?',
995 995
  'Do you really want to save?' => 'Wollen Sie wirklich speichern?',
996 996
  'Do you really want to unimport the selected documents?' => 'Wollen Sie wirklich diese Dateien an die Quelle zurückgeben?',
......
1076 1076
  'Edit Accounts Receivables Transaction' => 'Debitorenbuchung bearbeiten',
1077 1077
  'Edit Assembly'               => 'Erzeugnis bearbeiten',
1078 1078
  'Edit Assortment'             => 'Sortiment bearbeiten',
1079
  'Edit Bins'                   => 'Lagerplätze bearbeiten',
1079
  'Edit Bins for Warehouse \'#1\'' => 'Lagerplätze von Lager »#1« bearbeiten',
1080 1080
  'Edit Client'                 => 'Mandanten bearbeiten',
1081 1081
  'Edit Credit Note'            => 'Gutschrift bearbeiten',
1082 1082
  'Edit Customer'               => 'Kunde editieren',
templates/webpages/am/confirm_delete_warehouse.html
1
[%- USE T8 %]
2
[%- USE HTML %]
3
 <h1>[% title %]</h1>
4

  
5
 <p>[% 'Do you really want to delete this warehouse?' | $T8 %]</p>
6

  
7
 <p>[% 'Warehouse' | $T8 %]: [% HTML.escape(orig_description) %]</p>
8

  
9
 <form action="am.pl" method="post">
10

  
11
  <input type="hidden" name="id" value="[% HTML.escape(id) %]">
12
  <input type="hidden" name="callback" value="[% HTML.escape(callback) %]">
13
  <input type="hidden" name="type" value="warehouse">
14
  <input type="hidden" name="confirmed" value="1">
15

  
16
  <button type="button" class="submit" onclick="history.back()">[% 'Back' | $T8 %]</button>
17
  <input type="submit" class="submit" name="action" value="[% 'Delete' | $T8 %]">
18
 </form>
19

  
20
</form>
templates/webpages/am/edit_bins.html
1
[%- USE HTML -%][%- USE T8 -%]
2

  
3
<h1>[% title %]</h1>
4

  
5
[% UNLESS BINS.size %]
6
 <p>[% 'No bins have been added to this warehouse yet.' | $T8 %]</p>
7

  
8
[% ELSE %]
9

  
10
 <p>
11
  [%- 'Bins that have been used in the past cannot be deleted anymore. For these bins there\'s no checkbox in the &quot;Delete&quot; column.' | $T8 %]
12
 </p>
13

  
14
 <form method="post" action="am.pl" id="form">
15

  
16
  <input type="hidden" name="warehouse_id" value="[% HTML.escape(id) %]">
17

  
18
  <input type="hidden" name="type" value="bin">
19
  <input type="hidden" name="callback" value="[% HTML.escape(callback) %]">
20

  
21
  <table border="0">
22
   <tr>
23
    <th class="listheading">[% 'Delete' | $T8 %]</th><th class="listheading">[% 'Description' | $T8 %]</th>
24
    <th class="listheading">[% 'Delete' | $T8 %]</th><th class="listheading">[% 'Description' | $T8 %]</th>
25
   </tr>
26
   [%- SET row_odd = '1' %]
27
   [%- USE bin_it = Iterator(BINS) %]
28
   [%- FOREACH bin = bin_it %]
29
   [%- IF row_odd %]
30
   <tr>
31
    [%- END %]
32

  
33
    <td>[% IF bin.in_use %]&nbsp;[% ELSE %]<input type="checkbox" name="delete_[% bin_it.count %]" value="1">[% END %]</td>
34
    <td>
35
     <input type="hidden" name="id_[% bin_it.count %]" value="[% HTML.escape(bin.id) %]">
36
     <input name="description_[% bin_it.count %]" value="[% HTML.escape(bin.description) %]">
37
    </td>
38

  
39
    [%- SET end_tr = '0' %]
40
    [%- UNLESS row_odd %][%- SET end_tr = '1' %][%- END %]
41
    [%- IF bin_it.last %][%- SET end_tr = '1' %][%- END %]
42
    [%- IF end_tr %]
43
   </tr>
44
   [%- END %]
45

  
46
   [%- IF row_odd %][% SET row_odd = '0' %][% ELSE %][% SET row_odd = '1' %][% END %]
47
   [%- END %]
48
  </table>
49

  
50
  <input type="hidden" name="rowcount" value="[% BINS.size %]">
51
 </form>
52

  
53
[% END %]
templates/webpages/am/edit_warehouse.html
6 6
  <p>[% saved_message %]</p>
7 7
 [% END %]
8 8

  
9
 <form method="post" action="am.pl">
9
 <form method="post" action="am.pl" id="form">
10 10

  
11 11
  <input type="hidden" name="id" value="[% HTML.escape(id) %]">
12 12

  
......
37 37
    <td><input name="prefix" value="[% 'Bin' | $T8 %]"></td>
38 38
   </tr>
39 39
  </table>
40

  
41
  <p>
42
   <input type="submit" class="submit" name="action" value="[% 'Save' | $T8 %]">
43
   [%- IF id %][%- UNLESS in_use %]
44
   <input type="submit" class="submit" name="action" value="[% 'Delete' | $T8 %]">
45
   [%- END %][%- END %]
46
  </p>
47

  
48 40
 </form>
49

  
50
 [% IF id %]
51

  
52
 <hr height="3">
53

  
54
 <h2>[% 'Edit Bins' | $T8 %]</h2>
55

  
56
 [% UNLESS BINS.size %]
57
 <p>[% 'No bins have been added to this warehouse yet.' | $T8 %]</p>
58

  
59
 [% ELSE %]
60

  
61
 <p>
62
  [%- 'Bins that have been used in the past cannot be deleted anymore. For these bins there\'s no checkbox in the &quot;Delete&quot; column.' | $T8 %]
63
 </p>
64

  
65
 <form method="post" action="am.pl">
66

  
67
  <input type="hidden" name="warehouse_id" value="[% HTML.escape(id) %]">
68

  
69
  <input type="hidden" name="type" value="bin">
70
  <input type="hidden" name="callback" value="[% HTML.escape(callback) %]">
71

  
72
  <table border="0">
73
   <tr>
74
    <th class="listheading">[% 'Delete' | $T8 %]</th><th class="listheading">[% 'Description' | $T8 %]</th>
75
    <th class="listheading">[% 'Delete' | $T8 %]</th><th class="listheading">[% 'Description' | $T8 %]</th>
76
   </tr>
77
   [%- SET row_odd = '1' %]
78
   [%- USE bin_it = Iterator(BINS) %]
79
   [%- FOREACH bin = bin_it %]
80
   [%- IF row_odd %]
81
   <tr>
82
    [%- END %]
83

  
84
    <td>[% IF bin.in_use %]&nbsp;[% ELSE %]<input type="checkbox" name="delete_[% bin_it.count %]" value="1">[% END %]</td>
85
    <td>
86
     <input type="hidden" name="id_[% bin_it.count %]" value="[% HTML.escape(bin.id) %]">
87
     <input name="description_[% bin_it.count %]" value="[% HTML.escape(bin.description) %]">
88
    </td>
89

  
90
    [%- SET end_tr = '0' %]
91
    [%- UNLESS row_odd %][%- SET end_tr = '1' %][%- END %]
92
    [%- IF bin_it.last %][%- SET end_tr = '1' %][%- END %]
93
    [%- IF end_tr %]
94
   </tr>
95
   [%- END %]
96

  
97
   [%- IF row_odd %][% SET row_odd = '0' %][% ELSE %][% SET row_odd = '1' %][% END %]
98
   [%- END %]
99
  </table>
100

  
101
  <input type="hidden" name="rowcount" value="[% BINS.size %]">
102

  
103
  <p><input type="submit" class="submit" name="action" value="[% 'Save' | $T8 %]"></p>
104
 </form>
105

  
106
 [% END %]
107

  
108
 [% END %]
templates/webpages/am/list_warehouses.html
24 24
  </table>
25 25
 </p>
26 26

  
27
 <hr height="3">
28

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

  
33 27
 [% L.sortable_element('#warehouse_list tbody', url => 'controller.pl?action=Warehouse/reorder', with => 'warehouse_id') %]

Auch abrufbar als: Unified diff