<?php

class Sistema_Form_Cooperativa extends Agro_Form
{
    public function init()
    {
        $this->addElement('hidden', 'id', array(
          'decorators' => $this->elementDecorator
        ));

        $this->addElement('hidden', 'tp_pessoa', array('decorators' => $this->elementDecorator, 'value' => 'J'));

        $this->addElement('text', 'cnpj', array(
          'decorators' => $this->elementDecorator,
          'validator'  => 'CpfCnpj',
          'label'      => 'CNPJ',
          'required'   => true,
          'class'      => 'cpf_cnpj',
          'maxlength'  => 18,
          'size'       => 20
        ));

        $this->addElement('text', 'ds_nome_cooperativa', array(
          'decorators' => $this->elementDecorator,
          'label'      => 'Nome',
          'required'   => true,
          'class'      => 'upper',
          'maxlength'  => 150,
          'size'       => 60
        ));

        $modelEstado = new Sistema_Model_Estados();
        $this->addElement('select', 'id_estado', array(
          'decorators'   => $this->elementDecorator,
          'MultiOptions' => $modelEstado->getCombo(),
          'label'        => 'UF',
          'required'     => true
        ));

        $this->addElement('select', 'id_municipio', array(
          'decorators'                => $this->elementDecorator,
          'MultiOptions'              => array('--- Selecione uma UF ---'),
          'label'                     => 'Município',
          'required'                  => true,
          'disable_inarray_validator' => true,
          'registerInArrayValidator'  => false,
          'options'                   => array(
            'disable_inarray_validator' => true,
            'registerInArrayValidator'  => false,
            'label'                     => 'county',
          )
        ));
    }
}
