Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 12254 Rev 12260
Línea 69... Línea 69...
69
    public function indexAction() {
69
    public function indexAction() {
70
        $request = $this->getRequest();
70
        $request = $this->getRequest();
71
        $currentUserPlugin = $this->plugin('currentUserPlugin');
71
        $currentUserPlugin = $this->plugin('currentUserPlugin');
72
        $currentCompany = $currentUserPlugin->getCompany();
72
        $currentCompany = $currentUserPlugin->getCompany();
73
        $currentUser = $currentUserPlugin->getUser();
73
        $currentUser = $currentUserPlugin->getUser();
74
 
-
 
75
        $id =  $this->params()->fromRoute('id');
-
 
76
 
-
 
Línea 77... Línea 74...
77
        
74
        
Línea 78... Línea 75...
78
        $request = $this->getRequest();
75
        $request = $this->getRequest();
Línea 95... Línea 92...
95
                    }
92
                    }
Línea 96... Línea 93...
96
 
93
 
97
                }
94
                }
Línea 98... Línea -...
98
            }
-
 
99
 
-
 
100
                if($id){
-
 
101
                    $topicMapper = TopicMapper::getInstance($this->adapter);
-
 
102
                    $topic = $topicmapper->fetchOneByUUid($id);
-
 
103
                
-
 
104
                    $topicsMapper = FeedTopicMapper::getInstance($this->adapter);
-
 
105
                    $feedTopics = $topicsMapper->fetchAllByTopicid($topic->id);
-
 
106
                    return new JsonModel([
-
 
107
                        'success' => false,
-
 
108
                        'data' => $feedTopics
-
 
109
                    ]);
-
 
110
                    foreach ($questions as $question) {
-
 
111
                        $topicRelationships = $topicsMapper->fetchAllByFeedId($question->id);
-
 
112
                        $question->topics = [];
-
 
113
                    
-
 
114
                    
-
 
115
                        foreach ($topicRelationships as $rel) {
-
 
116
                            $topic = $topicMapper->fetchOne($rel->topic_id);
-
 
117
                            if ($topic) {
-
 
118
                                $question->topics []= $topic;
-
 
119
                            }
-
 
120
                        }
-
 
121
 
-
 
122
                    }
-
 
123
                
-
 
124
                
-
 
125
                }else{
95
            }
126
 
96
 
127
                $acl = $this->getEvent()->getViewModel()->getVariable('acl');
97
                $acl = $this->getEvent()->getViewModel()->getVariable('acl');
128
                $allowAdd = $acl->isAllowed($currentUser->usertype_id, 'my-trainer/question/add');
98
                $allowAdd = $acl->isAllowed($currentUser->usertype_id, 'my-trainer/question/add');
129
                $allowEdit = $acl->isAllowed($currentUser->usertype_id, 'my-trainer/question/edit');
99
                $allowEdit = $acl->isAllowed($currentUser->usertype_id, 'my-trainer/question/edit');
Línea 151... Línea 121...
151
                    }
121
                    }
Línea 152... Línea 122...
152
                    
122
                    
153
                }
123
                }
Línea 154... Línea 124...
154
                $topics [] = $question->topics;
124
                $topics [] = $question->topics;
Línea 155... Línea 125...
155
 
125
 
156
            } 
126
            
157
        
127
        
158
                $viewModel = new ViewModel();
128
                $viewModel = new ViewModel();