added calendar slot_duration config (#989)

This commit is contained in:
Kevin Papst
2019-07-26 23:51:29 +02:00
committed by GitHub
parent 0d11aded40
commit 1bd784eef3
7 changed files with 13 additions and 3 deletions

View File

@@ -124,6 +124,7 @@ kimai:
# week_numbers: true # week_numbers: true
# weekends: true # weekends: true
# day_limit: 4 # day_limit: 4
# slot_duration: '00:30:00'
# businessHours: # businessHours:
# days: [1, 2, 3, 4, 5] # days: [1, 2, 3, 4, 5]
# begin: '08:00' # begin: '08:00'

View File

@@ -97,4 +97,9 @@ class CalendarConfiguration implements SystemBundleConfiguration
{ {
return $this->find('google.sources'); return $this->find('google.sources');
} }
public function getSlotDuration(): string
{
return (string) $this->find('slot_duration');
}
} }

View File

@@ -250,6 +250,7 @@ class Configuration implements ConfigurationInterface
->children() ->children()
->booleanNode('week_numbers')->defaultTrue()->end() ->booleanNode('week_numbers')->defaultTrue()->end()
->integerNode('day_limit')->defaultValue(4)->end() ->integerNode('day_limit')->defaultValue(4)->end()
->scalarNode('slot_duration')->defaultValue('00:30:00')->end()
->arrayNode('businessHours') ->arrayNode('businessHours')
->addDefaultsIfNotSet() ->addDefaultsIfNotSet()
->children() ->children()

View File

@@ -215,9 +215,8 @@
eventResize: changeHandler, eventResize: changeHandler,
{% endif %} {% endif %}
{% endif %} {% endif %}
/* slotDuration: '{{ config.slotDuration }}',
slotDuration: '00:30:00', // TODO make me configurable slotLabelInterval: '{{ config.slotDuration }}',
*/
minTime: '{{ config.timeframeBegin }}', minTime: '{{ config.timeframeBegin }}',
maxTime: '{{ config.timeframeEnd }}', maxTime: '{{ config.timeframeEnd }}',
defaultTimedEventDuration: '00:30' defaultTimedEventDuration: '00:30'

View File

@@ -42,6 +42,7 @@ class CalendarConfigurationTest extends TestCase
'end' => '19:27' 'end' => '19:27'
], ],
'day_limit' => 20, 'day_limit' => 20,
'slot_duration' => '01:11:00',
'week_numbers' => false, 'week_numbers' => false,
'google' => [ 'google' => [
'api_key' => 'wertwertwegsdfbdf243w567fg8ihuon', 'api_key' => 'wertwertwegsdfbdf243w567fg8ihuon',
@@ -72,6 +73,7 @@ class CalendarConfigurationTest extends TestCase
$this->assertEquals([2, 4, 6], $sut->getBusinessDays()); $this->assertEquals([2, 4, 6], $sut->getBusinessDays());
$this->assertEquals('07:49', $sut->getBusinessTimeBegin()); $this->assertEquals('07:49', $sut->getBusinessTimeBegin());
$this->assertEquals('19:27', $sut->getBusinessTimeEnd()); $this->assertEquals('19:27', $sut->getBusinessTimeEnd());
$this->assertEquals('01:11:00', $sut->getSlotDuration());
$this->assertEquals(20, $sut->getDayLimit()); $this->assertEquals(20, $sut->getDayLimit());
$this->assertFalse($sut->isShowWeekNumbers()); $this->assertFalse($sut->isShowWeekNumbers());

View File

@@ -68,6 +68,7 @@ class CalendarControllerTest extends ControllerBaseTest
], ],
'day_limit' => 20, 'day_limit' => 20,
'week_numbers' => false, 'week_numbers' => false,
'slot_duration' => '00:15:00',
'google' => [ 'google' => [
'api_key' => 'wertwertwegsdfbdf243w567fg8ihuon', 'api_key' => 'wertwertwegsdfbdf243w567fg8ihuon',
'sources' => [ 'sources' => [

View File

@@ -63,6 +63,7 @@ class AppExtensionTest extends TestCase
'kimai.calendar' => [ 'kimai.calendar' => [
'week_numbers' => true, 'week_numbers' => true,
'day_limit' => 4, 'day_limit' => 4,
'slot_duration' => '00:30:00',
'businessHours' => [ 'businessHours' => [
'days' => [1, 2, 3, 4, 5], 'days' => [1, 2, 3, 4, 5],
'begin' => '08:00', 'begin' => '08:00',