rounding rules via admin screen, round begin when starting record (#1229)
This commit is contained in:
@@ -36,10 +36,15 @@ class AppExtension extends Extension
|
||||
if (isset($config['timesheet']['duration_only'])) {
|
||||
@trigger_error('Configuration "kimai.timesheet.duration_only" is deprecated, please remove it', E_USER_DEPRECATED);
|
||||
if (true === $config['timesheet']['duration_only'] && 'duration_only' !== $config['timesheet']['mode']) {
|
||||
trigger_error('Found ambiguous configuration. Please remove "kimai.timesheet.duration_only" and set "kimai.timesheet.mode" instead.');
|
||||
trigger_error('Found ambiguous configuration: remove "kimai.timesheet.duration_only" and set "kimai.timesheet.mode" instead.');
|
||||
}
|
||||
}
|
||||
|
||||
// we use a comma sepearated string internally, to be able to use it in combination with the database configuration system
|
||||
foreach ($config['timesheet']['rounding'] as $name => $settings) {
|
||||
$config['timesheet']['rounding'][$name]['days'] = implode(',', $settings['days']);
|
||||
}
|
||||
|
||||
// safe alternatives to %kernel.project_dir%
|
||||
$container->setParameter('kimai.data_dir', $config['data_dir']);
|
||||
$container->setParameter('kimai.plugin_dir', $config['plugin_dir']);
|
||||
|
||||
@@ -98,17 +98,15 @@ class Configuration implements ConfigurationInterface
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->arrayNode('days')
|
||||
->requiresAtLeastOneElement()
|
||||
->useAttributeAsKey('key')
|
||||
->isRequired()
|
||||
->scalarPrototype()->end()
|
||||
->defaultValue([])
|
||||
->defaultValue(['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'])
|
||||
->end()
|
||||
->integerNode('begin')
|
||||
->defaultValue(0)
|
||||
->defaultValue(1)
|
||||
->end()
|
||||
->integerNode('end')
|
||||
->defaultValue(0)
|
||||
->defaultValue(1)
|
||||
->end()
|
||||
->integerNode('duration')
|
||||
->defaultValue(0)
|
||||
@@ -131,7 +129,15 @@ class Configuration implements ConfigurationInterface
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->defaultValue([])
|
||||
->defaultValue([
|
||||
'default' => [
|
||||
'days' => ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'],
|
||||
'begin' => 1,
|
||||
'end' => 1,
|
||||
'duration' => 0,
|
||||
'mode' => 'default'
|
||||
]
|
||||
])
|
||||
->end()
|
||||
->arrayNode('rates')
|
||||
->requiresAtLeastOneElement()
|
||||
|
||||
Reference in New Issue
Block a user