/** * Método vincularpropostas() * UC 89 - Fluxo FA6 - Vincular Propostas * @access public * @param void * @return void */ public function vincularpropostasAction() { $tbVinculo = new TbVinculo(); $propostas = new PreProjeto(); // $proposta = new Proposta(); $agentes = new Agentes(); $dadosCombo = array(); $rsVinculo = $agentes->listarVincularPropostaCombo($this->idResponsavel); $i = 0; foreach ($rsVinculo as $rs) { $dadosCombo[$i]['idResponsavel'] = $rs->idUsuarioResponsavel; $dadosCombo[$i]['idVinculo'] = $rs->idVinculo; $dadosCombo[$i]['NomeResponsavel'] = $rs->NomeResponsavel; $i++; } //ADICIONA AO ARRAY O IDAGENTE DO USUARIO LOGADO $dadosIdAgentes = array($this->idAgenteProponente); //VERIFICA SE O USUARIO LOGADO EH DIRIGENTE DE ALGUMA EMPRESA $Vinculacao = new Vinculacao(); $rsVinculucao = $Vinculacao->verificarDirigenteIdAgentes($this->cpfLogado); //CASO RETORNE ALGUM RESULTADO, ADICIONA OS IDAGENTE'S DE CADA UM AO ARRAY if (count($rsVinculucao) > 0) { foreach ($rsVinculucao as $value) { $dadosIdAgentes[] = $value->idAgente; } } // $whereResponsavel['VI.idAgenteProponente in (?)'] = $dadosIdAgentes; // $whereResponsavel['VI.siVinculo = ?'] = 2; // $buscaResponsavel = $tbVinculo->buscarResponsaveis($whereResponsavel, $this->idAgenteProponente); //PROCURA AS PROPOSTAS DE TODOS OS IDAGENTE'S $listaPropostas = $propostas->buscarVinculadosProponenteDirigentes($dadosIdAgentes); $wherePropostaD['pp.idAgente = ?'] = $this->idAgenteProponente; $wherePropostaD['pr.idProjeto IS NULL'] = ''; $wherePropostaD['pp.idUsuario <> ?'] = $this->idResponsavel; $listaPropostasD = $propostas->buscarPropostaProjetos($wherePropostaD); $this->view->responsaveis = $dadosCombo; $this->view->propostas = $listaPropostas; $this->view->propostasD = $listaPropostasD; }