improved calendar (#784)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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'
|
||||
]));
|
||||
|
||||
Reference in New Issue
Block a user