Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision e3bc89a0

Von Bernd Bleßmann vor etwa 1 Monat hinzugefügt

  • ID e3bc89a03ef1be3263e293755cdfecc6141ab868
  • Vorgänger 7bbfa415
  • Nachfolger b8828a31

Presenter für Lager/Lagerplatz-Auswahl

Unterschiede anzeigen:

SL/Controller/Warehouse.pm
5 5
use parent qw(SL::Controller::Base);
6 6

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

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

  
11 14
#
12 15
# actions
13 16
#
14 17

  
18
sub action_test_page {
19
  $_[0]->render('warehouse/test_page');
20
}
21

  
15 22
sub action_reorder {
16 23
  my ($self) = @_;
17 24

  
18 25
  SL::DB::Warehouse->reorder_list(@{ $::form->{warehouse_id} || [] });
19 26

  
20
  $self->render(\'', { type => 'json' });
27
  $self->render(\'', { type => 'json' }); # make emacs happy again ')
28
}
29

  
30
sub action_wh_bin_select_update_bins {
31
  my ($self) = @_;
32

  
33
  my $wh_id      = $::form->{wh_id};
34
  my $bin_dom_id = $::form->{bin_dom_id} || 'bin';
35

  
36
  my $bins = $wh_id ? SL::DB::Warehouse->new(id => $wh_id)->load->bins_sorted_naturally
37
           : [{id => '', description => ''}];
38

  
39
  $self->js->run('kivi.Warehouse.wh_bin_select_update_bins', $bin_dom_id, [map { {key => $_->{id}, value => $_->{description}} } @$bins])
40
           ->render;
21 41
}
22 42

  
43

  
23 44
#
24 45
# filters
25 46
#
......
29 50
}
30 51

  
31 52
1;
53

  
54

  
55
__END__
56

  
57
=pod
58

  
59
=encoding utf8
60

  
61
=head1 NAME
62

  
63
SL::Controller::Warehouse - Controller module for warehouse and bin objects
64

  
65
=head1 FUNCTIONS
66

  
67
=over 4
68

  
69
=item C<action_test_page>
70

  
71
Renders the test page.
72

  
73
=item C<action_wh_bin_select_update_bins>
74

  
75
This action is used by the C<SL::Presenter::Warehouse::wh_bin_select>
76
to update the bin selection after the warehouse selection was changed.
77
See also L<SL::Presenter::Warehouse::wh_bin_select> and
78
L<js/kivi.Warehouse.js>).
79

  
80
=back
81

  
82
=head1 BUGS
83

  
84
Nothing here yet.
85

  
86
=head1 AUTHOR
87

  
88
Bernd Bleßmann E<lt>bernd@kivitendo-premium.deE<gt>
89

  
90
=cut

Auch abrufbar als: Unified diff