Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 12022 Rev 12023
Línea 188... Línea 188...
188
    public function addAction() {
188
    public function addAction() {
189
        $request = $this->getRequest();
189
        $request = $this->getRequest();
190
        $currentUserPlugin = $this->plugin('currentUserPlugin');
190
        $currentUserPlugin = $this->plugin('currentUserPlugin');
191
        $currentCompany = $currentUserPlugin->getCompany();
191
        $currentCompany = $currentUserPlugin->getCompany();
192
        $currentUser = $currentUserPlugin->getUser();
192
        $currentUser = $currentUserPlugin->getUser();
-
 
193
        $actual_date = strtotime(date("Y-m-d"));
Línea 193... Línea 194...
193
 
194
 
Línea 194... Línea 195...
194
        $request = $this->getRequest();
195
        $request = $this->getRequest();
Línea 195... Línea 196...
195
 
196
 
Línea 196... Línea 197...
196
        if ($request->isPost()) {
197
        if ($request->isPost()) {
197
            
198
            
Línea 198... Línea -...
198
            $form = new SurveyForm($this->adapter, $currentCompany->id);
-
 
199
            
-
 
200
            $dataPost = $request->getPost()->toArray();
-
 
201
            $dataPost['status'] = isset($dataPost['status']) ? $dataPost['status'] : SurveyForm::STATUS_INACTIVE;           
-
 
Línea 202... Línea 199...
202
 
199
            $form = new SurveyForm($this->adapter, $currentCompany->id);
203
            return new JsonModel([
200
            
204
                'success' => false,
201
            $dataPost = $request->getPost()->toArray();
205
                'data' => $dataPost['since_date']
202
            $dataPost['status'] = isset($dataPost['status']) ? $dataPost['status'] : SurveyForm::STATUS_INACTIVE;           
206
            ]);
203
 
207
 
204
 
Línea -... Línea 205...
-
 
205
            if($dataPost['since_date'] > $dataPost['last_date']){
-
 
206
                new JsonModel([
-
 
207
                    'success' => false,
-
 
208
                    'data' => 'ERROR_UNAUTHORIZED'
-
 
209
                ]);
-
 
210
            }
-
 
211
 
208
            if($dataPost['since_date'] > $dataPost['last_date']){
212
            if($dataPost['since_date'] > $actual_date){
Línea 209... Línea 213...
209
                new JsonModel([
213
                new JsonModel([
210
                    'success' => false,
214
                    'success' => false,