Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision a833c262

Von Bernd Bleßmann vor 5 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
use parent qw(SL::Controller::Base);
use SL::DB::Bin;
use SL::DB::Warehouse;
use SL::Presenter::Tag qw(select_tag);
__PACKAGE__->run_before('check_auth');
__PACKAGE__->run_before(sub { $::auth->assert('developer') },
only => [ qw(test_page) ]);
only => [ qw(test_page test_result) ]);
#
# actions
#
sub action_test_page {
$_[0]->render('warehouse/test_page');
my $pre_filled_wh = SL::DB::Manager::Warehouse->get_all()->[-1];
my $pre_filled_bin = SL::DB::Manager::Bin->get_all()->[-1];
$_[0]->render('warehouse/test_page',
pre_filled_wh => $pre_filled_wh,
pre_filled_bin => $pre_filled_bin);
}
sub action_test_result {
my @results;
foreach (1..4) {
my $wh = 'wh' . $_;
push @results, $wh . ' : ' . SL::DB::Manager::Bin->find_by_or_create(id => $::form->{$wh . '_bin'}||0)->full_description;
}
$::form->show_generic_information(join("<br>", @results), 'Results');
}
sub action_reorder {
templates/design40_webpages/warehouse/test_page.html
<h1>[% 'Warehouse/Bin Testpage' | $T8 %]</h1>
<div class="wrapper">
[% P.warehouse.wh_bin_select('wh') %]
<form method="post" action="controller.pl" id="test_form">
[% P.hidden_tag(action = 'Warehouse/test_result') %]
with_empty: [% P.warehouse.wh_bin_select('wh2', with_empty=1) %]
<table>
<tbody>
<tr>
<td>wh1<td>
<td>[% P.warehouse.wh_bin_select('wh1') %]</td>
</tr>
<tr>
<td>wh2 (with_empty)<td>
<td>[% P.warehouse.wh_bin_select('wh2', with_empty=1) %]</td>
</tr>
<tr>
<td>wh3 (with_empty, pre_filled_bin)<td>
<td>[% P.warehouse.wh_bin_select('wh3', bin_default=pre_filled_bin.id, with_empty=1) %]</td>
</tr>
<tr>
<td>wh4 (with_empty, pre_filled_wh)<td>
<td>[% P.warehouse.wh_bin_select('wh4', wh_default=pre_filled_wh.id, with_empty=1) %]</td>
</tr>
</tbody>
</table>
<div>
[% P.submit_tag('', 'go') %]
</div>
</form>
</div>
templates/webpages/warehouse/test_page.html
<h1>[% 'Warehouse/Bin Testpage' | $T8 %]</h1>
<div>
[% P.warehouse.wh_bin_select('wh') %]
<form method="post" action="controller.pl" id="test_form">
[% P.hidden_tag(action = 'Warehouse/test_result') %]
with_empty: [% P.warehouse.wh_bin_select('wh2', with_empty=1) %]
</div>
<table>
<tbody>
<tr>
<td>wh<td>
<td>[% P.warehouse.wh_bin_select('wh') %]</td>
</tr>
<tr>
<td>wh2 (with_empty)<td>
<td>[% P.warehouse.wh_bin_select('wh2', with_empty=1) %]</td>
</tr>
</tbody>
</table>
<div>
[% P.submit_tag('', 'go') %]
</div>
</form>

Auch abrufbar als: Unified diff