added database driven system configurations with admin screen (#647)

This commit is contained in:
Kevin Papst
2019-03-22 20:58:38 +01:00
committed by GitHub
parent e990ae4800
commit 13d9f8f3f7
142 changed files with 2262 additions and 64727 deletions

View File

@@ -38,8 +38,7 @@ kimai:
# If you want to limit the max. active entries per user, you can do it here.
#
# The soft_limit is used as theme setting (formerly "kimai.theme.active_warning"):
# display a warning color if the user has at least X active recordings
# 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.
@@ -98,7 +97,7 @@ kimai:
ROLE_USER: []
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]
ROLE_SUPER_ADMIN: [hourly-rate_own_profile,hourly-rate_other_profile,delete_own_profile,roles_own_profile,system_information,system_configuration]
# --------------------------------------------------------------------------------
# Language specific settings, like the date formats
@@ -266,9 +265,7 @@ kimai:
activeUsersTotal: { title: stats.userActiveTotal, query: users, icon: user, color: red }
activeRecordings: { title: stats.activeRecordings, query: active, icon: duration, color: red }
# Default settings used to populate forms
#defaults:
# customer:
# timezone: Europe/Berlin
# country: DE
# currency: EUR
# --------------------------------------------------------------------------------
# Storage directories
data_dir: '%kernel.project_dir%/var/data'
plugin_dir: '%kernel.project_dir%/var/plugins'

View File

@@ -14,7 +14,6 @@ services:
# The best practice is to be explicit about your dependencies anyway.
bind:
$projectDirectory: "%kernel.project_dir%"
$hardLimit: "%kimai.timesheet.active_entries.hard_limit%"
# makes classes in src/ available to be used as services
# this creates a service per class whose id is the fully-qualified class name
@@ -47,17 +46,20 @@ services:
arguments:
$dashboard: "%kimai.dashboard%"
App\Twig\MarkdownExtension:
arguments:
$timesheetAsMarkdown: "%kimai.timesheet.markdown%"
App\Controller\CustomerController:
arguments:
$defaults: "%kimai.defaults%"
App\Configuration\LanguageFormattings:
arguments: ["%kimai.languages%"]
App\Configuration\TimesheetConfiguration:
arguments:
$languageSettings: "%kimai.languages%"
$settings: "%kimai.timesheet%"
App\Configuration\FormConfiguration:
arguments:
$settings: "%kimai.defaults%"
App\Configuration\SystemConfiguration:
arguments:
$settings: "%kimai.config%"
App\Utils\MPdfConverter:
arguments: ['%kernel.cache_dir%']
@@ -104,19 +106,10 @@ services:
tags:
- { name: form.type_extension, extended_type: Symfony\Bridge\Doctrine\Form\Type\EntityType }
App\Form\TimesheetEditForm:
arguments:
$durationOnly: "%kimai.timesheet.duration_only%"
App\Form\Extension\SelectWithApiDataExtension:
tags:
- { name: form.type_extension, extended_type: Symfony\Bridge\Doctrine\Form\Type\EntityType }
App\Validator\Constraints\TimesheetValidator:
arguments:
$ruleset: "%kimai.timesheet.rules%"
$durationOnly: "%kimai.timesheet.duration_only%"
# ================================================================================
# THEME
# ================================================================================
@@ -175,6 +168,11 @@ services:
factory: ['@doctrine.orm.entity_manager', getRepository]
arguments: ['App\Entity\InvoiceTemplate']
App\Repository\ConfigurationRepository:
class: Doctrine\ORM\EntityRepository
factory: ['@doctrine.orm.entity_manager', getRepository]
arguments: ['App\Entity\Configuration']
App\Repository\InvoiceDocumentRepository:
class: App\Repository\InvoiceDocumentRepository
arguments: ['%kimai.invoice.documents%']

View File

@@ -2,4 +2,12 @@ services:
_defaults:
public: true
test.PasswordEncoder: "@security.encoder_factory"
test.PasswordEncoder: "@security.encoder_factory"
App\Configuration\SystemConfiguration:
arguments: ['@App\Repository\ConfigurationRepository', "%kimai.config%"]
App\Repository\ConfigurationRepository:
class: Doctrine\ORM\EntityRepository
factory: ['@doctrine.orm.entity_manager', getRepository]
arguments: ['App\Entity\Configuration']