/** * faz calculo da pontuacao para tabela Radar */ public function dadosTabelaPontuacao() { $arrCriteria = $this->getArrCriteria(); $arrPunctuation = $this->getArrPunctuation(); $arrRadarData = $this->getArrRadarData(); $arrTabulation = $this->getArrTabulation(); $pontuacaoMaxima = Vtx_Util_Array::pontuacaoMaximaCriteriosGestao(); #('15,0', '9,0', '9,0', '6,0', '6,0','9,0','16,0','30,0' ); $objPontuacao = new stdClass(); //Lideranca $objPontuacao->Lideranca = new stdClass(); $objPontuacao->Lideranca->nome = $arrCriteria[1]; $objPontuacao->Lideranca->pontuacaoMaxima = $pontuacaoMaxima[1]; $objPontuacao->Lideranca->pontuacaoObtida = Vtx_Util_Formatting::roundAndDouble($arrPunctuation[1]); $objPontuacao->Lideranca->porcentagem = Vtx_Util_Formatting::roundAndDouble($arrRadarData[1]); //Estrategias e Planos $objPontuacao->Estrategias = new stdClass(); $objPontuacao->Estrategias->nome = $arrCriteria[2]; $objPontuacao->Estrategias->pontuacaoMaxima = $pontuacaoMaxima[2]; $objPontuacao->Estrategias->pontuacaoObtida = Vtx_Util_Formatting::roundAndDouble($arrPunctuation[2]); $objPontuacao->Estrategias->porcentagem = Vtx_Util_Formatting::roundAndDouble($arrRadarData[2]); //Clientes $objPontuacao->Clientes = new stdClass(); $objPontuacao->Clientes->nome = $arrCriteria[3]; $objPontuacao->Clientes->pontuacaoMaxima = $pontuacaoMaxima[3]; $objPontuacao->Clientes->pontuacaoObtida = Vtx_Util_Formatting::roundAndDouble($arrPunctuation[3]); $objPontuacao->Clientes->porcentagem = Vtx_Util_Formatting::roundAndDouble($arrRadarData[3]); //Sociedade $objPontuacao->Sociedade = new stdClass(); $objPontuacao->Sociedade->nome = $arrCriteria[4]; $objPontuacao->Sociedade->pontuacaoMaxima = $pontuacaoMaxima[4]; $objPontuacao->Sociedade->pontuacaoObtida = Vtx_Util_Formatting::roundAndDouble($arrPunctuation[4]); $objPontuacao->Sociedade->porcentagem = Vtx_Util_Formatting::roundAndDouble($arrRadarData[4]); //Informações e Conhecimento $objPontuacao->Informacoes = new stdClass(); $objPontuacao->Informacoes->nome = $arrCriteria[5]; $objPontuacao->Informacoes->pontuacaoMaxima = $pontuacaoMaxima[5]; $objPontuacao->Informacoes->pontuacaoObtida = Vtx_Util_Formatting::roundAndDouble($arrPunctuation[5]); $objPontuacao->Informacoes->porcentagem = Vtx_Util_Formatting::roundAndDouble($arrRadarData[5]); //Pessoas $objPontuacao->Pessoas = new stdClass(); $objPontuacao->Pessoas->nome = $arrCriteria[6]; $objPontuacao->Pessoas->pontuacaoMaxima = $pontuacaoMaxima[6]; $objPontuacao->Pessoas->pontuacaoObtida = Vtx_Util_Formatting::roundAndDouble($arrPunctuation[6]); $objPontuacao->Pessoas->porcentagem = Vtx_Util_Formatting::roundAndDouble($arrRadarData[6]); //Processos $objPontuacao->Processos = new stdClass(); $objPontuacao->Processos->nome = $arrCriteria[7]; $objPontuacao->Processos->pontuacaoMaxima = $pontuacaoMaxima[7]; $objPontuacao->Processos->pontuacaoObtida = Vtx_Util_Formatting::roundAndDouble($arrPunctuation[7]); $objPontuacao->Processos->porcentagem = Vtx_Util_Formatting::roundAndDouble($arrRadarData[7]); //Resultados $objPontuacao->Resultados = new stdClass(); $objPontuacao->Resultados->nome = $arrCriteria[8]; $objPontuacao->Resultados->pontuacaoMaxima = $pontuacaoMaxima[8]; $objPontuacao->Resultados->pontuacaoObtida = Vtx_Util_Formatting::roundAndDouble($arrPunctuation[8]); $objPontuacao->Resultados->porcentagem = Vtx_Util_Formatting::roundAndDouble($arrRadarData[8]); return $objPontuacao; }
public function reportGlobalAction() { $this->incluirJoinRegionalForce = false; $filter = $this->_getParam('filter', null); $filter['show_only'] = 'candidatas'; if (isset($filter['competition_id']) and $filter['competition_id'] != $this->competitionId) { throw new Exception('access denied'); return; } $format = $this->_getParam('format', null); $render = $format == 'csv' ? 'report-global' : 'index'; $this->_helper->viewRenderer->setRender($render); if (!$format) { self::indexAction(); return; } $cacheQuestion = new Vtx_Cache_MPE_QuestionarioCache(); $Qstn = new Model_Questionnaire(); $alternativesByQuestion = $allAlternativeIds = array(); $blockId = isset($filter['qstn']) ? $filter['qstn'] : Zend_Registry::get('configDb')->qstn->currentBlockIdNegocios; //$this->view->showRadar = $blockId==Model_Devolutive::BLOCO_GESTAOEMPRESA? true : false; $this->view->showRadar = false; $questions = $cacheQuestion->BlocoECriterios($blockId, $Qstn->getCurrentQstnRow()); $this->view->questions = $questions = $questions[$blockId]; foreach ($questions['Criterions'] as $criterion) { foreach ($criterion['Questions'] as $questionId => $question) { $alternativesQuestion = $cacheQuestion->alternativasEQuestoes($question['QuestionId'], new Model_Alternative()); $alternativesByQuestion[$questionId] = $alternativesQuestion; foreach ($alternativesQuestion as $alternative) { $allAlternativeIds[] = $alternative['Id']; } } } $this->filterAdditional = $filter; $this->filterAdditional['alternativesId'] = $allAlternativeIds; $this->view->alternativesByQuestion = $alternativesByQuestion; $this->fetchReturn = 'pairs'; $this->fetchReturnForce = 'pairs'; $this->tipoRelatorio = 'report-global-respostas'; self::indexAction(); $this->view->qtRespostasAlternativa = $this->view->getAllEnterprise; if (!$this->view->showRadar) { return; } $dataCriterios = $this->Enterprise->getAllByColAE($this->paramsBuscaServiceArea[0], $this->paramsBuscaServiceArea[1], $this->autoavaliacaoId, null, null, $this->filter, null, $format, 'assoc', 'report-global-criterios'); $dataCriteriosPorcent = array(); $this->view->dataCriterios = $dataCriterios['total']; $this->view->pontuacaoMaxima = $pontuacaoMaxima = Vtx_Util_Array::pontuacaoMaximaCriteriosGestao(); $i = 0; foreach ($this->view->dataCriterios as $criterio => $pontuacao) { if ($i != 0) { $dataCriteriosPorcent[] = (double) $pontuacao / (double) $pontuacaoMaxima[$i] * 100; } $i++; } $this->view->dataCriteriosPoncent = $dataCriteriosPorcent; }