Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 486 Rev 487
Línea 329... Línea 329...
329
        ]);
329
        ]);
330
    }
330
    }
Línea 331... Línea 331...
331
 
331
 
Línea -... Línea 332...
-
 
332
    public function reportAction() {
-
 
333
 
-
 
334
        $currentUserPlugin = $this->plugin('currentUserPlugin');
-
 
335
        $currentUser = $currentUserPlugin->getUser();
-
 
336
 
-
 
337
        $uuid = $this->params()->fromRoute('id');
-
 
338
 
-
 
339
        $companySelfEvaluationFormMapper = CompanySelfEvaluationTestMapper::getInstance($this->adapter);
-
 
340
        $companySelfEvaluationForm = $companySelfEvaluationFormMapper->fetchOneByUuid($uuid);
-
 
341
 
-
 
342
        if (!$companySelfEvaluationForm) {
-
 
343
            return new JsonModel([
-
 
344
                'success' => false,
-
 
345
                'data' => 'ERROR_FORM_SELF_EVALUATION_NOT_FOUND'
-
 
346
            ]);
-
 
347
        }
-
 
348
 
-
 
349
        if ($companySelfEvaluationForm->status != CompanySelfEvaluationTest::STATUS_COMPLETE) {
-
 
350
            return new JsonModel([
-
 
351
                'success' => false,
-
 
352
                'data' => 'ERROR_FORM_SELF_EVALUATION_IS_INACTIVE'
-
 
353
            ]);
-
 
354
        }
-
 
355
 
-
 
356
 
-
 
357
        return new JsonModel([
-
 
358
            'success' => true,
-
 
359
            'data' => 'ERROR_FORM_SELF_EVALUATION_ALREADY_YOUR_APPLICATION_IN_THIS_TEST'
-
 
360
        ]);
-
 
361
 
-
 
362
 
-
 
363
        $request = $this->getRequest();
-
 
364
        if ($request->isGet()) {
-
 
365
            return new JsonModel([
-
 
366
                'success' => false,
-
 
367
                'data' => [
-
 
368
                    'name' => $companySelfEvaluationForm->name,
-
 
369
                    'description' => $companySelfEvaluationForm->description,
-
 
370
                    'text' => $companySelfEvaluationForm->text,
-
 
371
                    'content' => $companySelfEvaluationTest && $companySelfEvaluationTest->status == CompanySelfEvaluationTest::STATUS_DRAFT ?
-
 
372
                    json_decode($companySelfEvaluationTest->content) :
-
 
373
                    json_decode($companySelfEvaluationForm->content),
-
 
374
                ]
-
 
375
            ]);
-
 
376
        }
-
 
377
 
332
    public function reportAction() {
378
 
333
 
379
 
-
 
380
        return new JsonModel([
334
        return new JsonModel([
381
            'success' => false,
Línea 335... Línea 382...
335
            'data' => 'Pdf'
382
            'data' => 'ERROR_METHOD_NOT_ALLOWED'
Línea 336... Línea 383...
336
        ]);
383
        ]);