Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 3454 Rev 3639
Línea 100... Línea 100...
100
        ]);
100
        ]);
101
    }
101
    }
Línea 102... Línea 102...
102
 
102
 
103
    public function viewAction()
103
    public function viewAction()
-
 
104
    {
-
 
105
        $currentUserPlugin = $this->plugin('currentUserPlugin');
Línea 104... Línea 106...
104
    {
106
        $currentUser = $currentUserPlugin->getUser();
105
        
107
        
106
        $flashMessenger = $this->plugin('FlashMessenger');
108
        $flashMessenger = $this->plugin('FlashMessenger');
Línea 111... Línea 113...
111
            $flashMessenger->addErrorMessage('ERROR_INVALID_PARAMETER');
113
            $flashMessenger->addErrorMessage('ERROR_INVALID_PARAMETER');
112
            return $this->redirect()->toRoute('dashboard');
114
            return $this->redirect()->toRoute('dashboard');
113
        }
115
        }
Línea 114... Línea 116...
114
        
116
        
115
        $jobMapper = JobMapper::getInstance($this->adapter);
117
        $jobMapper = JobMapper::getInstance($this->adapter);
116
        $job = $jobMapper->fetchOneByUuid($id);
118
        $job = $jobMapper->fetchOneByUuidAndNetworkId($id, $currentUser->network_id);
117
        if(!$job) {
119
        if(!$job) {
118
            $flashMessenger->addErrorMessage('ERROR_RECORD_NOT_FOUND');
120
            $flashMessenger->addErrorMessage('ERROR_RECORD_NOT_FOUND');
119
            return $this->redirect()->toRoute('dashboard');
121
            return $this->redirect()->toRoute('dashboard');
Línea 358... Línea 360...
358
        return new JsonModel($data);
360
        return new JsonModel($data);
359
    }
361
    }
Línea 360... Línea 362...
360
    
362
    
361
    public function applyJobAction()
363
    public function applyJobAction()
-
 
364
    {
-
 
365
        $currentUserPlugin = $this->plugin('currentUserPlugin');
-
 
366
        $currentUser = $currentUserPlugin->getUser();
-
 
367
        
362
    {
368
        
363
        $request = $this->getRequest();
369
        $request = $this->getRequest();
Línea 364... Línea 370...
364
        $id = $this->params()->fromRoute('id');
370
        $id = $this->params()->fromRoute('id');
365
        
371
        
Línea 371... Línea 377...
371
            
377
            
372
            return new JsonModel($data);
378
            return new JsonModel($data);
Línea 373... Línea 379...
373
        }
379
        }
374
        
380
        
375
        $jobMapper = JobMapper::getInstance($this->adapter);
381
        $jobMapper = JobMapper::getInstance($this->adapter);
376
        $job = $jobMapper->fetchOneByUuid($id);
382
        $job = $jobMapper->fetchOneByUuidAndNetworkId($id, $currentUser->network_id);
377
        if(!$job) {
383
        if(!$job) {
378
            $data = [
384
            $data = [
379
                'success' => false,
385
                'success' => false,
Línea 403... Línea 409...
403
            return new JsonModel($data);
409
            return new JsonModel($data);
404
        }
410
        }
Línea 405... Línea 411...
405
        
411
        
406
        
-
 
407
        if($request->isPost()) {
-
 
408
            $currentUserPlugin = $this->plugin('currentUserPlugin');
412
        
409
            $currentUser = $currentUserPlugin->getUser();
413
        if($request->isPost()) {
410
            
414
 
Línea 411... Línea 415...
411
            $form = new ApplyForm($this->adapter, $currentUser->id);
415
            $form = new ApplyForm($this->adapter, $currentUser->id);
Línea 483... Línea 487...
483
        }
487
        }
484
    }
488
    }
Línea 485... Línea 489...
485
    
489
    
486
    public function removeApplyJobAction()
490
    public function removeApplyJobAction()
-
 
491
    {
-
 
492
        $currentUserPlugin = $this->plugin('currentUserPlugin');
-
 
493
        $currentUser = $currentUserPlugin->getUser();
487
    {
494
        
488
        $request = $this->getRequest();
495
        $request = $this->getRequest();
Línea 489... Línea 496...
489
        $id = $this->params()->fromRoute('id');
496
        $id = $this->params()->fromRoute('id');
490
        
497
        
Línea 496... Línea 503...
496
            
503
            
497
            return new JsonModel($data);
504
            return new JsonModel($data);
Línea 498... Línea 505...
498
        }
505
        }
499
        
506
        
500
        $jobMapper = JobMapper::getInstance($this->adapter);
