PersonHistoryFile -> AccompanyingPeriod - refs #275

This commit is contained in:
Marc Ducobu
2015-02-06 11:19:36 +01:00
parent 58d05123bb
commit 8d5d2189f1
15 changed files with 394 additions and 404 deletions

View File

@@ -1,4 +1,4 @@
Chill\PersonBundle\Entity\PersonHistoryFile:
Chill\PersonBundle\Entity\AccompanyingPeriod:
type: entity
table: person_history_file
id:

View File

@@ -45,30 +45,30 @@ chill_person_search:
order: 30
label: Search within persons
chill_person_history_list:
pattern: /{_locale}/person/{person_id}/history
defaults: { _controller: ChillPersonBundle:History:list }
chill_person_accompanying_period_list:
pattern: /{_locale}/person/{person_id}/accompanying-period
defaults: { _controller: ChillPersonBundle:AccompanyingPeriod:list }
# options:
# menus:
# person:
# order: 100
# label: menu.person.history
chill_person_history_create:
pattern: /{_locale}/person/{person_id}/history/create
defaults: { _controller: ChillPersonBundle:History:create }
chill_person_accompanying_period_create:
pattern: /{_locale}/person/{person_id}/accompanying-period/create
defaults: { _controller: ChillPersonBundle:AccompanyingPeriod:create }
chill_person_history_update:
pattern: /{_locale}/person/history/{history_id}/update
defaults: { _controller: ChillPersonBundle:History:update }
chill_person_accompanying_period_update:
pattern: /{_locale}/person/{person_id}/accompanying-period/{period_id}/update
defaults: { _controller: ChillPersonBundle:AccompanyingPeriod:update }
chill_person_history_close:
pattern: /{_locale}/person/{person_id}/history/close
defaults: { _controller: ChillPersonBundle:History:close }
chill_person_accompanying_period_close:
pattern: /{_locale}/person/{person_id}/accompanying-period/close
defaults: { _controller: ChillPersonBundle:AccompanyingPeriod:close }
chill_person_history_open:
pattern: /{_locale}/person/{person_id}/history/open
defaults: { _controller: ChillPersonBundle:History:open }
chill_person_accompanying_period_open:
pattern: /{_locale}/person/{person_id}/accompanying-period/open
defaults: { _controller: ChillPersonBundle:AccompanyingPeriod:open }
chill_person_admin:
pattern: /{_locale}/admin/person

View File

@@ -30,7 +30,7 @@ Chill\PersonBundle\Entity\Person:
traverse: true
constraints:
- Callback:
methods: [isHistoryValid]
methods: [isAccompanyingPeriodValid]
groups: [history_consistent]
Chill\PersonBundle\Entity\PersonHistoryFile:

View File

@@ -57,24 +57,13 @@ Reset: 'Remise à zéro'
'Search within persons': 'Recherche parmi les personnes'
'%total% persons matching the search %pattern%': '{0} Aucune personne ne correspond aux termes de recherche "%pattern%" | {1} Une personne a été trouvée par la recherche "%pattern%" | ]1,Inf] %total% personnes correspondent aux termes de recherche "%pattern%".'
'Last opening since %last_opening%': 'Dernière ouverture le %last_opening%.'
'Close person history': Clotûrer
'Person history - %name%': 'Historique du dossier - %name%'
'Close person accompanying period': Clotûrer
'Person accompanying period - %name%': 'Historique du dossier - %name%'
'Opening date': 'Date d''ouverture'
'Closing date': 'Date de fermeture'
'Still open': 'Toujours en cours'
'Close history': 'Clôre le dossier'
'Open history': 'Ouvrir le dossier'
'Create history': 'Nouvel ouverture-fermeture à une autre date'
'Close accompanying period': 'Clôre le dossier'
'Open accompanying period': 'Ouvrir le dossier'
'Create accompanying period': 'Nouvel ouverture-fermeture à une autre date'
'Closing motive': 'Motif de clôture'
'History created!': 'Bravo ! Le dossier est maintenant ouvert.'
'Error! History not created!': 'Erreur ! Le dossier n''a pas pu être ouvert.'
'Updating history done': 'Bravo ! La mise à jour de l''historique a réussi !'
'Error when updating history': 'Les données introduites ne sont pas valides. Veuillez vérifier les informations ci-dessous.'
'Beware history is closed': 'Attention le dossier est déjà fermé'
'History closed!': 'Bravo ! Le dossier de <em>%name%</em> a été clotûré.'
'Error! History not closed!': 'Les informations introduites ne sont pas valides. Le dossier n''a pu être clos.'
'History closing form is not valide': 'Le formulaire n''est pas valide.'
'Error! History %name% is not closed ; it can be open': 'Le dossier de <em>%name%</em> n''est pas fermé. Il ne peut donc être ouvert.'
'History %name% opened!': 'Bravo ! Le dossier de <em>%name</em> a été ouvert'
'History not opened': 'Les informations introduites ne sont pas valides. Le dossier n''a pu être ouvert.'
'Person details': 'Détails de la personne'

View File

