<?php

class Sistema_Form_Status extends Agro_Form {
		
	public function init() {
		$this->id = $this->createElement('hidden', 'id');
		$this->id->setDecorators($this->buttonDecorator);
		$this->addElement($this->id);
		
		$this->ds_status = $this->createElement('text', 'ds_status');
		$this->ds_status->setDecorators($this->elementDecorator);
		$this->ds_status->setRequired(true);
		$this->ds_status->setAttrib('size', '50');
		$this->ds_status->setAttrib('maxlength', '200');
		$this->ds_status->setLabel('Status');
		$this->addElement($this->ds_status);
		
		$this->ds_chave = $this->createElement('text', 'ds_chave');
		$this->ds_chave->setDecorators($this->elementDecorator);
		$this->ds_chave->setRequired(false);
		$this->ds_chave->setAttrib('size', '50');
		$this->ds_chave->setAttrib('maxlength', '40');
		$this->ds_chave->setLabel('Chave');
		$this->addElement($this->ds_chave);
		
		
		$TipoStatus = new Sistema_Model_Status();
		$this->id_tipo_status = $this->createElement('select', 'id_tipo_status');
		$this->id_tipo_status->setDecorators($this->elementDecorator);
		$this->id_tipo_status->addMultiOptions($TipoStatus->getComboTipoStatus());
		$this->id_tipo_status->setLabel('Tipo');
		$this->id_tipo_status->setRequired(true);
		$this->addElement($this->id_tipo_status);
		
		$this->cd_status = $this->createElement('text', 'cd_status');
		$this->cd_status->setDecorators($this->elementDecorator);
		$this->cd_status->setRequired(true);
		$this->cd_status->setAttrib('size', '10');
		$this->cd_status->setAttrib('maxlength', '10');
		$this->cd_status->setLabel('Código');
		$this->addElement($this->cd_status);
		
		$this->ds_cor = $this->createElement('text', 'ds_cor');
		$this->ds_cor->setDecorators($this->elementDecorator);
		$this->ds_cor->setAttrib('size', '10');
		$this->ds_cor->setAttrib('maxlength', '7');
		$this->ds_cor->setLabel('Cor');
		$this->addElement($this->ds_cor);
		
		$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='/sistema/status'"));
		$this->cancel->setDecorators($this->buttonDecorator);
		$this->cancel->setLabel('Cancelar');
		$this->addElement($this->cancel);
	}
}