Proyectos de Subversion LeadersLinked - Services

Rev

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

Rev 302 Rev 303
Línea 110... Línea 110...
110
                foreach($records as $record)
110
                foreach($records as $record)
111
                {
111
                {
112
                    $item = [
112
                    $item = [
113
                        'id' => $record->id,
113
                        'id' => $record->id,
114
                        'name' => $record->name,
114
                        'name' => $record->name,
-
 
115
                        'description' => $record->description,
115
                        'actions' => [
116
                        'actions' => [
116
                            'link_edit' => $allowEdit ? $this->url()->fromRoute('habits/paradigms/edit', ['id' => $record->uuid ], ['force_canonical' => true]) : '',
117
                            'link_edit' => $allowEdit ? $this->url()->fromRoute('habits/paradigms/edit', ['id' => $record->uuid ], ['force_canonical' => true]) : '',
117
                            'link_delete' => $allowDelete ? $this->url()->fromRoute('habits/paradigms/delete', ['id' =>$record->uuid ],  ['force_canonical' => true]) : '',
118
                            'link_delete' => $allowDelete ? $this->url()->fromRoute('habits/paradigms/delete', ['id' =>$record->uuid ],  ['force_canonical' => true]) : '',
118
                        ] 
119
                        ] 
119
                    ];
120
                    ];
Línea 161... Línea 162...
161
 
162
 
162
 
163
 
163
                $habitParadigm = new HabitParadigm();
164
                $habitParadigm = new HabitParadigm();
-
 
165
                $habitParadigm->network_id = $currentUser->network_id;
164
                $habitParadigm->network_id = $currentUser->network_id;
166
                $habitParadigm->name       = $dataPost['name'];
Línea 165... Línea 167...
165
                $habitParadigm->name       = $dataPost['name'];
167
                $habitParadigm->desription = $dataPost['description'];
166
                $habitParadigm->user_id    = $currentUser->id;
168
                $habitParadigm->user_id    = $currentUser->id;
Línea 251... Línea 253...
251
        if($request->isGet()) {
253
        if($request->isGet()) {
252
            return new JsonModel([
254
            return new JsonModel([
253
                'success'   => true,
255
                'success'   => true,
254
                'data'   => [
256
                'data'   => [
255
                    'name' => $habitParadigm->name,
257
                    'name' => $habitParadigm->name,
-
 
258
                    'description' => $habitParadigm->description,
256
                ]
259
                ]
257
            ]);
260
            ]);
258
        } else if($request->isPost()) {
261
        } else if($request->isPost()) {
259
            $form = new  HabitParadigmForm($this->adapter);
262
            $form = new  HabitParadigmForm($this->adapter);
260
            $dataPost = $request->getPost()->toArray();
263
            $dataPost = $request->getPost()->toArray();
Línea 264... Línea 267...
264
            if($form->isValid()) {
267
            if($form->isValid()) {
Línea 265... Línea 268...
265
                
268
                
Línea 266... Línea 269...
266
                $dataPost = (array) $form->getData();
269
                $dataPost = (array) $form->getData();
-
 
270
                
Línea 267... Línea 271...
267
                
271
                $habitParadigm->name = $dataPost['name'];
Línea 268... Línea 272...
268
                $habitParadigm->name = $dataPost['name'];
272
                $habitParadigm->desription = $dataPost['description'];
269
                
273