Revision 6d75a1bc
Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt
SL/DB/RequirementSpecStatus.pm | ||
---|---|---|
2 | 2 |
|
3 | 3 |
use strict; |
4 | 4 |
|
5 |
use List::MoreUtils qw(none); |
|
6 |
|
|
5 | 7 |
use SL::DB::MetaSetup::RequirementSpecStatus; |
6 | 8 |
use SL::DB::Manager::RequirementSpecStatus; |
7 | 9 |
use SL::DB::Helper::ActsAsList; |
8 | 10 |
use SL::Locale::String; |
9 | 11 |
|
12 |
our @valid_names = qw(planning running done); |
|
13 |
|
|
10 | 14 |
sub validate { |
11 | 15 |
my ($self) = @_; |
12 | 16 |
|
13 | 17 |
my @errors; |
14 | 18 |
|
15 |
push @errors, t8('The name is missing.') if !$self->name; |
|
16 |
push @errors, t8('The description is missing.') if !$self->description; |
|
19 |
push @errors, t8('The name is missing.') if !$self->name; |
|
20 |
push @errors, t8('The name and description are not unique.') if $self->get_first_conflicting('name', 'description'); |
|
21 |
push @errors, t8('The name is invalid.') if none { $_ eq $self->name } @valid_names; |
|
22 |
push @errors, t8('The description is missing.') if !$self->description; |
|
17 | 23 |
|
18 | 24 |
return @errors; |
19 | 25 |
} |
Auch abrufbar als: Unified diff
Verwaltung von Pflichtenheftstatus