507
        $jobMapper = JobMapper::getInstance($this->adapter);
501
        $job = $jobMapper->fetchOneByUuid($id);
508
        $job = $jobMapper->fetchOneByUuidAndNetworkId($id, $currentUser->network_id);
502
        if(!$job) {
509
        if(!$job) {
503
            $data = [
510
            $data = [
504
                'success' => false,
511
                'success' => false,
Línea 528... Línea 535...
528
            return new JsonModel($data);
535
            return new JsonModel($data);
529
        }
536
        }
Línea 530... Línea 537...
530
        
537
        
531
        
-
 
532
        if($request->isPost()) {
-
 
Línea 533... Línea 538...
533
            $currentUserPlugin = $this->plugin('currentUserPlugin');
538
        
534
            $currentUser = $currentUserPlugin->getUser();
539
        if($request->isPost()) {
Línea 535... Línea 540...
535
 
540
 
Línea 567... Línea 572...
567
        }
572
        }
568
    }
573
    }
Línea 569... Línea 574...
569
    
574
    
570
    public function removeSaveJobAction()
575
    public function removeSaveJobAction()
-
 
576
    {
-
 
577
        $currentUserPlugin = $this->plugin('currentUserPlugin');
-
 
578
        $currentUser = $currentUserPlugin->getUser();
571
    {
579
        
572
        $request = $this->getRequest();
580
        $request = $this->getRequest();
Línea 573... Línea 581...
573
        $id = $this->params()->fromRoute('id');
581
        $id = $this->params()->fromRoute('id');
574
        
582
        
Línea 580... Línea 588...
580
            
588
            
581
            return new JsonModel($data);
589
            return new JsonModel($data);
Línea 582... Línea 590...
582
        }
590
        }
583
        
591
        
584
        $jobMapper = JobMapper::getInstance($this->adapter);
592
        $jobMapper = JobMapper::getInstance($this->adapter);
585
        $job = $jobMapper->fetchOneByUuid($id);
593
        $job = $jobMapper->fetchOneByUuidAndNetworkId($id, $currentUser->network_id);
