Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 366 Rev 446
Línea 209... Línea 209...
209
 
209
 
210
            return new JsonModel($data);
210
            return new JsonModel($data);
Línea 211... Línea 211...
211
        }
211
        }
212
 
212
 
213
        $companySelfEvaluationTestMapper = CompanySelfEvaluationTestMapper::getInstance($this->adapter);
213
        $companySelfEvaluationTestMapper = CompanySelfEvaluationTestMapper::getInstance($this->adapter);
214
        $testMapper = $companySelfEvaluationTestMapper->fetchOneByUuid($uuid);
214
        $companySelfEvaluationTest = $companySelfEvaluationTestMapper->fetchOneByUuid($uuid);
215
        if (!$testMapper) {
215
        if (!$companySelfEvaluationTest) {
216
            $data = [
216
            $data = [
217
                'success' => false,
217
                'success' => false,
Línea 230... Línea 230...
230
 
230
 
231
                $selfEvaluationTest = new CompanySelfEvaluationTest();
231
                $selfEvaluationTest = new CompanySelfEvaluationTest();
232
                $selfEvaluationTest->status = $dataPost['status'];
232
                $selfEvaluationTest->status = $dataPost['status'];
Línea 233... Línea 233...
233
                $selfEvaluationTest->content = $dataPost['content'];
233
                $selfEvaluationTest->content = $dataPost['content'];
Línea 234... Línea 234...
234
 
234
 
235
                $result = $companySelfEvaluationTestMapper->update($selfEvaluationTest, $testMapper->id);
235
                $result = $companySelfEvaluationTestMapper->update($selfEvaluationTest, $companySelfEvaluationTest->id);
236
 
236
 
237
                if ($result) {
237
                if ($result) {
Línea 262... Línea 262...
262
        } else if ($request->isGet()) {
262
        } else if ($request->isGet()) {
263
            $hydrator = new ObjectPropertyHydrator();
263
            $hydrator = new ObjectPropertyHydrator();
Línea 264... Línea 264...
264
 
264
 
265
            //get form data           
265
            //get form data           
266
            $companySelfEvaluationFormMapper = CompanySelfEvaluationFormMapper::getInstance($this->adapter);
266
            $companySelfEvaluationFormMapper = CompanySelfEvaluationFormMapper::getInstance($this->adapter);
Línea 267... Línea 267...
267
            $formMapper = $companySelfEvaluationFormMapper->fetchOne($testMapper->form_id);
267
            $companySelfEvaluationForm = $companySelfEvaluationFormMapper->fetchOne($companySelfEvaluationTest->form_id);
268
 
268
 
269
            //get user data
269
            //get user data
Línea 270... Línea 270...
270
            $CompanyUserMapper = UserMapper::getInstance($this->adapter);
270
            $CompanyUserMapper = UserMapper::getInstance($this->adapter);
Línea 271... Línea 271...
271
            $userMapper = $CompanyUserMapper->fetchOne($testMapper->user_id);
271
            $userMapper = $CompanyUserMapper->fetchOne($companySelfEvaluationTest->user_id);
272
 
272
 
273
            if ($formMapper && $userMapper) {
273
            if ($companySelfEvaluationForm && $userMapper) {
274
 
274
 
275
                $data = [
275
                $data = [
276
                    'success' => true,
276
                    'success' => true,
277
                    'data' => [
277
                    'data' => [
278
                        'id' => $testMapper->id,
278
                        'id' => $companySelfEvaluationTest->id,
279
                        'name' => $formMapper->name,
279
                        'name' => $companySelfEvaluationForm->name,
280
                        'text' => $formMapper->text,
280
                        'text' => $companySelfEvaluationForm->text,
281
                        'user' => $userMapper->first_name . ' ' . $userMapper->last_name,
281
                        'user' => $userMapper->first_name . ' ' . $userMapper->last_name,
Línea 282... Línea 282...
282
                        'status' => $testMapper->status,
282
                        'status' => $companySelfEvaluationTest->status,
283
                        'content' => json_decode($testMapper->content),
283
                        'content' => json_decode($companySelfEvaluationTest->content),