Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 9c7262bf

Von Sven Schöling vor fast 11 Jahren hinzugefügt

  • ID 9c7262bf1daa8ca9bb1c81a11be0e47cbcf1b533
  • Vorgänger bf2f7ae2
  • Nachfolger ce213a0a

Projekttypen verwaltbar gemacht

Unterschiede anzeigen:

SL/Controller/Project.pm
16 16
use SL::DB::Order;
17 17
use SL::DB::Project;
18 18
use SL::DB::PurchaseInvoice;
19
use SL::DB::ProjectType;
19 20
use SL::Helper::Flash;
20 21
use SL::Locale::String;
21 22

  
......
26 27
);
27 28

  
28 29
__PACKAGE__->run_before('check_auth');
29
__PACKAGE__->run_before('load_project', only => [ qw(edit update destroy) ]);
30
__PACKAGE__->run_before('load_project',       only => [ qw(edit update destroy) ]);
30 31

  
31 32
#
32 33
# actions
......
37 38

  
38 39
  my %params;
39 40

  
40
  $params{CUSTOM_VARIABLES} = CVar->get_configs(module => 'Projects');
41
  $params{ALL_PROJECT_TYPES} = SL::DB::Manager::ProjectType->get_all_sorted;
42
  $params{CUSTOM_VARIABLES}  = CVar->get_configs(module => 'Projects');
41 43
  ($params{CUSTOM_VARIABLES_FILTER_CODE}, $params{CUSTOM_VARIABLES_INCLUSION_CODE})
42 44
    = CVar->render_search_options(variables      => $params{CUSTOM_VARIABLES},
43 45
                                  include_prefix => 'l_',
......
121 123
sub display_form {
122 124
  my ($self, %params) = @_;
123 125

  
124
  $params{ALL_CUSTOMERS}    = SL::DB::Manager::Customer->get_all_sorted(where => [ or => [ obsolete => 0, obsolete => undef, id => $self->project->customer_id ]]);
125
  $params{CUSTOM_VARIABLES} = CVar->get_custom_variables(module => 'Projects', trans_id => $self->project->id);
126
  $params{ALL_CUSTOMERS}     = SL::DB::Manager::Customer->get_all_sorted(where => [ or => [ obsolete => 0, obsolete => undef, id => $self->project->customer_id ]]);
127
  $params{ALL_PROJECT_TYPES} = SL::DB::Manager::ProjectType->get_all_sorted;
128
  $params{CUSTOM_VARIABLES}  = CVar->get_custom_variables(module => 'Projects', trans_id => $self->project->id);
126 129
  CVar->render_inputs(variables => $params{CUSTOM_VARIABLES}) if @{ $params{CUSTOM_VARIABLES} };
127 130

  
128 131
  $self->render('project/form', %params);
......
171 174
  $self->{filter} = {};
172 175
  my %args = parse_filter(
173 176
    $self->_pre_parse_filter($::form->{filter}, $self->{filter}),
174
    with_objects => [ 'customer' ],
177
    with_objects => [ 'customer', 'project_type' ],
175 178
    launder_to   => $self->{filter},
176 179
  );
177 180

  
......
186 189
  my $report      = SL::ReportGenerator->new(\%::myconfig, $::form);
187 190
  $self->{report} = $report;
188 191

  
189
  my @columns     = qw(projectnumber description customer active valid type);
190
  my @sortable    = qw(projectnumber description customer              type);
192
  my @columns     = qw(projectnumber description customer active valid project_type);
193
  my @sortable    = qw(projectnumber description customer              project_type);
191 194

  
192 195
  my %column_defs = (
193 196
    projectnumber => { obj_link => sub { $self->url_for(action => 'edit', id => $_[0]->id, callback => $callback) } },
194 197
    description   => { obj_link => sub { $self->url_for(action => 'edit', id => $_[0]->id, callback => $callback) } },
195
    type          => { },
198
    project_type  => { sub  => sub { $_[0]->project_type->description } },
196 199
    customer      => { sub  => sub { $_[0]->customer ? $_[0]->customer->name     : '' } },
197 200
    active        => { sub  => sub { $_[0]->active   ? $::locale->text('Active') : $::locale->text('Inactive') },
198 201
                       text => $::locale->text('Active') },
......
235 238
      customer      => t8('Customer'),
236 239
      description   => t8('Description'),
237 240
      projectnumber => t8('Project Number'),
238
      type          => t8('Type'),
241
      project_type  => t8('Project Type'),
239 242
    },
240 243
    with_objects => [ 'customer' ],
241 244
  );

Auch abrufbar als: Unified diff