PrestataireAdhesionForm.class.php 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <?php
  2. class PrestataireAdhesionForm extends sfForm {
  3. public static $HASH_KEYS = array(
  4. 'structure_name' => 'Nom de la structure',
  5. 'siret' => 'Siret',
  6. 'card_number' => 'Numéro de carte',
  7. 'card_lost' => 'Carte perdue ?',
  8. 'referent_first_name' => 'Prénom',
  9. 'referent_last_name' => 'Nom',
  10. 'email' => 'Email',
  11. 'telephone' => 'Téléphone',
  12. 'adress' => 'Adresse',
  13. 'zip_code' => 'Code postal',
  14. 'city' => 'Ville',
  15. 'payment_amount' => 'Montant adhésion',
  16. 'payment_mode' => 'Mode de paiement',
  17. 'payment_mode_cheque' => 'Numéro du chèque');
  18. public static $HASH_PAYMENT_MODE = array(
  19. '0' => 'Sols-Violette',
  20. '1' => 'Carte bancaire',
  21. '2' => 'Chèque',
  22. '3' => 'Espèces');
  23. public static $HASH_PAYMENT_AMOUNT = array(
  24. '0' => '100 € (adhésion classique)',
  25. '1' => '25 € + je parraine des solistes à hauteur de 75 € en leur offrant l\'adhésion',
  26. '2' => '25 € + je m\'engage à trouver des solistes pour parrainer ma structure à hauteur de 75 €',
  27. '3' => '+de 100 € (adhésion de soutien');
  28. public static $HASH_CARD_LOST = array(
  29. 'on' => 'Oui',
  30. 'off' => 'Non');
  31. public function configure()
  32. {
  33. $this->widgetSchema['structure_name'] = new sfWidgetFormInput();
  34. $this->validatorSchema['structure_name'] = new sfValidatorString(array('max_length' => 255), array('required' => 'Veuillez entrer le nom de la structure'));
  35. $this->widgetSchema->setLabel('structure_name', 'Nom de la structure');
  36. $this->widgetSchema['siret'] = new sfWidgetFormInput();
  37. $this->validatorSchema['siret'] = new sfValidatorString(array('max_length' => 255), array('required' => 'Veuillez entrer le numéro de SIRET'));
  38. $this->widgetSchema->setLabel('siret', 'SIRET');
  39. $this->widgetSchema['card_number'] = new sfWidgetFormInput();
  40. $this->validatorSchema['card_number'] = new sfValidatorString(array('max_length' => 255), array('required' => 'Veuillez entrer le numéro de la carte'));
  41. $this->widgetSchema->setLabel('card_number', 'Numéro de carte');
  42. $this->widgetSchema['card_lost'] = new sfWidgetFormInputCheckbox();
  43. $this->validatorSchema['card_lost'] = new sfValidatorPass();
  44. $this->widgetSchema->setLabel('card_lost', 'Carte perdue ?');
  45. $this->widgetSchema['referent_first_name'] = new sfWidgetFormInput();
  46. $this->validatorSchema['referent_first_name'] = new sfValidatorString(array('max_length' => 255), array('required' => 'Veuillez entrer le prénom du référent'));
  47. $this->widgetSchema->setLabel('referent_first_name', 'Prénom du référent');
  48. $this->widgetSchema['referent_last_name'] = new sfWidgetFormInput();
  49. $this->validatorSchema['referent_last_name'] = new sfValidatorString(array('max_length' => 255), array('required' => 'Veuillez entrer le nom du référent'));
  50. $this->widgetSchema->setLabel('referent_last_name', 'Nom du référent');
  51. $this->widgetSchema['email'] = new sfWidgetFormInput();
  52. $this->validatorSchema['email'] = new sfValidatorString(array('max_length' => 255), array('required' => 'Veuillez entrer l\'email'));
  53. $this->widgetSchema->setLabel('email', 'Email');
  54. $this->widgetSchema['telephone'] = new sfWidgetFormInput();
  55. $this->validatorSchema['telephone'] = new sfValidatorString(array('max_length' => 255), array('required' => 'Veuillez entrer le numéro de téléphone'));
  56. $this->widgetSchema->setLabel('telephone', 'Téléphone');
  57. $this->widgetSchema['adress'] = new sfWidgetFormInput();
  58. $this->validatorSchema['adress'] = new sfValidatorString(array('max_length' => 255), array('required' => 'Veuillez entrer l\'adresse physique'));
  59. $this->widgetSchema->setLabel('adress', 'Adresse');
  60. $this->widgetSchema['zip_code'] = new sfWidgetFormInput();
  61. $this->validatorSchema['zip_code'] = new sfValidatorString(array('max_length' => 255), array('required' => 'Veuillez entrer le code postal'));
  62. $this->widgetSchema->setLabel('zip_code', 'Code postal');
  63. $this->widgetSchema['city'] = new sfWidgetFormInput();
  64. $this->validatorSchema['city'] = new sfValidatorString(array('max_length' => 255), array('required' => 'Veuillez entrer la ville'));
  65. $this->widgetSchema->setLabel('city', 'Ville');
  66. $this->widgetSchema['payment_amount'] = new sfWidgetFormSelectRadio(array('choices' => array(0 => '100 € (adhésion classique)',
  67. 1 => '25 € + je parraine des solistes à hauteur de 75€ en leur offrant l\'adhésion',
  68. 2 => '25 € - je m\'engage à trouver des solistes pour parrainer ma structure à hauteur de 75 €',
  69. 3 => '+ de 100 € (adhésion de soutien)'
  70. )));
  71. $this->validatorSchema['payment_amount'] = new sfValidatorString(array('required' => 'Choisissez un montant'));
  72. $this->widgetSchema->setLabel('payment_amount', 'Choisissez le montant de votre adhésion ');
  73. $this->setDefault('payment_amount', 0);
  74. $this->widgetSchema['payment_mode'] = new sfWidgetFormSelectRadio(array('choices' => array(KataoMemberDeposit::PAYMENT_MODE_WITHDRAWAL => 'Sols-Violette',
  75. KataoMemberDeposit::PAYMENT_MODE_OTHER => 'Carte Bleue',
  76. KataoMemberDeposit::PAYMENT_MODE_CHECK => 'Chèque',
  77. KataoMemberDeposit::PAYMENT_MODE_CASH => 'Espèces')));
  78. $this->validatorSchema['payment_mode'] = new sfValidatorPass();
  79. $this->widgetSchema->setLabel('payment_mode', 'Mon moyen de paiement ');
  80. $this->setDefault('payment_mode', '0');
  81. $this->widgetSchema['payment_mode_cheque'] = new sfWidgetFormInput();
  82. $this->validatorSchema['payment_mode_cheque'] = new sfValidatorPass();
  83. $this->widgetSchema['payment_mode_cheque']->setAttributes(array('placeholder' => 'Numéro du chèque'));
  84. $this->widgetSchema->setLabel('payment_mode_cheque', 'Numéro du chèque ');
  85. $this->widgetSchema->setNameFormat('form_presta_subscription[%s]');
  86. }
  87. }
  88. ?>