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,
Línea 115... Línea 116...
115
            
116
            
116
                        'actions' => [
117
                        'actions' => [
117
                            'link_edit' => $allowEdit ? $this->url()->fromRoute('habits/values/edit', ['id' => $record->uuid ], ['force_canonical' => true]) : '',
118
                            'link_edit' => $allowEdit ? $this->url()->fromRoute('habits/values/edit', ['id' => $record->uuid ], ['force_canonical' => true]) : '',
118
                            'link_delete' => $allowDelete ? $this->url()->fromRoute('habits/values/delete', ['id' =>$record->uuid ],  ['force_canonical' => true]) : '',
119
                            'link_delete' => $allowDelete ? $this->url()->fromRoute('habits/values/delete', ['id' =>$record->uuid ],  ['force_canonical' => true]) : '',
Línea 162... Línea 163...
162
 
163
 
163
 
164
 
164
                $habitValue = new HabitValue();
165
                $habitValue = new HabitValue();
-
 
166
                $habitValue->network_id = $currentUser->network_id;
165
                $habitValue->network_id = $currentUser->network_id;
167
                $habitValue->name       = $dataPost['name'];
Línea 166... Línea 168...
166
                $habitValue->name       = $dataPost['name'];
168
                $habitValue->desription = $dataPost['description'];
167
                $habitValue->user_id    = $currentUser->id;
169
                $habitValue->user_id    = $currentUser->id;
Línea 252... Línea 254...
252
        if($request->isGet()) {
254
        if($request->isGet()) {
253
            return new JsonModel([
255
            return new JsonModel([
254
                'success'   => true,
256
                'success'   => true,
255
                'data'   => [
257
                'data'   => [
256
                    'name' => $habitValue->name,
258
                    'name' => $habitValue->name,
-
 
259
                    'description' => $habitValue->description
257
                ]
260
                ]
258
            ]);
261
            ]);
259
        } else if($request->isPost()) {
262
        } else if($request->isPost()) {
260
            $form = new  HabitValueForm($this->adapter);
263
            $form = new  HabitValueForm($this->adapter);
261
            $dataPost = $request->getPost()->toArray();
264
            $dataPost = $request->getPost()->toArray();
Línea 265... Línea 268...
265
            if($form->isValid()) {
268
            if($form->isValid()) {
Línea 266... Línea 269...
266
                
269
                
Línea 267... Línea 270...
267
                $dataPost = (array) $form->getData();
270
                $dataPost = (array) $form->getData();
-
 
271
                
Línea 268... Línea 272...
268
                
272
                $habitValue->name = $dataPost['name'];
Línea 269... Línea 273...
269
                $habitValue->name = $dataPost['name'];
273
                $habitValue->desription = $dataPost['description'];
270
                
274