Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision a833c262

Von Bernd Bleßmann vor 3 Monaten hinzugefügt

  • ID a833c262d5bc0dc972832dd25ad1b14375405250
  • Vorgänger 8b0265d1
  • Nachfolger 96145038

Presenter Lagerplatz: Test-Seite erweitert …

- Vorbelegte Lager/Lagerplätze
- mit submit und Ergebnisanzeige

Unterschiede anzeigen:

SL/Controller/Warehouse.pm
4 4

  
5 5
use parent qw(SL::Controller::Base);
6 6

  
7
use SL::DB::Bin;
7 8
use SL::DB::Warehouse;
8 9
use SL::Presenter::Tag qw(select_tag);
9 10

  
10 11
__PACKAGE__->run_before('check_auth');
11 12
__PACKAGE__->run_before(sub { $::auth->assert('developer') },
12
                        only => [ qw(test_page) ]);
13
                        only => [ qw(test_page test_result) ]);
13 14

  
14 15
#
15 16
# actions
16 17
#
17 18

  
18 19
sub action_test_page {
19
  $_[0]->render('warehouse/test_page');
20
  my $pre_filled_wh  = SL::DB::Manager::Warehouse->get_all()->[-1];
21
  my $pre_filled_bin = SL::DB::Manager::Bin->get_all()->[-1];
22
  $_[0]->render('warehouse/test_page',
23
                pre_filled_wh  => $pre_filled_wh,
24
                pre_filled_bin => $pre_filled_bin);
25
}
26

  
27
sub action_test_result {
28
  my @results;
29

  
30
  foreach (1..4) {
31
    my $wh = 'wh' . $_;
32
    push @results, $wh . ' : ' . SL::DB::Manager::Bin->find_by_or_create(id => $::form->{$wh . '_bin'}||0)->full_description;
33
  }
34

  
35
  $::form->show_generic_information(join("<br>", @results), 'Results');
20 36
}
21 37

  
22 38
sub action_reorder {
templates/design40_webpages/warehouse/test_page.html
4 4
<h1>[% 'Warehouse/Bin Testpage' | $T8 %]</h1>
5 5

  
6 6
<div class="wrapper">
7
  [% P.warehouse.wh_bin_select('wh') %]
7
 <form method="post" action="controller.pl" id="test_form">
8
  [% P.hidden_tag(action = 'Warehouse/test_result') %]
8 9

  
9
  with_empty: [% P.warehouse.wh_bin_select('wh2', with_empty=1) %]
10
  <table>
11
    <tbody>
12
      <tr>
13
        <td>wh1<td>
14
        <td>[% P.warehouse.wh_bin_select('wh1') %]</td>
15
      </tr>
16
      <tr>
17
        <td>wh2 (with_empty)<td>
18
        <td>[% P.warehouse.wh_bin_select('wh2', with_empty=1) %]</td>
19
      </tr>
20
      <tr>
21
        <td>wh3 (with_empty, pre_filled_bin)<td>
22
        <td>[% P.warehouse.wh_bin_select('wh3', bin_default=pre_filled_bin.id, with_empty=1) %]</td>
23
      </tr>
24
      <tr>
25
        <td>wh4 (with_empty, pre_filled_wh)<td>
26
        <td>[% P.warehouse.wh_bin_select('wh4', wh_default=pre_filled_wh.id, with_empty=1) %]</td>
27
      </tr>
28
    </tbody>
29
  </table>
30

  
31
  <div>
32
    [% P.submit_tag('', 'go') %]
33
  </div>
34
 </form>
10 35
</div>
templates/webpages/warehouse/test_page.html
3 3

  
4 4
<h1>[% 'Warehouse/Bin Testpage' | $T8 %]</h1>
5 5

  
6
<div>
7
  [% P.warehouse.wh_bin_select('wh') %]
6
<form method="post" action="controller.pl" id="test_form">
7
  [% P.hidden_tag(action = 'Warehouse/test_result') %]
8 8

  
9
  with_empty: [% P.warehouse.wh_bin_select('wh2', with_empty=1) %]
10
</div>
9
  <table>
10
    <tbody>
11
      <tr>
12
        <td>wh<td>
13
        <td>[% P.warehouse.wh_bin_select('wh') %]</td>
14
      </tr>
15
      <tr>
16
        <td>wh2 (with_empty)<td>
17
        <td>[% P.warehouse.wh_bin_select('wh2', with_empty=1) %]</td>
18
      </tr>
19
    </tbody>
20
  </table>
21

  
22
  <div>
23
    [% P.submit_tag('', 'go') %]
24
  </div>
25
</form>

Auch abrufbar als: Unified diff