<?

class Produto_Form_Variedade extends Agro_Form {
	public $id;
	public $ds_nome_variedade;
	
	public function init() {
		$this->id = $this->createElement('hidden', 'id');
		$this->id->setDecorators($this->buttonDecorator);
		$this->addElement($this->id);
		
		$this->ds_nome_variedade = $this->createElement('text', 'ds_nome_variedade');
		$this->ds_nome_variedade->setDecorators($this->elementDecorator);
		$this->ds_nome_variedade->setRequired(true);
		$this->ds_nome_variedade->setAttrib('size', '50');
		$this->ds_nome_variedade->setAttrib('maxlength', '40');
		$this->ds_nome_variedade->setLabel('Nome');
		$this->addElement($this->ds_nome_variedade);
		
		$this->cd_variedade_seguradora = $this->createElement('text', 'cd_variedade_seguradora');
		$this->cd_variedade_seguradora->setDecorators($this->elementDecorator);
		$this->cd_variedade_seguradora->setAttrib('size', '15');
		$this->cd_variedade_seguradora->setAttrib('class', 'integer');
		$this->cd_variedade_seguradora->setAttrib('maxlength', '10');
		$this->cd_variedade_seguradora->setLabel('Cód. Seguradora');
		$this->addElement($this->cd_variedade_seguradora);
		
		$this->fl_transgenico = $this->createElement('checkbox', 'fl_transgenico');
		$this->fl_transgenico->setDecorators($this->elementDecorator);
		$this->fl_transgenico->setLabel('Transgênica?');
		$this->addElement($this->fl_transgenico);
		
		$this->save = $this->createElement('button', 'salvar', array('type'=>'submit'));
		$this->save->setDecorators($this->buttonDecorator);
		$this->save->setLabel('Salvar');
		$this->addElement($this->save);
		
		$this->cancel = $this->createElement('button', 'cancelar', array('onclick'=>"location.href='/produto/variedade'"));
		$this->cancel->setDecorators($this->buttonDecorator);
		$this->cancel->setLabel('Cancelar');
		$this->addElement($this->cancel);
	}
}