/** * * // case 1 = Tipo do questionario diagnostico. */ public function initTipo() { $this->execution->finishExecution($this->devolutive->getQuestionnaireId(), $this->devolutive->getUserId(), $this->devolutive->getArqPath(), null, $this->devolutive->getIsRA()); $this->eligibility->doAutoavaliacaoEligibility($this->devolutive->getQuestionnaireId(), $this->devolutive->getUserId()); $result = $this->devolutive->makePdfDevolutiveAllBlocks($this->devolutive->getQuestionnaireId(), $this->devolutive->getUserId(), $this->devolutive->getDirName(), $this->devolutive->getPublicDir(), $this->devolutive->getArqName(), $this->devolutive->getIsRA()); return $result; }
/** * * // case 2 = Tipo do questionario autoavaliacao. */ public function initTipo() { // case 2 = Tipo do questionario autoavaliacao. $result = false; $arrScore = $this->devolutive->makeScoreRAA($this->devolutive->getQuestionnaireId(), $this->devolutive->getUserId()); if ($arrScore) { //grava dados em Execution $this->execution->finishExecution($this->devolutive->getQuestionnaireId(), $this->devolutive->getUserId(), $this->devolutive->getArqPath(), $arrScore[2], $this->devolutive->getIsRA()); //faz geracao do pdf $result = $this->devolutive->makePdfDevolutiveAutoAvaliacao($this->devolutive->getQuestionnaireId(), $this->devolutive->getUserId(), $this->devolutive->getDirName(), $this->devolutive->getPublicDir(), $this->devolutive->getArqName(), $this->devolutive->getIsRA()); } //end if return $result; }
/** * * * metodo que recebe objeto Devolutive e nomeia arquivo pdf e cria diretorio onde pdf sera gravado * * @param Model_Devolutive $objDevolutive * * @return boolean */ public function preparaFileSystemParaDevolutiva() { $result = false; $arrUser = array('Id = ?' => $this->objDevolutive->getUserId()); $this->userSalt = $this->tbUser->fetchRow($arrUser)->getSalt(); if (!$this->objDevolutive->getIsRA()) { $arqName = self::ARQNAME_DEVOLUTIVE . $this->objDevolutive->getQuestionnaireId() . "_" . date("YmdHis") . self::EXTENSION_ARQ; } else { $arqName = self::ARQNAME_EVALUATION . $this->objDevolutive->getQuestionnaireId() . "_" . date("YmdHis") . self::EXTENSION_ARQ; } $this->objDevolutive->setArqName($arqName); $basePath = self::BASE_PATH . hash("sha256", $this->objDevolutive->getUserId() . "_" . $this->userSalt) . "/"; $dirName = $this->public_path . $basePath; $this->objDevolutive->setDirName($dirName); $publicDir = Zend_Controller_Front::getInstance()->getBaseUrl() . $basePath; $this->objDevolutive->setPublicDir($publicDir); $arqPath = $publicDir . $arqName; $this->objDevolutive->setArqPath($arqPath); //cria diretorio para pdf try { if (!is_dir($dirName)) { mkdir($dirName); } chmod($dirName, 0777); } catch (Excception $e) { } return $result; }
/** * carrega dados/array list de: * * - questionario * - blocos de questionario * - contato da empresa * - criterios do questionario * */ protected function arrayListTodosDadosParaGeracaoDevolutiva() { /** PARTE 1 * */ //bloco 1 do questionario $blockId_1 = $this->devolutive->getBlockIdNegocios(); //bloco 2 do questionario $blockId_2 = $this->devolutive->getBlockIdEmpreendedorismo(); //recupera todos os dados do usuario Empresa list($arrEnterprise, $arrContact, $arrIssues) = $this->devolutive->getEnterpriseData($this->devolutive->getUserId()); // bloco 1 //recupera dados completos do questionario, blocos, questoes, criterios e respostas list($arrDevolutiveGov, $arrBlocksGov, $arrCriteriaGov, $arrQuestionnaire) = $this->getArrayQuestionsAndAlternatives($this->devolutive->getQuestionnaireId(), $this->devolutive->getUserId(), $blockId_1); //getArrayDevolutiveRAA // bloco 2 //recupera dados completos do questionario, blocos, questoes, criterios e respostas list($arrDevolutiveGes, $arrBlocksGes, $arrCriteriaGes, $arrQuestionnaire) = $this->getArrayQuestionsAndAlternatives($this->devolutive->getQuestionnaireId(), $this->devolutive->getUserId(), $blockId_2); //define calculo do grafico de radar com base no IdBloco informado //list($arrRadarDataGes, $arrTabulationGes, $arrPunctuationGes) //= $this->questionnaire->getRadarData($this->devolutive->getQuestionnaireId(), $gestaoBlockId, $this->devolutive->getUserId()); /** //Porcentagem de acertos por criterio //nao utilizado no PSMN //$strPathRadar = $this->devolutive->makeRadarPlot($arrCriteriaGes, $arrRadarDataGes, $arrTabulationGes, $arrPunctuationGes, $this->devolutive->getDirName()); //nao utilizado no PSMN //calcula scores de autoavaliacao -> PSMN nao usa $arrScores = $this->makeScoreRAA($questionnaireId, $userId); $scorePart1 = $arrScores[0]; $scorePart2 = $arrScores[1]; * */ $this->devolutive->setArrEnterprise($arrEnterprise); $this->devolutive->setArrContact($arrContact); $this->devolutive->setArrIssues($arrIssues); $this->devolutive->setArrDevolutiveGov($arrDevolutiveGov); $this->devolutive->setArrBlocksGov($arrBlocksGov); $this->devolutive->setArrCriteriaGov($arrCriteriaGov); $this->devolutive->setArrQuestionnaire($arrQuestionnaire); $this->devolutive->setArrDevolutiveGes($arrDevolutiveGes); $this->devolutive->setArrBlocksGes($arrBlocksGes); $this->devolutive->setArrCriteriaGes($arrCriteriaGes); }