From e5f67e32c3f18b3ed7760136eb7b9470f23fc16a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 7 Nov 2014 23:48:26 +0100 Subject: [PATCH] upgrade and refactor personhistoryFile --- Controller/HistoryController.php | 196 +++++------------- .../LoadAccompanyingPeriodClosingMotive.php | 69 ++++++ Entity/AccompanyingPeriod/ClosingMotive.php | 92 ++++++++ Entity/Person.php | 32 +-- Entity/PersonHistoryFile.php | 46 ++-- Form/PersonHistoryFileType.php | 55 +++-- Form/Type/ClosingMotiveType.php | 53 +++++ .../AccompanyingPeriod.ClosingMotive.orm.yml | 12 ++ .../config/doctrine/PersonHistoryFile.orm.yml | 6 +- Resources/config/routing.yml | 2 +- Resources/config/services.yml | 8 + .../{close.html.twig => form.html.twig} | 15 +- Resources/views/History/list.html.twig | 12 +- Resources/views/History/open.html.twig | 26 --- Resources/views/History/update.html.twig | 29 --- 15 files changed, 365 insertions(+), 288 deletions(-) create mode 100644 DataFixtures/ORM/LoadAccompanyingPeriodClosingMotive.php create mode 100644 Entity/AccompanyingPeriod/ClosingMotive.php create mode 100644 Form/Type/ClosingMotiveType.php create mode 100644 Resources/config/doctrine/AccompanyingPeriod.ClosingMotive.orm.yml rename Resources/views/History/{close.html.twig => form.html.twig} (58%) delete mode 100644 Resources/views/History/open.html.twig delete mode 100644 Resources/views/History/update.html.twig diff --git a/Controller/HistoryController.php b/Controller/HistoryController.php index 0dabef2eb..52e7c80c1 100644 --- a/Controller/HistoryController.php +++ b/Controller/HistoryController.php @@ -9,9 +9,9 @@ use Chill\PersonBundle\Entity\PersonHistoryFile; class HistoryController extends Controller { - public function listAction($id){ + public function listAction($person_id){ - $person = $this->_getPerson($id); + $person = $this->_getPerson($person_id); if ($person === null) { return $this->createNotFoundException('Person not found'); @@ -23,21 +23,21 @@ class HistoryController extends Controller } - public function createAction($personId) { - $person = $this->_getPerson($personId); + public function createAction($person_id) { + $person = $this->_getPerson($person_id); if ($person === null) { return $this->createNotFoundException('Person not found'); } $history = new PersonHistoryFile(new \DateTime()); - $history->setPerson($person); + $history->setPerson($person) + ->setDateOpening(new \DateTime()) + ->setDateClosing(new \DateTime()); - $motivesArray = $this->get('service_container') - ->getParameter('person.history.close.motives'); - $form = $this->createForm(new PersonHistoryFileType($motivesArray), - $history); + $form = $this->createForm(new PersonHistoryFileType(), + $history, array('period_action' => 'update')); $request = $this->getRequest(); @@ -62,7 +62,7 @@ class HistoryController extends Controller 'controller.Person.history.create.done')); return $this->redirect($this->generateUrl('chill_person_history_list', - array('id' => $person->getId()))); + array('person_id' => $person->getId()))); } else { $flashBag->add('danger', $this->get('translator') @@ -76,43 +76,30 @@ class HistoryController extends Controller - return $this->render('ChillPersonBundle:History:update.html.twig', - array('form' => $form->createView(), - 'person' => $person ) ); + return $this->render('ChillPersonBundle:History:form.html.twig', + array( + 'form' => $form->createView(), + 'person' => $person, + 'history' => $history + ) + ); } - public function updateAction($id, $historyId){ + public function updateAction($history_id){ $em = $this->getDoctrine()->getManager(); $history = $em->getRepository('ChillPersonBundle:PersonHistoryFile') - ->find($historyId); + ->find($history_id); if ($history === null) { - return $this->createNotFoundException("history with id ".$historyId. + return $this->createNotFoundException("history with id ".$history_id. " is not found"); } - if ($history->isOpen()) { - $r = new \Symfony\Component\HttpFoundation\Response("You are not allowed " - . "to edit an opened history"); - $r->setStatusCode(400); - return $r; - } - $person = $history->getPerson(); - if ($person->getId() != $id) { - $r = new \Symfony\Component\HttpFoundation\Response("person id does not" - . " match history id"); - $r->setStatusCode(400); - return $r; - } - - $motivesArray = $this->get('service_container') - ->getParameter('person.history.close.motives'); - - $form = $this->createForm(new PersonHistoryFileType($motivesArray), - $history); + $form = $this->createForm(new PersonHistoryFileType(), + $history, array('period_action' => 'update')); $request = $this->getRequest(); @@ -133,11 +120,11 @@ class HistoryController extends Controller 'controller.Person.history.update.done')); return $this->redirect($this->generateUrl('chill_person_history_list', - array('id' => $person->getId()))); + array('person_id' => $person->getId()))); } else { $flashBag->add('danger', $this->get('translator') - ->trans('controller.Person.history.update.error')); + ->trans('controller.Person.history.edit.error')); foreach($errors as $error) { $flashBag->add('info', $error->getMessage()); @@ -147,13 +134,16 @@ class HistoryController extends Controller - return $this->render('ChillPersonBundle:History:update.html.twig', - array('form' => $form->createView(), - 'person' => $person ) ); + return $this->render('ChillPersonBundle:History:form.html.twig', + array( + 'form' => $form->createView(), + 'person' => $person, + 'history' => $history + ) ); } - public function closeAction($id) { - $person = $this->_getPerson($id); + public function closeAction($person_id) { + $person = $this->_getPerson($person_id); if ($person === null) { return $this->createNotFoundException('Person not found'); @@ -162,54 +152,29 @@ class HistoryController extends Controller if ($person->isOpen() === false) { $this->get('session')->getFlashBag() ->add('danger', $this->get('translator') - ->trans('controller.Person.history.close.is_not_open', + ->trans('controller.Person.history.close.is_closed', array('%name%' => $person->__toString()))); return $this->redirect( $this->generateUrl('chill_person_history_list', array( - 'id' => $person->getId() + 'person_id' => $person->getId() ))); } $current = $person->getCurrentHistory(); - $container = array( - 'dateClosing' => new \DateTime(), - 'motive' => null, - 'texto' => $current->getMemo()); - - - - $form = $this->createFormBuilder($container) - ->add('dateClosing', 'date', array( - 'data' => new \DateTime() - )) - ->add('motive', 'choice', array( - 'choices' => $this->_getMotive(), - 'empty_value' => 'views.Person.close.select_a_motive' - )) - ->add('texto', 'textarea', array( - 'required' => false - )) - ->getForm(); - + $form = $this->createForm(new PersonHistoryFileType(), $current, array( + 'period_action' => 'close' + )); + $request = $this->getRequest(); if ($request->getMethod() === 'POST') { $form->handleRequest($request); if ($form->isValid()){ - - - - $person->close($form['dateClosing']->getData(), - $form['motive']->getData(), - $form['texto']->getData()); - - + $person->close($current); $errors = $this->_validatePerson($person); - - if (count($errors) === 0) { $this->get('session')->getFlashBag() @@ -221,7 +186,7 @@ class HistoryController extends Controller return $this->redirect( $this->generateUrl('chill_person_history_list', array( - 'id' => $person->getId() + 'person_id' => $person->getId() )) ); } else { @@ -250,7 +215,7 @@ class HistoryController extends Controller - return $this->render('ChillPersonBundle:History:close.html.twig', + return $this->render('ChillPersonBundle:History:form.html.twig', array( 'form' => $form->createView(), 'person' => $person, @@ -277,8 +242,8 @@ class HistoryController extends Controller } - public function openAction($id) { - $person = $this->_getPerson($id); + public function openAction($person_id) { + $person = $this->_getPerson($person_id); if ($person === null) { return $this->createNotFoundException('Person not found'); @@ -286,7 +251,8 @@ class HistoryController extends Controller $request = $this->getRequest(); - if ($person->isOpen() === true && ! $request->query->has('historyId')) { + //in case the person is already open + if ($person->isOpen() === true) { $this->get('session')->getFlashBag() ->add('danger', $this->get('translator') ->trans('controller.Person.history.open.is_not_closed', @@ -294,60 +260,20 @@ class HistoryController extends Controller return $this->redirect( $this->generateUrl('chill_person_history_list', array( - 'id' => $person->getId() + 'person_id' => $person->getId() ))); } - - $historyId = $request->query->get('historyId', null); - - if ($historyId !== null) { - $history = $this->getDoctrine()->getEntityManager() - ->getRepository('ChillPersonBundle:PersonHistoryFile') - ->find($historyId); - - } else { - $history = new PersonHistoryFile(new \DateTime()); - } - - //this may happen if we set an historyId and history is not closed - if ($request->query->has('historyId') && ! $history->isOpen()) { - $r = new \Symfony\Component\HttpFoundation\Response("You are not allowed " - . "to edit a closed history"); - $r->setStatusCode(400); - return $r; + $history = new PersonHistoryFile(new \DateTime()); - } - - - - - - $form = $this->createFormBuilder() - ->add('dateOpening', 'date', array( - 'data' => $history->getDateOpening() - )) - ->add('texto', 'textarea', array( - 'required' => false, - 'data' => $history->getMemo() - )) - ->getForm(); - - + $form = $this->createForm(new PersonHistoryFileType(), $history, array( + 'period_action' => 'open')); if ($request->getMethod() === 'POST') { $form->handleRequest($request); if ($form->isValid()) { - if ($request->query->has('historyId')) { - $history->setDateOpening($form['dateOpening']->getData()) - ->setMemo($form['texto']->getData()); - } else { - $person->open($form['dateOpening']->getData(), - $form['texto']->getData()); - } - - + $person->open($history); $errors = $this->_validatePerson($person); @@ -361,7 +287,7 @@ class HistoryController extends Controller return $this->redirect( $this->generateUrl('chill_person_history_list', array( - 'id' => $person->getId() + 'person_id' => $person->getId() )) ); } else { @@ -383,11 +309,7 @@ class HistoryController extends Controller } - - - - - return $this->render('ChillPersonBundle:History:open.html.twig', + return $this->render('ChillPersonBundle:History:form.html.twig', array( 'form' => $form->createView(), 'person' => $person, @@ -395,20 +317,6 @@ class HistoryController extends Controller )); } - private function _getMotive() { - $motivesArray = $this->get('service_container') - ->getParameter('person.history.close.motives'); - - $a = array(); - - foreach ($motivesArray as $key => $params ) { - $a[$key] = $params['label']; - } - - return $a; - - } - private function _getPerson($id) { return $this->getDoctrine()->getManager() ->getRepository('ChillPersonBundle:Person') diff --git a/DataFixtures/ORM/LoadAccompanyingPeriodClosingMotive.php b/DataFixtures/ORM/LoadAccompanyingPeriodClosingMotive.php new file mode 100644 index 000000000..8853999b2 --- /dev/null +++ b/DataFixtures/ORM/LoadAccompanyingPeriodClosingMotive.php @@ -0,0 +1,69 @@ + + */ +class LoadAccompanyingPeriodClosingMotive extends AbstractFixture + implements OrderedFixtureInterface +{ + + public function getOrder() { + return 9500; + } + + public static $closingMotives = array( + 'nothing_to_do' => array( + 'name' => array( + 'fr' => 'Plus rien à faire', + 'en' => 'Nothing to do', + 'nl' => 'nieks meer te doen' + ) + ), + 'did_not_come_back' => array( + 'name' => array( + 'fr' => "N'est plus revenu", + 'en' => "Did'nt come back", + 'nl' => "Niet teruggekomen" + ) + ), + 'no_more_money' => array( + 'active' => false, + 'name' => array( + 'fr' => "Plus d'argent", + 'en' => "No more money", + 'nl' => "Geen geld" + ) + ) + ); + + public static $references = array(); + + public function load(ObjectManager $manager) + { + foreach (static::$closingMotives as $ref => $new) { + $motive = new ClosingMotive(); + $motive->setName($new['name']) + ->setActive((isset($new['active']) ? $new['active'] : true)) + ; + + $manager->persist($motive); + $this->addReference($ref, $motive); + echo "Adding ClosingMotive $ref\n"; + } + + $manager->flush(); + } + + + + +} diff --git a/Entity/AccompanyingPeriod/ClosingMotive.php b/Entity/AccompanyingPeriod/ClosingMotive.php new file mode 100644 index 000000000..44cbeb1aa --- /dev/null +++ b/Entity/AccompanyingPeriod/ClosingMotive.php @@ -0,0 +1,92 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +namespace Chill\PersonBundle\Entity\AccompanyingPeriod; + +/** + * ClosingMotive give an explanation why we closed the Accompanying period + */ +class ClosingMotive +{ + /** + * @var integer + */ + private $id; + + /** + * @var array + */ + private $name; + + /** + * + * @var boolean + */ + private $active; + + + /** + * Get id + * + * @return integer + */ + public function getId() + { + return $this->id; + } + + /** + * Set name + * + * @param array $name + * + * @return ClosingMotive + */ + public function setName($name) + { + $this->name = $name; + + return $this; + } + + /** + * Get name + * + * @return array + */ + public function getName() + { + return $this->name; + } + + public function isActive() + { + return $this->active; + } + + public function setActive($active) + { + $this->active = $active; + return $this; + } + + +} + diff --git a/Entity/Person.php b/Entity/Person.php index 53792fcd4..947963c9e 100644 --- a/Entity/Person.php +++ b/Entity/Person.php @@ -110,11 +110,9 @@ class Person { * * @param \DateTime $date */ - public function open(\DateTime $date, $memo = '') { - $history = new PersonHistoryFile($date); - $history->setMemo($memo); + public function open(PersonHistoryFile $accompanyingPeriod) { $this->proxyHistoryOpenState = true; - $this->addHistoryFile($history); + $this->addHistoryFile($accompanyingPeriod); } /** @@ -126,30 +124,12 @@ class Person { * * To check if the Person and his history are consistent, use validation. * - * @param \DateTime $date - * @param string $motive - * @param string $memo + * @param PersonHistoryFile * @throws \Exception if two lines of history are open. */ - public function close(\DateTime $date, $motive, $memo = '') { - $histories = $this->history; - - $found = false; - - foreach ($histories as $history) { - if ($history->isOpen()) { - - if ($found === true) { - throw new \Exception('two open line in history were found. This should not happen.'); - } - - $history->setDateClosing($date); - $history->setMotive($motive); - $history->setMemo($memo); - $this->proxyHistoryOpenState = false; - $found = true; - } - } + public function close(PersonHistoryFile $accompanyingPeriod) + { + $this->proxyHistoryOpenState = false; } /** diff --git a/Entity/PersonHistoryFile.php b/Entity/PersonHistoryFile.php index 2f0c07076..c28034499 100644 --- a/Entity/PersonHistoryFile.php +++ b/Entity/PersonHistoryFile.php @@ -25,11 +25,6 @@ class PersonHistoryFile */ private $date_closing; - /** - * @var string - */ - private $motive = ''; - /** * @var string */ @@ -40,6 +35,12 @@ class PersonHistoryFile */ private $person; + /** + * + * @var AccompanyingPeriod\ClosingMotive + */ + private $closingMotive = null; + /** * * @param \DateTime $dateOpening @@ -121,29 +122,6 @@ class PersonHistoryFile } } - /** - * Set motive - * - * @param string $motive - * @return PersonHistoryFile - */ - public function setMotive($motive) - { - $this->motive = $motive; - - return $this; - } - - /** - * Get motive - * - * @return string - */ - public function getMotive() - { - return $this->motive; - } - /** * Set memo * @@ -197,6 +175,18 @@ class PersonHistoryFile return $this->person; } + public function getClosingMotive() + { + return $this->closingMotive; + } + + public function setClosingMotive(AccompanyingPeriod\ClosingMotive $closingMotive) + { + $this->closingMotive = $closingMotive; + return $this; + } + + /// VALIDATION function diff --git a/Form/PersonHistoryFileType.php b/Form/PersonHistoryFileType.php index e01eb539f..4274d4800 100644 --- a/Form/PersonHistoryFileType.php +++ b/Form/PersonHistoryFileType.php @@ -5,17 +5,12 @@ namespace Chill\PersonBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolverInterface; +use Symfony\Component\Form\FormEvents; +use Symfony\Component\Form\FormEvent; class PersonHistoryFileType extends AbstractType { - private $motives = array(); - - public function __construct(array $motivesArray) { - foreach ($motivesArray as $key => $params ) { - $this->motives[$key] = $params['label']; - } - } /** * @param FormBuilderInterface $builder @@ -23,16 +18,35 @@ class PersonHistoryFileType extends AbstractType */ public function buildForm(FormBuilderInterface $builder, array $options) { - $builder - ->add('date_opening', 'date', array("required" => true, - 'widget' => 'single_text')) - ->add('date_closing', 'date', array('required' => true, - 'widget' => 'single_text')) - ->add('motive', 'choice', array( - 'choices' => $this->motives, - 'required' => true - )) - ->add('memo', 'textarea', array( + + //if the period_action is close, date opening should not be seen + if ($options['period_action'] !== 'close') { + $builder + ->add('date_opening', 'date', array("required" => true, + 'widget' => 'single_text')); + } + + // the closingDate should be seen only if period_action = close + // or period_action = update AND accopanying period is already closed + $builder->addEventListener( + FormEvents::PRE_SET_DATA, function (FormEvent $event) use ($options) { + $accompanyingPeriod = $event->getData(); + $form = $event->getForm(); + + //add date opening + if ( + //if the period_action is "close, should not be shown" + ($options['period_action'] === 'close') + OR + ($options['period_action'] === 'update' AND !$accompanyingPeriod->isOpen()) + ){ + $form->add('date_closing', 'date', array('required' => true, + 'widget' => 'single_text')); + $form->add('closingMotive', 'closing_motive'); + } + }); + + $builder->add('memo', 'textarea', array( 'required' => false )) ; @@ -46,6 +60,13 @@ class PersonHistoryFileType extends AbstractType $resolver->setDefaults(array( 'data_class' => 'Chill\PersonBundle\Entity\PersonHistoryFile' )); + + $resolver + ->setRequired(array('period_action')) + ->addAllowedTypes(array('period_action' => 'string')) + ->addAllowedValues(array('period_action' => array( + 'update', 'open', 'close'))) + ; } /** diff --git a/Form/Type/ClosingMotiveType.php b/Form/Type/ClosingMotiveType.php new file mode 100644 index 000000000..a041818f2 --- /dev/null +++ b/Form/Type/ClosingMotiveType.php @@ -0,0 +1,53 @@ + + */ +class ClosingMotiveType extends AbstractType +{ + + private $locale; + + public function __construct(Request $request = NULL) + { + if ($request !== NULL) { + $this->locale = $request->getLocale(); + } + } + + public function getName() + { + return 'closing_motive'; + } + + public function getParent() + { + return 'entity'; + } + + public function setDefaultOptions(\Symfony\Component\OptionsResolver\OptionsResolverInterface $resolver) + { + if ($this->locale === NULL) { + throw new \LogicException('the locale should be defined and is extracted ' + . 'from the \'request\' service. Maybe was this service ' + . 'unaccessible ?'); + } + + $resolver->setDefaults(array( + 'class' => 'ChillPersonBundle:AccompanyingPeriod\ClosingMotive', + 'empty_data' => null, + 'empty_value' => 'Choose a motive', + 'property' => 'name['.$this->locale.']' + ) + ); + } + +} diff --git a/Resources/config/doctrine/AccompanyingPeriod.ClosingMotive.orm.yml b/Resources/config/doctrine/AccompanyingPeriod.ClosingMotive.orm.yml new file mode 100644 index 000000000..85f37c603 --- /dev/null +++ b/Resources/config/doctrine/AccompanyingPeriod.ClosingMotive.orm.yml @@ -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 diff --git a/Resources/config/doctrine/PersonHistoryFile.orm.yml b/Resources/config/doctrine/PersonHistoryFile.orm.yml index 358dadf25..5307fb27d 100644 --- a/Resources/config/doctrine/PersonHistoryFile.orm.yml +++ b/Resources/config/doctrine/PersonHistoryFile.orm.yml @@ -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 diff --git a/Resources/config/routing.yml b/Resources/config/routing.yml index c6f69015b..301f1e027 100644 --- a/Resources/config/routing.yml +++ b/Resources/config/routing.yml @@ -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: diff --git a/Resources/config/services.yml b/Resources/config/services.yml index 7896b62a0..7130fde11 100644 --- a/Resources/config/services.yml +++ b/Resources/config/services.yml @@ -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 } diff --git a/Resources/views/History/close.html.twig b/Resources/views/History/form.html.twig similarity index 58% rename from Resources/views/History/close.html.twig rename to Resources/views/History/form.html.twig index 5bef4c7bc..e338fd538 100644 --- a/Resources/views/History/close.html.twig +++ b/Resources/views/History/form.html.twig @@ -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) }} diff --git a/Resources/views/History/list.html.twig b/Resources/views/History/list.html.twig index d4665a784..3016d0393 100644 --- a/Resources/views/History/list.html.twig +++ b/Resources/views/History/list.html.twig @@ -32,11 +32,7 @@ {% endspaceless %} @@ -58,7 +54,7 @@
@@ -72,11 +68,11 @@ {% endif %}{% endspaceless %}"> {% spaceless %} {% if person.isOpen == true %} - + {{'views.Person.hlist.close'|trans }} {% else %} - + {{'views.Person.hlist.open'|trans }} {% endif %} diff --git a/Resources/views/History/open.html.twig b/Resources/views/History/open.html.twig deleted file mode 100644 index 0e176001a..000000000 --- a/Resources/views/History/open.html.twig +++ /dev/null @@ -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) }} - -
- -
- -{{ form_end(form) }} - - -{% endblock personcontent %} diff --git a/Resources/views/History/update.html.twig b/Resources/views/History/update.html.twig deleted file mode 100644 index 03ae338e3..000000000 --- a/Resources/views/History/update.html.twig +++ /dev/null @@ -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) }} - -
- -
- -{{ form_end(form) }} - -{% endblock personcontent %}