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

@@ -14,6 +14,7 @@ class SystemConfiguration
public const SECTION_TIMESHEET = 'timesheet';
public const SECTION_FORM_CUSTOMER = 'form_customer';
public const SECTION_THEME = 'theme';
public const SECTION_CALENDAR = 'calendar';
/**
* @var string

View File

@@ -44,7 +44,7 @@ class SystemConfigurationForm extends AbstractType
'data_class' => SystemConfiguration::class,
'csrf_protection' => true,
'csrf_field_name' => '_token',
'csrf_token_id' => 'edit_user_preferences',
'csrf_token_id' => 'edit_system_configurations',
]);
}
}

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'
]));