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:
parent
a72f021445
commit
0fc5b728d5
1 changed files with 5 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue