From 804e16d12721dc31d9aeabe0c90dd383b5a9dba6 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 29 Jan 2013 11:28:29 +0100 Subject: [PATCH] =?utf8?q?Projektstammdaten:=20Liste=20verkn=C3=BCpfter=20?= =?utf8?q?Dokumente=20anzeigen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Conflicts: SL/Controller/Project.pm --- SL/Controller/Project.pm | 16 +++++++++++++++- templates/webpages/project/form.html | 14 +++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/SL/Controller/Project.pm b/SL/Controller/Project.pm index fa42007bd..18523b7ce 100644 --- a/SL/Controller/Project.pm +++ b/SL/Controller/Project.pm @@ -13,13 +13,17 @@ use SL::Controller::Helper::ParseFilter; use SL::Controller::Helper::ReportGenerator; use SL::CVar; use SL::DB::Customer; +use SL::DB::DeliveryOrder; +use SL::DB::Invoice; +use SL::DB::Order; use SL::DB::Project; +use SL::DB::PurchaseInvoice; use SL::Helper::Flash; use SL::Locale::String; use Rose::Object::MakeMethods::Generic ( - scalar => [ qw(project db_args flat_filter) ], + scalar => [ qw(project db_args flat_filter linked_records) ], ); __PACKAGE__->run_before('check_auth'); @@ -88,6 +92,16 @@ sub action_new { sub action_edit { my ($self) = @_; + + $self->linked_records([ + map { @{ $_ } } + grep { $_ } ( + SL::DB::Manager::Order-> get_all(where => [ globalproject_id => $self->project->id ], with_objects => [ 'customer', 'vendor' ], sort_by => 'transdate ASC'), + SL::DB::Manager::DeliveryOrder-> get_all(where => [ globalproject_id => $self->project->id ], with_objects => [ 'customer', 'vendor' ], sort_by => 'transdate ASC'), + SL::DB::Manager::Invoice-> get_all(where => [ globalproject_id => $self->project->id ], with_objects => [ 'customer' ], sort_by => 'transdate ASC'), + SL::DB::Manager::PurchaseInvoice->get_all(where => [ globalproject_id => $self->project->id ], with_objects => [ 'vendor' ], sort_by => 'transdate ASC'), + )]); + $self->display_form(title => $::locale->text('Edit project #1', $self->project->projectnumber), callback => $::form->{callback} || $self->url_for(action => 'edit', id => $self->project->id)); } diff --git a/templates/webpages/project/form.html b/templates/webpages/project/form.html index 2ea52bc8f..a8d168a59 100644 --- a/templates/webpages/project/form.html +++ b/templates/webpages/project/form.html @@ -1,5 +1,5 @@ [%- USE T8 %] -[%- USE L %] +[%- USE L %][%- USE P %] [%- USE HTML %][%- USE LxERP %] [%- INCLUDE 'common/flash.html' %] @@ -15,6 +15,9 @@ [%- IF CUSTOM_VARIABLES.size %]
  • [% 'Custom Variables' | $T8 %]
  • [%- END %] + [%- IF SELF.project.id %] +
  • [% 'Linked Records' | $T8 %]
  • + [%- END %]
    @@ -83,6 +86,15 @@
    [%- END %] + [%- IF SELF.project.id %] +
    + + [% P.grouped_record_list(SELF.linked_records) %] + +
    +
    + [%- END %] +

    -- 2.20.1