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
| <?php
/**
* Question form.
*
* @package form
* @subpackage Question
* @version SVN: $Id: sfDoctrineFormTemplate.php 6174 2007-11-27 06:22:40Z fabien $
*/
class QuestionFirstPageForm extends BaseQuestionForm
{
public function configure()
{
unset(
$this["id"], $this["created_at"],$this["resolu"], $this["payer"],$this["flag_contrat"], $this["file"],$this["id_utilisateur"],
$this["email_client"], $this["code_postal_client"],
$this["pays_client"], $this["nom_client"],
$this["prenom_client"], $this["tel_client"],$this["updated_at"],$this["reponse"]
);
$choix = Doctrine::getTable('question')->getDomaines();
$this->widgetSchema['domaines'] = new sfWidgetFormChoice(array('choices' => $choix));
$this->widgetSchema['title'] = new sfWidgetFormInput(array('label' => 'Titre'), array('size' => 53));
$this->widgetSchema['question'] = new sfWidgetFormTextarea(array('label' => 'Question*'), array('cols' => '80', 'rows' => '15'));
$this->widjetSchema['captcha']=new sfWidgetFormInput();
$this->widgetSchema->setLabels(array(
'domaines' => 'Domaine dintervention',
'title' => 'Titre de votre question',
'question' => 'Votre question',
'captcha' => 'captcha',
));
$this->setValidators(array(
'title' => new sfValidatorString(array('max_length' => 255, 'required' => false),
array(
'max_length' => "Titre trés long. 255 characters maximum.",
)),
'question' => new sfValidatorString(array('max_length' => 2147483647, 'required' => false),
array(
'max_length' => "Question trés longue.",
)),
'domaines' => new sfValidatorChoice(array('choices' => array_keys(Doctrine::getTable('Question')->getDomaines()), 'required' => false)),
));
}
} |
Partager