use SL::DB::Invoice;
use SL::DB::Order;
use SL::DB::Project;
+use SL::DB::ProjectType;
+use SL::DB::ProjectStatus;
use SL::DB::PurchaseInvoice;
use SL::DB::ProjectType;
use SL::Helper::Flash;
);
__PACKAGE__->run_before('check_auth');
-__PACKAGE__->run_before('load_project', only => [ qw(edit update destroy) ]);
+__PACKAGE__->run_before('load_project', only => [ qw(edit update destroy) ]);
+__PACKAGE__->run_before('load_project_types', only => [ qw(search edit new) ]);
+__PACKAGE__->run_before('load_project_status', only => [ qw(search edit new) ]);
#
# actions
my %params;
- $params{ALL_PROJECT_TYPES} = SL::DB::Manager::ProjectType->get_all_sorted;
$params{CUSTOM_VARIABLES} = CVar->get_configs(module => 'Projects');
($params{CUSTOM_VARIABLES_FILTER_CODE}, $params{CUSTOM_VARIABLES_INCLUSION_CODE})
= CVar->render_search_options(variables => $params{CUSTOM_VARIABLES},
my ($self, %params) = @_;
$params{ALL_CUSTOMERS} = SL::DB::Manager::Customer->get_all_sorted(where => [ or => [ obsolete => 0, obsolete => undef, id => $self->project->customer_id ]]);
- $params{ALL_PROJECT_TYPES} = SL::DB::Manager::ProjectType->get_all_sorted;
$params{CUSTOM_VARIABLES} = CVar->get_custom_variables(module => 'Projects', trans_id => $self->project->id);
if ($params{keep_cvars}) {
my $report = SL::ReportGenerator->new(\%::myconfig, $::form);
$self->{report} = $report;
- my @columns = qw(projectnumber description customer active valid project_type);
- my @sortable = qw(projectnumber description customer project_type);
+ my @columns = qw(projectnumber description customer active valid project_type project_status);
+ my @sortable = qw(projectnumber description customer project_type project_status);
my %column_defs = (
projectnumber => { obj_link => sub { $self->url_for(action => 'edit', id => $_[0]->id, callback => $callback) } },
description => { obj_link => sub { $self->url_for(action => 'edit', id => $_[0]->id, callback => $callback) } },
project_type => { sub => sub { $_[0]->project_type->description } },
+ project_status => { sub => sub { $_[0]->project_status->description }, text => t8('Project Status') },
customer => { sub => sub { $_[0]->customer ? $_[0]->customer->name : '' } },
active => { sub => sub { $_[0]->active ? $::locale->text('Active') : $::locale->text('Inactive') },
text => $::locale->text('Active') },
);
}
+sub load_project_types {
+ $_[0]{ALL_PROJECT_TYPES} = SL::DB::Manager::ProjectType->get_all_sorted;
+}
+
+sub load_project_status {
+ $_[0]{ALL_PROJECT_STATUS} = SL::DB::Manager::ProjectStatus->get_all_sorted;
+}
+
1;
'Project Description' => 'Projektbeschreibung',
'Project Number' => 'Projektnummer',
'Project Numbers' => 'Projektnummern',
+ 'Project Status' => 'Projektstatus',
'Project Transactions' => 'Projektbuchungen',
'Project Type' => 'Projekttyp',
'Project Types' => 'Projekttypen',
<tr>
<th align="right">[% 'Project Type' | $T8 %]</th>
- <td>[% L.select_tag('project.project_type_id', ALL_PROJECT_TYPES, default=SELF.project.project_type_id, title_key='description', style='width: 300px') %]</td>
+ <td>[% L.select_tag('project.project_type_id', SELF.ALL_PROJECT_TYPES, default=SELF.project.project_type_id, title_key='description', style='width: 300px') %]</td>
+ </tr>
+
+ <tr>
+ <th align="right">[% 'Project Status' | $T8 %]</th>
+ <td>[% L.select_tag('project.project_status_id', SELF.ALL_PROJECT_STATUS, default=SELF.project.project_status_id, title_key='description', style='width: 300px') %]</td>
</tr>
<tr>
<tr>
<th align="right">[% 'Project Type' | $T8 %]</th>
- <td>[% L.select_tag('filter.project_type_id', ALL_PROJECT_TYPES, default=filter.project_type_id, title_key='description', with_empty=1) %]</td>
+ <td>[% L.select_tag('filter.project_type_id', SELF.ALL_PROJECT_TYPES, default=filter.project_type_id, title_key='description', with_empty=1) %]</td>
+ </tr>
+
+ <tr>
+ <th align="right">[% 'Project Status' | $T8 %]</th>
+ <td>[% L.select_tag('filter.project_status_id', SELF.ALL_PROJECT_STATUS, default=filter.project_status_id, title_key='description', with_empty=1) %]</td>
</tr>
[% CUSTOM_VARIABLES_FILTER_CODE %]