diff --git a/composer.lock b/composer.lock index db77085e..1aa63dc2 100644 --- a/composer.lock +++ b/composer.lock @@ -52,12 +52,12 @@ "source": { "type": "git", "url": "https://github.com/kevinpapst/AdminThemeBundle.git", - "reference": "d0d849ac59889ad6f4408fee84e23b09d7d65d36" + "reference": "909be9b2d19bc31db1751990b93cf0192893ae5c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/kevinpapst/AdminThemeBundle/zipball/d0d849ac59889ad6f4408fee84e23b09d7d65d36", - "reference": "d0d849ac59889ad6f4408fee84e23b09d7d65d36", + "url": "https://api.github.com/repos/kevinpapst/AdminThemeBundle/zipball/909be9b2d19bc31db1751990b93cf0192893ae5c", + "reference": "909be9b2d19bc31db1751990b93cf0192893ae5c", "shasum": "" }, "require": { @@ -111,7 +111,7 @@ "support": { "source": "https://github.com/kevinpapst/AdminThemeBundle/tree/kevinpapst" }, - "time": "2018-01-21T19:07:18+00:00" + "time": "2018-06-19T21:30:20+00:00" }, { "name": "beberlei/DoctrineExtensions", diff --git a/config/services.yaml b/config/services.yaml index 83c7dff6..d8d5d74e 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -73,6 +73,10 @@ services: tags: - { name: form.type } + App\Form\Extension\DocumentationLinkExtension: + tags: + - { name: form.type_extension, extended_type: Symfony\Component\Form\Extension\Core\Type\FormType } + # ================================================================================ # THEME # ================================================================================ diff --git a/src/Form/Extension/DocumentationLinkExtension.php b/src/Form/Extension/DocumentationLinkExtension.php new file mode 100644 index 00000000..a5d57bf0 --- /dev/null +++ b/src/Form/Extension/DocumentationLinkExtension.php @@ -0,0 +1,49 @@ +vars['documentation'] = $options['documentation'] ?? ''; + } + + /** + * @param OptionsResolver $resolver + */ + public function configureOptions(OptionsResolver $resolver) + { + $resolver->setDefined(array('documentation')); + $resolver->setDefaults(['documentation' => null]); + } +} diff --git a/src/Form/TimesheetEditForm.php b/src/Form/TimesheetEditForm.php index f309c582..e9766b94 100644 --- a/src/Form/TimesheetEditForm.php +++ b/src/Form/TimesheetEditForm.php @@ -94,6 +94,7 @@ class TimesheetEditForm extends AbstractType 'csrf_token_id' => 'timesheet_edit', 'duration_only' => false, 'include_user' => false, + 'documentation' => 'timesheet', ]); } } diff --git a/templates/default/_form.html.twig b/templates/default/_form.html.twig index 4443383b..89102233 100644 --- a/templates/default/_form.html.twig +++ b/templates/default/_form.html.twig @@ -1,7 +1,13 @@