public function init()
 {
     /* Form Elements & Other Definitions Here ... */
     if (!isset($this->_PROJETOS)) {
         $projeto = new Application_Model_DbTable_Projeto();
         $this->_PROJETOS = $projeto->getProjetoCombo();
     }
     $this->setName('FormularioServico');
     $FL_VALIDAR_SERVICO = new Zend_Form_Element_Hidden('FL_VALIDAR_SERVICO');
     $FL_VALIDAR_SERVICO->addFilter('Int');
     $FL_VALIDAR_SERVICO->removeDecorator('Label');
     $ID_SERVICO = new Zend_Form_Element_Hidden('ID_SERVICO');
     $ID_SERVICO->addFilter('Int');
     $ID_SERVICO->removeDecorator('Label');
     $FK_OPERADOR = new Zend_Form_Element_Hidden('FK_OPERADOR');
     $FK_OPERADOR->addFilter('Int');
     $FK_OPERADOR->removeDecorator('Label');
     $FL_PCP = new Zend_Form_Element_Hidden('FL_PCP');
     $FL_PCP->addFilter('Int');
     $FL_PCP->removeDecorator('Label');
     /* 
      */
     $FK_TIPO_SERVICO = new Zend_Form_Element_Select('FK_TIPO_SERVICO');
     $tipoServico = new Application_Model_DbTable_TipoServico();
     $FK_TIPO_SERVICO->setLabel('TIPO PCP');
     $FK_TIPO_SERVICO->setMultiOptions($tipoServico->getTipoServicoCombo())->setRequired(true)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control select2');
     $FK_PROJETO = new Zend_Form_Element_Hidden('FK_PROJETO');
     $FK_PROJETO->addFilter('Int');
     $FK_PROJETO->removeDecorator('Label');
     $FK_PROJETO1 = new Zend_Form_Element_Text('FK_PROJETO1');
     $FK_PROJETO1->setLabel('PROJETO')->setAttrib('class', 'form-control');
     $DS_SERVICO = new Zend_Form_Element_Textarea('DS_SERVICO');
     $DS_SERVICO->setLabel('PCP')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control ')->setAttrib('rows', '20');
     $DT_SERVICO = new Zend_Form_Element_Text('DT_SERVICO');
     $DT_SERVICO->setLabel('DATA')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->addPrefixPath('Aplicacao_Validate', 'Aplicacao/Validate/', 'validate')->addValidator(new Aplicacao_Validate_Data())->setAttrib('placeholder', 'Enter serviço ');
     $NR_CARGA_HORARIA = new Zend_Form_Element_Text('NR_CARGA_HORARIA');
     $NR_CARGA_HORARIA->setLabel('CARGA HORARIA')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->addValidator('float', true, array('locale' => 'en_US'))->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter carga horária ');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel("Adiconar");
     $submit->setAttrib('id', 'submitbutton');
     $submit->removeDecorator('DtDdWrapper')->setAttrib('class', 'btn btn-primary button')->removeDecorator('HtmlTag')->removeDecorator('Label');
     $this->addElements(array($FK_PROJETO1, $FL_VALIDAR_SERVICO, $ID_SERVICO, $FK_PROJETO, $DS_SERVICO, $FK_OPERADOR, $FK_TIPO_SERVICO, $DT_SERVICO, $FL_PCP, $NR_CARGA_HORARIA, $submit));
     $this->setDecorators(array(array('ViewScript', array('viewScript' => '/forms/formularioPcpProjeto.phtml'))));
 }
 public function init()
 {
     /* Form Elements & Other Definitions Here ... */
     $this->setName('FormularioServico');
     $id = new Zend_Form_Element_Hidden('ID_PLANO_ACAO');
     $id->addFilter('Int');
     $id->removeDecorator('Label');
     $DS_ASSUNTO = new Zend_Form_Element_Text('DS_ASSUNTO');
     $DS_ASSUNTO->setLabel('ASSUNTO')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter assunto ');
     $TX_PLANO_ACAO = new Zend_Form_Element_Textarea('TX_PLANO_ACAO');
     $TX_PLANO_ACAO->setLabel('AÇÕES')->setRequired(true)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('rows', '20');
     $FK_PROJETO = new Zend_Form_Element_Select('FK_PROJETO');
     $projeto = new Application_Model_DbTable_Projeto();
     $FK_PROJETO->setLabel('PROJETO');
     $FK_PROJETO->setMultiOptions($projeto->getProjetoCombo())->setRequired(true)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control select2');
     $FK_STATUS_PLANO_ACAO = new Zend_Form_Element_Select('FK_STATUS_PLANO_ACAO');
     $statusPlanoAcao = new Application_Model_DbTable_StatusPlanoAcao();
     $FK_STATUS_PLANO_ACAO->setLabel('STATUS');
     $FK_STATUS_PLANO_ACAO->setMultiOptions($statusPlanoAcao->getStatusPlanoAcaoCombo())->setRequired(true)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control select2');
     $FK_OPERADOR = new Zend_Form_Element_Select('FK_OPERADOR');
     $operador = new Application_Model_DbTable_Operador();
     $FK_OPERADOR->setLabel('OPERADOR');
     $FK_OPERADOR->setMultiOptions($operador->getOperadorCombo())->setRequired(true)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control select2');
     $DT_ATUALIZACAO = new Zend_Form_Element_Text('DT_ATUALIZACAO');
     $DT_ATUALIZACAO->setLabel('DATA ATUALIZAÇÃO')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control data');
     $DT_PREVISAO = new Zend_Form_Element_Text('DT_PREVISAO');
     $DT_PREVISAO->setLabel('DATA PREVISÃO')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control data');
     $DT_CONTROLE = new Zend_Form_Element_Text('DT_CONTROLE');
     $DT_CONTROLE->setLabel('DATA CONTROLE')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control data');
     $DT_CONCLUSAO = new Zend_Form_Element_Text('DT_CONCLUSAO');
     $DT_CONCLUSAO->setLabel('DATA CONCLUSAO')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control data');
     /* I*/
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel("Adiconar");
     $submit->setAttrib('id', 'submitbutton');
     $submit->removeDecorator('DtDdWrapper')->setAttrib('class', 'btn btn-primary button')->removeDecorator('HtmlTag')->removeDecorator('Label');
     $this->addElements(array($id, $submit, $DS_ASSUNTO, $TX_PLANO_ACAO, $FK_PROJETO, $FK_OPERADOR, $FK_STATUS_PLANO_ACAO, $DT_ATUALIZACAO, $DT_PREVISAO, $DT_CONTROLE, $DT_CONCLUSAO));
     $this->setDecorators(array(array('ViewScript', array('viewScript' => '/forms/formularioPlanoAcao.phtml'))));
 }
 public function init()
 {
     /* Form Elements & Other Definitions Here ... */
     $this->setName('FormularioProjetoOperador');
     /* $FK_PROJETO = new Zend_Form_Element_Hidden('FK_PROJETO');
        $FK_PROJETO->addFilter('Int');
        $FK_PROJETO->removeDecorator('Label');*/
     /* 
      */
     $FK_OPERADOR = new Zend_Form_Element_Select('FK_OPERADOR');
     $operador = new Application_Model_DbTable_Operador();
     $FK_OPERADOR->setLabel('OPERADOR');
     $FK_OPERADOR->setMultiOptions($operador->getOperadores())->setRequired(true)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control select2');
     $FK_PROJETO = new Zend_Form_Element_Select('FK_PROJETO');
     $projeto = new Application_Model_DbTable_Projeto();
     $FK_PROJETO->setLabel('PROJETO');
     $FK_PROJETO->setMultiOptions($projeto->getProjetoIndividualCombo($this->_PROJETO))->setRequired(true)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control select2');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel("Adiconar");
     $submit->setAttrib('id', 'submitbutton');
     $submit->removeDecorator('DtDdWrapper')->setAttrib('class', 'btn btn-primary button')->removeDecorator('HtmlTag')->removeDecorator('Label');
     $this->addElements(array($FK_PROJETO, $FK_OPERADOR, $submit));
     $this->setDecorators(array(array('ViewScript', array('viewScript' => '/forms/formularioProjetoOperador.phtml'))));
 }
