$self->class('SL::DB::Project');
}
+sub set_profile_defaults {
+};
+
sub init_all_cvar_configs {
my ($self) = @_;
sub check_objects {
my ($self) = @_;
+ $self->controller->track_progress(phase => 'building data', progress => 0);
+
+ my $i;
+ my $num_data = scalar @{ $self->controller->data };
foreach my $entry (@{ $self->controller->data }) {
+ $self->controller->track_progress(progress => $i/$num_data * 100) if $i % 100 == 0;
+
$self->handle_cvars($entry);
+ } continue {
+ $i++;
}
$self->add_cvar_raw_data_columns;
}
-sub check_duplicates {
- my $self = shift;
-
- my %duplicates_by_number;
-
- if ( $self->controller->profile->get('duplicates') eq 'check_db' ) {
- foreach my $object (@{$self->existing_objects}) {
- $duplicates_by_number{$object->{projectnumber}} = 'db';
- }
- }
-
- foreach my $entry (@{ $self->controller->data }) {
-
- my $object = $entry->{object};
-
- if ( $duplicates_by_number{$object->projectnumber()} )
- {
- push( @{$entry->{errors}},
- $duplicates_by_number{$object->projectnumber()} eq 'db' ? $::locale->text('Duplicate in database') : $::locale->text('Duplicate in CSV file')
- );
- } else {
- $duplicates_by_number{$object->projectnumber()} = 'csv';
- }
-
- }
+sub get_duplicate_check_fields {
+ return {
+ projectnumber => {
+ label => $::locale->text('Project Number'),
+ default => 1,
+ std_check => 1
+ },
+ };
}
sub setup_displayable_columns {