upgrade and refactor personhistoryFile

This commit is contained in:
2014-11-07 23:48:26 +01:00
parent 29af313582
commit e5f67e32c3
15 changed files with 365 additions and 288 deletions

View File

@@ -0,0 +1,12 @@
Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive:
type: entity
id:
id:
type: integer
id: true
generator: { strategy: AUTO }
fields:
name:
type: json_array
active:
type: boolean

View File

@@ -13,9 +13,6 @@ Chill\PersonBundle\Entity\PersonHistoryFile:
type: date
default: null
nullable: true
motive:
type: string
length: 200
memo:
type: text
manyToOne:
@@ -23,3 +20,6 @@ Chill\PersonBundle\Entity\PersonHistoryFile:
targetEntity: Person
inversedBy: history
cascade: [refresh]
closingMotive:
targetEntity: Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive
nullable: true

View File

@@ -49,7 +49,7 @@ chill_person_history_create:
chill_person_history_update:
pattern: /person/{person_id}/history/{history_id}/update
pattern: /person/history/{history_id}/update
defaults: { _controller: ChillPersonBundle:History:update }
chill_person_history_close:

View File

@@ -6,3 +6,11 @@ services:
class: Chill\PersonBundle\Routing\RoutesLoader
tags:
- { name: routing.loader }
chill.person.accompanying_period_closing_motive:
class: Chill\PersonBundle\Form\Type\ClosingMotiveType
scope: request
arguments:
- "@request"
tags:
- { name: form.type, alias: closing_motive }

View File

@@ -4,7 +4,6 @@
{% block title %}{% endblock title %}
{% form_theme form 'CLChillMainBundle:Form:fields.html.twig' %}
{% block personcontent %}
@@ -12,12 +11,16 @@
{{ 'views.Person.close.last_opening_since'|trans(
{ '%last_opening%' : history.dateOpening|date(date_format) }) }}
{% if form.dateClosing is defined %}
{{ form_row(form.dateClosing, {'label' : 'views.Person.close.date_of_closing'} ) }}
{% endif %}
{{ form_row(form.dateClosing, {'label' : 'views.Person.close.date_of_closing'} ) }}
{{ form_row(form.motive, {'label' : 'views.Person.close.motive_of_closing'} ) }}
{{ form_row(form.texto, {'label' : 'views.Person.close.texto' } ) }}
{% if form.closingMotive is defined %}
{{ form_row(form.closingMotive, {'label' : 'views.Person.close.motive_of_closing'} ) }}
{% endif %}
{{ form_row(form.memo, {'label' : 'views.Person.close.texto' } ) }}
{{ form_rest(form) }}

View File

@@ -32,11 +32,7 @@
{% endspaceless %}</td>
<td>
<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 %}
<a href="{{ path('chill_person_history_update', {'person_id' : person.id, 'history_id' : history.id } ) }}">{{ 'views.Person.hlist.edit'|trans }}</a>
</div>
</td>
</tr>
@@ -58,7 +54,7 @@
<div class="form_control">
<div class="btn small warning icon-right entypo icon-plus">
<a href="{{ path ('chill_person_history_create', {'personId' : person.id } ) }}">
<a href="{{ path ('chill_person_history_create', {'person_id' : person.id } ) }}">
{{ 'views.Person.hlist.create'|trans }}
</a>
</div>
@@ -72,11 +68,11 @@
{% endif %}{% endspaceless %}">
{% spaceless %}
{% if person.isOpen == true %}
<a href="{{ path('chill_person_history_close', {'id' : person.id}) }}">
<a href="{{ path('chill_person_history_close', {'person_id' : person.id}) }}">
{{'views.Person.hlist.close'|trans }}
</a>
{% else %}
<a href="{{ path('chill_person_history_open', {'id' : person.id} ) }}">
<a href="{{ path('chill_person_history_open', {'person_id' : person.id} ) }}">
{{'views.Person.hlist.open'|trans }}
</a>
{% endif %}

View File

@@ -1,26 +0,0 @@
{% extends "ChillPersonBundle::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.dateOpening, {'label' : 'views.Person.open.date_of_opening'} ) }}
{{ form_row(form.texto, {'label' : 'views.Person.open.texto' } ) }}
{{ form_rest(form) }}
<div class="medium btn danger icon-right entypo icon-lock">
<button type="submit">{{ 'views.Person.open.action'|trans }}</button>
</div>
{{ form_end(form) }}
{% endblock personcontent %}

View File

@@ -1,29 +0,0 @@
{% extends "ChillPersonBundle::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 %}