X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FProject.pm;h=df5fe09ec2e24d17cce4f335ac8f48db135e8500;hb=29dad41c0aeeb866ef040c173f78a1306cae69c8;hp=aa97f764ea39573a89c830702f22bd54573de9b8;hpb=fac8417d136f89b1ce0fed8c2ef35ee089228ac7;p=kivitendo-erp.git diff --git a/SL/DB/Project.pm b/SL/DB/Project.pm index aa97f764e..df5fe09ec 100644 --- a/SL/DB/Project.pm +++ b/SL/DB/Project.pm @@ -48,6 +48,12 @@ sub is_projectnumber_unique { 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) = @_; @@ -60,7 +66,7 @@ sub full_description { } 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; @@ -113,6 +119,11 @@ Returns trueish if the project number is not used for any other project in the database. Also returns trueish if no project number has been set yet. +=item C + +Returns a human-readable description of the project, consisting of projectnumber +and description. + =item C Returns a full description for the project which can consist of the @@ -143,6 +154,9 @@ description in parenthesis (e.g. "Evil Corp (12345 World 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 is +used instead. + =back =back