Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 10609 Rev 10612
Línea 71... Línea 71...
71
        $currentUserPlugin = $this->plugin('currentUserPlugin');
71
        $currentUserPlugin = $this->plugin('currentUserPlugin');
72
        $currentUser = $currentUserPlugin->getUser();
72
        $currentUser = $currentUserPlugin->getUser();
73
        $currentCompany = $currentUserPlugin->getCompany();
73
        $currentCompany = $currentUserPlugin->getCompany();
74
        $topic_uuid   = $this->params()->fromRoute('topic_uuid');
74
        $topic_uuid   = $this->params()->fromRoute('topic_uuid');
75
        $urgent   = $this->params()->fromRoute('urgent');
75
        $urgent   = $this->params()->fromRoute('urgent');
-
 
76
      
76
        if(!isset($urgent)){
77
        if(!isset($urgent)){
77
            $urgent='';
78
            $urgent='';
78
        }
79
        }
Línea 79... Línea 80...
79
 
80
 
80
        if(!isset($topic_uuid)){
81
        if(!isset($topic_uuid)){
81
            $topic_uuid='';
82
            $topic_uuid='';
-
 
83
        }
-
 
84
        try{
-
 
85
            $request = $this->getRequest();
-
 
86
            if($request->isGet()) {
-
 
87
                $headers  = $request->getHeaders();
-
 
88
 
-
 
89
                $isJson = false;
-
 
90
                if($headers->has('Accept')) {
-
 
91
                    $accept = $headers->get('Accept');
-
 
92
 
-
 
93
                    $prioritized = $accept->getPrioritized();
-
 
94
 
-
 
95
                    foreach($prioritized as $key => $value) {
-
 
96
                        $raw = trim($value->getRaw());
-
 
97
 
-
 
98
                        if(!$isJson) {
-
 
99
                            $isJson = strpos($raw, 'json');
Línea 82... Línea -...
82
        }
-
 
83
 
-
 
84
        $request = $this->getRequest();
-
 
85
        if($request->isGet()) {
-
 
86
            $headers  = $request->getHeaders();
-
 
87
            
-
 
88
            $isJson = false;
-
 
89
            if($headers->has('Accept')) {
-
 
90
                $accept = $headers->get('Accept');
-
 
91
                
-
 
92
                $prioritized = $accept->getPrioritized();
-
 
93
                
-
 
94
                foreach($prioritized as $key => $value) {
-
 
95
                    $raw = trim($value->getRaw());
-
 
96
                    
-
 
97
                    if(!$isJson) {
100
                        }
98
                        $isJson = strpos($raw, 'json');
-
 
99
                    }
101
 
100
                    
-
 
101
                }
-
 
102
            }
-
 
103
            
-
 
Línea 104... Línea -...
104
        
-
 
105
            $rolAdmin=true;
-
 
106
 
-
 
107
            $formFeed = new CreateFeedForm($this->adapter);
-
 
108
            $formTopicNomal = new TopicForm();
-
 
109
            $this->layout()->setTemplate('layout/layout-backend');
-
 
110
            $viewModel = new ViewModel();
-
 
111
            $viewModel->setTemplate('leaders-linked/my-trainer-answer/index.phtml');
-
 
112
            $viewModel->setVariables([
-
 
113
                'formFeed'    =>  $formFeed,
-
 
114
                'topic_uuid' => $topic_uuid,
-
 
115
                'formTopicNormal' => $formTopicNomal,
-
 
116
                'urgent'=>$urgent,
-
 
Línea -... Línea 102...
-
 
102
                    }
117
                'rolAdmin'=>$rolAdmin,
103
                }
-
 
104
 
-
 
105
            
-
 
106
                $rolAdmin=true;
-
 
107
 
-
 
108
                $formFeed = new CreateFeedForm($this->adapter);
-
 
109
                $formTopicNomal = new TopicForm();
-
 
110
                $this->layout()->setTemplate('layout/layout-backend');
-
 
111
                $viewModel = new ViewModel();
-
 
112
                $viewModel->setTemplate('leaders-linked/my-trainer-answer/index.phtml');
-
 
113
                $viewModel->setVariables([
-
 
114
                    'formFeed'    =>  $formFeed,
-
 
115
                    'topic_uuid' => $topic_uuid,
-
 
116
                    'formTopicNormal' => $formTopicNomal,
-
 
117
                    'urgent'=>$urgent,
-
 
118
                    'rolAdmin'=>$rolAdmin,
118
            ]);
119
                ]);
-
 
120
                return $viewModel ;
-
 
121
 
-
 
122
 
-
 
123
            } else {
-
 
124
                return new JsonModel([
-
 
125
                    'success' => false,
-
 
126
                    'data' => 'ERROR_METHOD_NOT_ALLOWED'
119
            return $viewModel ;
127
                ]);
120
            
128
            }
121
            
129
        } catch (\Throwable $e) {
122
        } else {
130
            $e->getMessage();
123
            return new JsonModel([
131
            return new JsonModel([
124
                'success' => false,
-
 
125
                'data' => 'ERROR_METHOD_NOT_ALLOWED'
132
                'success' => false,
126
            ]);
133
                'data' => $e
Línea 127... Línea 134...
127
        }
134
            ]);
128
    
135
        }