Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 11085 Rev 11188
Línea 99... Línea 99...
99
                        $isJson = strpos($raw, 'json');
99
                        $isJson = strpos($raw, 'json');
100
                    }
100
                    }
Línea 101... Línea 101...
101
                    
101
                    
102
                }
102
                }
-
 
103
            }
-
 
104
            $this->layout()->setTemplate('layout/layout-backend');
Línea 103... Línea 105...
103
            }
105
            $viewModel = new ViewModel();
104
 
106
 
Línea 105... Línea 107...
105
            $highPerformanceTeamsGroupsMapper = HighPerformanceTeamsGroupsMapper::getInstance($this->adapter);
107
            $highPerformanceTeamsGroupsMapper = HighPerformanceTeamsGroupsMapper::getInstance($this->adapter);
106
            $highPerformanceTeamsGroups = $highPerformanceTeamsGroupsMapper->fetchOneByUuid($group_uuid);
-
 
107
            
-
 
108
            if (!$highPerformanceTeamsGroups) {
108
            $highPerformanceTeamsGroups = $highPerformanceTeamsGroupsMapper->fetchOneByUuid($group_uuid);
109
                $data = [
-
 
110
                    'success' => false,
-
 
111
                    'data' => 'ERROR_RECORD_NOT_FOUND'
109
            
112
                ];
110
            if (!$highPerformanceTeamsGroups) {
Línea 113... Línea 111...
113
 
111
               $viewModel->setTemplate('leaders-linked/no-access/index.phtml');
114
                return new JsonModel($data);
-
 
115
            }
112
                return $viewModel;
116
           
113
            }
117
            if($highPerformanceTeamsGroups->status != HighPerformanceTeamsGroups::STATUS_ACTIVE) {
-
 
118
 
-
 
119
                return new JsonModel([
-
 
120
                    'success' => false,
114
           
Línea 121... Línea 115...
121
                    'data' => 'ERROR_UNAUTHORIZED'
115
            if($highPerformanceTeamsGroups->status != HighPerformanceTeamsGroups::STATUS_ACTIVE) {
122
                ]);
116
                $viewModel->setTemplate('leaders-linked/no-access/index.phtml');
123
 
117
                return $viewModel;
124
            } 
118
            } 
125
 
119
 
126
            $highPerformanceTeamsGroupsMembersMapper = HighPerformanceTeamsGroupsMembersMapper::getInstance($this->adapter);
-
 
127
            $highPerformanceTeamsGroupsMember = $highPerformanceTeamsGroupsMembersMapper->fetchOneByGroupIdAndUserId($highPerformanceTeamsGroups->id, $currentUser->id);
-
 
128
            if(!$highPerformanceTeamsGroupsMember) {
120
            $highPerformanceTeamsGroupsMembersMapper = HighPerformanceTeamsGroupsMembersMapper::getInstance($this->adapter);
129
                return new JsonModel([
121
            $highPerformanceTeamsGroupsMember = $highPerformanceTeamsGroupsMembersMapper->fetchOneByGroupIdAndUserId($highPerformanceTeamsGroups->id, $currentUser->id);
130
                    'success' => false,
-
 
131
                    'data' => 'ERROR_RECORD_NOT_FOUND'
-
 
132
                ]);
122
            if(!$highPerformanceTeamsGroupsMember) {
133
            }
123
                $viewModel->setTemplate('leaders-linked/no-access/index.phtml');
134
            if(!($highPerformanceTeamsGroupsMember->status == HighPerformanceTeamsGroupsMembers::STATUS_ACCEPTED || $highPerformanceTeamsGroupsMember->status == HighPerformanceTeamsGroupsMembers::STATUS_ADDED_BY_ADMIN) ){
124
                return $viewModel;
135
                return new JsonModel([
125
            }
136
                    'success' => false,
126
            if(!($highPerformanceTeamsGroupsMember->status == HighPerformanceTeamsGroupsMembers::STATUS_ACCEPTED || $highPerformanceTeamsGroupsMember->status == HighPerformanceTeamsGroupsMembers::STATUS_ADDED_BY_ADMIN) ){
137
                    'data' => 'ERROR_YOU_DO_NOT_HAVE_ACCESS'
127
                $viewModel->setTemplate('leaders-linked/no-access/index.phtml');
138
                ]);
128
                return $viewModel;
Línea 139... Línea -...
139
            }
-
 
140
            $addTopicBoton=true;
-
 
-
 
129
            }
Línea 141... Línea 130...
141
            if($highPerformanceTeamsGroupsMember->type==HighPerformanceTeamsGroupsMembers::TYPE_MODERATOR||$highPerformanceTeamsGroupsMember->type==HighPerformanceTeamsGroupsMembers::TYPE_USER){
130
            $addTopicBoton=true;
142
                $addTopicBoton=false;
131
            if($highPerformanceTeamsGroupsMember->type==HighPerformanceTeamsGroupsMembers::TYPE_MODERATOR||$highPerformanceTeamsGroupsMember->type==HighPerformanceTeamsGroupsMembers::TYPE_USER){
143
            }
132
                $addTopicBoton=false;
144
 
133
            }