示例#4
0
 public function getProjetoCombo()
 {
     $listaProjeto = new Application_Model_DbTable_Projeto();
     return $listaProjeto->getAdapter()->fetchPairs($listaProjeto->select()->from('TB_PROJETO', array('ID_PROJETO', 'NM_PROJETO'))->order('NM_PROJETO'));
 }
 public function listaProjetoAction()
 {
     // action body
     $projeto = new Application_Model_DbTable_Projeto();
     $menu = new Application_Model_DbTable_MenuPermissaoPerfil();
     $permissao = $menu->retornaPermissaoPagina("add-projeto", $this->user->getFKPerfil());
     $this->view->permissaoAdicionarProjeto = $permissao;
     $permissao = $menu->retornaPermissaoPagina("delete-projeto", $this->user->getFKPerfil());
     $this->view->permissaoDeleteProjeto = $permissao;
     $permissao = $menu->retornaPermissaoPagina("edit-projeto", $this->user->getFKPerfil());
     $this->view->permissaoEditProjeto = $permissao;
     if ($this->getRequest()->isPost()) {
         $del = $this->getRequest()->getPost('del');
         if ($del == 'Sim') {
             //Zend_Registry::get('logger')->log("teste2222", Zend_Log::INFO);
             $id = $this->getRequest()->getPost('ID_PROJETO');
             try {
                 $projeto->deleteProjeto($id);
                 $this->view->mensagem = "Excluído com sucesso";
                 $this->view->erro = 0;
             } catch (Exception $e) {
                 $this->view->mensagem = $e->getCode() . " Deletar projeto";
                 $this->view->erro = 1;
                 $this->view->mensagemExcecao = $e->getMessage();
             }
         }
     }
     Zend_Registry::get('logger')->log("aaaa", Zend_Log::INFO);
     //$this->view->listaProjetos = $projeto->getProjetos();
     $this->view->listaProjetos = $projeto->getProjetosIndividual($this->user->getId());
     Zend_Registry::get('logger')->log($this->view->listaProjetos, Zend_Log::INFO);
 }