1 package SL::Controller::CsvImport::Project;
6 use SL::DB::CustomVariable;
7 use SL::DB::CustomVariableConfig;
9 use parent qw(SL::Controller::CsvImport::Base);
11 use Rose::Object::MakeMethods::Generic
13 scalar => [ qw(table) ],
18 $self->class('SL::DB::Project');
21 sub set_profile_defaults {
24 sub init_all_cvar_configs {
27 return SL::DB::Manager::CustomVariableConfig->get_all(where => [ module => 'Projects' ]);
33 $self->controller->track_progress(phase => 'building data', progress => 0);
36 my $num_data = scalar @{ $self->controller->data };
37 foreach my $entry (@{ $self->controller->data }) {
38 $self->controller->track_progress(progress => $i/$num_data * 100) if $i % 100 == 0;
40 $self->handle_cvars($entry);
45 $self->add_cvar_raw_data_columns;
48 sub get_duplicate_check_fields {
51 label => $::locale->text('Project Number'),
58 sub setup_displayable_columns {
61 $self->SUPER::setup_displayable_columns;
62 $self->add_cvar_columns_to_displayable_columns;
64 $self->add_displayable_columns({ name => 'projectnumber', description => $::locale->text('number') },
65 { name => 'description', description => $::locale->text('Description') },
66 { name => 'active', description => $::locale->text('Active') },