KataoMemberAdhesionForm.class.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. * KataoMemberAdhesion form.
  4. *
  5. * @package form
  6. * @subpackage katao_member_adhesion
  7. * @version SVN: $Id: sfPropelFormTemplate.php 6174 2007-11-27 06:22:40Z fabien $
  8. */
  9. class KataoMemberAdhesionForm extends BaseKataoMemberAdhesionForm
  10. {
  11. static public $PAYMENT_KIND = array( '0' => 'Sols-Violette',
  12. '1' => 'Carte bancaire',
  13. '2' => 'Chèque',
  14. '3' => 'Espèces');
  15. static public $PAYMENT_AMOUNT = array( '0' => '5',
  16. '1' => '15',
  17. '2' => '100');
  18. public function configure()
  19. {
  20. parent::configure();
  21. // unset($this->validatorSchema['id']);
  22. // unset($this->widgetSchema['id']);
  23. $this->widgetSchema['year'] = new wpWidgetFormRichDate();
  24. $this->validatorSchema['year'] = new sfValidatorDateTime(array('date_format' => '@(?P<day>\d{2}).(?P<month>\d{2}).(?P<year>\d{4})@'));
  25. $this->widgetSchema['katao_user_id'] = new sfWidgetFormInputHidden();
  26. $this->widgetSchema['type'] = new sfWidgetFormSelectRadio(array('choices' => array('1' => 'Nouvelle adhésion',
  27. '2' => 'Renouvellement')));
  28. $this->validatorSchema['type'] = new sfValidatorString(array('max_length' => 255), array('required' => 'Choisissez le type d\'adhésion'));
  29. $this->widgetSchema['amount'] = new sfWidgetFormInput();
  30. $this->validatorSchema['amount'] = new sfValidatorString(array('max_length' => 255), array('required' => 'Veuillez entrer le montant'));
  31. $this->widgetSchema['payment_kind'] = new sfWidgetFormSelectRadio(array('choices' => self::$PAYMENT_KIND));
  32. $this->validatorSchema['payment_kind'] = new sfValidatorString(array('max_length' => 255), array('required' => 'Veuillez choisir le mode de paiment'));
  33. $this->widgetSchema['check_no'] = new sfWidgetFormInput();
  34. $this->validatorSchema['check_no'] = new sfValidatorPass();
  35. $this->widgetSchema->setLabels(array(
  36. 'year' => 'Date d\'adhésion',
  37. 'amount' => 'Montant',
  38. 'type' => 'Type d\'adhésion',
  39. 'payment_kind' => 'Mode de paiment',
  40. 'check_no' => 'Numéro de chèque'
  41. ));
  42. $this->widgetSchema->setNameFormat('form_subscription[%s]');
  43. }
  44. }