Proyectos de Subversion LeadersLinked - Services

Rev

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

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