diff --git a/src/Controller/SystemConfigurationController.php b/src/Controller/SystemConfigurationController.php
index bbf48d19..270ac554 100644
--- a/src/Controller/SystemConfigurationController.php
+++ b/src/Controller/SystemConfigurationController.php
@@ -449,11 +449,12 @@ final class SystemConfigurationController extends AbstractController
(new SystemConfigurationModel())
->setSection(SystemConfigurationModel::SECTION_FORM_INVOICE)
->setConfiguration([
+ // TODO that should be a custom type with validation
(new Configuration())
->setName('invoice.number_format')
->setLabel('invoice.number_format')
->setRequired(true)
- ->setType(TextType::class) // TODO that should be a custom type with validation
+ ->setType(TextType::class)
->setTranslationDomain('system-configuration'),
(new Configuration())
->setName('invoice.simple_form')
@@ -470,15 +471,18 @@ final class SystemConfigurationController extends AbstractController
->setName('defaults.customer.timezone')
->setLabel('timezone')
->setType(TimezoneType::class)
- ->setValue(date_default_timezone_get()),
+ ->setValue(date_default_timezone_get())
+ ->setOptions(['help' => 'default_value_new']),
(new Configuration())
->setName('defaults.customer.country')
->setLabel('country')
- ->setType(CountryType::class),
+ ->setType(CountryType::class)
+ ->setOptions(['help' => 'default_value_new']),
(new Configuration())
->setName('defaults.customer.currency')
->setLabel('currency')
- ->setType(CurrencyType::class),
+ ->setType(CurrencyType::class)
+ ->setOptions(['help' => 'default_value_new']),
]),
(new SystemConfigurationModel())
->setSection(SystemConfigurationModel::SECTION_FORM_USER)
@@ -487,19 +491,28 @@ final class SystemConfigurationController extends AbstractController
->setName('defaults.user.timezone')
->setLabel('timezone')
->setType(TimezoneType::class)
- ->setValue(date_default_timezone_get()),
+ ->setValue(date_default_timezone_get())
+ ->setOptions(['help' => 'default_value_new']),
(new Configuration())
->setName('defaults.user.language')
->setLabel('language')
- ->setType(LanguageType::class),
+ ->setType(LanguageType::class)
+ ->setOptions(['help' => 'default_value_new']),
(new Configuration())
->setName('defaults.user.theme')
->setLabel('skin')
- ->setType(SkinType::class),
+ ->setType(SkinType::class)
+ ->setOptions(['help' => 'default_value_new']),
(new Configuration())
->setName('defaults.user.currency')
->setLabel('currency')
->setType(CurrencyType::class),
+ (new Configuration())
+ ->setName('theme.avatar_url')
+ ->setRequired(false)
+ ->setLabel('theme.avatar_url')
+ ->setType(CheckboxType::class)
+ ->setTranslationDomain('system-configuration'),
]),
(new SystemConfigurationModel())
->setSection(SystemConfigurationModel::SECTION_THEME)
@@ -532,13 +545,6 @@ final class SystemConfigurationController extends AbstractController
->setOptions(['help' => 'help.theme.color_choices'])
->setConstraints([new ColorChoices()])
->setTranslationDomain('system-configuration'),
- // allow avatar URLs
- (new Configuration())
- ->setName('theme.avatar_url')
- ->setRequired(false)
- ->setLabel('theme.avatar_url')
- ->setType(CheckboxType::class)
- ->setTranslationDomain('system-configuration'),
// random colors as fallback
(new Configuration())
->setName('theme.random_colors')
diff --git a/src/Form/Model/SystemConfiguration.php b/src/Form/Model/SystemConfiguration.php
index a1ae7ad0..77428062 100644
--- a/src/Form/Model/SystemConfiguration.php
+++ b/src/Form/Model/SystemConfiguration.php
@@ -15,8 +15,8 @@ class SystemConfiguration
public const SECTION_LOCKDOWN = 'lockdown_period';
public const SECTION_TIMESHEET = 'timesheet';
public const SECTION_FORM_INVOICE = 'invoice';
- public const SECTION_FORM_CUSTOMER = 'form_customer';
- public const SECTION_FORM_USER = 'form_user';
+ public const SECTION_FORM_CUSTOMER = 'customer';
+ public const SECTION_FORM_USER = 'user';
public const SECTION_THEME = 'theme';
public const SECTION_AUTHENTICATION = 'authentication';
public const SECTION_CALENDAR = 'calendar';
diff --git a/templates/system-configuration/index.html.twig b/templates/system-configuration/index.html.twig
index dccc9d3c..a5446537 100644
--- a/templates/system-configuration/index.html.twig
+++ b/templates/system-configuration/index.html.twig
@@ -9,8 +9,12 @@
{% set formEditTemplate = app.request.xmlHttpRequest ? 'default/_form_modal.html.twig' : 'default/_form.html.twig' %}
{% for section in sections %}
+ {% set title = section.model.section|trans({}, 'system-configuration') %}
+ {% if title == section.model.section %}
+ {% set title = ('label.' ~ section.model.section)|trans %}
+ {% endif %}
{{ include(formEditTemplate, {
- 'title': section.model.section|trans({}, 'system-configuration'),
+ 'title': title,
'form': section.form,
}) }}
{% endfor %}
diff --git a/tests/Controller/SystemConfigurationControllerTest.php b/tests/Controller/SystemConfigurationControllerTest.php
index 25b939ca..48123f59 100644
--- a/tests/Controller/SystemConfigurationControllerTest.php
+++ b/tests/Controller/SystemConfigurationControllerTest.php
@@ -54,8 +54,6 @@ class SystemConfigurationControllerTest extends ControllerBaseTest
$client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN);
$this->assertAccessIsGranted($client, '/admin/system-config/edit/timesheet');
- $expectedForms = $this->getTestDataForms();
-
$result = $client->getCrawler()->filter('section.content div.box.box-primary');
$this->assertEquals(1, \count($result));
@@ -76,8 +74,8 @@ class SystemConfigurationControllerTest extends ControllerBaseTest
['form[name=system_configuration_form_invoice]', $this->createUrl('/admin/system-config/update/invoice')],
['form[name=system_configuration_form_authentication]', $this->createUrl('/admin/system-config/update/authentication')],
['form[name=system_configuration_form_rounding]', $this->createUrl('/admin/system-config/update/rounding')],
- ['form[name=system_configuration_form_form_customer]', $this->createUrl('/admin/system-config/update/form_customer')],
- ['form[name=system_configuration_form_form_user]', $this->createUrl('/admin/system-config/update/form_user')],
+ ['form[name=system_configuration_form_customer]', $this->createUrl('/admin/system-config/update/customer')],
+ ['form[name=system_configuration_form_user]', $this->createUrl('/admin/system-config/update/user')],
['form[name=system_configuration_form_theme]', $this->createUrl('/admin/system-config/update/theme')],
['form[name=system_configuration_form_calendar]', $this->createUrl('/admin/system-config/update/calendar')],
['form[name=system_configuration_form_branding]', $this->createUrl('/admin/system-config/update/branding')],
@@ -191,9 +189,9 @@ class SystemConfigurationControllerTest extends ControllerBaseTest
$this->assertEquals('DE', $configService->find('defaults.customer.country'));
$this->assertEquals('EUR', $configService->find('defaults.customer.currency'));
- $form = $client->getCrawler()->filter('form[name=system_configuration_form_form_customer]')->form();
+ $form = $client->getCrawler()->filter('form[name=system_configuration_form_customer]')->form();
$client->submit($form, [
- 'system_configuration_form_form_customer' => [
+ 'system_configuration_form_customer' => [
'configuration' => [
['name' => 'defaults.customer.timezone', 'value' => 'Atlantic/Canary'],
['name' => 'defaults.customer.country', 'value' => 'BB'],
@@ -223,9 +221,9 @@ class SystemConfigurationControllerTest extends ControllerBaseTest
$this->assertNull($configService->find('defaults.user.theme'));
$this->assertEquals('en', $configService->find('defaults.user.language'));
- $form = $client->getCrawler()->filter('form[name=system_configuration_form_form_user]')->form();
+ $form = $client->getCrawler()->filter('form[name=system_configuration_form_user]')->form();
$client->submit($form, [
- 'system_configuration_form_form_user' => [
+ 'system_configuration_form_user' => [
'configuration' => [
['name' => 'defaults.user.timezone', 'value' => 'Pacific/Tahiti'],
['name' => 'defaults.user.language', 'value' => 'ru'],
@@ -250,9 +248,9 @@ class SystemConfigurationControllerTest extends ControllerBaseTest
$this->assertFormHasValidationError(
User::ROLE_SUPER_ADMIN,
'/admin/system-config/',
- 'form[name=system_configuration_form_form_customer]',
+ 'form[name=system_configuration_form_customer]',
[
- 'system_configuration_form_form_customer' => [
+ 'system_configuration_form_customer' => [
'configuration' => [
['name' => 'defaults.customer.timezone', 'value' => 'XX'],
['name' => 'defaults.customer.country', 'value' => 1],
@@ -261,9 +259,9 @@ class SystemConfigurationControllerTest extends ControllerBaseTest
]
],
[
- '#system_configuration_form_form_customer_configuration_0_value',
- '#system_configuration_form_form_customer_configuration_1_value',
- '#system_configuration_form_form_customer_configuration_2_value',
+ '#system_configuration_form_customer_configuration_0_value',
+ '#system_configuration_form_customer_configuration_1_value',
+ '#system_configuration_form_customer_configuration_2_value',
],
true
);
diff --git a/translations/messages.de.xlf b/translations/messages.de.xlf
index a11fa6ec..f77f50f8 100644
--- a/translations/messages.de.xlf
+++ b/translations/messages.de.xlf
@@ -725,7 +725,7 @@
label.avatar
- Profilbild
+ Profilbild (URL)
label.active
@@ -1252,6 +1252,10 @@
team.add_user.help
Durch Auswahl wird dem Team ein neuer Benutzer hinzugefügt. Sie können im Anschluss festlegen, ob der Benutzer ein Teamleiter sein soll.
+
+ default_value_new
+ Standard Wert für neue Einträge
+