Proyectos de Subversion LeadersLinked - Services

Rev

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

Rev 304 Rev 309
Línea 171... Línea 171...
171
                $result = $habitParadigmMapper->insert($habitParadigm );
171
                $result = $habitParadigmMapper->insert($habitParadigm );
Línea 172... Línea 172...
172
                
172
                
173
                if($result) {
173
                if($result) {
Línea -... Línea 174...
-
 
174
                    $this->logger->info('Se agrego el valor : ' . $habitParadigm->name, ['user_id' => $currentUser->id, 'ip' => Functions::getUserIP()]);
-
 
175
                    
-
 
176
                    
-
 
177
                    $habitParadigm = $habitParadigmMapper->fetchOne($habitParadigm->id);
-
 
178
                    
-
 
179
                    $acl            = $this->getEvent()->getViewModel()->getVariable('acl');
-
 
180
                    $allowEdit      = $acl->isAllowed($currentUser->usertype_id, 'habits/paradigms/edit');
174
                    $this->logger->info('Se agrego el valor : ' . $habitParadigm->name, ['user_id' => $currentUser->id, 'ip' => Functions::getUserIP()]);
181
                    $allowDelete    = $acl->isAllowed($currentUser->usertype_id, 'habits/paradigms/delete');
175
                    
182
                    
176
                    $data = [
183
                    $data = [
-
 
184
                        'success'   => true,
-
 
185
                        'message'   => 'LABEL_RECORD_ADDED',
-
 
186
                        'data'      => [
-
 
187
                            'id' => $habitParadigm->uid,
-
 
188
                            'name' => $habitParadigm->name,
-
 
189
                            'description' => $habitParadigm->description,
-
 
190
                            
-
 
191
                            'actions' => [
-
 
192
                                'link_edit' => $allowEdit ? $this->url()->fromRoute('habits/paradigms/edit', ['id' => $habitParadigm->uuid ], ['force_canonical' => true]) : '',
-
 
193
                                'link_delete' => $allowDelete ? $this->url()->fromRoute('habits/paradigms/delete', ['id' => $habitParadigm->uuid ],  ['force_canonical' => true]) : '',
177
                        'success'   => true,
194
                            ]
-
 
195
                        ]
178
                        'data'   => 'LABEL_RECORD_ADDED'
196
                    ];
179
                    ];
197
 
180
                } else {
198
                } else {
181
                    $data = [
199
                    $data = [
182
                        'success'   => false,
200
                        'success'   => false,
Línea 274... Línea 292...
274
                $result = $habitParadigmMapper->update($habitParadigm);
292
                $result = $habitParadigmMapper->update($habitParadigm);
Línea 275... Línea 293...
275
                
293
                
276
                if($result) {
294
                if($result) {
Línea -... Línea 295...
-
 
295
                    $this->logger->info('Se edito el valor : ' . $habitParadigm->name, ['user_id' => $currentUser->id, 'ip' => Functions::getUserIP()]);
-
 
296
                    
-
 
297
                    $acl            = $this->getEvent()->getViewModel()->getVariable('acl');
-
 
298
                    $allowEdit      = $acl->isAllowed($currentUser->usertype_id, 'habits/paradigms/edit');
277
                    $this->logger->info('Se edito el valor : ' . $habitParadigm->name, ['user_id' => $currentUser->id, 'ip' => Functions::getUserIP()]);
299
                    $allowDelete    = $acl->isAllowed($currentUser->usertype_id, 'habits/paradigms/delete');
278
                    
300
                    
279
                    $data = [
301
                    $data = [
-
 
302
                        'success'   => true,
-
 
303
                        'message'   => 'LABEL_RECORD_UPDATED',
-
 
304
                        'data'      => [
-
 
305
                            'id' => $habitParadigm->uid,
-
 
306
                            'name' => $habitParadigm->name,
-
 
307
                            'description' => $habitParadigm->description,
-
 
308
                            
-
 
309
                            'actions' => [
-
 
310
                                'link_edit' => $allowEdit ? $this->url()->fromRoute('habits/paradigms/edit', ['id' => $habitParadigm->uuid ], ['force_canonical' => true]) : '',
-
 
311
                                'link_delete' => $allowDelete ? $this->url()->fromRoute('habits/paradigms/delete', ['id' => $habitParadigm->uuid ],  ['force_canonical' => true]) : '',
280
                        'success'   => true,
312
                            ]
-
 
313
                        ]
281
                        'data'   => 'LABEL_RECORD_UPDATED'
314
                    ];    
282
                    ];
315
  
283
                } else {
316
                } else {
284
                    $data = [
317
                    $data = [
285
                        'success'   => false,
318
                        'success'   => false,