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

@@ -20,6 +20,8 @@ admin_lte:
theme:
widget:
use_footer: false
type: secondary
solid: false
routes:
adminlte_profile: user_profile

View File

@@ -4,23 +4,27 @@
#
# Be aware that this file is YAML format and the indentation is important.
# Each config level needs to be indented with 4 additional spaces.
#
# ---------------------------------------------------------------------------------------------
kimai:
# --------------------------------------------------------------------------------
# You can disable the user management functions in the authentication screens (default: true).
#user:
# registration: false
# password_reset: false
# --------------------------------------------------------------------------------
# --------------------------------------------------------------------------------
# AUTHENTICATION
# You can disable some user management functions in the authentication screens.
# Both settings default to "true"
# --------------------------------------------------------------------------------
# user:
# registration: false
# password_reset: false
# --------------------------------------------------------------------------------
# --------------------------------------------------------------------------------
# All configs related to timesheet and record management
# --------------------------------------------------------------------------------
# TIME-TRACKING
# All configs related to time-tracking, timesheets and record management
# --------------------------------------------------------------------------------
timesheet:
# render timesheet descriptions with markdown
# renders timesheet descriptions with markdown
markdown_content: false
# The time-tracking mode that should be used (allowed values: default, duration_only)
@@ -40,53 +44,39 @@ kimai:
duration: 0
mode: default
# If you want to apply different hourly rates for specific weekdays, you can uncomment the "rates" configuration.
# The "weekend" rule will add 50% to each timesheet entry that will be recorded on "saturdays" or "sundays".
# See documentation about rate rules: https://www.kimai.org/documentation/timesheet.html#rate-calculation
# rates:
# weekend:
# days: ['saturday','sunday']
# factor: 1.5
# If you want to limit the max. active entries per user, you can do it here.
#
# The soft_limit is used as theme setting and displays a warning color if the user has at least X active recordings
#
# The hard_limit is used to detect how many active records are allowed per user:
# By default a user can only have one active time-record. The first one is stopped when the new one starts.
# When hard_limit is > 1: as soon as the limit is reached and warning is shown and the user has to stop one active entry.
active_entries:
soft_limit: 1
hard_limit: 3
# Rules that define the Timesheet validation and behaviour
rules:
# whether records in the future can be created
allow_future_times: true
# # If you want to apply different hourly rates for specific weekdays, you can uncomment the "rates" configuration.
# # The "weekend" rule will add 50% to each timesheet entry that will be recorded on "saturdays" or "sundays".
# # See documentation at: https://www.kimai.org/documentation/timesheet.html#rate-calculation
# rates:
# weekend:
# days: ['saturday','sunday']
# factor: 1.5
#
# # If you want to limit the max. active entries per user, you can do it here.
# # The soft_limit is used as theme setting and displays a warning color if the user has reached X active recordings
# # The hard_limit is used to detect how many active records are allowed per user:
# # - by default a user can only have one active time-record: it is automatically stopped when a new one is started
# # - when hard_limit is > 1 and the user is trying to start a new entry after reaching the limit, a warning is shown
# # and the user has to stop an active entry first
# active_entries:
# soft_limit: 1
# hard_limit: 3
#
# # Rules that define timesheet validation and behaviour
# rules:
# # whether records in the future can be created
# allow_future_times: true
# --------------------------------------------------------------------------------
# --------------------------------------------------------------------------------
# Invoice management
#invoice:
# # all files in these directories will be used as invoice documents (if supported by a renderer)
# documents:
# - 'var/invoices/'
# - 'templates/invoice/renderer/'
# --------------------------------------------------------------------------------
# Default settings used to populate forms
#defaults:
# customer:
# timezone: Europe/Berlin
# country: DE
# currency: EUR
# --------------------------------------------------------------------------------
# Find out more about the configurable permission system at https://www.kimai.org/documentation/permissions.html
# --------------------------------------------------------------------------------
# PERMISSIONS
# Find out more about the configurable permission system at:
# https://www.kimai.org/documentation/permissions.html
# --------------------------------------------------------------------------------
permissions:
sets:
# mapping complex rulesets of single permissions to named "sets" ("set name" = [array of "permissions"])
# mapping complex rule sets of single permissions to named "sets" ("set name" = [array of "permissions"])
ACTIVITIES: [view_activity,create_activity,edit_activity,delete_activity]
PROJECTS: [view_project,create_project,edit_project,delete_project]
CUSTOMERS: [view_customer,create_customer,edit_customer,delete_customer]
@@ -113,9 +103,124 @@ kimai:
ROLE_TEAMLEAD: [view_invoice_template,create_invoice_template,edit_invoice_template,view_rate_own_timesheet,view_rate_other_timesheet,hourly-rate_own_profile]
ROLE_ADMIN: [hourly-rate_own_profile]
ROLE_SUPER_ADMIN: [hourly-rate_own_profile,hourly-rate_other_profile,delete_own_profile,roles_own_profile,system_information,system_actions,system_configuration,plugins]
# --------------------------------------------------------------------------------
# --------------------------------------------------------------------------------
# Language specific settings, like the date formats
# --------------------------------------------------------------------------------
# CALENDAR Configuration
# See documentation at https://www.kimai.org/documentation/calendar.html
# --------------------------------------------------------------------------------
# calendar:
# week_numbers: true
# weekends: true
# day_limit: 4
# businessHours:
# days: [1, 2, 3, 4, 5]
# begin: '08:00'
# end: '18:00'
# visibleHours:
# begin: '00:00'
# end: '24:00'
#
# # You can configure unlimited google calendars to display events for your company (e.g. holidays)
# google:
# api_key: 'your-restricted-google-api-key'
# sources:
# holidays:
# id: 'de.german#holiday@group.v.calendar.google.com'
# color: '#ccc'
# --------------------------------------------------------------------------------
# --------------------------------------------------------------------------------
# INVOICES
# --------------------------------------------------------------------------------
# invoice:
# # all files in these directories will be used as invoice documents (if supported by a renderer)
# documents:
# - 'var/invoices/'
# - 'templates/invoice/renderer/'
# --------------------------------------------------------------------------------
# --------------------------------------------------------------------------------
# THEME Settings
# will be available as twig globals at "kimai_context.*".
# See documentation at https://www.kimai.org/documentation/theme.html
# --------------------------------------------------------------------------------
# theme:
# # BETA test: If you set this to 'selectpicker' the customer/project/activity select boxes will be transformed
# # into a searchable and javascript enhanced input type
# select_type: ~
# --------------------------------------------------------------------------------
# --------------------------------------------------------------------------------
# DASHBOARD
# Using the configurable widget sections.
# See documentation at https://www.kimai.org/documentation/dashboard.html
# --------------------------------------------------------------------------------
dashboard:
user_duration:
title: dashboard.you
order: 10
permission: ROLE_USER
widgets: [userDurationToday, userDurationWeek, userDurationMonth, userDurationYear]
user_rates:
title: ~
order: 20
permission: ROLE_USER
widgets: [userAmountToday, userAmountWeek, userAmountMonth, userAmountYear]
duration:
title: dashboard.all
order: 30
permission: ROLE_TEAMLEAD
widgets: [durationToday, durationWeek, durationMonth, durationYear]
active_users:
title: ~
order: 40
permission: ROLE_TEAMLEAD
widgets: [activeUsersToday, activeUsersWeek, activeUsersMonth, activeUsersYear]
rates:
title: ~
order: 50
permission: ROLE_ADMIN
widgets: [amountToday, amountWeek, amountMonth, amountYear]
widgets:
userDurationToday: { title: stats.durationToday, query: duration, user: true, begin: '00:00:00', end: '23:59:59', icon: duration, color: green }
userDurationWeek: { title: stats.durationWeek, query: duration, user: true, begin: 'monday this week 00:00:00', end: 'sunday this week 23:59:59', icon: duration, color: blue }
userDurationMonth: { title: stats.durationMonth, query: duration, user: true, begin: 'first day of this month 00:00:00', end: 'last day of this month 23:59:59', icon: duration, color: purple }
userDurationYear: { title: stats.durationYear, query: duration, user: true, begin: '01 january this year 00:00:00', end: '31 december this year 23:59:59', icon: duration, color: yellow }
userDurationTotal: { title: stats.durationTotal, query: duration, user: true, icon: duration, color: red }
userAmountToday: { title: stats.amountToday, query: rate, user: true, begin: '00:00:00', end: '23:59:59', icon: money, color: green }
userAmountWeek: { title: stats.amountWeek, query: rate, user: true, begin: 'monday this week 00:00:00', end: 'sunday this week 23:59:59', icon: money, color: blue }
userAmountMonth: { title: stats.amountMonth, query: rate, user: true, begin: 'first day of this month 00:00:00', end: 'last day of this month 23:59:59', icon: money, color: purple }
userAmountYear: { title: stats.amountYear, query: rate, user: true, begin: '01 january this year 00:00:00', end: '31 december this year 23:59:59', icon: money, color: yellow }
userAmountTotal: { title: stats.amountTotal, query: rate, user: true, icon: money, color: red }
durationToday: { title: stats.durationToday, query: duration, begin: '00:00:00', end: '23:59:59', icon: duration, color: green }
durationWeek: { title: stats.durationWeek, query: duration, begin: 'monday this week 00:00:00', end: 'sunday this week 23:59:59', icon: duration, color: blue }
durationMonth: { title: stats.durationMonth, query: duration, begin: 'first day of this month 00:00:00', end: 'last day of this month 23:59:59', icon: duration, color: purple }
durationYear: { title: stats.durationYear, query: duration, begin: '01 january this year 00:00:00', end: '31 december this year 23:59:59', icon: duration, color: yellow }
durationTotal: { title: stats.durationTotal, query: duration, icon: duration, color: red }
amountToday: { title: stats.amountToday, query: rate, begin: '00:00:00', end: '23:59:59', icon: money, color: green }
amountWeek: { title: stats.amountWeek, query: rate, begin: 'monday this week 00:00:00', end: 'sunday this week 23:59:59', icon: money, color: blue }
amountMonth: { title: stats.amountMonth, query: rate, begin: 'first day of this month 00:00:00', end: 'last day of this month 23:59:59', icon: money, color: purple }
amountYear: { title: stats.amountYear, query: rate, begin: '01 january this year 00:00:00', end: '31 december this year 23:59:59', icon: money, color: yellow }
amountTotal: { title: stats.amountTotal, query: rate, icon: money, color: red }
activeUsersToday: { title: stats.userActiveToday, query: users, begin: '00:00:00', end: '23:59:59', icon: user, color: green }
activeUsersWeek: { title: stats.userActiveWeek, query: users, begin: 'monday this week 00:00:00', end: 'sunday this week 23:59:59', icon: user, color: blue }
activeUsersMonth: { title: stats.userActiveMonth, query: users, begin: 'first day of this month 00:00:00', end: 'last day of this month 23:59:59', icon: user, color: purple }
activeUsersYear: { title: stats.userActiveYear, query: users, begin: '01 january this year 00:00:00', end: '31 december this year 23:59:59', icon: user, color: yellow }
activeUsersTotal: { title: stats.userActiveTotal, query: users, icon: user, color: red }
activeRecordings: { title: stats.activeRecordings, query: active, icon: duration, color: red }
# --------------------------------------------------------------------------------
# --------------------------------------------------------------------------------
# LANGUAGES
# Locale specific settings, like date formats
# --------------------------------------------------------------------------------
languages:
de:
date_time_type: 'dd.MM.yyyy HH:mm'
@@ -183,95 +288,25 @@ kimai:
date: 'Y-m-d'
date_time: 'm-d H:i'
duration: '%%h:%%m tim'
# --------------------------------------------------------------------------------
# --------------------------------------------------------------------------------
# timesheet calendar configuration
calendar:
week_numbers: true
day_limit: 4
businessHours:
days: [1, 2, 3, 4, 5]
begin: '08:00'
end: '20:00'
# You can configure unlimited google calendars to display events for your company (e.g. holidays)
# Find out more about calendar integration at https://www.kimai.org/documentation/calendar.html
# google:
# api_key: 'your-restricted-google-api-key'
# sources:
# holidays:
# id: 'de.german#holiday@group.v.calendar.google.com'
# color: '#ccc'
# --------------------------------------------------------------------------------
# FORMS
# Default settings used to populate forms
# --------------------------------------------------------------------------------
# defaults:
# customer:
# timezone: Europe/Berlin
# country: DE
# currency: EUR
# --------------------------------------------------------------------------------
# --------------------------------------------------------------------------------
# Theme related settings, will be available as twig globals at "kimai_context.*".
# See documentation at https://www.kimai.org/documentation/theme.html
#theme:
# BETA test: If you set this to 'selectpicker' the customer/project/activity select boxes will be transformed
# into a searchable and javascript enhanced input type
#select_type: ~
# --------------------------------------------------------------------------------
# Dashboard widget sections.
# See documentation at https://www.kimai.org/documentation/dashboard.html
dashboard:
user_duration:
title: dashboard.you
order: 10
permission: ROLE_USER
widgets: [userDurationToday, userDurationWeek, userDurationMonth, userDurationYear]
user_rates:
title: ~
order: 20
permission: ROLE_USER
widgets: [userAmountToday, userAmountWeek, userAmountMonth, userAmountYear]
duration:
title: dashboard.all
order: 30
permission: ROLE_TEAMLEAD
widgets: [durationToday, durationWeek, durationMonth, durationYear]
active_users:
title: ~
order: 40
permission: ROLE_TEAMLEAD
widgets: [activeUsersToday, activeUsersWeek, activeUsersMonth, activeUsersYear]
rates:
title: ~
order: 50
permission: ROLE_ADMIN
widgets: [amountToday, amountWeek, amountMonth, amountYear]
# --------------------------------------------------------------------------------
# Find out more about dashboard widgets at https://www.kimai.org/documentation/dashboard.html
widgets:
userDurationToday: { title: stats.durationToday, query: duration, user: true, begin: '00:00:00', end: '23:59:59', icon: duration, color: green }
userDurationWeek: { title: stats.durationWeek, query: duration, user: true, begin: 'monday this week 00:00:00', end: 'sunday this week 23:59:59', icon: duration, color: blue }
userDurationMonth: { title: stats.durationMonth, query: duration, user: true, begin: 'first day of this month 00:00:00', end: 'last day of this month 23:59:59', icon: duration, color: purple }
userDurationYear: { title: stats.durationYear, query: duration, user: true, begin: '01 january this year 00:00:00', end: '31 december this year 23:59:59', icon: duration, color: yellow }
userDurationTotal: { title: stats.durationTotal, query: duration, user: true, icon: duration, color: red }
userAmountToday: { title: stats.amountToday, query: rate, user: true, begin: '00:00:00', end: '23:59:59', icon: money, color: green }
userAmountWeek: { title: stats.amountWeek, query: rate, user: true, begin: 'monday this week 00:00:00', end: 'sunday this week 23:59:59', icon: money, color: blue }
userAmountMonth: { title: stats.amountMonth, query: rate, user: true, begin: 'first day of this month 00:00:00', end: 'last day of this month 23:59:59', icon: money, color: purple }
userAmountYear: { title: stats.amountYear, query: rate, user: true, begin: '01 january this year 00:00:00', end: '31 december this year 23:59:59', icon: money, color: yellow }
userAmountTotal: { title: stats.amountTotal, query: rate, user: true, icon: money, color: red }
durationToday: { title: stats.durationToday, query: duration, begin: '00:00:00', end: '23:59:59', icon: duration, color: green }
durationWeek: { title: stats.durationWeek, query: duration, begin: 'monday this week 00:00:00', end: 'sunday this week 23:59:59', icon: duration, color: blue }
durationMonth: { title: stats.durationMonth, query: duration, begin: 'first day of this month 00:00:00', end: 'last day of this month 23:59:59', icon: duration, color: purple }
durationYear: { title: stats.durationYear, query: duration, begin: '01 january this year 00:00:00', end: '31 december this year 23:59:59', icon: duration, color: yellow }
durationTotal: { title: stats.durationTotal, query: duration, icon: duration, color: red }
amountToday: { title: stats.amountToday, query: rate, begin: '00:00:00', end: '23:59:59', icon: money, color: green }
amountWeek: { title: stats.amountWeek, query: rate, begin: 'monday this week 00:00:00', end: 'sunday this week 23:59:59', icon: money, color: blue }
amountMonth: { title: stats.amountMonth, query: rate, begin: 'first day of this month 00:00:00', end: 'last day of this month 23:59:59', icon: money, color: purple }
amountYear: { title: stats.amountYear, query: rate, begin: '01 january this year 00:00:00', end: '31 december this year 23:59:59', icon: money, color: yellow }
amountTotal: { title: stats.amountTotal, query: rate, icon: money, color: red }
activeUsersToday: { title: stats.userActiveToday, query: users, begin: '00:00:00', end: '23:59:59', icon: user, color: green }
activeUsersWeek: { title: stats.userActiveWeek, query: users, begin: 'monday this week 00:00:00', end: 'sunday this week 23:59:59', icon: user, color: blue }
activeUsersMonth: { title: stats.userActiveMonth, query: users, begin: 'first day of this month 00:00:00', end: 'last day of this month 23:59:59', icon: user, color: purple }
activeUsersYear: { title: stats.userActiveYear, query: users, begin: '01 january this year 00:00:00', end: '31 december this year 23:59:59', icon: user, color: yellow }
activeUsersTotal: { title: stats.userActiveTotal, query: users, icon: user, color: red }
activeRecordings: { title: stats.activeRecordings, query: active, icon: duration, color: red }
# --------------------------------------------------------------------------------
# Storage directories
# --------------------------------------------------------------------------------
# STORAGE
# If you want to use directories outside the Kimai directory, change these
# --------------------------------------------------------------------------------
data_dir: '%kernel.project_dir%/var/data'
plugin_dir: '%kernel.project_dir%/var/plugins'
# --------------------------------------------------------------------------------

