/** * Método construtor * * (non-PHPdoc) * @see Zend_Form::init() */ public function init() { // Tradução self::$oTranslate = Zend_Registry::get('Zend_Translate'); // Url base do sistema self::$oBaseUrlHelper = new Zend_View_Helper_BaseUrl(); // Configurações pado do formulário $this->setName('formRelatorio'); $this->setMethod(Zend_form::METHOD_POST); $oElm = $this->createElement('text', 'prestador_cnpj', array('divspan' => '10')); $oElm->setLabel('CNPJ Prestador:'); $oElm->setAttrib('class', 'span2 mask-cnpj'); $oElm->setAttrib('maxlength', '14'); $oElm->setAttrib('data-url', self::$oBaseUrlHelper->baseUrl('/contribuinte/empresa/dados-cgm/')); $oElm->addValidator(new DBSeller_Validator_Cnpj()); $oElm->addFilter(new Zend_Filter_Digits()); $oElm->setRequired(TRUE); $oElm->removeDecorator('errors'); $this->addCampo($oElm); $oElm = $this->createElement('hidden', 'prestador_razao_social'); $this->addCampo($oElm); $oElm = $this->createElement('text', 'data_competencia_inicial', array('divspan' => '4')); $oElm->setLabel('Competência Inicial:'); $oElm->setAttrib('class', 'span2'); $oElm->setAttrib('placeholder', 'Mês/Ano'); $oElm->addValidator(new Zend_Validate_StringLength(array('min' => 7, 'max' => 7))); $oElm->addValidator(new Zend_Validate_Date(array('format' => 'MM/yyyy'))); $oElm->setRequired(TRUE); $oElm->removeDecorator('errors'); $this->addCampo($oElm); $oElm = $this->createElement('text', 'data_competencia_final', array('divspan' => '6')); $oElm->setLabel('Competência Final:'); $oElm->setAttrib('class', 'span2'); $oElm->setAttrib('placeholder', 'Mês/Ano'); $oElm->addValidator(new Zend_Validate_StringLength(array('min' => 7, 'max' => 7))); $oElm->addValidator(new Zend_Validate_Date(array('format' => 'MM/yyyy'))); $oElm->setRequired(TRUE); $oElm->removeDecorator('errors'); $this->addCampo($oElm); $oElm = $this->createElement('select', 'guia_emitida', array('divspan' => '6')); $oElm->setLabel('Guia Emitida:'); $oElm->setAttrib('class', 'span2'); $oElm->setRequired(TRUE); $oElm->removeDecorator('errors'); $oElm->setMultiOptions(array(1 => 'Sim', 2 => 'Não')); $this->addCampo($oElm); $oElm = $this->createElement('select', 'tipo_relatorio', array('divspan' => '6')); $oElm->setLabel('Tipo de Relatório:'); $oElm->setAttrib('class', 'span2'); $oElm->setRequired(TRUE); $oElm->removeDecorator('errors'); $this->addCampo($oElm); $oElm = $this->createElement('select', 'ordenacao', array('divspan' => '4')); $oElm->setLabel('Ordenação:'); $oElm->setAttrib('class', 'span4'); $oElm->removeDecorator('errors'); $this->addCampo($oElm); $oElm = $this->createElement('select', 'ordem', array('divspan' => '2')); $oElm->setAttrib('class', 'span2'); $oElm->removeDecorator('errors'); $oElm->addMultiOptions(array('asc' => 'Crescente', 'desc' => 'Decrescente')); $this->addCampo($oElm); $oElm = $this->createElement('radio', 'movimentacao', array('divspan' => '6')); $oElm->setLabel('Movimentação:'); $oElm->setAttrib('class', 'pull-left'); $oElm->removeDecorator('errors'); $oElm->addMultiOptions(array('sim' => 'Sim', 'nao' => 'Não')); $oElm->setValue('sim'); $this->addCampo($oElm); $oElm = $this->createElement('submit', 'btn_gerar', array('divspan' => 10, 'label' => 'Gerar Relatório', 'class' => 'span2', 'msg-loading' => 'Aguarde...', 'buttonType' => Twitter_Bootstrap_Form_Element_Button::BUTTON_PRIMARY)); $this->addCampo($oElm); return $this; }