Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 1600ef67

Von Sven Schöling vor mehr als 10 Jahren hinzugefügt

  • ID 1600ef672b02029ef3bb2ab940c0954820ef47b3
  • Vorgänger 5a469687
  • Nachfolger 03f5aaa3

Projekte: Templates und get_linked_records etwas entzerrt

Unterschiede anzeigen:

SL/Controller/Project.pm
71 71
sub action_edit {
72 72
  my ($self) = @_;
73 73

  
74
  $self->linked_records([
75
    map  { @{ $_ } }
76
    grep { $_      } (
77
      SL::DB::Manager::Order->          get_all(where => [ globalproject_id => $self->project->id ], with_objects => [ 'customer', 'vendor' ], sort_by => 'transdate ASC'),
78
      SL::DB::Manager::DeliveryOrder->  get_all(where => [ globalproject_id => $self->project->id ], with_objects => [ 'customer', 'vendor' ], sort_by => 'transdate ASC'),
79
      SL::DB::Manager::Invoice->        get_all(where => [ globalproject_id => $self->project->id ], with_objects => [ 'customer'           ], sort_by => 'transdate ASC'),
80
      SL::DB::Manager::PurchaseInvoice->get_all(where => [ globalproject_id => $self->project->id ], with_objects => [             'vendor' ], sort_by => 'transdate ASC'),
81
    )]);
82

  
74
  $self->get_linked_records;
83 75
  $self->display_form(title    => $::locale->text('Edit project #1', $self->project->projectnumber),
84 76
                      callback => $::form->{callback} || $self->url_for(action => 'edit', id => $self->project->id));
85 77
}
......
176 168
  $self->project(SL::DB::Project->new(id => $::form->{id})->load);
177 169
}
178 170

  
171
sub get_linked_records {
172
  my ($self) = @_;
173

  
174
  $self->linked_records([
175
    map  { @{ $_ } }
176
    grep { $_      } (
177
      SL::DB::Manager::Order->          get_all(where => [ globalproject_id => $self->project->id ], with_objects => [ 'customer', 'vendor' ], sort_by => 'transdate ASC'),
178
      SL::DB::Manager::DeliveryOrder->  get_all(where => [ globalproject_id => $self->project->id ], with_objects => [ 'customer', 'vendor' ], sort_by => 'transdate ASC'),
179
      SL::DB::Manager::Invoice->        get_all(where => [ globalproject_id => $self->project->id ], with_objects => [ 'customer'           ], sort_by => 'transdate ASC'),
180
      SL::DB::Manager::PurchaseInvoice->get_all(where => [ globalproject_id => $self->project->id ], with_objects => [             'vendor' ], sort_by => 'transdate ASC'),
181
    )]);
182
}
183

  
179 184
sub setup_db_args_from_filter {
180 185
  my ($self) = @_;
181 186

  

Auch abrufbar als: Unified diff