Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 14278 Rev 14281
Línea 307... Línea 307...
307
 
307
 
308
        return new JsonModel($data);
308
        return new JsonModel($data);
Línea 309... Línea 309...
309
    }
309
    }
310
 
310
 
311
    public function deleteAction() {
311
    public function deleteAction() {
Línea 312... Línea 312...
312
        // $currentUserPlugin = $this->plugin('currentUserPlugin');
312
        $currentUserPlugin = $this->plugin('currentUserPlugin');
313
        // $currentUser = $currentUserPlugin->getUser();
313
        $currentUser = $currentUserPlugin->getUser();
Línea 314... Línea 314...
314
 
314
 
315
        // $request = $this->getRequest();
315
        $request = $this->getRequest();
316
        // $id = $this->params()->fromRoute('id');
316
        $id = $this->params()->fromRoute('id');
317
 
317
 
318
        // if (!$id) {
318
        if (!$id) {
319
        //     $data = [
319
            $data = [
320
        //         'success' => false,
320
                'success' => false,
321
        //         'data' => 'ERROR_INVALID_PARAMETER'
321
                'data' => 'ERROR_INVALID_PARAMETER'
322
        //     ];
322
            ];
323
 
323
 
324
        //     return new JsonModel($data);
324
            return new JsonModel($data);
325
        // }
325
        }
326
 
326
 
327
 
327
 
328
        // $behaviorMapper = BehaviorMapper::getInstance($this->adapter);
328
        $behaviorMapper = BehaviorMapper::getInstance($this->adapter);
329
        // $behavior = $behaviorMapper->fetchOneByUuid($id);
329
        $behavior = $behaviorMapper->fetchOneByUuid($id);
330
        // if (!$behavior) {
330
        if (!$behavior) {
331
        //     $data = [
331
            $data = [
332
        //         'success' => false,
332
                'success' => false,
333
        //         'data' => 'ERROR_RECORD_NOT_FOUND'
333
                'data' => 'ERROR_RECORD_NOT_FOUND'
334
        //     ];
334
            ];
335
 
335
 
336
        //     return new JsonModel($data);
336
            return new JsonModel($data);
337
        // }
337
        }
338
 
338
 
339
        // if ($request->isPost()) {
339
        if ($request->isPost()) {
340
        //     $result = $behaviorMapper->delete($behavior);
340
            $result = $behaviorMapper->delete($behavior);
341
        //     if ($result) {
341
            if ($result) {
342
        //         $this->logger->info('Se borro el tipo de competencia ' . $behavior->description, ['user_id' => $currentUser->id, 'ip' => Functions::getUserIP()]);
342
                $this->logger->info('Se borro el tipo de competencia ' . $behavior->description, ['user_id' => $currentUser->id, 'ip' => Functions::getUserIP()]);
343
 
343
 
344
        //         $data = [
344
                $data = [
345
        //             'success' => true,
345
                    'success' => true,
346
        //             'data' => 'LABEL_RECORD_DELETED'
346
                    'data' => 'LABEL_RECORD_DELETED'
347
        //         ];
347
                ];
348
        //     } else {
348
            } else {
349
 
349
 
350
        //         $data = [
350
                $data = [
351
        //             'success' => false,
351
                    'success' => false,
352
        //             'data' => $behaviorMapper->getError()
352
                    'data' => $behaviorMapper->getError()
353
        //         ];
353
                ];
354
 
354
 
355
        //         return new JsonModel($data);
355
                return new JsonModel($data);
356
        //     }
356
            }
357
        // } else {
357
        } else {
Línea 358... Línea 358...
358
            $data = [
358
            $data = [
359
                'success' => false,
359
                'success' => false,
Línea 360... Línea 360...
360
                'data' => 'ERROR_METHOD_NOT_ALLOWED'
360
                'data' => 'ERROR_METHOD_NOT_ALLOWED'
361
            ];
361
            ];
Línea 362... Línea 362...
362
 
362