added customer name as pattern option in project dropdown (#3589)

This commit is contained in:
Kevin Papst
2022-10-21 15:26:53 +02:00
committed by GitHub
parent 73ef090b9e
commit 2022fa54d3
2 changed files with 4 additions and 0 deletions

View File

@@ -21,6 +21,7 @@ final class ProjectHelper
public const PATTERN_DATERANGE = '{daterange}';
public const PATTERN_START = '{start}';
public const PATTERN_END = '{end}';
public const PATTERN_CUSTOMER = '{parentTitle}';
public const PATTERN_SPACER = '{spacer}';
public const SPACER = ' - ';
@@ -70,6 +71,7 @@ final class ProjectHelper
$name = $this->getChoicePattern();
$name = str_replace(self::PATTERN_NAME, $project->getName(), $name);
$name = str_replace(self::PATTERN_COMMENT, $project->getComment() ?? '', $name);
$name = str_replace(self::PATTERN_CUSTOMER, $project->getCustomer()->getName() ?? '', $name);
$name = str_replace(self::PATTERN_ORDERNUMBER, $project->getOrderNumber() ?? '', $name);
$name = str_replace(self::PATTERN_START, $start, $name);
$name = str_replace(self::PATTERN_END, $end, $name);