@@ -58,12 +58,12 @@ Reset: Delete
'%total% persons matching the search %pattern%': '{0} Geen personen stemmen met het gezocht "%pattern%" overeen. | {1} Één persoon stemd met het gezocht "%pattern%" overeen. | ]1,Inf] %total% personen stemmen met het gezocht "%pattern%" overeen.'
'Person details': 'Details van de persoon'
'Last opening since %last_opening%': '__Last opening since %last_opening%'
'Close person history': '__Close person history'
'Person history - %name%': '__Person history - %name%'
'Close person accompanying period ': '__Close person accompanying period '
'Person accompanying period - %name%': '__Person accompanying period - %name%'
'Opening date': '__Opening date'
'Closing date': '__Closing date'
'Still open': '__Still open'
'Create history': '__Create history'
'Close history': '__Close history'
'Open history': '__Open history'
'Create accompanying period': '__Create accompanying period'
'Close accompanying period ': '__Close accompanying period '
'Open accompanying period': '__Open accompanying period'
'Unknown spoken languages': 'Spreektalen onbekend'

View File

@@ -10,7 +10,7 @@
{{ form_start(form) }}
{{ 'Last opening since %last_opening%'|trans(
{ '%last_opening%' : history.dateOpening|localizeddate('long', 'none', app.request.locale) }) }}
{ '%last_opening%' : accompanying_period.dateOpening|localizeddate('long', 'none', app.request.locale) }) }}
{% if form.dateClosing is defined %}
{{ form_row(form.dateClosing, {'label' : 'Closing date'} ) }}
@@ -25,7 +25,7 @@
{{ form_rest(form) }}
<div class="medium btn danger icon-right entypo icon-lock">
<button type="submit">{{ 'Close person history'|trans }}</button>
<button type="submit">{{ 'Close person accompanying period'|trans }}</button>
</div>
{{ form_end(form) }}

View File

@@ -1,8 +1,8 @@
{% extends "ChillPersonBundle::layout.html.twig" %}
{% set activeRouteKey = 'chill_person_history_list' %}
{% set activeRouteKey = 'chill_person_accompanying_period_list' %}
{% block title %}{{ 'Person history - %name%'|trans({ '%name%' : person.__toString}) }}{% endblock title %}
{% block title %}{{ 'Person accompanying period - %name%'|trans({ '%name%' : person.__toString}) }}{% endblock title %}
{% block personcontent %}
<table class="rounded">
@@ -16,28 +16,28 @@
</thead>
<tbody>
{% set i = 0 %}
{% for history in histories %}
{% for accompanying_period in accompanying_periods %}
<tr class="{% if i is not even %}striped{% endif %}">
<td>{{ history.dateOpening|localizeddate('long', 'none', app.request.locale) }}</td>
<td>{{ accompanying_period.dateOpening|localizeddate('long', 'none', app.request.locale) }}</td>
<td>{% spaceless %}
{% if history.isOpen %}
{% if accompanying_period.isOpen %}
{{ 'Still open'|trans }}
{% else %}
{{ history.dateClosing|localizeddate('long', 'none', app.request.locale) }}
{{ accompanying_period.dateClosing|localizeddate('long', 'none', app.request.locale) }}
{% endif %}
{% endspaceless %}</td>
<td>
<div class="small warning btn icon-right entypo icon-pencil">
<a href="{{ path('chill_person_history_update', {'person_id' : person.id, 'history_id' : history.id } ) }}">{{ 'Edit'|trans }}</a>
<a href="{{ path('chill_person_accompanying_period_update', {'person_id' : person.id, 'period_id' : accompanying_period.id } ) }}">{{ 'Edit'|trans }}</a>
</div>
</td>
</tr>
{% if history.memo is not empty %}
{% if accompanying_period.memo is not empty %}
<tr class="{% if i is not even %}striped{% endif %}">
<td colspan="3">
<pre>{{ history.memo }}</pre>
<pre>{{ accompanying_period.memo }}</pre>
</td>
</tr>
{% endif %}
@@ -49,8 +49,8 @@
<div class="form_control">
<div class="btn small warning icon-right entypo icon-plus">
<a href="{{ path ('chill_person_history_create', {'person_id' : person.id } ) }}">
{{ 'Create history'|trans }}
<a href="{{ path ('chill_person_accompanying_period_create', {'person_id' : person.id } ) }}">
{{ 'Create accompanying period'|trans }}
</a>
</div>
@@ -63,12 +63,12 @@
{% endif %}{% endspaceless %}">
{% spaceless %}
{% if person.isOpen == true %}
<a href="{{ path('chill_person_history_close', {'person_id' : person.id}) }}">
{{'Close history'|trans }}
<a href="{{ path('chill_person_accompanying_period_close', {'person_id' : person.id}) }}">
{{'Close accompanying period'|trans }}
</a>
{% else %}
<a href="{{ path('chill_person_history_open', {'person_id' : person.id} ) }}">
{{'Open history'|trans }}
<a href="{{ path('chill_person_accompanying_period_open', {'person_id' : person.id} ) }}">
{{'Open accompanying period'|trans }}
</a>
{% endif %}
{% endspaceless %}