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

@@ -0,0 +1,56 @@
<?php
namespace CL\Chill\PersonBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
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
* @param array $options
*/
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')
;
}
/**
* @param OptionsResolverInterface $resolver
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'CL\Chill\PersonBundle\Entity\PersonHistoryFile'
));
}
/**
* @return string
*/
public function getName()
{
return 'cl_chill_personbundle_personhistoryfile';
}
}