Proyectos de Subversion LeadersLinked - Backend

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
7231 nelberth 1
<?php
2
declare(strict_types=1);
3
 
4
namespace LeadersLinked\Controller;
5
 
7233 nelberth 6
use Laminas\Authentication\AuthenticationService;
7
use Laminas\Authentication\Result as AuthResult;
7231 nelberth 8
use Laminas\Db\Adapter\AdapterInterface;
9
use Laminas\Cache\Storage\Adapter\AbstractAdapter;
10
use Laminas\Mvc\Controller\AbstractActionController;
7233 nelberth 11
use Laminas\Mvc\I18n\Translator;
7231 nelberth 12
use Laminas\Log\LoggerInterface;
13
use Laminas\View\Model\ViewModel;
14
use Laminas\View\Model\JsonModel;
7233 nelberth 15
use LeadersLinked\Model\HighPerformanceTeamsGroups;
16
use LeadersLinked\Hydrator\ObjectPropertyHydrator;
17
use LeadersLinked\Form\HighPerformanceTeamsGroupsForm;
7231 nelberth 18
use LeadersLinked\Library\Functions;
7233 nelberth 19
use LeadersLinked\Mapper\UserMapper;
20
use LeadersLinked\Mapper\HighPerformanceTeamsGroupsMapper;
21
use LeadersLinked\Mapper\CompanyMapper;
7276 nelberth 22
use LeadersLinked\Mapper\CompanyUserMapper;
7305 nelberth 23
 
24
 
