add feature: update the date of an opened file

This commit is contained in:
2013-11-28 21:51:16 +01:00
parent af984962a7
commit 9c249160cc
7 changed files with 218 additions and 22 deletions

View File

@@ -52,6 +52,8 @@ CL\Chill\PersonBundle\Entity\PersonHistoryFile:
- NotNull: ~
date_closing:
- Date: ~
- NotNull:
groups: [closed]
constraints:
- Callback:
methods: [isDateConsistent]

View File

@@ -36,14 +36,17 @@ controller:
history:
close:
done: Bravo ! Le dossier de <em>%name%</em> a été clotûré.
error: Une erreur est survenue. Le dossier n'a pu être clos.
error: Les informations introduites ne sont pas valides. Le dossier n'a pu être clos.
error_in_form: Le formulaire n'est pas valide.
is_not_open: Le dossier de </em>%name%</em> n'est pas ouvert. Il ne peut donc être fermé.
open:
done: Bravo ! Le dossier de <em>%name%</em> est maintenant ouvert.
error: Une erreur est survenue. Le dossier n'a pu être ouvert.
error_in_form: Le formulaire n'est pas valide.
error: Les informations introduites ne sont pas valides. Le dossier n'a pu être ouvert.
error_in_fom: Le formulaire n'est pas valide.
is_not_closed: Le dossier de <em>%name%</em> n'est pas fermé. Il ne peut donc être ouvert.
update:
done: Bravo ! La mise à jour de l'historique a réussi !
error: Les données introduites ne sont pas valides. Veuillez vérifier les informations ci-dessous.
views:
layout:
@@ -100,6 +103,12 @@ views:
action: Ouvrir
date_of_opening: Date d'ouverture
texto: Mémo
hupdate:
dateOpening: Date d'ouverture
dateClosing: Date de fermeture
motive_of_closing: Motif de clôture
texto: Mémo
action: Modifier

View File

@@ -30,7 +30,13 @@
{% endspaceless %}</td>
<td>
<div class="small warning btn icon-right entypo icon-pencil"><a href="{{ path('chill_person_history_update', {'id' : person.id, 'historyId' : history.id } ) }}">{{ 'views.Person.hlist.edit'|trans }}</a></div>
<div class="small warning btn icon-right entypo icon-pencil">
{% if history.isOpen %}
<a href="{{ path('chill_person_history_open', {'id' : person.id, 'historyId' : history.id } ) }}">{{ 'views.Person.hlist.edit'|trans }}</a>
{% else %}
<a href="{{ path('chill_person_history_update', {'id' : person.id, 'historyId' : history.id } ) }}">{{ 'views.Person.hlist.edit'|trans }}</a>
{% endif %}
</div>
</td>
</tr>

View File

@@ -0,0 +1,29 @@
{% extends "CLChillPersonBundle::layout.html.twig" %}
{% set activeRouteKey = null %}
{% block title %}{% endblock title %}
{% form_theme form 'CLChillMainBundle:Form:fields.html.twig' %}
{% block personcontent %}
{{ form_start(form) }}
{{ form_row(form.date_opening, { 'label' : 'views.Person.hupdate.dateOpening' }) }}
{{ form_row(form.date_closing, { 'label' : 'views.Person.hupdate.dateClosing' }) }}
{{ form_row(form.motive, { 'label' : 'views.Person.hupdate.motive_of_closing' }) }}
{{ form_row(form.memo, { 'label' : 'views.Person.hupdate.texto' }) }}
{{form_rest(form) }}
<div class="medium btn danger icon-right entypo icon-lock">
<button type="submit">{{ 'views.Person.hupdate.action'|trans }}</button>
</div>
{{ form_end(form) }}
{% endblock personcontent %}