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
|
class GncGencodeMasterForm extends BaseAoGencodeForm
{
public function configure()
{
$this->setWidgets(array(
'code_article' => new sfWidgetFormInputText(
array(),
array(
'class' => 'master_code_article',
'size' => 8,
'alt' => $this->getOption('alt'),
'rel' => 'code_article',
'onchange' => 'loadArticleFocusOut(this)',
// PROPOSITION
//'onkeyup' => 'addGencodeMaster(this);loadArticleByLength(this);')),
'onkeyup' => 'loadArticleByLength(this);')),
'gencode' => new sfWidgetFormInputText(
array(),
array(
'class' => 'gencode',
'maxlength' => 13,
'size' => 13,
'alt' => $this->getOption('alt'),
'onkeyup' => 'gencodeIsAvailable(this);')),
'exist' => new sfWidgetFormInputHidden(
array(),array('value' => '','class' => 'exist')),
'libelle' => new sfWidgetFormInputHidden(
array(),array('value' => '','class' => 'libelle')),
));
$this->setValidators(array(
'code_article' => new sfValidatorString(array('required' => false)),
'gencode' => new sfValidatorNumber(
array('required' => false),
array('invalid' => 'Le gencode doit être composer de numéro.'))
));
$form = new GncGencodeChildrenForm(null, array(
'master' => $this->getObject(),
'size' => 1,
'start' => $this->getOption('start', 0)
));
$this->embedForm('children', $form);
}
} |
Partager