<?php

class Solicitacao_Form_Tarefa extends Agro_Form {
	
	public function init() {
		$this->addElement('hidden', 'id', array(
			'decorators' => $this->elementDecorator
		));
		
		$Departamentos = new Sistema_Model_Departamentos();
		$this->addElement('select', 'id_departamento', array(
			'MultiOptions' => $Departamentos->getComboAgroBrasil(),
			'decorators' => $this->elementDecorator,
			'required' => true,
			'label' => 'Departamento'
		));
		
		$Prioridades = new Solicitacao_Model_TarefaPrioridade();
		$this->addElement('select', 'id_prioridade', array(
			'MultiOptions' => $Prioridades->getCombo(false, 'ds_nome_prioridade'),
			'decorators' => $this->elementDecorator,
			'required' => true,
			'label' => 'Prioridade'
		));
		
		$this->addElement('select', 'id_tarefa_tipo', array(
			'RegisterInArrayValidator' => false,
			'decorators' => $this->elementDecorator,
			'required' => true,
			'label' => 'Tipo'
		));
		
		$this->addElement('text', 'ds_titulo', array(
			'decorators' => $this->elementDecorator,
			'label' => 'Título',
			'required' => true,
			'style' => 'width:700px;'
		));
		
		$this->addElement('textarea', 'ds_descricao', array(
			'decorators' => $this->elementDecorator,
			'label' => 'Descrição',
			'required' => true,
			'style' => 'width:700px;height:200px;',
		));
		
		$this->addElement('file', 'ds_arquivo1', array(
                        'destination' => APPLICATION_PATH.'/upload_files/solicitacoes/',
			'decorators' => $this->fileDecorator,
                        'validators' => array(
                            array ('validator' => 'Count', 'options' => 2),
                            array ('validator' => 'Size', 'options', 409600)
                        ),
			'label' => '',
                        'size' => 40
		));
		
		$ModelStatus = new Sistema_Model_Status();
		$this->addElement('select', 'id_status', array(
			'MultiOptions' => $ModelStatus->getCombo('SOLICITACAO'),
			'RegisterInArrayValidator' => false,
			'decorators' => $this->elementDecorator,
			'required' => false,
			'label' => 'Status'
		));
				
	}
	
	public function populate(array $values) {
		parent::populate($values);
	}
	
}