diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ec2365b7..51cf606e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,19 @@ and this project adheres to * [activity] display error messages above the form in creating a new location (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/481) * [activity] show required field in activity edit/new by an asterix in the vuejs fields (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/494) - +* [ACL] fix allow to see the course, event if the scope'course does not contains the scope's user +* [search] enforce limit of results for fetching rsults by search api https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/576 +* [activity] Fix delete button for document (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/554) +* [activity] Add return path the document generation (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/553) +* [person] add person ressource to person docgen normaliser (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/517) +* [person] AccompanyingCourseWorkEdit: fix deleting evaluation documents (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/546) +* [person] AccompanyingCourseWorkEdit: download existing documents (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/512) +* [person] AccompanyingCourseWorkEdit: replace document by a new one (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/511) +* [person] AccompanyingPeriodWork: add referrers to work, add doctrine event listener to add logged user to referrers collection and display a referrers list in work list (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/502) +* [person] AccompanyingPeriodWorkEvaluation: fix circular reference when serialising (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/495) +* [person] order accompanying period by opening date in search persons, person and household period lists (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/493) +* [parcours] autosave of the pinned comment for draft accompanying course (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/477) +* [main] filter user job in undispatch acc period to assign (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/472) * [main] filter user job in undispatch acc period to assign (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/472) * [person] Add url in accompanying period work evaluations entity and form (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/476) * [person] Add document generation in admin and in person/{id}/document (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/464) @@ -26,16 +38,33 @@ and this project adheres to * [Person/Household list] when listing other simultaneous members of an household, exclude the members on person, not on members (avoid to show two membersship with the same person) * [draft periods] add a delete button (if acl granted) on each draft period listed on draft period page (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/463) * [Person] Display suffixText in RenderPerson, PersonText.vue, RenderPersonBox.vue (was made for displaying "enfant confie") (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/441) -* [person] residential address: show residential address or info in PersonRenderBox, refactor Residential Address (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/439) +* [budget]: budget enabled for persons and households (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/469) +* [person] residential address: show residential address or info in PersonRenderBox, refactor Residential Address (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/439) * [thirdparty] Add a contact to a thirdparty from within onTheFly (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/345) * [documents] Improve flex-table item-col placement when long buttons and long metadata * [thirdparty] Fix display of multiple contact badges so they wrap onto next line (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/482) * [confidential] Fix position of toggle button so it does not cover text nor fall outside of box (no issue) * [parcours] Fix edit of both thirdparty and contact name (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/474) * [template] do not list inactive templates (for doc generator) +* [household] bugfix if position of member is null, renderbox no longer throws an error (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/480) * [parcours] location cannot be removed if linked to a user (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/478) * [person] email added to twig personRenderbox (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/490) * [person] Add link to current household in person banner (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/484) +* [address] person badge in address history changed to open OnTheFly with all person info (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/489) +* [person] Change 'personne' with 'usager' and '&' with 'ET' (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/499) +* [thirdparty] Add parameter condition to display centers or not (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/500) +* [phonenumber] Remove placeholder in phonenumber field (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/496) +* [person_resource] separate create page created to avoid confusion (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/504) +* [contact] add contact button color changed plus the pipe at the side removed (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/506) +* [household] create-edit household composition placed in separate page to avoid confusion (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/505) +* [blur] Improved positioning of toggle icon (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/486) +* [parcours] List of parcours for a specific user so they can be reassigned in case of absence (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/509) +* [thirdparty] Thirdparty view page, english text translated (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/534) +* [social_action] Translation changed in evaluation section (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/512) +* [filiation] Possible to add person (or create onthefly) to add to filiation graph + add relation (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/519) +* [household] Within parcours listing page of household add create button (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/560) +* [person_resource] bugfix when adding thirdparty or freetext resource (no issue) +* [aside_activity] style correction + sticky-form create button (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/529) ## Test releases diff --git a/docs/source/development/pagination.rst b/docs/source/development/pagination.rst index 1a2c91ff0..a9df72805 100644 --- a/docs/source/development/pagination.rst +++ b/docs/source/development/pagination.rst @@ -32,7 +32,7 @@ Then, render the pagination using the dedicated twig function. {% block title 'Item list'|trans %} - {% block personcontent %} + {% block content %} diff --git a/docs/source/development/user-interface/layout-template-usage.rst b/docs/source/development/user-interface/layout-template-usage.rst index 69848c650..1ddbacafd 100644 --- a/docs/source/development/user-interface/layout-template-usage.rst +++ b/docs/source/development/user-interface/layout-template-usage.rst @@ -156,7 +156,7 @@ This layout extend `ChillMainBundle::layoutWithVerticalMenu.html.twig` add the p It proposes 1 new block : -* personcontent +* content * where to display the information of the person diff --git a/phpstan-deprecations.neon b/phpstan-deprecations.neon index 1e80ab775..2de8b8bc8 100644 --- a/phpstan-deprecations.neon +++ b/phpstan-deprecations.neon @@ -222,33 +222,6 @@ parameters: count: 1 path: src/Bundle/ChillActivityBundle/Timeline/TimelineActivityProvider.php - - - message: - """ - #^Class Chill\\\\AMLI\\\\BudgetBundle\\\\Controller\\\\AbstractElementController extends deprecated class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\Controller\\: - since Symfony 4\\.2, use "Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController" instead\\.$# - """ - count: 1 - path: src/Bundle/ChillBudgetBundle/Controller/AbstractElementController.php - - - - message: - """ - #^Class Chill\\\\AMLI\\\\BudgetBundle\\\\Controller\\\\ElementController extends deprecated class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\Controller\\: - since Symfony 4\\.2, use "Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController" instead\\.$# - """ - count: 1 - path: src/Bundle/ChillBudgetBundle/Controller/ElementController.php - - - - message: - """ - #^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: - since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$# - """ - count: 1 - path: src/Bundle/ChillBudgetBundle/Security/Authorization/BudgetElementVoter.php - - message: """ diff --git a/phpstan-types.neon b/phpstan-types.neon index ddde5cc03..9671c05a5 100644 --- a/phpstan-types.neon +++ b/phpstan-types.neon @@ -250,11 +250,6 @@ parameters: count: 1 path: src/Bundle/ChillMainBundle/Entity/Address.php - - - message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" - count: 1 - path: src/Bundle/ChillMainBundle/Entity/Embeddable/CommentEmbeddable.php - - message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" count: 1 diff --git a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php index 3858979ef..a89b1d67c 100644 --- a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php +++ b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php @@ -179,14 +179,15 @@ final class ActivityController extends AbstractController { $view = null; - [$person, $accompanyingPeriod] = $this->getEntity($request); - $entity = $this->activityRepository->find($id); if (null === $entity) { throw $this->createNotFoundException('Unable to find Activity entity.'); } + $accompanyingPeriod = $entity->getAccompanyingPeriod(); + $person = $entity->getPerson(); + if ($entity->getAccompanyingPeriod() instanceof AccompanyingPeriod) { $view = 'ChillActivityBundle:Activity:editAccompanyingCourse.html.twig'; $accompanyingPeriod = $entity->getAccompanyingPeriod(); @@ -220,6 +221,9 @@ final class ActivityController extends AbstractController $this->entityManager->persist($entity); $this->entityManager->flush(); + $params = $this->buildParamsToUrl($person, $accompanyingPeriod); + $params['id'] = $entity->getId(); + if ($form->has('gendocTemplateId') && null !== $form['gendocTemplateId']->getData()) { return $this->redirectToRoute( 'chill_docgenerator_generate_from_template', @@ -227,15 +231,13 @@ final class ActivityController extends AbstractController 'template' => $form->get('gendocTemplateId')->getData(), 'entityClassName' => Activity::class, 'entityId' => $entity->getId(), + 'returnPath' => $this->generateUrl('chill_activity_activity_edit', $params), ] ); } $this->addFlash('success', $this->get('translator')->trans('Success : activity updated!')); - $params = $this->buildParamsToUrl($person, $accompanyingPeriod); - $params['id'] = $entity->getId(); - return $this->redirectToRoute('chill_activity_activity_show', $params); } @@ -444,6 +446,9 @@ final class ActivityController extends AbstractController 'template' => $form->get('gendocTemplateId')->getData(), 'entityClassName' => Activity::class, 'entityId' => $entity->getId(), + 'returnPath' => $this->generateUrl('chill_activity_activity_edit', [ + 'id' => $entity->getId(), + ]), ] ); } diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityType.php b/src/Bundle/ChillActivityBundle/Form/ActivityType.php index 020955851..3a772d878 100644 --- a/src/Bundle/ChillActivityBundle/Form/ActivityType.php +++ b/src/Bundle/ChillActivityBundle/Form/ActivityType.php @@ -309,6 +309,7 @@ class ActivityType extends AbstractType 'label' => $activityType->getLabel('documents'), 'required' => $activityType->isRequired('documents'), 'allow_add' => true, + 'allow_delete' => true, 'button_add_label' => 'activity.Insert a document', 'button_remove_label' => 'activity.Remove a document', 'empty_collection_explain' => 'No documents', diff --git a/src/Bundle/ChillActivityBundle/Resources/public/page/edit_activity/index.scss b/src/Bundle/ChillActivityBundle/Resources/public/page/edit_activity/index.scss new file mode 100644 index 000000000..16e66eadb --- /dev/null +++ b/src/Bundle/ChillActivityBundle/Resources/public/page/edit_activity/index.scss @@ -0,0 +1,16 @@ +div.chill-dropzone__below-zone { + a.btn-delete { + display: none; + } +} + +// do it in js does not work +// document.addEventListener('DOMContentLoaded', e => { +// const dropzoneBelow = document.querySelectorAll('div.chill-dropzone__below-zone'); +// dropzoneBelow.forEach( +// d => { +// const a = d.querySelector('a.btn-delete'); +// d.removeChild(a); +// } +// ) +// }); diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/confirm_deletePerson.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/confirm_deletePerson.html.twig index 9f8172bb4..43c2157fa 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/confirm_deletePerson.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/confirm_deletePerson.html.twig @@ -5,7 +5,7 @@ {% block title 'Remove activity'|trans %} -{% block personcontent %} +{% block content %} {{ include('@ChillMain/Util/confirmation_template.html.twig', { 'title' : 'Remove activity'|trans, diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/editAccompanyingCourse.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/editAccompanyingCourse.html.twig index b278c0300..d0359e223 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/editAccompanyingCourse.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/editAccompanyingCourse.html.twig @@ -30,4 +30,5 @@ {{ parent() }} {{ encore_entry_link_tags('mod_async_upload') }} {{ encore_entry_link_tags('vue_activity') }} + {{ encore_entry_link_tags('page_edit_activity') }} {% endblock %} diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/editPerson.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/editPerson.html.twig index 82c7403c6..91b3867c1 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/editPerson.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/editPerson.html.twig @@ -20,7 +20,7 @@ {% block title 'Update activity'|trans %} -{% block personcontent %} +{% block content %}
{# <=== vue component #} diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/listPerson.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/listPerson.html.twig index ac4266f8c..f55c68fcc 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/listPerson.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/listPerson.html.twig @@ -30,7 +30,7 @@ {{ encore_entry_link_tags('mod_notification_toggle_read_status') }} {% endblock %} -{% block personcontent %} +{% block content %} {% set person_id = null %} {% if person %} @@ -46,7 +46,7 @@ {% include 'ChillActivityBundle:Activity:list.html.twig' with {'context': 'person'} %} - {% if is_granted('CHILL_ACTIVITY_CREATE', person) %} + {% if is_granted('CHILL_ACTIVITY_CREATE_PERSON', person) %}
-
+
+ + + + + + + + + + {% set total = 0 %} + {% for f in elements %} + {% set total = total + f.amount %} + + + + + + + {% endfor %} + + + + + + + +
{{ 'Budget element type'|trans }}{{ 'Amount'|trans }}{{ 'Validity period'|trans }} 
+ + + {{ f.type|budget_element_type_display(family) }} + + {{ f.amount|format_currency('EUR') }} + {% if f.endDate is not null %} + {{ f.startDate|format_date('short') ~ ' - ' ~ f.endDate|format_date('short') }} + {% else %} + {{ f.startDate|format_date('short') ~ ' - ...' }} + {% endif %} + +
    + {% if is_granted('CHILL_BUDGET_ELEMENT_SEE', f) %} +
  • + +
  • + {% endif %} + {% if is_granted('CHILL_BUDGET_ELEMENT_UPDATE', f) %} +
  • + +
  • + {% endif %} + {% if is_granted('CHILL_BUDGET_ELEMENT_DELETE', f) %} +
  • + +
  • + {% endif %} +
+
+ {{ 'Total'|trans }} + + {{ total|format_currency('EUR') }} +   
+{% endmacro %} + +{% macro table_results(actualCharges, actualResources) %} + +{% set totalCharges = 0 %} +{% for c in actualCharges %} + {% set totalCharges = totalCharges + c.amount %} +{% endfor %} + +{% set totalResources = 0 %} +{% for r in actualResources %} + {% set totalResources = totalResources + r.amount %} +{% endfor %} + +{% set result = (totalResources - totalCharges) %} + + + + + + + + + + + + + + + + +
  {{ 'Budget calculator result'|trans }}
{{ 'The balance'|trans }}  + {{ result|format_currency('EUR') }} +
+{% endmacro %} diff --git a/src/Bundle/ChillBudgetBundle/Resources/views/Budget/_past_budget.html.twig b/src/Bundle/ChillBudgetBundle/Resources/views/Budget/_past_budget.html.twig new file mode 100644 index 000000000..14573048e --- /dev/null +++ b/src/Bundle/ChillBudgetBundle/Resources/views/Budget/_past_budget.html.twig @@ -0,0 +1,53 @@ +{% from 'ChillBudgetBundle:Budget:_macros.html.twig' import table_elements, table_results %} + +
+
+

+ +

+ +
+ +
+

{{ 'Past resources'|trans }}

+ + {% if pastResources|length > 0 %} +
+ {{ table_elements(pastResources, 'resource') }} +
+ {% else %} +
+ {{ 'No past resources registered'|trans }} +
+ {% endif %} +
+ +
+

{{ 'Past charges'|trans }}

+ + {% if pastCharges|length > 0 %} +
+ {{ table_elements(pastCharges, 'charge') }} +
+ {% else %} +
+ {{ 'No past charges registered'|trans }} +
+ {% endif %} +
+
+ +
+
\ No newline at end of file diff --git a/src/Bundle/ChillBudgetBundle/Resources/views/Charge/confirm_delete.html.twig b/src/Bundle/ChillBudgetBundle/Resources/views/Charge/confirm_delete.html.twig index 1f191eafd..f64184d6f 100644 --- a/src/Bundle/ChillBudgetBundle/Resources/views/Charge/confirm_delete.html.twig +++ b/src/Bundle/ChillBudgetBundle/Resources/views/Charge/confirm_delete.html.twig @@ -1,18 +1,29 @@ -{% extends "@ChillPerson/Person/layout.html.twig" %} +{% if element.person is not null %} + {% set template = '@ChillPerson/Person/layout.html.twig' %} + {% set indexPage = 'chill_budget_elements_index' %} + {% set activeRouteKey = '' %} + {% set person = element.person %} + {% set confirm_question = 'Are you sure you want to remove the charge "%type%" associated to "%name%" ?'|trans({ '%name%' : person.firstname ~ ' ' ~ person.lastname, '%type%': element.type|budget_element_type_display('charge') } ) %} +{% else %} + {% set template = '@ChillPerson/Household/layout.html.twig' %} + {% set indexPage = 'chill_budget_elements_household_index' %} + {% set activeRouteKey = '' %} + {% set household = element.household %} + {% set confirm_question = 'Are you sure you want to remove the charge "%type%" associated to household "%household%" ?'|trans({ '%household%' : household.id, '%type%': element.type|budget_element_type_display('charge') } ) %} +{% endif %} -{% set activeRouteKey = '' %} -{% set person = element.person %} +{% extends template %} -{% block title 'Remove resource'|trans %} +{% block title 'Remove charge'|trans %} -{% block personcontent %} +{% block content %} {{ include('ChillMainBundle:Util:confirmation_template.html.twig', { 'title' : 'Remove charge'|trans, - 'confirm_question' : 'Are you sure you want to remove the charge "%type%" associated to "%name%" ?'|trans({ '%name%' : person.firstname ~ ' ' ~ person.lastname, '%type%': element.type|budget_element_type_display('charge') } ), - 'cancel_route' : 'chill_budget_elements_index', - 'cancel_parameters' : { 'id' : element.person.id }, + 'confirm_question' : confirm_question, + 'cancel_route' : indexPage, + 'cancel_parameters' : { 'id': person is defined ? person.id : household.id }, 'form' : delete_form } ) }} diff --git a/src/Bundle/ChillBudgetBundle/Resources/views/Charge/edit.html.twig b/src/Bundle/ChillBudgetBundle/Resources/views/Charge/edit.html.twig index 5b1bc538a..fed80a5c0 100644 --- a/src/Bundle/ChillBudgetBundle/Resources/views/Charge/edit.html.twig +++ b/src/Bundle/ChillBudgetBundle/Resources/views/Charge/edit.html.twig @@ -1,31 +1,43 @@ -{% extends "@ChillPerson/Person/layout.html.twig" %} +{% if element.person is not null %} + {% set template = '@ChillPerson/Person/layout.html.twig' %} + {% set indexPage = 'chill_budget_elements_index' %} + {% set activeRouteKey = '' %} + {% set person = element.person %} +{% else %} + {% set template = '@ChillPerson/Household/layout.html.twig' %} + {% set indexPage = 'chill_budget_elements_household_index' %} + {% set activeRouteKey = '' %} + {% set household = element.household %} +{% endif %} + +{% set title = 'Edit charge'|trans %} + +{% extends template %} -{% set activeRouteKey = '' %} -{% set title = 'Edit Charge for %name%'|trans({ '%name%' : person.firstName ~ " " ~ person.lastName } ) %} {% block title title %} -{% block personcontent %} +{% block content %}

{{ title }}

{{ form_start(form) }} {{ form_row(form.type) }} {{ form_row(form.amount) }} -{{ form_row(form.help) }} +{{ form_row(form.help) }} {{ form_row(form.comment) }} {{ form_row(form.startDate) }} {{ form_row(form.endDate) }}
- + {{ form_end(form) }} {% endblock %} diff --git a/src/Bundle/ChillBudgetBundle/Resources/views/Charge/new.html.twig b/src/Bundle/ChillBudgetBundle/Resources/views/Charge/new.html.twig index e784b5bf7..817d501ca 100644 --- a/src/Bundle/ChillBudgetBundle/Resources/views/Charge/new.html.twig +++ b/src/Bundle/ChillBudgetBundle/Resources/views/Charge/new.html.twig @@ -1,31 +1,42 @@ -{% extends "@ChillPerson/Person/layout.html.twig" %} +{% if element.person is not null %} + {% set template = '@ChillPerson/Person/layout.html.twig' %} + {% set indexPage = 'chill_budget_elements_index' %} + {% set activeRouteKey = '' %} + {% set person = element.person %} +{% else %} + {% set template = '@ChillPerson/Household/layout.html.twig' %} + {% set indexPage = 'chill_budget_elements_household_index' %} + {% set activeRouteKey = '' %} + {% set household = element.household %} +{% endif %} -{% set activeRouteKey = '' %} -{% set title = 'New Charge for %name%'|trans({ '%name%' : person.firstName ~ " " ~ person.lastName } ) %} +{% set title = 'New charge'|trans %} + +{% extends template %} {% block title title %} -{% block personcontent %} +{% block content %}

{{ title }}

{{ form_start(form) }} {{ form_row(form.type) }} {{ form_row(form.amount) }} -{{ form_row(form.help) }} +{{ form_row(form.help) }} {{ form_row(form.comment) }} {{ form_row(form.startDate) }} {{ form_row(form.endDate) }}
- + {{ form_end(form) }} {% endblock %} diff --git a/src/Bundle/ChillBudgetBundle/Resources/views/Charge/view.html.twig b/src/Bundle/ChillBudgetBundle/Resources/views/Charge/view.html.twig index d939fe81a..d3b9ef71b 100644 --- a/src/Bundle/ChillBudgetBundle/Resources/views/Charge/view.html.twig +++ b/src/Bundle/ChillBudgetBundle/Resources/views/Charge/view.html.twig @@ -1,49 +1,68 @@ -{% extends "@ChillPerson/Person/layout.html.twig" %} +{% if element.person is not null %} + {% set template = '@ChillPerson/Person/layout.html.twig' %} + {% set indexPage = 'chill_budget_elements_index' %} + {% set activeRouteKey = '' %} + {% set person = element.person %} +{% else %} + {% set template = '@ChillPerson/Household/layout.html.twig' %} + {% set indexPage = 'chill_budget_elements_household_index' %} + {% set activeRouteKey = '' %} + {% set household = element.household %} +{% endif %} -{% set activeRouteKey = '' %} -{% set person = element.person %} -{% set title = 'Charge for %name%'|trans({ '%name%' : person.firstName ~ " " ~ person.lastName } ) %} +{% set title = 'Charge' %} + +{% extends template %} {% block title title %} -{% block personcontent %} -

{{ title }}

+{% block content %} +
+

{{ title }}

-
-
{{ 'Type'|trans }}
-
{{ element.type|budget_element_type_display('charge') }}
- -
{{ 'Amount'|trans }}
-
{{ element.amount|localizedcurrency('EUR') }}
- -
{{ 'Validity period'|trans }}
-
- {% if element.endDate is not null %} - {{ 'Valid since %startDate% until %endDate%'|trans( { '%startDate%': element.startDate|localizeddate('long', 'none'), '%endDate%': familyMember.endDate|localizeddate('long', 'none') } ) }} - {% else %} - {{ 'Valid since %startDate%'|trans( { '%startDate%': element.startDate|localizeddate('long', 'none') } ) }} - {% endif %} -
- -
{{ 'Comment'|trans }}
-
- {%- if element.comment is not empty -%} -
- {{ element.comment }} -
- {%- else -%} - {{ 'Not given'|trans }} - {%- endif -%} -
-
+
+
+
+

+ + {{ element.type|budget_element_type_display('charge') }} +

+
+
+
+
{{ 'Amount'|trans }}
+
{{ element.amount|format_currency('EUR') }}
+
{{ 'Validity period'|trans }}
+
+ {% if element.endDate is not null %} + {{ 'Valid since %startDate% until %endDate%'|trans( { '%startDate%': element.startDate|format_date('long'), '%endDate%': element.endDate|format_date('long') } ) }} + {% else %} + {{ 'Valid since %startDate%'|trans( { '%startDate%': element.startDate|format_date('long') } ) }} + {% endif %} +
+
{{ 'Comment'|trans }}
+
+ {%- if element.comment is not empty -%} +
+ {{ element.comment }} +
+ {%- else -%} + {{ 'Not given'|trans }} + {%- endif -%} +
+
+
+
+
+