From e7c07dfd71ff0a74de729351627ca5b3a3833ec9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Wed, 3 Dec 2014 20:15:18 +0100 Subject: [PATCH] Lieferplan: all_businesses in init-methode ausgelagert MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit kurzes feedback zum lieferplan: in der action alle business laden: der ganze punkt an den init_* sachen ist, dass mand as laden von nötigen daten aus der action rauskriegt --- SL/Controller/DeliveryPlan.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/SL/Controller/DeliveryPlan.pm b/SL/Controller/DeliveryPlan.pm index 8d2417eb5..a69702f1b 100644 --- a/SL/Controller/DeliveryPlan.pm +++ b/SL/Controller/DeliveryPlan.pm @@ -13,7 +13,7 @@ use Carp; use Rose::Object::MakeMethods::Generic ( scalar => [ qw(db_args flat_filter) ], - 'scalar --get_set_init' => [ qw(models all_edit_right mode vc all_employees) ], + 'scalar --get_set_init' => [ qw(models all_edit_right mode vc all_employees all_businesses) ], ); __PACKAGE__->run_before(sub { $::auth->assert('delivery_plan'); }); @@ -40,7 +40,6 @@ sub action_list { $self->prepare_report; my $orderitems = $self->models->get; - $self->{all_businesses} = SL::DB::Manager::Business->get_all_sorted; $self->report_generator_list_objects(report => $self->{report}, objects => $orderitems); } @@ -306,6 +305,9 @@ sub init_mode { sub init_all_employees { return SL::DB::Manager::Employee->get_all_sorted; } +sub init_all_businesses { + return SL::DB::Manager::Business->get_all_sorted; +} sub link_to { my ($self, $object, %params) = @_; -- 2.20.1