示例#1
0
 /**
 * 
 * Verifica se usuario respondeu completamente:
 * - preencheu Relato
 * - bloco Empreendedorismo
 * - bloco Negocios
 * - gerou Devolutiva
 * 
 * @param type $enterpriseRow
 * @return Array
 * 
   $arrTerminoEtapas = array(
        'relato' => $relato,
        'negocios' => $negocios,
        'empreemdedorismo' => $empreendedorismo,
        'devolutiva' => $gerouDevolutiva,
   );   
 *
 */
 public function terminoEtapas($enterpriseId, $userId)
 {
     //config
     $questionarioCurrentId = Zend_Registry::get('configDb')->qstn->currentAutoavaliacaoId;
     $negociosBlockId = Zend_Registry::get('configDb')->qstn->currentBlockIdNegocios;
     $enterpreneurBlockId = Zend_Registry::get('configDb')->qstn->currentBlockIdEmpreendedorismo;
     //models
     $model_enterpriseReport = new Model_EnterpriseReport();
     $model_execution = new Model_Execution();
     //variades de retorno
     $relato = false;
     $gerouDevolutiva = false;
     $negocios = true;
     $empreendedorismo = true;
     //$enterpriseId = $enterpriseRow->getId();
     $relatoRow = $model_enterpriseReport->getEnterpriseReport("EnterpriseId = " . $enterpriseId);
     $empreendedorismoRow = $this->isFullyAnsweredByBloco($questionarioCurrentId, $userId, $enterpreneurBlockId);
     $negociosRow = $this->isFullyAnsweredByBloco($questionarioCurrentId, $userId, $negociosBlockId);
     $reportId = $relatoRow ? $relatoRow->getId() : null;
     //se respondeu todo bloco de Empreendedorismo
     if (!$empreendedorismoRow) {
         $empreendedorismo = false;
     }
     //se respondeu todo bloco de Negocios
     if (!$negociosRow) {
         $negocios = false;
     }
     //tem relato
     if ($reportId) {
         $relato = true;
     }
     //row execution
     $devolutive = $model_execution->getExecutionByUserAndQuestionnaire($questionarioCurrentId, $userId);
     //string - url da devolutiva gerada
     $devolutivePath = $devolutive ? $devolutive->getDevolutivePath() : null;
     //gerou devvolutiva
     if ($devolutivePath) {
         $gerouDevolutiva = true;
     }
     //return
     $arrTerminoEtapas = array('relato' => $relato, 'negocios' => $negocios, 'empreendedorismo' => $empreendedorismo, 'devolutiva' => $gerouDevolutiva);
     return $arrTerminoEtapas;
 }
 public function reportAction()
 {
     $this->view->fase = $this->fase;
     $modelReport = new Model_EnterpriseReport();
     $V = array('report' => $modelReport->getEnterpriseReportByEnterpriseIdKey($this->enterpriseKey), 'enterprise' => $this->enterpriseRow, 'president' => $this->enterpriseRow->getPresidentRow(), 'scores' => $this->Appraiser->getEnterpriseScoreAppraisersData($this->enterpriseRow->getId(), null, $this->fase));
     $this->view->assign($V);
 }
示例#3
0
 public function internalReportAction()
 {
     $enterpriseKey = $this->_getParam('enterprise-id-key');
     $competitionId = $this->_getParam('competition-id', null);
     $nacional = $this->_getParam('nacional', null);
     $this->view->fase = $nacional;
     $enterpriseRow = $this->Enterprise->getEnterpriseByIdKey($enterpriseKey);
     $commentQuestions = $this->Appraiser->getQuestions();
     $evaluationQuestions = DbTable_QuestionChecker::getInstance()->fetchAll('QuestionTypeId = 7', 'Designation');
     $this->evaluationRow = $this->Appraiser->getCheckerEvaluation($enterpriseRow->getId(), $competitionId ? $competitionId : $this->programId, $nacional);
     $modelReport = new Model_EnterpriseReport();
     $scores = $this->Appraiser->getEnterpriseScoreAppraisersData($enterpriseRow->getId(), $competitionId, $nacional);
     $checkerId = (isset($scores) and $scores->getCheckerId() != null) ? $scores->getCheckerId() : 0;
     $commentAnswers = $this->Appraiser->getApeEvaluationVerificadorComment($enterpriseRow->getId(), $checkerId);
     $View = array('report' => $modelReport->getEnterpriseReportByEnterpriseIdKey($enterpriseKey, $competitionId), 'enterprise' => $enterpriseRow, 'president' => $enterpriseRow->getPresidentRow(), 'questoes' => $commentQuestions, 'questionsAvaliacao' => $evaluationQuestions, 'evaluationRow' => $this->evaluationRow, 'respostas' => $this->evaluationRow ? $this->evaluationRow->getAnswers() : null, 'commentAnswers' => $commentAnswers->count() > 0 ? $commentAnswers : null, 'scores' => $scores);
     $this->view->assign($View);
 }
 public function getArrayReport()
 {
     $modelReport = new Model_EnterpriseReport();
     $AppraiserModel = new Model_Appraiser();
     $V = array('report' => $modelReport->getEnterpriseReportByEnterpriseIdKey($this->enterpriseKey->IdKey), 'enterprise' => $this->enterpriseRow, 'president' => $this->enterpriseRow->getPresidentRow(), 'scores' => $this->Appraiser->getEnterpriseScoreAppraisersData($this->enterpriseRow->getId(), null, 2));
     //var_dump($this->Appraiser->getEnterpriseScoreAppraisersData($this->enterpriseRow->getId(), null, 2));die;
     $data['enterprise_id'] = $this->enterpriseRow->getId();
     $data['user_id'] = $this->userAuth->getUserId();
     $data['programa_id'] = $this->programId;
     $data['tipo'] = 1;
     if ($this->nacional == 2) {
         $data['tipo'] = 2;
     }
     $data['status'] = "IIII";
     $objAppraiser = $AppraiserModel->setCheckerToEnterpriseVerificador($data);
     return $V;
 }
示例#5
0
 public function reportAction()
 {
     $modelReport = new Model_EnterpriseReport();
     $View = array('report' => $modelReport->getEnterpriseReportByEnterpriseIdKey($this->enterpriseKey), 'enterprise' => $this->enterpriseRow, 'president' => $this->enterpriseRow->getPresidentRow());
     $this->view->assign($View);
 }