improved calendar (#784)

This commit is contained in:
Kevin Papst
2019-05-19 16:16:20 +02:00
committed by GitHub
parent 1903d6fb77
commit d2ad87d09c
66 changed files with 1030 additions and 1190 deletions

View File

@@ -80,6 +80,7 @@ class TimesheetEditForm extends AbstractType
$end = null;
$begin = null;
$customerCount = $this->customers->countCustomer(true);
$isNew = true;
if (isset($options['data'])) {
/** @var Timesheet $entry */
@@ -89,6 +90,10 @@ class TimesheetEditForm extends AbstractType
$project = $entry->getProject();
$customer = null === $project ? null : $project->getCustomer();
if (null !== $entry->getId()) {
$isNew = false;
}
if (null === $project && null !== $activity) {
$project = $activity->getProject();
}
@@ -117,7 +122,7 @@ class TimesheetEditForm extends AbstractType
$dateTimeOptions['format'] = $options['date_format'];
}
if (null === $end || !$this->configuration->isDurationOnly()) {
if ($isNew || null === $end || !$this->configuration->isDurationOnly()) {
$builder->add('begin', DateTimePickerType::class, array_merge($dateTimeOptions, [
'label' => 'label.begin'
]));