Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 487 | Rev 489 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 487 Rev 488
Línea 334... Línea 334...
334
        $currentUserPlugin = $this->plugin('currentUserPlugin');
334
        $currentUserPlugin = $this->plugin('currentUserPlugin');
335
        $currentUser = $currentUserPlugin->getUser();
335
        $currentUser = $currentUserPlugin->getUser();
Línea 336... Línea 336...
336
 
336
 
Línea 337... Línea 337...
337
        $uuid = $this->params()->fromRoute('id');
337
        $uuid = $this->params()->fromRoute('id');
338
 
338
 
Línea 339... Línea 339...
339
        $companySelfEvaluationFormMapper = CompanySelfEvaluationTestMapper::getInstance($this->adapter);
339
        $companySelfEvaluationTestMapper = CompanySelfEvaluationTestMapper::getInstance($this->adapter);
340
        $companySelfEvaluationForm = $companySelfEvaluationFormMapper->fetchOneByUuid($uuid);
340
        $companySelfEvaluationTest = $companySelfEvaluationTestMapper->fetchOneByUuid($uuid);
341
 
341
 
342
        if (!$companySelfEvaluationForm) {
342
        if (!$companySelfEvaluationTest) {
343
            return new JsonModel([
343
            return new JsonModel([
344
                'success' => false,
344
                'success' => false,
Línea 345... Línea 345...
345
                'data' => 'ERROR_FORM_SELF_EVALUATION_NOT_FOUND'
345
                'data' => 'ERROR_FORM_SELF_EVALUATION_TEST_NOT_FOUND'
346
            ]);
346
            ]);
347
        }
347
        }
348
 
348
 
349
        if ($companySelfEvaluationForm->status != CompanySelfEvaluationTest::STATUS_COMPLETE) {
349
        if ($companySelfEvaluationTest->status != CompanySelfEvaluationTest::STATUS_COMPLETE) {
350
            return new JsonModel([
350
            return new JsonModel([
Línea 351... Línea 351...
351
                'success' => false,
351
                'success' => false,
Línea 360... Línea 360...
360
        ]);
360
        ]);
Línea 361... Línea 361...
361
 
361
 
362
 
362
 
-
 
363
        $request = $this->getRequest();
-
 
364
        if ($request->isGet()) {
-
 
365
 
-
 
366
            //get form data           
-
 
367
            $companySelfEvaluationFormMapper = CompanySelfEvaluationFormMapper::getInstance($this->adapter);
-
 
368
            $companySelfEvaluationForm = $companySelfEvaluationFormMapper->fetchOne($companySelfEvaluationTest->form_id);
363
        $request = $this->getRequest();
369
 
364
        if ($request->isGet()) {
370
 
365
            return new JsonModel([
371
            return new JsonModel([
366
                'success' => false,
372
                'success' => false,
367
                'data' => [
373
                'data' => [
368
                    'name' => $companySelfEvaluationForm->name,
374
                    'name' => $companySelfEvaluationForm->name,
369
                    'description' => $companySelfEvaluationForm->description,
-
 
370
                    'text' => $companySelfEvaluationForm->text,
375
                    'description' => $companySelfEvaluationForm->description,
371
                    'content' => $companySelfEvaluationTest && $companySelfEvaluationTest->status == CompanySelfEvaluationTest::STATUS_DRAFT ?
-
 
372
                    json_decode($companySelfEvaluationTest->content) :
376
                    'text' => $companySelfEvaluationForm->text,
373
                    json_decode($companySelfEvaluationForm->content),
377
                    'content' => json_decode($companySelfEvaluationTest->content)
374
                ]
378
                ]