return !SL::DB::Manager::Project->get_first(where => \@filter);
}
+sub displayable_name {
+ my ($self) = @_;
+
+ return join ' ', grep $_, $self->projectnumber, $self->description;
+}
+
sub full_description {
my ($self, %params) = @_;
} elsif ($params{style} =~ m/description/) {
$description = $self->description;
- } elsif ($params{style} =~ m/full/) {
+ } elsif (($params{style} =~ m/full/) && $self->customer) {
$description = $self->projectnumber;
if ($self->description && do { my $desc = quotemeta $self->description; $self->projectnumber !~ m/$desc/ }) {
$description .= ' ' . $self->description;
project in the database. Also returns trueish if no project number has
been set yet.
+=item C<displayable_name>
+
+Returns a human-readable description of the project, consisting of projectnumber
+and description.
+
=item C<full_description %params>
Returns a full description for the project which can consist of the
domination)"). If the project's description is already part of the
project's number then it will not be appended.
+If this project isn't linked to a customer then the style C<both> is
+used instead.
+
=back
=back