1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
| <?php
namespace Adl\HiringBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Adl\HiringBundle\Entity\CandidateCampaignRepository;
class InterviewType extends AbstractType
{
public function __construct($id)
{
$this->id = $id;
}
public function buildForm(FormBuilder $builder, array $options)
{
$id = $this->id;
$builder
->add('date', 'date', array (
'widget' => 'choice',
'pattern' => '{{ day }}-{{ month }}-{{ year }',
))
->add('startingTime', 'time')
->add('endingTime','time')
->add('round','choice',array(
'choices'=>array(
'Round_0'=>'Round 0',
'Round_1'=>'Round 1',
'Round_2'=>'Round 2',
'Round_2bis'=>'Round 2 - bis',
'Round_3'=>'Round 3',
'Round_final'=>'Final Round',
)))
->add('offerStatus','choice',array(
'choices'=>array(
'none'=>'None',
'accepted'=>'Accepted',
'pending'=>'Pending',
'declined'=>'Declined')))
->add('status','choice',array(
'choices'=>array(
'none'=>'None',
'done'=>'Done',
'no_show'=>'No Show')))
->add('offerMade','choice',array(
'choices'=>array(
'no'=>'No',
'yes'=>'Yes')))
->add('interviewer', 'entity', array (
'label' => 'NomDuLabel',
'class' => 'Adl\\HiringBundle\\Entity\\Interviewer',
'property' => 'firstname',
'required' => true))
->add('comment','textarea',array(
'required'=>false))
->add('candidatecampaign', 'entity',
array (
'label' => 'NomDuLabel',
'class' => 'Adl\\HiringBundle\\Entity\\CandidateCampaign',
'property' => 'name',
'query_builder' => function(CandidateCampaignRepository $er) use ($id)
{
return $er->getCandidateCampaignList($id);
}
))
->add('_token','hidden')
;
}
public function getName()
{
return 'adl_hiringbundle_interview';
}
public function getDefaultOptions(array $options)
{
return array(
'data_class' => 'Adl\HiringBundle\Entity\Interview',
'csrf_protection' => true,
'csrf_field_name' => '_token',
'intention' => 'interview_item', // a unique key to help generate the secret token
);
}
} |