View File

@@ -26,7 +26,6 @@ App\Entity\Activity:
groups: [Default]
color:
include: true
groups: [Entity]
virtual_properties:
getProject:
serialized_name: project

View File

@@ -55,4 +55,3 @@ App\Entity\Customer:
groups: [Customer]
color:
include: true
groups: [Entity]

View File

@@ -27,7 +27,6 @@ App\Entity\Project:
groups: [Subresource]
color:
include: true
groups: [Entity]
virtual_properties:
getCustomer:
serialized_name: customer

View File

@@ -34,10 +34,6 @@ services:
App\EventSubscriber\RedirectToLocaleSubscriber:
arguments: ['@router', '%app_locales%', '%locale%']
App\Calendar\Service:
arguments:
$config: "%kimai.calendar%"
App\Repository\WidgetRepository:
arguments:
$widgets: "%kimai.widgets%"
@@ -53,6 +49,10 @@ services:
arguments:
$settings: "%kimai.timesheet%"
App\Configuration\CalendarConfiguration:
arguments:
$settings: "%kimai.calendar%"
App\Configuration\FormConfiguration:
arguments:
$settings: "%kimai.defaults%"

View File

@@ -4,6 +4,11 @@ services:
test.PasswordEncoder: "@security.encoder_factory"
# added, so we are able to overwrite the service for the CalendarControllerTest
App\Configuration\CalendarConfiguration:
arguments: ['@App\Repository\ConfigurationRepository', "%kimai.calendar%"]
public: true
App\Configuration\SystemConfiguration:
arguments: ['@App\Repository\ConfigurationRepository', "%kimai.config%"]