Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 12693 Rev 12694
Línea 982... Línea 982...
982
        $currentUserPlugin = $this->plugin('currentUserPlugin');
982
        $currentUserPlugin = $this->plugin('currentUserPlugin');
983
        $currentUser = $currentUserPlugin->getUser();
983
        $currentUser = $currentUserPlugin->getUser();
984
        $currentCompany = $currentUserPlugin->getCompany();
984
        $currentCompany = $currentUserPlugin->getCompany();
Línea 985... Línea 985...
985
 
985
 
-
 
986
        $request = $this->getRequest();
-
 
987
        $group_uuid = $this->params()->fromRoute('group_id');
-
 
988
        if(!$group_uuid) {
-
 
989
            $data = [
-
 
990
                'success'   => false,
-
 
991
                'data'   => 'ERROR_INVALID_PARAMETER'
-
 
992
            ];
-
 
993
            
-
 
994
            return new JsonModel($data);
-
 
995
        }
-
 
996
        
-
 
997
        $highPerformanceTeamsGroupsMapper = HighPerformanceTeamsGroupsMapper::getInstance($this->adapter);
-
 
998
        $highPerformanceTeamsGroups = $highPerformanceTeamsGroupsMapper->fetchOneByUuid($group_uuid);
-
 
999
        
-
 
1000
        if (!$highPerformanceTeamsGroups) {
-
 
1001
            $data = [
-
 
1002
                'success' => false,
-
 
1003
                'data' => 'ERROR_RECORD_NOT_FOUND'
Línea -... Línea 1004...
-
 
1004
            ];
-
 
1005
 
-
 
1006
            return new JsonModel($data);
Línea -... Línea 1007...
-
 
1007
        }
-
 
1008
        if($highPerformanceTeamsGroups->status != HighPerformanceTeamsGroups::STATUS_ACTIVE) {
-
 
1009
 
-
 
1010
            return new JsonModel([
-
 
1011
                'success' => false,
-
 
1012
                'data' => 'ERROR_UNAUTHORIZED'
-
 
1013
            ]);
-
 
1014
 
-
 
1015
        } 
-
 
1016
        $highPerformanceTeamsGroupsMembersMapper = HighPerformanceTeamsGroupsMembersMapper::getInstance($this->adapter);
-
 
1017
        $highPerformanceTeamsGroupsMember = $highPerformanceTeamsGroupsMembersMapper->fetchOneByGroupIdAndUserId($highPerformanceTeamsGroups->id, $currentUser->id);
-
 
1018
        if(!$highPerformanceTeamsGroupsMember) {
-
 
1019
            return new JsonModel([
-
 
1020
                'success' => false,
-
 
1021
                'data' => 'ERROR_YOU_DO_NOT_HAVE_ACCESS'
-
 
1022
            ]);
-
 
1023
        }
-
 
1024
        if(!($highPerformanceTeamsGroupsMember->status == HighPerformanceTeamsGroupsMembers::STATUS_ACCEPTED || $highPerformanceTeamsGroupsMember->status == HighPerformanceTeamsGroupsMembers::STATUS_ADDED_BY_ADMIN) ){
-
 
1025
            return new JsonModel([
-
 
1026
                'success' => false,
-
 
1027
                'data' => 'ERROR_YOU_DO_NOT_HAVE_ACCESS'
Línea 986... Línea 1028...
986
        $request = $this->getRequest();
1028
            ]);
987
 
1029
        }
Línea 988... Línea 1030...
988
 
1030
       
989
      
1031
      
990
 
1032
 
991
        $planningObjectivesAndGoalsObjectivesMapper = PlanningObjectivesAndGoalsObjectivesMapper::getInstance($this->adapter);
1033
        $planningObjectivesAndGoalsObjectivesMapper = PlanningObjectivesAndGoalsObjectivesMapper::getInstance($this->adapter);