25
use LeadersLinked\Model\HighPerformanceTeamsGroupsMembers;
26
use LeadersLinked\Form\HighPerformanceTeamsGroupsMembersForm;
27
use LeadersLinked\Mapper\HighPerformanceTeamsGroupsMembersMapper;
7231 nelberth 28
class HighPerformanceTeamsGroupsController extends AbstractActionController
29
{
30
    /**
31
     *
32
     * @var AdapterInterface
33
     */
34
    private $adapter;
35
 
36
 
37
    /**
38
     *
39
     * @var AbstractAdapter
40
     */
41
    private $cache;
42
 
43
    /**
44
     *
45
     * @var  LoggerInterface
46
     */
47
    private $logger;
48
 
49
    /**
50
     *
51
     * @var array
52
     */
53
    private $config;
54
 
7233 nelberth 55
 
56
 
7231 nelberth 57
    /**
58
     *
59
     * @param AdapterInterface $adapter
60
     * @param AbstractAdapter $cache
61
     * @param LoggerInterface $logger
62
     * @param array $config
63
     */
7233 nelberth 64
    public function __construct($adapter, $cache , $logger, $config)
7231 nelberth 65
    {
66
        $this->adapter      = $adapter;
67
        $this->cache        = $cache;
68
        $this->logger       = $logger;
69
        $this->config       = $config;
7233 nelberth 70
 
71
 
7231 nelberth 72
    }
73
 
7233 nelberth 74
 
75
 
76
 
7231 nelberth 77
    public function indexAction()
78
    {
7233 nelberth 79
 
80
 
7231 nelberth 81
        $currentUserPlugin = $this->plugin('currentUserPlugin');
82
        $currentUser = $currentUserPlugin->getUser();
7233 nelberth 83
        $currentCompany = $currentUserPlugin->getCompany();
7231 nelberth 84
 
7233 nelberth 85
 
7231 nelberth 86
        $request = $this->getRequest();
87
        if($request->isGet()) {
88
 
89
 
90
            $headers  = $request->getHeaders();
91
 
92
            $isJson = false;
93
            if($headers->has('Accept')) {
94
                $accept = $headers->get('Accept');
95
 
96
                $prioritized = $accept->getPrioritized();
97
 
98
                foreach($prioritized as $key => $value) {
99
                    $raw = trim($value->getRaw());
100
 
101
                    if(!$isJson) {
102
                        $isJson = strpos($raw, 'json');
103
                    }
104
 
105
                }
106
            }
107
 
108
            if($isJson) {
109
 
7233 nelberth 110
 
7231 nelberth 111
                $acl = $this->getEvent()->getViewModel()->getVariable('acl');
7233 nelberth 112
                $allowEdit = $acl->isAllowed($currentUser->usertype_id, 'high-performance-teams/groups/edit');
113
                $allowDelete = $acl->isAllowed($currentUser->usertype_id,'high-performance-teams/groups/delete');
7249 nelberth 114
                $allowView = $acl->isAllowed($currentUser->usertype_id,'high-performance-teams/groups/view');
7251 nelberth 115
 
7233 nelberth 116
 
117
                $search = $this->params()->fromQuery('search', []);
118
                $search = empty($search['value']) ? '' : filter_var($search['value'], FILTER_SANITIZE_STRING);
7231 nelberth 119
 
120
 
7233 nelberth 121
                $records_x_page     = intval($this->params()->fromQuery('length', 10), 10);
122
                $page               = (intval($this->params()->fromQuery('start', 1), 10)/$records_x_page)+1;
123
                $order =  $this->params()->fromQuery('order', []);
124
                $order_field        = empty($order[0]['column']) ? 99 :  intval($order[0]['column'], 10);
125
                $order_direction    = empty($order[0]['dir']) ? 'ASC' : strtoupper(filter_var( $order[0]['dir'], FILTER_SANITIZE_STRING));
126
 
127
                $fields =  ['title', 'date'];
128
                $order_field = isset($fields[$order_field]) ? $fields[$order_field] : 'title';
129
 
130
                if(!in_array($order_direction, ['ASC', 'DESC'])) {
131
                    $order_direction = 'ASC';
7231 nelberth 132
                }
133
 
7243 nelberth 134
                $highPerformanceTeamsGroupsMapper = HighPerformanceTeamsGroupsMapper::getInstance($this->adapter);
11206 nelberth 135
 
11205 nelberth 136
                $paginator = $highPerformanceTeamsGroupsMapper->fetchAllDataTableInnerJoinMember($search, $page, $records_x_page, $order_field, $order_direction, $currentUser->id);
11208 nelberth 137
 
7231 nelberth 138
                $items = [];
7233 nelberth 139
 
140
                $records = $paginator->getCurrentItems();
11203 nelberth 141
 
7233 nelberth 142
 
11204 nelberth 143
 
11196 nelberth 144
                $highPerformanceTeamsGroupsMembersMapper = HighPerformanceTeamsGroupsMembersMapper::getInstance($this->adapter);
7231 nelberth 145
                foreach($records as $record)
146
                {
147
 
11196 nelberth 148
                    $highPerformanceTeamsGroupsMember = $highPerformanceTeamsGroupsMembersMapper->fetchOneByGroupIdAndUserId($record->id, $currentUser->id);
149
                    if($highPerformanceTeamsGroupsMember) {
150
                        if(($highPerformanceTeamsGroupsMember->status == HighPerformanceTeamsGroupsMembers::STATUS_ACCEPTED || $highPerformanceTeamsGroupsMember->status == HighPerformanceTeamsGroupsMembers::STATUS_ADDED_BY_ADMIN) ){
11200 nelberth 151
                           $contentAllowDelete=$allowDelete;
11198 nelberth 152
                            $contentAllowEdit=$allowEdit;
11201 nelberth 153
                             if($highPerformanceTeamsGroupsMember->type==HighPerformanceTeamsGroupsMembers::TYPE_MODERATOR||$highPerformanceTeamsGroupsMember->type==HighPerformanceTeamsGroupsMembers::TYPE_USER){
11196 nelberth 154
                                $allowDelete=false;
155
                                $allowEdit=false;
156
                            }
11201 nelberth 157
                            if($highPerformanceTeamsGroupsMember->type==HighPerformanceTeamsGroupsMembers::TYPE_ADMINISTRATOR){
11196 nelberth 158
                                $allowDelete=false;
159
                            }
11201 nelberth 160
 
11196 nelberth 161
                            $item = [
162
                                'title' => $record->title,
163
                                'description' => $record->description,
164
                                'status'=> $record->status,
165
                                'actions' => [
166
                                    'link_edit' => $allowEdit ? $this->url()->fromRoute('high-performance-teams/groups/edit', ['group_id' => $record->uuid]) : '',
167
                                    'link_delete' => $allowDelete ? $this->url()->fromRoute('high-performance-teams/groups/delete', ['group_id' => $record->uuid]) : '',
168
                                    'link_view' => $allowView ? $this->url()->fromRoute('high-performance-teams/groups/view', ['group_id' => $record->uuid]) : '',
169
                                ]
170
 
171
                            ];
172
 
173
                            array_push($items, $item);
11201 nelberth 174
 
11196 nelberth 175
                            $allowDelete=$contentAllowDelete;
176
                            $allowEdit=$contentAllowEdit;
11201 nelberth 177
 
11196 nelberth 178
                        }
179
                    }
7233 nelberth 180
 
7231 nelberth 181
                }
7233 nelberth 182
 
183
                return new JsonModel([
7231 nelberth 184
                    'success' => true,
7233 nelberth 185
                    'data' => [
186
                        'items' => $items,
187
                        'total' => $paginator->getTotalItemCount(),
188
                    ]
189
                ]);
7231 nelberth 190
 
7233 nelberth 191
            } else  {
7271 nelberth 192
                $formAdd = new HighPerformanceTeamsGroupsForm($this->adapter, $currentCompany->id);
7231 nelberth 193
                $this->layout()->setTemplate('layout/layout-backend');
194
                $viewModel = new ViewModel();
7233 nelberth 195
                $viewModel->setTemplate('leaders-linked/high-performance-teams-groups/index.phtml');
7231 nelberth 196
                $viewModel->setVariables([
7233 nelberth 197
                    'formAdd' => $formAdd,
7231 nelberth 198
                ]);
199
                return $viewModel ;
200
            }
201
        } else {
202
            return new JsonModel([
203
                'success' => false,
204
                'data' => 'ERROR_METHOD_NOT_ALLOWED'
205
            ]);
206
        }
207
    }
7244 nelberth 208
 
7231 nelberth 209
    public function addAction()
210
    {
7233 nelberth 211
      $currentUserPlugin = $this->plugin('currentUserPlugin');
212
        $currentUser = $currentUserPlugin->getUser();
213
        $currentCompany = $currentUserPlugin->getCompany();
214
 
7231 nelberth 215
        $request = $this->getRequest();
216
        if($request->isPost()) {
7271 nelberth 217
            $form = new  HighPerformanceTeamsGroupsForm($this->adapter, $currentCompany->id);
7231 nelberth 218
            $dataPost = $request->getPost()->toArray();
219
 
220
            $form->setData($dataPost);
221
 
222
            if($form->isValid()) {
223
                $dataPost = (array) $form->getData();
7233 nelberth 224
                $dataPost['status'] =  isset($dataPost['status']) ? $dataPost['status'] : HighPerformanceTeamsGroups::STATUS_INACTIVE;
225
                $dataPost['company_id']=$currentCompany->id;
7231 nelberth 226
 
7233 nelberth 227
                $hydrator = new ObjectPropertyHydrator();
228
                $highPerformanceTeamsGroups = new HighPerformanceTeamsGroups();
229
                $hydrator->hydrate($dataPost, $highPerformanceTeamsGroups);
7231 nelberth 230
 
7233 nelberth 231
                $highPerformanceTeamsGroupsMapper = HighPerformanceTeamsGroupsMapper::getInstance($this->adapter);
7248 nelberth 232
 
7233 nelberth 233
                $result = $highPerformanceTeamsGroupsMapper->insert($highPerformanceTeamsGroups);
7231 nelberth 234
 
235
                if($result) {
7304 nelberth 236
 
7296 nelberth 237
                        $highPerformanceTeamsGroupsMember = new HighPerformanceTeamsGroupsMembers();
238
                        $highPerformanceTeamsGroupsMember->group_id  = $highPerformanceTeamsGroups->id;
7306 nelberth 239
 
7296 nelberth 240
                        $highPerformanceTeamsGroupsMember->user_id = $currentUser->id;
241
                        $highPerformanceTeamsGroupsMember->status = HighPerformanceTeamsGroupsMembers::STATUS_ADDED_BY_ADMIN;
242
                        $highPerformanceTeamsGroupsMember->type = HighPerformanceTeamsGroupsMembers::TYPE_CREATOR;
243
                        $highPerformanceTeamsGroupsMemberMapper = HighPerformanceTeamsGroupsMembersMapper::getInstance($this->adapter);
7305 nelberth 244
 
7296 nelberth 245
                        $highPerformanceTeamsGroupsMemberMapper->insert($highPerformanceTeamsGroupsMember);
246
 
7287 nelberth 247
 
7244 nelberth 248
                    $this->logger->info('Se agrego el grupo de alto rendimiento ' . $highPerformanceTeamsGroups->title, ['user_id' => $currentUser->id, 'ip' => Functions::getUserIP()]);
7231 nelberth 249
 
250
                    $data = [
251
                        'success'   => true,
252
                        'data'   => 'LABEL_RECORD_ADDED'
253
                    ];
254
                } else {
255
                    $data = [
256
                        'success'   => false,
7246 nelberth 257
                        'data'      => $highPerformanceTeamsGroupsMapper->getError()
7231 nelberth 258
                    ];
259
 
260
                }
261
 
262
                return new JsonModel($data);
263
 
264
            } else {
265
                $messages = [];
266
                $form_messages = (array) $form->getMessages();
267
                foreach($form_messages  as $fieldname => $field_messages)
268
                {
269
 
270
                    $messages[$fieldname] = array_values($field_messages);
271
                }
272
 
273
                return new JsonModel([
274
                    'success'   => false,
275
                    'data'   => $messages
276
                ]);
277
            }
7233 nelberth 278
 
7275 nelberth 279
        }else if ($request->isGet()) {
280
            $companyUserMapper = CompanyUserMapper::getInstance($this->adapter);
281
            $userMapper = UserMapper::getInstance($this->adapter);
282
            $datosCompanyUser = $companyUserMapper->fetchAllByCompanyId($currentCompany->id);
283
 
284
            $users=[];
285
 
286
            foreach($datosCompanyUser as $record){
287
                $datosUser = $userMapper->fetchOne($record->user_id);
288
 
289
                    $user=[
290
                        'uuid'=>$datosUser->uuid,
291
                        'email'=>$datosUser->email,
292
                        'first_name'=>$datosUser->first_name,
293
                        'last_name'=>$datosUser->last_name,
294
 
295
                    ];
296
                    array_push($users, $user);
297
 
298
            }
299
 
300
            return new JsonModel([
301
                'success' => true,
302
                'data' => $users
303
 
304
            ]);
7231 nelberth 305
        } else {
306
            $data = [
307
                'success' => false,
308
                'data' => 'ERROR_METHOD_NOT_ALLOWED'
309
            ];
310
 
311
            return new JsonModel($data);
312
        }
313
 
314
        return new JsonModel($data);
7233 nelberth 315
 
316
 
7231 nelberth 317
    }
7233 nelberth 318
 
319
 
7259 nelberth 320
 
7233 nelberth 321
     public function editAction(){
322
 
323
        $currentUserPlugin = $this->plugin('currentUserPlugin');
324
        $currentUser = $currentUserPlugin->getUser();
325
        $currentCompany = $currentUserPlugin->getCompany();
7231 nelberth 326
        $request = $this->getRequest();
11082 nelberth 327
        $uuid = $this->params()->fromRoute('group_id');
7233 nelberth 328
 
7231 nelberth 329
 
7233 nelberth 330
        if(!$uuid) {
7231 nelberth 331
            $data = [
332
                'success'   => false,
333
                'data'   => 'ERROR_INVALID_PARAMETER'
334
            ];
335
 
336
            return new JsonModel($data);
337
        }
338
 
7233 nelberth 339
        $highPerformanceTeamsGroupsMapper = HighPerformanceTeamsGroupsMapper::getInstance($this->adapter);
11210 nelberth 340
        $highPerformanceTeamsGroups = $highPerformanceTeamsGroupsMapper->fetchOneByUuid($uuid);
7233 nelberth 341
 
11210 nelberth 342
        if (!$highPerformanceTeamsGroups) {
7231 nelberth 343
            $data = [
344
                'success' => false,
7233 nelberth 345
                'data' => 'ERROR_RECORD_NOT_FOUND'
7231 nelberth 346
            ];
347
 
348
            return new JsonModel($data);
349
        }
11212 nelberth 350
 
11210 nelberth 351
        $highPerformanceTeamsGroupsMembersMapper = HighPerformanceTeamsGroupsMembersMapper::getInstance($this->adapter);
352
        $highPerformanceTeamsGroupsMember = $highPerformanceTeamsGroupsMembersMapper->fetchOneByGroupIdAndUserId($highPerformanceTeamsGroups->id, $currentUser->id);
353
        if(!$highPerformanceTeamsGroupsMember) {
7233 nelberth 354
            return new JsonModel([
7231 nelberth 355
                'success' => false,
11210 nelberth 356
                'data' => 'ERROR_RECORD_NOT_FOUND'
7233 nelberth 357
            ]);
11210 nelberth 358
        }
11213 nelberth 359
 
11210 nelberth 360
        if(!($highPerformanceTeamsGroupsMember->status == HighPerformanceTeamsGroupsMembers::STATUS_ACCEPTED || $highPerformanceTeamsGroupsMember->status == HighPerformanceTeamsGroupsMembers::STATUS_ADDED_BY_ADMIN) ){
361
            return new JsonModel([
362
                'success' => false,
363
                'data' => 'ERROR_YOU_DO_NOT_HAVE_ACCESS'
364
            ]);
365
        }
7233 nelberth 366
 
11210 nelberth 367
        if($highPerformanceTeamsGroupsMember->type==HighPerformanceTeamsGroupsMembers::TYPE_MODERATOR||$highPerformanceTeamsGroupsMember->type==HighPerformanceTeamsGroupsMembers::TYPE_USER){
368
            return new JsonModel([
369
                'success' => false,
370
                'data' => 'ERROR_METHOD_NOT_ALLOWED'
371
            ]);
372
        }
7233 nelberth 373
        if($request->isPost()) {
7271 nelberth 374
            $form = new  HighPerformanceTeamsGroupsForm($this->adapter, $currentCompany->id);
7231 nelberth 375
            $dataPost = $request->getPost()->toArray();
7233 nelberth 376
            $dataPost['status'] =  isset($dataPost['status']) ? $dataPost['status'] : HighPerformanceTeamsGroups::STATUS_INACTIVE;
7231 nelberth 377
            $form->setData($dataPost);
378
 
379
            if($form->isValid()) {
380
                $dataPost = (array) $form->getData();
381
 
382
                $hydrator = new ObjectPropertyHydrator();
11213 nelberth 383
                $hydrator->hydrate($dataPost, $highPerformanceTeamsGroups);
384
                $result = $highPerformanceTeamsGroupsMapper->update($highPerformanceTeamsGroups);
7231 nelberth 385
 
7233 nelberth 386
                if($result) {
11213 nelberth 387
                    $this->logger->info('Se actualizo el grupo de alto rendimiento ' . $highPerformanceTeamsGroups->title, ['user_id' => $currentUser->id, 'ip' => Functions::getUserIP()]);
7233 nelberth 388
 
389
                    $data = [
390
                        'success' => true,
391
                        'data' => 'LABEL_RECORD_UPDATED'
392
                    ];
393
                } else {
394
                    $data = [
395
                        'success'   => false,
396
                        'data'      => $highPerformanceTeamsGroupsMapper->getError()
397
                    ];
398
                }
7231 nelberth 399
 
7233 nelberth 400
                return new JsonModel($data);
7231 nelberth 401
 
402
            } else {
403
                $messages = [];
404
                $form_messages = (array) $form->getMessages();
405
                foreach($form_messages  as $fieldname => $field_messages)
406
                {
407
                    $messages[$fieldname] = array_values($field_messages);
408
                }
409
 
410
                return new JsonModel([
411
                    'success'   => false,
412
                    'data'   => $messages
413
                ]);
414
            }
7233 nelberth 415
        }else if ($request->isGet()) {
416
            $hydrator = new ObjectPropertyHydrator();
417
 
418
            $data = [
419
                'success' => true,
11213 nelberth 420
                'data' => $hydrator->extract($highPerformanceTeamsGroups)
7231 nelberth 421
            ];
422
 
7233 nelberth 423
            return new JsonModel($data);
424
        } else {
425
            $data = [
7231 nelberth 426
                'success' => false,
7233 nelberth 427
                'data' => 'ERROR_METHOD_NOT_ALLOWED'
7231 nelberth 428
            ];
429
 
7233 nelberth 430
            return new JsonModel($data);
7231 nelberth 431
        }
432
 
7233 nelberth 433
        return new JsonModel($data);
7231 nelberth 434
 
7233 nelberth 435
    }
7231 nelberth 436
 
437
 
7233 nelberth 438
 
439
 
440
    public function deleteAction(){
441
        $currentUserPlugin = $this->plugin('currentUserPlugin');
442
        $currentCompany = $currentUserPlugin->getCompany();
443
        $currentUser = $currentUserPlugin->getUser();
444
 
445
        $request = $this->getRequest();
11082 nelberth 446
        $uuid = $this->params()->fromRoute('group_id');
7231 nelberth 447
 
448
 
7233 nelberth 449
        if (!$uuid) {
450
            $data = [
7231 nelberth 451
                'success' => false,
452
                'data' => 'ERROR_INVALID_PARAMETER'
453
            ];
7233 nelberth 454
 
455
            return new JsonModel($data);
7231 nelberth 456
        }
457
 
7233 nelberth 458
 
459
 
460
        $highPerformanceTeamsGroupsMapper = HighPerformanceTeamsGroupsMapper::getInstance($this->adapter);
11210 nelberth 461
        $highPerformanceTeamsGroups = $highPerformanceTeamsGroupsMapper->fetchOneByUuid($uuid);
7233 nelberth 462
 
11210 nelberth 463
        if (!$highPerformanceTeamsGroups) {
7233 nelberth 464
            $data = [
7231 nelberth 465
                'success' => false,
466
                'data' => 'ERROR_RECORD_NOT_FOUND'
467
            ];
7233 nelberth 468
 
469
            return new JsonModel($data);
7231 nelberth 470
        }
11210 nelberth 471
 
472
        $highPerformanceTeamsGroupsMembersMapper = HighPerformanceTeamsGroupsMembersMapper::getInstance($this->adapter);
473
        $highPerformanceTeamsGroupsMember = $highPerformanceTeamsGroupsMembersMapper->fetchOneByGroupIdAndUserId($highPerformanceTeamsGroups->id, $currentUser->id);
474
        if(!$highPerformanceTeamsGroupsMember) {
7233 nelberth 475
            return new JsonModel([
7231 nelberth 476
                'success' => false,
11210 nelberth 477
                'data' => 'ERROR_RECORD_NOT_FOUND'
7233 nelberth 478
            ]);
11210 nelberth 479
        }
480
        if(!($highPerformanceTeamsGroupsMember->status == HighPerformanceTeamsGroupsMembers::STATUS_ACCEPTED || $highPerformanceTeamsGroupsMember->status == HighPerformanceTeamsGroupsMembers::STATUS_ADDED_BY_ADMIN) ){
481
            return new JsonModel([
482
                'success' => false,
483
                'data' => 'ERROR_YOU_DO_NOT_HAVE_ACCESS'
484
            ]);
485
        }
486
 
11213 nelberth 487
        if($highPerformanceTeamsGroupsMember->type==HighPerformanceTeamsGroupsMembers::TYPE_ADMINISTRATOR||$highPerformanceTeamsGroupsMember->type==HighPerformanceTeamsGroupsMembers::TYPE_MODERATOR||$highPerformanceTeamsGroupsMember->type==HighPerformanceTeamsGroupsMembers::TYPE_USER){
11210 nelberth 488
            return new JsonModel([
489
                'success' => false,
490
                'data' => 'ERROR_METHOD_NOT_ALLOWED'
491
            ]);
492
        }
7233 nelberth 493
 
494
        if ($request->isPost()) {
7231 nelberth 495
 
496
 
11213 nelberth 497
            $result = $highPerformanceTeamsGroupsMapper->delete($highPerformanceTeamsGroups->id);
7233 nelberth 498
            if ($result) {
11213 nelberth 499
                $this->logger->info('Se borro el grupo de alto rendimiento  ' . $highPerformanceTeamsGroups->title, ['user_id' => $currentUser->id, 'ip' => Functions::getUserIP()]);
7233 nelberth 500
 
501
                $data = [
502
                    'success' => true,
503
                    'data' => 'LABEL_RECORD_DELETED'
504
                ];
7231 nelberth 505
            } else {
7233 nelberth 506
 
507
                $data = [
508
                    'success' => false,
509
                    'data' => $highPerformanceTeamsGroupsMapper->getError()
510
                ];
511
 
512
                return new JsonModel($data);
7231 nelberth 513
            }
7233 nelberth 514
        } else {
515
            $data = [
7231 nelberth 516
                'success' => false,
7233 nelberth 517
                'data' => 'ERROR_METHOD_NOT_ALLOWED'
7231 nelberth 518
            ];
7233 nelberth 519
 
7231 nelberth 520
            return new JsonModel($data);
521
        }
7233 nelberth 522
 
7231 nelberth 523
        return new JsonModel($data);
524
    }
525
 
7233 nelberth 526
 
527
 
7259 nelberth 528
 
7233 nelberth 529
}