Status in der Projektverwaltung
authorSven Schöling <s.schoeling@linet-services.de>
Mon, 6 May 2013 15:52:22 +0000 (17:52 +0200)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 1 Apr 2014 11:03:21 +0000 (13:03 +0200)
SL/Controller/Project.pm
locale/de/all
templates/webpages/project/_basic_data.html
templates/webpages/project/search.html

index 64e33a0..c14f62e 100644 (file)
@@ -15,6 +15,8 @@ use SL::DB::DeliveryOrder;
 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;
@@ -27,7 +29,9 @@ use Rose::Object::MakeMethods::Generic
 );
 
 __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
@@ -38,7 +42,6 @@ sub action_search {
 
   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},
@@ -116,7 +119,6 @@ sub display_form {
   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}) {
@@ -202,13 +204,14 @@ sub prepare_report {
   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') },
@@ -259,4 +262,12 @@ sub init_models {
   );
 }
 
+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;
index 77e9eb0..5c15430 100755 (executable)
@@ -1761,6 +1761,7 @@ $self->{texts} = {
   'Project Description'         => 'Projektbeschreibung',
   'Project Number'              => 'Projektnummer',
   'Project Numbers'             => 'Projektnummern',
+  'Project Status'              => 'Projektstatus',
   'Project Transactions'        => 'Projektbuchungen',
   'Project Type'                => 'Projekttyp',
   'Project Types'               => 'Projekttypen',
index a278356..a0982f1 100644 (file)
 
  <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>
index 1f3e33b..23c9fe8 100644 (file)
 
     <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 %]