Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 6395 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 6395 Rev 8367
Línea 93... Línea 93...
93
   }*/
93
   }*/
Línea 94... Línea 94...
94
 
94
 
95
        
95
        
96
    public function indexAction()
96
    public function indexAction()
Línea 97... Línea 97...
97
    {
97
    {
98
        $uuid_objetives = $this->params()->fromRoute('uuid_objective');
98
        $uuid_objective = $this->params()->fromRoute('uuid_objective');
99
        
99
        
100
        if(!$uuid_objetives) {
100
        if(!$uuid_objective) {
101
            $data = [
101
            $data = [
Línea 153... Línea 153...
153
                if(!in_array($order_direction, ['ASC', 'DESC'])) {
153
                if(!in_array($order_direction, ['ASC', 'DESC'])) {
154
                    $order_direction = 'ASC';
154
                    $order_direction = 'ASC';
155
                }
155
                }
Línea 156... Línea 156...
156
                
156
                
157
                $planningObjectivesAndGoalsObjectivesMapper = PlanningObjectivesAndGoalsObjectivesMapper::getInstance($this->adapter);
157
                $planningObjectivesAndGoalsObjectivesMapper = PlanningObjectivesAndGoalsObjectivesMapper::getInstance($this->adapter);
Línea 158... Línea 158...
158
                $objectives = $planningObjectivesAndGoalsObjectivesMapper->fetchOneByUuid($uuid_objetives);
158
                $objectives = $planningObjectivesAndGoalsObjectivesMapper->fetchOneByUuid($uuid_objective);
159
                
159
                
160
                if (!$objectives) {
160
                if (!$objectives) {
161
                    $data = [
161
                    $data = [
Línea 210... Línea 210...
210
                            'id' =>$record->uuid,
210
                            'id' =>$record->uuid,
211
                        ],
211
                        ],
212
                        'DT_RowClass'=> 'Goals',*/
212
                        'DT_RowClass'=> 'Goals',*/
213
                        'status'=>$record->status,
213
                        'status'=>$record->status,
214
                        'actions' => [
214
                        'actions' => [
215
                            'link_edit' => $allowEdit ? $this->url()->fromRoute('planning-objectives-and-goals/objectives/goals/edit', ['uuid_objective' => $uuid_objetives,'id' => $record->uuid]) : '',
215
                            'link_edit' => $allowEdit ? $this->url()->fromRoute('planning-objectives-and-goals/objectives/goals/edit', ['uuid_objective' => $uuid_objective,'id' => $record->uuid]) : '',
216
                            'link_delete' => $allowDelete ? $this->url()->fromRoute('planning-objectives-and-goals/objectives/goals/delete', ['uuid_objective' => $uuid_objetives,'id' => $record->uuid]) : '',
216
                            'link_delete' => $allowDelete ? $this->url()->fromRoute('planning-objectives-and-goals/objectives/goals/delete', ['uuid_objective' => $uuid_objective,'id' => $record->uuid]) : '',
217
                            'link_goals' => $allowGoals ? $this->url()->fromRoute('planning-objectives-and-goals/objectives/goals/task', ['uuid_objective' => $uuid_objetives,'uuid_goals' => $record->uuid]) : ''
217
                            'link_goals' => $allowGoals ? $this->url()->fromRoute('planning-objectives-and-goals/objectives/goals/task', ['uuid_objective' => $uuid_objective,'uuid_goal' => $record->uuid]) : ''
218
                        ]
218
                        ]
Línea 219... Línea 219...
219
 
219
 
Línea 287... Línea 287...
287
                $this->layout()->setTemplate('layout/layout-backend');
287
                $this->layout()->setTemplate('layout/layout-backend');
288
                $viewModel = new ViewModel();
288
                $viewModel = new ViewModel();
289
                $viewModel->setTemplate('leaders-linked/planning-objectives-and-goals-goals/index.phtml');
289
                $viewModel->setTemplate('leaders-linked/planning-objectives-and-goals-goals/index.phtml');
290
                $viewModel->setVariables([
290
                $viewModel->setVariables([
291
                    'formAdd' => $formAdd,  
291
                    'formAdd' => $formAdd,  
292
                    'uuid'=> $uuid_objetives
292
                    'uuid'=> $uuid_objective
Línea 293... Línea 293...
293
 
293
 
294
                ]);
294
                ]);
295
                return $viewModel ;
295
                return $viewModel ;
296
            }
296
            }
Línea 304... Línea 304...
304
    public function addAction()
304
    public function addAction()
305
    {
305
    {
306
      $currentUserPlugin = $this->plugin('currentUserPlugin');
306
      $currentUserPlugin = $this->plugin('currentUserPlugin');
307
        $currentUser = $currentUserPlugin->getUser();
307
        $currentUser = $currentUserPlugin->getUser();
308
        $currentCompany = $currentUserPlugin->getCompany();
308
        $currentCompany = $currentUserPlugin->getCompany();
309
        $uuid_objetives = $this->params()->fromRoute('uuid_objective');
309
        $uuid_objective = $this->params()->fromRoute('uuid_objective');
Línea 310... Línea 310...
310
        
310
        
311
        if(!$uuid_objetives) {
311
        if(!$uuid_objective) {
312
            $data = [
312
            $data = [
313
                'success'   => false,
313
                'success'   => false,
314
                'data'   => 'ERROR_INVALID_PARAMETER'
314
                'data'   => 'ERROR_INVALID_PARAMETER'
Línea 323... Línea 323...
323
            $dataPost = $request->getPost()->toArray();
323
            $dataPost = $request->getPost()->toArray();
324
            $form->setData($dataPost);
324
            $form->setData($dataPost);
Línea 325... Línea 325...
325
            
325
            
326
            if($form->isValid()) {
326
            if($form->isValid()) {
327
                $planningObjectivesAndGoalsObjectivesMapper = PlanningObjectivesAndGoalsObjectivesMapper::getInstance($this->adapter);
327
                $planningObjectivesAndGoalsObjectivesMapper = PlanningObjectivesAndGoalsObjectivesMapper::getInstance($this->adapter);
Línea 328... Línea 328...
328
                $objectives = $planningObjectivesAndGoalsObjectivesMapper->fetchOneByUuid($uuid_objetives);
328
                $objectives = $planningObjectivesAndGoalsObjectivesMapper->fetchOneByUuid($uuid_objective);
329
            
329
            
330
                if (!$objectives) {
330
                if (!$objectives) {
331
                    $data = [
331
                    $data = [
Línea 419... Línea 419...
419
            ];
419
            ];
Línea 420... Línea 420...
420
            
420
            
421
            return new JsonModel($data);
421
            return new JsonModel($data);
Línea 422... Línea 422...
422
        }
422
        }
423
 
423
 
424
        $uuid_objetives = $this->params()->fromRoute('uuid_objective');
424
        $uuid_objective = $this->params()->fromRoute('uuid_objective');
425
        if(!$uuid_objetives) {
425
        if(!$uuid_objective) {
426
            $data = [
426
            $data = [
427
                'success'   => false,
427
                'success'   => false,
Línea 428... Línea 428...
428
                'data'   => 'ERROR_INVALID_PARAMETER'
428
                'data'   => 'ERROR_INVALID_PARAMETER'
429
            ];
429
            ];
430
            
430
            
431
            return new JsonModel($data);
431
            return new JsonModel($data);
Línea 432... Línea 432...
432
        }
432
        }
433
        $planningObjectivesAndGoalsObjectivesMapper = PlanningObjectivesAndGoalsObjectivesMapper::getInstance($this->adapter);
433
        $planningObjectivesAndGoalsObjectivesMapper = PlanningObjectivesAndGoalsObjectivesMapper::getInstance($this->adapter);
434
        $objectives = $planningObjectivesAndGoalsObjectivesMapper->fetchOneByUuid($uuid_objetives);
434
        $objectives = $planningObjectivesAndGoalsObjectivesMapper->fetchOneByUuid($uuid_objective);
435
    
435
    
Línea 547... Línea 547...
547
            ];
547
            ];
Línea 548... Línea 548...
548
 
548
 
549
            return new JsonModel($data);
549
            return new JsonModel($data);
Línea 550... Línea 550...
550
        }
550
        }
551
 
551
 
552
        $uuid_objetives = $this->params()->fromRoute('uuid_objective');
552
        $uuid_objective = $this->params()->fromRoute('uuid_objective');
553
        if(!$uuid_objetives) {
553
        if(!$uuid_objective) {
554
            $data = [
554
            $data = [
555
                'success'   => false,
555
                'success'   => false,
Línea 556... Línea 556...
556
                'data'   => 'ERROR_INVALID_PARAMETER'
556
                'data'   => 'ERROR_INVALID_PARAMETER'
557
            ];
557
            ];
558
            
558
            
559
            return new JsonModel($data);
559
            return new JsonModel($data);
Línea 560... Línea 560...
560
        }
560
        }
561
        $planningObjectivesAndGoalsObjectivesMapper = PlanningObjectivesAndGoalsObjectivesMapper::getInstance($this->adapter);
561
        $planningObjectivesAndGoalsObjectivesMapper = PlanningObjectivesAndGoalsObjectivesMapper::getInstance($this->adapter);
562
        $objectives = $planningObjectivesAndGoalsObjectivesMapper->fetchOneByUuid($uuid_objetives);
562
        $objectives = $planningObjectivesAndGoalsObjectivesMapper->fetchOneByUuid($uuid_objective);
563
    
563