Release 2.38.0 (#5563)
This commit is contained in:
@@ -19,7 +19,7 @@ final class ProjectHelper
|
||||
public const PATTERN_NAME = '{name}';
|
||||
public const PATTERN_NUMBER = '{number}';
|
||||
public const PATTERN_COMMENT = '{comment}';
|
||||
public const PATTERN_ORDERNUMBER = '{ordernumber}';
|
||||
public const PATTERN_ORDERNUMBER = '{orderNumber}';
|
||||
public const PATTERN_DATERANGE = '{daterange}';
|
||||
public const PATTERN_START = '{start}';
|
||||
public const PATTERN_END = '{end}';
|
||||
@@ -74,6 +74,7 @@ final class ProjectHelper
|
||||
$name = str_replace(self::PATTERN_NUMBER, $project->getNumber() ?? '', $name);
|
||||
$name = str_replace(self::PATTERN_COMMENT, $project->getComment() ?? '', $name);
|
||||
$name = str_replace(self::PATTERN_CUSTOMER, $project->getCustomer()?->getName() ?? '', $name);
|
||||
$name = str_replace('{ordernumber}', self::PATTERN_ORDERNUMBER, $name); // this was a typo before Kimai 2.38, can be removed in the future
|
||||
$name = str_replace(self::PATTERN_ORDERNUMBER, $project->getOrderNumber() ?? '', $name);
|
||||
|
||||
if ($this->dateFormatter === null) {
|
||||
|
||||
@@ -329,7 +329,7 @@ class TimesheetEditForm extends AbstractType
|
||||
$builder->add('duration', DurationType::class, $durationOptions);
|
||||
|
||||
if ($this->systemConfiguration->isBreakTimeEnabled()) {
|
||||
$builder->add('break', DurationType::class, ['label' => 'break', 'required' => false]);
|
||||
$builder->add('break', DurationType::class, ['label' => 'break', 'required' => false, 'icon' => 'break']);
|
||||
}
|
||||
|
||||
$builder->addEventListener(
|
||||
@@ -392,7 +392,14 @@ class TimesheetEditForm extends AbstractType
|
||||
return;
|
||||
}
|
||||
|
||||
$builder->add('user', UserType::class);
|
||||
$users = [];
|
||||
if (isset($options['data']) && $options['data'] instanceof Timesheet) {
|
||||
$users = [$options['data']->getUser()];
|
||||
}
|
||||
|
||||
$builder->add('user', UserType::class, [
|
||||
'include_users' => $users,
|
||||
]);
|
||||
}
|
||||
|
||||
protected function addExported(FormBuilderInterface $builder, array $options): void
|
||||
|
||||
@@ -32,7 +32,7 @@ final class DurationType extends AbstractType
|
||||
'preset_minutes' => null,
|
||||
'toggle' => false,
|
||||
'max_hours' => 24,
|
||||
'icon' => 'clock',
|
||||
'icon' => 'duration',
|
||||
'documentation' => [
|
||||
'type' => 'string',
|
||||
'description' => 'Duration - supports various formats: https://www.kimai.org/documentation/duration-format.html',
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
namespace App\Form\Type;
|
||||
|
||||
use App\Configuration\SystemConfiguration;
|
||||
use App\Entity\MetaTableTypeInterface;
|
||||
use App\Event\ActivityMetaDisplayEvent;
|
||||
use App\Event\CustomerMetaDisplayEvent;
|
||||
@@ -39,6 +40,7 @@ final class ExportColumnsType extends AbstractType
|
||||
public function __construct(
|
||||
private readonly EventDispatcherInterface $dispatcher,
|
||||
private readonly TranslatorInterface $translator,
|
||||
private readonly SystemConfiguration $configuration,
|
||||
)
|
||||
{
|
||||
}
|
||||
@@ -86,6 +88,17 @@ final class ExportColumnsType extends AbstractType
|
||||
],
|
||||
];
|
||||
|
||||
if ($this->configuration->isBreakTimeEnabled()) {
|
||||
$tmp = [
|
||||
$this->translator->trans('break') . ' (0:30)' => 'break',
|
||||
$this->translator->trans('break') . ' (0:30:00)' => 'break_seconds',
|
||||
$this->translator->trans('break') . ' (0.5)' => 'break_decimal',
|
||||
];
|
||||
foreach ($tmp as $k => $v) {
|
||||
$columns['timesheet'][$k] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($this->findMetaColumns(new TimesheetMetaDisplayEvent(new TimesheetQuery(), TimesheetMetaDisplayEvent::EXPORT)) as $metaField) {
|
||||
if ($metaField->getName() !== null) {
|
||||
$columns['timesheet'][$metaField->getLabel()] = 'timesheet.meta.' . $metaField->getName();
|
||||
|
||||
Reference in New Issue
Block a user