586
        if(!$job) {
594
        if(!$job) {
587
            $data = [
595
            $data = [
588
                'success' => false,
596
                'success' => false,
Línea 612... Línea 620...
612
            return new JsonModel($data);
620
            return new JsonModel($data);
613
        }
621
        }
Línea 614... Línea 622...
614
        
622
        
615
        
-
 
616
        if($request->isPost()) {
-
 
617
            $currentUserPlugin = $this->plugin('currentUserPlugin');
623
        
618
            $currentUser = $currentUserPlugin->getUser();
624
        if($request->isPost()) {
619
            
625
 
Línea 620... Línea 626...
620
            $jobSaveMapper = JobSaveMapper::getInstance($this->adapter);
626
            $jobSaveMapper = JobSaveMapper::getInstance($this->adapter);
621
            $result = $jobSaveMapper->deleteByJobIdAndUserId($job->id, $currentUser->id);
627
            $result = $jobSaveMapper->deleteByJobIdAndUserId($job->id, $currentUser->id);
Línea 650... Línea 656...
650
    }
656
    }
Línea 651... Línea 657...
651
    
657
    
652
    
658
    
-
 
659
    public function saveJobAction()
-
 
660
    {
-
 
661
        $currentUserPlugin = $this->plugin('currentUserPlugin');
653
    public function saveJobAction()
662
        $currentUser = $currentUserPlugin->getUser();
654
    {
663
        
Línea 655... Línea 664...
655
        $request = $this->getRequest();
664
        $request = $this->getRequest();
656
        $id = $this->params()->fromRoute('id');
665
        $id = $this->params()->fromRoute('id');
Línea 663... Línea 672...
663
            
672
            
664
            return new JsonModel($data);
673
            return new JsonModel($data);
Línea 665... Línea 674...
665
        }
674
        }
666
        
675
        
667
        $jobMapper = JobMapper::getInstance($this->adapter);
676
        $jobMapper = JobMapper::getInstance($this->adapter);
668
        $job = $jobMapper->fetchOneByUuid($id);
677
        $job = $jobMapper->fetchOneByUuidAndNetworkId($id, $currentUser->network_id);
669
        if(!$job) {
678
        if(!$job) {
670
            $data = [
679
            $data = [
671
                'success' => false,
680
                'success' => false,
Línea 695... Línea 704...
695
            return new JsonModel($data);
704
            return new JsonModel($data);
696
        }
705
        }
Línea 697... Línea 706...
697
        
706
        
698
        
-
 
699
        if($request->isPost()) {
-
 
700
            $currentUserPlugin = $this->plugin('currentUserPlugin');
707
        
701
            $currentUser = $currentUserPlugin->getUser();
708
        if($request->isPost()) {
702
            
709
 
Línea 703... Línea 710...
703
            $jobSaveMapper = JobSaveMapper::getInstance($this->adapter);
710
            $jobSaveMapper = JobSaveMapper::getInstance($this->adapter);
704
            $jobSave = $jobSaveMapper->fetchOneByJobIdAndUserId($job->id, $currentUser->id);
711
            $jobSave = $jobSaveMapper->fetchOneByJobIdAndUserId($job->id, $currentUser->id);
Línea 743... Línea 750...
743
    
750
    
744
    public function appliedJobsAction()
751
    public function appliedJobsAction()
745
    {
752
    {
746
        $currentUserPlugin = $this->plugin('currentUserPlugin');
753
        $currentUserPlugin = $this->plugin('currentUserPlugin');
747
        $currentUser = $currentUserPlugin->getUser();
754
        $currentUser = $currentUserPlugin->getUser();
748
        
755
 
749
        $request = $this->getRequest();
756
        $request = $this->getRequest();
Línea 750... Línea 757...
750
        if($request->isGet()) {
757
        if($request->isGet()) {
Línea 781... Línea 788...
781
                
788
                
782
                $select = $queryMapper->getSql()->select();
789
                $select = $queryMapper->getSql()->select();
783
                $select->columns(['id', 'uuid', 'title', 'employment_type', 'last_date_of_application']);
790
                $select->columns(['id', 'uuid', 'title', 'employment_type', 'last_date_of_application']);
784
                $select->from(['j' => JobMapper::_TABLE]);
791
                $select->from(['j' => JobMapper::_TABLE]);
-
 
792
                $select->join(['ja' => JobApplicationMapper::_TABLE], 'j.id = ja.job_id');
785
                $select->join(['ja' => JobApplicationMapper::_TABLE], 'j.id = ja.job_id');
793
                $select->where->equalTo('j.network_id', $currentUser->network_id);
786
                $select->where->equalTo('j.status', Job::STATUS_ACTIVE);
794
                $select->where->equalTo('j.status', Job::STATUS_ACTIVE);
Línea 787... Línea 795...
787
                $select->where->equalTo('ja.user_id', $currentUser->id);
795
                $select->where->equalTo('ja.user_id', $currentUser->id);
788
                
796
                
Línea 840... Línea 848...
840
    
848
    
841
    public function savedJobsAction()
849
    public function savedJobsAction()
842
    {
850
    {
843
        $currentUserPlugin = $this->plugin('currentUserPlugin');
851
        $currentUserPlugin = $this->plugin('currentUserPlugin');
844
        $currentUser = $currentUserPlugin->getUser();
852
        $currentUser = $currentUserPlugin->getUser();
845
        
853
 
846
        $request = $this->getRequest();
854
        $request = $this->getRequest();
Línea 847... Línea 855...
847
        if($request->isGet()) {
855
        if($request->isGet()) {
Línea 879... Línea 887...
879
                $select = $queryMapper->getSql()->select();
887
                $select = $queryMapper->getSql()->select();
880
                $select->columns(['id', 'uuid', 'title', 'employment_type', 'last_date_of_application']);
888
                $select->columns(['id', 'uuid', 'title', 'employment_type', 'last_date_of_application']);
881
                $select->from(['j' => JobMapper::_TABLE]);
889
                $select->from(['j' => JobMapper::_TABLE]);
882
                $select->join(['js' => JobSaveMapper::_TABLE], 'j.id = js.job_id');
890
                $select->join(['js' => JobSaveMapper::_TABLE], 'j.id = js.job_id');
883
                $select->join(['c' => CompanyMapper::_TABLE], 'j.company_id = c.id',['image', 'comp_uuid'=>'uuid']);
891
                $select->join(['c' => CompanyMapper::_TABLE], 'j.company_id = c.id',['image', 'comp_uuid'=>'uuid']);
-
 
892
                $select->where->equalTo('j.network_id', $currentUser->network_id);
884
                $select->where->equalTo('j.status', Job::STATUS_ACTIVE);
893
                $select->where->equalTo('j.status', Job::STATUS_ACTIVE);
885
                $select->where->equalTo('js.user_id', $currentUser->id);
894
                $select->where->equalTo('js.user_id', $currentUser->id);
Línea 886... Línea 895...
886
                
895
                
887
                if($search) {
896
                if($search) {