0
0
Fork 0
mirror of https://github.com/kevinpapst/kimai2.git synced 2025-03-30 03:13:34 +00:00

fix activity form

This commit is contained in:
Kevin Papst 2021-09-16 12:58:24 +02:00
parent a72f021445
commit 0fc5b728d5

View file

@ -37,6 +37,7 @@ class ActivityEditForm extends AbstractType
$project = null;
$customer = null;
$new = true;
$isGlobal = false;
if (isset($options['data'])) {
/** @var Activity $entry */
@ -46,6 +47,8 @@ class ActivityEditForm extends AbstractType
$project = $entry->getProject();
$customer = $project->getCustomer();
$options['currency'] = $customer->getCurrency();
} else {
$isGlobal = null === $entry->getProject();
}
$new = $entry->getId() === null;
@ -80,7 +83,9 @@ class ActivityEditForm extends AbstractType
'project_enabled' => true,
]);
}
}
if ($new || !$isGlobal) {
$builder
->add('project', ProjectType::class, [
'required' => false,