/**
  * @param FormBuilderInterface $builder
  * @param array $options
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     $builder->add('custodian', 'entity', array('class' => 'Tixi\\CoreDomain\\Custodian', 'property' => 'nameStringWithID', 'label' => 'passenger.field.custodian', 'required' => false, 'empty_data' => null, 'empty_value' => 'passenger.field.custodian.empty', 'query_builder' => function (EntityRepository $er) {
         return $er->createQueryBuilder('s')->where('s.isDeleted = 0')->orderBy('s.firstname', 'ASC');
     }));
     $builder->add('building', 'text', array('required' => false, 'label' => 'address.field.building'));
     $builder->add('lookaheadaddress', 'addresslookahead', array('label' => 'address.field.lookahead'));
     /** formerly isAuthorizedToRide */
     $builder->add('isAuthorizedToRide', 'checkbox', array('required' => false, 'label' => 'passenger.field.isAuthorizedToRide'));
     $builder->add('hasMonthlyBilling', 'checkbox', array('required' => false, 'label' => 'passenger.field.monthlybilling'));
     $builder->add('isInWheelChair', 'checkbox', array('required' => false, 'label' => 'passenger.field.isinwheelchair'));
     $builder->add('handicaps', 'entity', array('required' => false, 'class' => 'Tixi\\CoreDomain\\Handicap', 'property' => 'name', 'expanded' => true, 'multiple' => true, 'label' => 'passenger.field.handicap', 'query_builder' => function (EntityRepository $er) {
         return $er->createQueryBuilder('e')->where('e.isDeleted = 0');
     }));
     $builder->add('insurances', 'entity', array('required' => false, 'class' => 'Tixi\\CoreDomain\\Insurance', 'property' => 'name', 'expanded' => true, 'multiple' => true, 'label' => 'passenger.field.insurance', 'query_builder' => function (EntityRepository $er) {
         return $er->createQueryBuilder('e')->where('e.isDeleted = 0');
     }));
     $builder->add('personCategories', 'entity', array('required' => false, 'class' => 'Tixi\\CoreDomain\\PersonCategory', 'property' => 'name', 'expanded' => true, 'multiple' => true, 'label' => 'passenger.field.personcategory', 'query_builder' => function (EntityRepository $er) {
         return $er->createQueryBuilder('e')->where('e.isDeleted = 0');
     }));
     $builder->add('entryDate', 'datePicker', array('required' => false, 'label' => 'person.field.entrydate'));
     $builder->add('birthday', 'datePicker', array('required' => false, 'label' => 'person.field.birthday'));
     $builder->add('extraMinutes', 'integer', array('required' => false, 'label' => 'person.field.extraminutes', 'attr' => array('title' => 'form.field.title.digit'), 'constraints' => array(new Regex(array('message' => 'form.field.title.digit', 'pattern' => '/\\d+/')), new Range(array('min' => 0, 'max' => 999, 'minMessage' => 'validate.min.extraminutes', 'maxMessage' => 'validate.max.extraminutes')))));
     $builder->add('notice', 'textarea', array('required' => false, 'label' => 'passenger.field.notice'));
     $builder->add('contradictVehicleCategories', 'entity', array('required' => false, 'class' => 'Tixi\\CoreDomain\\VehicleCategory', 'property' => 'name', 'expanded' => true, 'multiple' => true, 'label' => 'person.field.contradict_vehicle_category', 'query_builder' => function (EntityRepository $er) {
         return $er->createQueryBuilder('e')->where('e.isDeleted = 0');
     }));
     if ($this->user->hasRole('ROLE_MANAGER')) {
         $builder->add('details', 'textarea', array('required' => false, 'label' => 'person.field.details'));
     }
 }
 /**
  * @param FormBuilderInterface $builder
  * @param array $options
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     $builder->add('building', 'text', array('required' => false, 'label' => 'address.field.building'));
     $builder->add('lookaheadaddress', 'addresslookahead', array('label' => 'address.field.lookahead'));
     $builder->add('details', 'textarea', array('required' => false, 'label' => 'person.field.details'));
 }
Exemple #3
0
 /**
  * @param FormBuilderInterface $builder
  * @param array $options
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     $builder->add('fax', 'telephoneType', array('required' => false, 'label' => 'person.field.fax'));
     $builder->add('email', 'email', array('required' => false, 'label' => 'person.field.email'));
     $builder->add('lookaheadaddress', 'addresslookahead', array('label' => 'address.field.lookahead'));
     $builder->add('licenceNumber', 'text', array('label' => 'driver.field.licence', 'attr' => array('title' => 'form.field.title.not_blank'), 'constraints' => array(new NotBlank(array('message' => 'form.field.not_blank')))));
     $builder->add('wheelChairAttendance', 'checkbox', array('required' => false, 'label' => 'driver.field.wheelchair'));
     $builder->add('driverCategory', 'entity', array('class' => 'Tixi\\CoreDomain\\DriverCategory', 'property' => 'name', 'label' => 'driver.field.category', 'attr' => array('title' => 'form.field.title.not_selected'), 'constraints' => array(new NotBlank(array('message' => 'form.field.not_blank'))), 'query_builder' => function (EntityRepository $er) {
         return $er->createQueryBuilder('e')->where('e.isDeleted = 0');
     }));
     $builder->add('entryDate', 'datePicker', array('required' => false, 'label' => 'person.field.entrydate'));
     $builder->add('birthday', 'datePicker', array('required' => false, 'label' => 'person.field.birthday'));
     $builder->add('extraMinutes', 'integer', array('required' => false, 'label' => 'person.field.extraminutes', 'attr' => array('title' => 'form.field.title.digit'), 'constraints' => array(new Regex(array('message' => 'form.field.title.digit', 'pattern' => '/\\d+/')), new Range(array('min' => 0, 'max' => 999, 'minMessage' => 'validate.min.extraminutes', 'maxMessage' => 'validate.max.extraminutes')))));
     $builder->add('contradictVehicleCategories', 'entity', array('required' => false, 'class' => 'Tixi\\CoreDomain\\VehicleCategory', 'property' => 'name', 'expanded' => true, 'multiple' => true, 'label' => 'person.field.contradict_vehicle_category', 'query_builder' => function (EntityRepository $er) {
         return $er->createQueryBuilder('e')->where('e.isDeleted = 0');
     }));
     $builder->add('operationWish', 'textarea', array('required' => false, 'label' => 'driver.field.operationwish'));
     if ($this->user->hasRole('ROLE_MANAGER')) {
         $builder->add('details', 'textarea', array('required' => false, 'label' => 'person.field.details'));
     }
 }