Proyectos de Subversion LeadersLinked - Services

Rev

Rev 128 | Rev 130 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
<?php
2
 
3
declare(strict_types=1);
4
 
5
namespace LeadersLinked\Controller;
6
 
7
use Laminas\Db\Adapter\AdapterInterface;
8
 
9
use Laminas\Mvc\Controller\AbstractActionController;
10
use Laminas\Log\LoggerInterface;
11
use Laminas\View\Model\ViewModel;
12
use Laminas\View\Model\JsonModel;
13
use LeadersLinked\Mapper\UserMapper;
14
use LeadersLinked\Mapper\CalendarEventMapper;
15
use LeadersLinked\Mapper\ZoomMeetingMapper;
16
use LeadersLinked\Model\CalendarEvent;
17
use LeadersLinked\Library\Functions;
18
use LeadersLinked\Mapper\PerformanceEvaluationTestMapper;
19
use LeadersLinked\Mapper\PerformanceEvaluationFormMapper;
20
use LeadersLinked\Model\PerformanceEvaluationTest;
21
use LeadersLinked\Mapper\JobDescriptionMapper;
22
use LeadersLinked\Mapper\CompanyUserMapper;
23
use LeadersLinked\Model\CompanyUser;
24
use LeadersLinked\Mapper\CompanyMapper;
25
use LeadersLinked\Mapper\RecruitmentSelectionInterviewMapper;
26
use LeadersLinked\Mapper\RecruitmentSelectionCandidateMapper;
27
use LeadersLinked\Mapper\RecruitmentSelectionVacancyMapper;
28
use LeadersLinked\Model\RecruitmentSelectionInterview;
29
use Laminas\Mvc\I18n\Translator;
30
use LeadersLinked\Cache\CacheInterface;
31
use LeadersLinked\Mapper\SurveyTestMapper;
32
use LeadersLinked\Mapper\SurveyCampaignMapper;
33
 
34
 
35
class CalendarController extends AbstractActionController
36
{
37
    /**
38
     *
39
     * @var \Laminas\Db\Adapter\AdapterInterface
40
     */
41
    private $adapter;
42
 
43
    /**
44
     *
45
     * @var \LeadersLinked\Cache\CacheInterface
46
     */
47
    private $cache;
48
 
49
 
50
    /**
51
     *
52
     * @var \Laminas\Log\LoggerInterface
53
     */
54
    private $logger;
55
 
56
    /**
57
     *
58
     * @var array
59
     */
60
    private $config;
61
 
62
 
63
    /**
64
     *
65
     * @var \Laminas\Mvc\I18n\Translator
66
     */
67
    private $translator;
68
 
69
 
70
    /**
71
     *
72
     * @param \Laminas\Db\Adapter\AdapterInterface $adapter
73
     * @param \LeadersLinked\Cache\CacheInterface $cache
74
     * @param \Laminas\Log\LoggerInterface LoggerInterface $logger
75
     * @param array $config
76
     * @param \Laminas\Mvc\I18n\Translator $translator
77
     */
78
    public function __construct($adapter, $cache, $logger, $config, $translator)
79
    {
80
        $this->adapter      = $adapter;
81
        $this->cache        = $cache;
82
        $this->logger       = $logger;
83
        $this->config       = $config;
84
        $this->translator   = $translator;
85
    }
86
 
87
 
88
 
89
    public function indexAction()
90
    {
91
        return new JsonModel([
92
            'success' => false,
93
            'data' => 'ERROR_METHOD_NOT_ALLOWED'
94
        ]);
95
    }
96
 
97
 
98
 
99
 
100
    public function eventsAction()
101
    {
102
 
103
        $request = $this->getRequest();
104
        if($request->isGet()) {
105
 
106
            $currentUserPlugin = $this->plugin('currentUserPlugin');
107
            $currentUser = $currentUserPlugin->getUser();
108
 
109
            $currentNetworkPlugin = $this->plugin('currentNetworkPlugin');
110
            $currentNetwork = $currentNetworkPlugin->getNetwork();
111
 
112
 
113
 
114
            $start  = $this->params()->fromQuery('start');
115
            $end    = $this->params()->fromQuery('end');
116
 
117
            if(!empty($start) && !empty($end)) {
118
 
119
                $dtStart = \DateTime::createFromFormat('Y-m-d', $start);
120
                $dtEnd = \DateTime::createFromFormat('Y-m-d', $end);
121
            } else {
122
                $dtStart = null;
123
                $dtEnd = null;
124
            }
125
 
128 efrain 126
 
127
            header('Access-Control-Allow-Origin: *');
128
            header('Access-Control-Allow-Headers: *');
129
            header('Access-Control-Allow-Method: POST, GET, HEAD, OPTIONS');
130
            header('Access-Control-Max-Age: 86400');
131
 
132
 
133
 
1 efrain 134
            if(!$dtStart || !$dtEnd) {
129 efrain 135
                echo 'Aqui1';
1 efrain 136
              $t = time();
137
              $year = intval(date('Y', $t), 10);
138
              $month = intval(date('m', $t), 10);
139
              $last_day = intval(date('t', $t), 10);
140
 
141
              $start = mktime(0, 0, 0, $month, 1, $year);
142
              $start = date('Y-m-d H:i:s');
143
 
144
              $end = mktime(23, 56, 59, $month, $last_day, $year);
145
              $end = date('Y-m-d H:i:s');
146
 
147
            } else {
129 efrain 148
                echo 'Aqui2';
149
 
1 efrain 150
                $dtStart->setTime(0, 0, 0);
151
                $start = $dtStart->format('Y-m-d H:i:s');
152
 
153
                $dtEnd->setTime(23, 59, 59);
154
                $end  = $dtEnd->format('Y-m-d H:i:s');
155
            }
156
 
157
 
128 efrain 158
            echo 'start = ' . $start . ' end = ' . $end;
159
 
160
 
1 efrain 161
            $events = [];
162
 
163
 
164
 
165
            //3 días
166
            $expirePeriod = 86400 * 3;
167
            $t1 = time();
168
 
169
 
170
            $companies = [];
171
            $companyMapper = CompanyMapper::getInstance($this->adapter);
172
 
173
            $companyUsers = [];
174
            $companyUserMapper = CompanyUserMapper::getInstance($this->adapter);
175
            $records = $companyUserMapper->fetchAllByUserId($currentUser->id);
176
 
177
            foreach($records as $record) {
178
                $companyUsers[$record->company_id] = $record->backend == CompanyUser::BACKEND_YES;
179
             }
180
 
181
 
182
 
183
 
184
 
185
 
186
            $zoomMeetingMapper = ZoomMeetingMapper::getInstance($this->adapter);
187
            $recruitmentSelectionCandidateMapper = RecruitmentSelectionCandidateMapper::getInstance($this->adapter);
188
            $recruitmentSelectionVacancyMapper = RecruitmentSelectionVacancyMapper::getInstance($this->adapter);
189
            $recruitmentSelectionInterviewMapper = RecruitmentSelectionInterviewMapper::getInstance($this->adapter);
190
            $performanceEvaluationTestMapper = PerformanceEvaluationTestMapper::getInstance($this->adapter);
191
            $performanceEvaluationFormMapper = PerformanceEvaluationFormMapper::getInstance($this->adapter);
192
            $jobDescriptionMapper = JobDescriptionMapper::getInstance($this->adapter);
193
            $userMapper = UserMapper::getInstance($this->adapter);
194
 
127 efrain 195
 
1 efrain 196
 
123 efrain 197
 
128 efrain 198
 
125 efrain 199
 
127 efrain 200
            $calendarEventMapper = CalendarEventMapper::getInstance($this->adapter);
201
            $records = $calendarEventMapper->fetchAllByUserIdAndStartTimeAndEndTime($currentUser->id, $start, $end);
202
 
123 efrain 203
            print_r($records); exit;
204
 
1 efrain 205
            foreach($records as $record)
206
            {
207
                switch($record->type)
208
                {
209
                    case CalendarEvent::TYPE_SURVEY_NORMAL:
210
                        $backgroundColor = $currentNetwork->css_calendar_survey_bg_color;
211
                        $textColor = $currentNetwork->css_calendar_survey_text_color;
212
 
213
                        $surveyTestMapper = SurveyTestMapper::getInstance($this->adapter);
214
                        $surveyTest = $surveyTestMapper->fetchOne($record->relational_id);
215
 
216
                        if($surveyTest && $surveyTest->user_id == $currentUser->id) {
217
 
218
                            $surveyCampaingMapper = SurveyCampaignMapper::getInstance($this->adapter);
219
                            $surveyCampaing = $surveyCampaingMapper->fetchOne($surveyTest->campaign_id);
220
 
221
                            $url = '';
222
                            $hasLink = !empty($companyUsers[$surveyTest->company_id]);
223
 
224
                            if ($hasLink) {
225
 
226
                                if (!isset($companies[$surveyTest->company_id])) {
227
                                    $company  = $companyMapper->fetchOne($surveyTest->company_id);
228
 
229
                                    $companies[$company->id]  = $company;
230
                                } else {
231
                                    $company = $companies[$surveyTest->company_id];
232
                                }
233
 
234
 
235
                                $url = $this->url()->fromRoute('backend/signin-company', [
236
                                    'id' => $company->uuid,
237
                                    'relational' => $surveyTest->uuid,
238
                                    'type' => CalendarEvent::TYPE_SURVEY_ORGANIZATIONAL_CLIMATE,
239
                                ]);
240
                            }
241
 
242
                            $dtStart = \DateTime::createFromFormat('Y-m-d', $surveyCampaing->end_date);
243
 
244
 
245
                            array_push($events, [
246
                                'id'                => $surveyTest->uuid,
247
                                'title'             => $surveyCampaing->name,
248
                                'start'             => $dtStart->format('d/m/Y'),
249
                                'url'               => $url,
250
                                'backgroundColor'   => $backgroundColor,
251
                                'textColor'         => $textColor,
252
                                'allDay'            => true,
253
                                'type'              => 'task',
254
                            ]);
255
                        }
256
 
257
                        break;
258
 
259
                    case CalendarEvent::TYPE_SURVEY_ORGANIZATIONAL_CLIMATE:
260
                        $backgroundColor = $currentNetwork->css_calendar_organizational_climate_bg_color;
261
                        $textColor = $currentNetwork->css_calendar_organizational_climate_text_color;
262
 
263
                        $surveyTestMapper = SurveyTestMapper::getInstance($this->adapter);
264
                        $surveyTest = $surveyTestMapper->fetchOne($record->relational_id);
265
 
266
                        if($surveyTest && $surveyTest->user_id == $currentUser->id) {
267
 
268
                            $surveyCampaingMapper = SurveyCampaignMapper::getInstance($this->adapter);
269
                            $surveyCampaing = $surveyCampaingMapper->fetchOne($surveyTest->campaign_id);
270
 
271
                            $url = '';
272
                            $hasLink = !empty($companyUsers[$surveyTest->company_id]);
273
 
274
                            if ($hasLink) {
275
 
276
                                if (!isset($companies[$surveyTest->company_id])) {
277
                                    $company  = $companyMapper->fetchOne($surveyTest->company_id);
278
 
279
                                    $companies[$company->id]  = $company;
280
                                } else {
281
                                    $company = $companies[$surveyTest->company_id];
282
                                }
283
 
284
 
285
                                $url = $this->url()->fromRoute('backend/signin-company', [
286
                                    'id' => $company->uuid,
287
                                    'relational' => $surveyTest->uuid,
288
                                    'type' => CalendarEvent::TYPE_SURVEY_ORGANIZATIONAL_CLIMATE,
289
                                ]);
290
                            }
291
 
292
                            $dtStart = \DateTime::createFromFormat('Y-m-d', $surveyCampaing->end_date);
293
 
294
 
295
                            array_push($events, [
296
                                'id'                => $surveyTest->uuid,
297
                                'title'             => $surveyCampaing->name,
298
                                'start'             => $dtStart->format('d/m/Y'),
299
                                'url'               => $url,
300
                                'backgroundColor'   => $backgroundColor,
301
                                'textColor'         => $textColor,
302
                                'allDay'            => true,
303
                                'type'              => 'task',
304
                            ]);
305
                        }
306
 
307
                        break;
308
 
309
 
310
 
311
 
312
 
313
                    case CalendarEvent::TYPE_RECRUITMENT_SELECTION_INTERVIEW  :
314
                        $backgroundColor = $currentNetwork->css_calendar_recruitment_and_selection_bg_color ;
315
                        $textColor = $currentNetwork->css_calendar_recruitment_and_selection_text_color;
316
 
317
 
318
                        $recruitmentSelectionInterview = $recruitmentSelectionInterviewMapper->fetchOne($record->relational_id);
319
                        if($recruitmentSelectionInterview) {
320
 
321
                            $recruitmentSelectionVacancy = $recruitmentSelectionVacancyMapper->fetchOne($recruitmentSelectionInterview->vacancy_id);
322
 
323
 
324
 
325
                            $recruitmentSelectionCandidate = $recruitmentSelectionCandidateMapper->fetchOne($recruitmentSelectionInterview->candidate_id);
326
                            if($recruitmentSelectionVacancy && $recruitmentSelectionCandidate) {
327
                                $jobDescription = $jobDescriptionMapper->fetchOne($recruitmentSelectionVacancy->job_description_id);
328
                                if($jobDescription) {
329
                                    $url = '';
330
                                    $hasLink = !empty($companyUsers[$recruitmentSelectionInterview->company_id]);
331
 
332
 
333
 
334
                                    if($hasLink) {
335
 
336
                                        if(!isset($companies[$recruitmentSelectionInterview->company_id])) {
337
                                            $company  = $companyMapper->fetchOne($recruitmentSelectionInterview->company_id);
338
 
339
                                            $companies[ $company->id ]  = $company;
340
                                        } else {
341
                                            $company = $companies[ $recruitmentSelectionInterview->company_id ];
342
                                        }
343
 
344
 
345
                                        $url = $this->url()->fromRoute('backend/signin-company', [
346
                                            'id' => $company->uuid,
347
                                            'relational' => $recruitmentSelectionInterview->uuid,
348
                                            'type' => CalendarEvent::TYPE_RECRUITMENT_SELECTION_INTERVIEW
349
                                        ]);
350
                                    }
351
 
352
                                    $agenda = " LABEL_RECRUITMENT_SELECTION_JOB_DESCRIPTION : " . $jobDescription->name . "<br>";
353
                                    switch($recruitmentSelectionInterview->type)
354
                                    {
355
                                        case RecruitmentSelectionInterview::TYPE_BOSS :
356
                                            $agenda .= " LABEL_RECRUITMENT_SELECTION_TYPE : LABEL_RECRUITMENT_SELECTION_TYPE_BOSS_INTERVIEW <br>";
357
                                            break;
358
 
359
                                        case RecruitmentSelectionInterview::TYPE_HUMAN_RESOURCE :
360
                                            $agenda .= " LABEL_RECRUITMENT_SELECTION_TYPE : LABEL_RECRUITMENT_SELECTION_TYPE_HUMAN_RESOURCE <br>";
361
                                            break;
362
                                    }
363
 
364
                                    $agenda .= " LABEL_RECRUITMENT_SELECTION_CANDIDATE : " . trim($recruitmentSelectionCandidate->first_name . ' ' . $recruitmentSelectionCandidate->last_name) . " <br>";
365
 
366
 
367
 
368
                                    $dtStart = \DateTime::createFromFormat('Y-m-d', $recruitmentSelectionInterview->last_date);
369
                                    $agenda .= " LABEL_PERFORMANCE_EVALUATION_LAST_DATE : " . $dtStart->format('Y-m-d') . "<br>" ;
370
 
371
 
372
                                    array_push($events, [
373
                                        'id'                => $recruitmentSelectionInterview->uuid,
374
                                        'title'             => $recruitmentSelectionVacancy->name,
375
                                        'agenda'            => $agenda,
376
                                        'url'               => $url,
377
                                        'start'             => $dtStart->format('Y-m-d'),
378
                                        'url'               => '',
379
                                        'backgroundColor'   => $backgroundColor,
380
                                        'textColor'         => $textColor,
381
                                        'allDay'            => true,
382
                                        'type'              => 'task',
383
                                    ]);
384
                                }
385
                            }
386
                        }
387
 
388
 
389
                        break;
390
 
391
                    case CalendarEvent::TYPE_PERFORMANCE_EVALUATION :
392
 
393
 
394
                        $backgroundColor = $currentNetwork->css_calendar_performance_evaluation_bg_color ;
395
                        $textColor = $currentNetwork->css_calendar_performance_evaluation_text_color;
396
 
397
 
398
                        $performanceEvaluationTest = $performanceEvaluationTestMapper->fetchOne($record->relational_id);
399
                        if($performanceEvaluationTest) {
400
 
401
 
402
 
403
                            $performanceEvaluationForm = $performanceEvaluationFormMapper->fetchOne($performanceEvaluationTest->form_id);
404
                            if($performanceEvaluationForm) {
405
                                $jobDescription = $jobDescriptionMapper->fetchOne($performanceEvaluationForm->job_description_id);
406
                                if($jobDescription) {
407
                                    $url = '';
408
                                    if($performanceEvaluationTest->supervisor_id) {
409
                                        $supervisor = $userMapper->fetchOne($performanceEvaluationTest->supervisor_id);
410
                                    } else {
411
                                        $supervisor = '';
412
                                    }
413
 
414
                                    if($performanceEvaluationTest->employee_id) {
415
                                        $employee = $userMapper->fetchOne($performanceEvaluationTest->employee_id);
416
                                    } else {
417
                                        $employee = '';
418
                                    }
419
 
420
 
421
                                    $hasLink = !empty($companyUsers[$performanceEvaluationTest->company_id]);
422
 
423
                                    switch ($performanceEvaluationTest->type)
424
                                    {
425
                                        case PerformanceEvaluationTest::TYPE_SUPERVISOR :
426
                                        case PerformanceEvaluationTest::TYPE_BOTH  :
427
                                            if($performanceEvaluationTest->supervisor_id != $currentUser->id) {
428
                                                $hasLink = false;
429
                                            }
430
                                            break;
431
 
432
                                        case  PerformanceEvaluationTest::TYPE_EMPLOYEE  :
433
                                            if($performanceEvaluationTest->employee_id != $currentUser->id) {
434
                                                $hasLink = false;
435
                                            }
436
                                            break;
437
 
438
                                        default :
439
                                            $hasLink = false;
440
                                            break;
441
                                    }
442
 
443
 
444
 
445
                                    if($hasLink) {
446
 
447
                                        if(!isset($companies[$performanceEvaluationTest->company_id])) {
448
                                            $company  = $companyMapper->fetchOne($performanceEvaluationTest->company_id);
449
 
450
                                            $companies[ $company->id ]  = $company;
451
                                        } else {
452
                                            $company = $companies[ $performanceEvaluationTest->company_id ];
453
                                        }
454
 
455
 
456
                                        $url = $this->url()->fromRoute('backend/signin-company', [
457
                                            'id' => $company->uuid,
458
                                            'relational' => $performanceEvaluationTest->uuid,
459
                                            'type' => CalendarEvent::TYPE_PERFORMANCE_EVALUATION
460
                                        ]);
461
 
462
 
463
 
464
                                    }
465
 
466
                                    $agenda = " LABEL_PERFORMANCE_EVALUATION_FORM_NAME : " . $performanceEvaluationForm->name . "<br>";
467
                                    $agenda .= " LABEL_PERFORMANCE_EVALUATION_JOB_DESCRIPTION : " . $jobDescription->name . "<br>";
468
 
469
                                    switch($performanceEvaluationTest->type)
470
                                    {
471
                                        case PerformanceEvaluationTest::TYPE_BOTH :
472
                                            $agenda .= " LABEL_PERFORMANCE_EVALUATION_TYPE : LABEL_PERFORMANCE_EVALUATION_TYPE_BOTH <br>";
473
                                            break;
474
 
475
                                        case PerformanceEvaluationTest::TYPE_SUPERVISOR :
476
                                            $agenda .= " LABEL_PERFORMANCE_EVALUATION_TYPE : LABEL_PERFORMANCE_EVALUATION_TYPE_SUPERVISOR <br>";
477
                                            break;
478
 
479
                                        case PerformanceEvaluationTest::TYPE_EMPLOYEE :
480
                                            $agenda .= " LABEL_PERFORMANCE_EVALUATION_TYPE : LABEL_PERFORMANCE_EVALUATION_TYPE_EMPLOYEE <br>";
481
                                            break;
482
 
483
 
484
                                    }
485
 
486
                                    if($supervisor) {
487
                                        $agenda .= " LABEL_PERFORMANCE_EVALUATION_SUPERVISOR : " . trim($supervisor->first_name . ' ' . $supervisor->last_name) . " <br>";
488
 
489
                                    }
490
                                    if($employee) {
491
                                        $agenda .= " LABEL_PERFORMANCE_EVALUATION_EMPLOYEE : " . trim($employee->first_name . ' ' . $employee->last_name) . " <br>";
492
 
493
                                    }
494
 
495
                                    $dtStart = \DateTime::createFromFormat('Y-m-d', $performanceEvaluationTest->last_date);
496
                                    $agenda .= " LABEL_PERFORMANCE_EVALUATION_LAST_DATE : " . $dtStart->format('Y-m-d') . "<br>" ;
497
 
498
 
499
 
500
                                    array_push($events, [
501
                                        'id'                => $performanceEvaluationTest->uuid,
502
                                        'title'             =>  $performanceEvaluationForm->name,
503
                                        'agenda'            => $agenda,
504
                                        'start'             => $dtStart->format('Y-m-d'),
505
                                        'url'               => $url,
506
                                        'backgroundColor'   => $backgroundColor,
507
                                        'textColor'         => $textColor,
508
                                        'allDay'            => true,
509
                                        'type'              => 'task',
510
                                    ]);
511
                                }
512
                            }
513
 
514
                        }
515
 
516
 
517
 
518
 
519
 
520
                        break;
521
 
522
                    case CalendarEvent::TYPE_ZOOM :
523
                        $zoomMeeting = $zoomMeetingMapper->fetchOne($record->relational_id);
524
                        if($zoomMeeting) {
525
 
526
                            $backgroundColor = $currentNetwork->css_calendar_zoom_bg_color ;
527
                            $textColor = $currentNetwork->css_calendar_zoom_text_color;
528
 
529
                            $dtStart = \DateTime::createFromFormat('Y-m-d H:i:s', $zoomMeeting->start_time);
530
                            $t2 = $dtStart->getTimestamp();
531
 
532
                            if($t2 > $t1) {
533
 
534
                                $t3 = $t1 + $expirePeriod;
535
                                if($t3 > $t2) {
536
                                    $backgroundColor = $currentNetwork->css_calendar_expire_bg_color;
537
                                    $textColor = $currentNetwork->css_calendar_expire_text_color;
538
                                }
539
 
540
                            }
541
 
542
 
543
 
544
                            if($currentUser->timezone && $currentUser->timezone != $zoomMeeting->timezone) {
545
 
546
                                $start =  str_replace(' ', 'T', Functions::convertDateTimeBetweenTimeZones($zoomMeeting->start_time, $zoomMeeting->timezone, $currentUser->timezone));
547
                                $end =  str_replace(' ', 'T', Functions::convertDateTimeBetweenTimeZones($zoomMeeting->end_time, $zoomMeeting->timezone, $currentUser->timezone));
548
 
549
 
550
 
551
 
552
 
553
                            } else {
554
                                $start = str_replace(' ', 'T', $zoomMeeting->start_time);
555
                                $end = str_replace(' ', 'T', $zoomMeeting->end_time);
556
                            }
557
 
558
 
559
 
560
 
561
 
562
 
563
                            $agenda = "<a href=\"{$zoomMeeting->join_url}\" target=\"_blank\">" .  $zoomMeeting->agenda . "<br>" .
564
                                " LABEL_ZOOM_MEETING_START_DATE : " . $dtStart->format('Y-m-d') . "<br>" .
565
                                " LABEL_ZOOM_MEETING_START_TIME : " . $dtStart->format('H:i a') . "<br>" .
566
                                " LABEL_ZOOM_MEETING_TIMEZONE : " . $zoomMeeting->timezone . "<br>" .
567
                                " LABEL_ZOOM_MEETING_TITLE :  " . $zoomMeeting->topic  . "<br>" .
568
                                " LABEL_ZOOM_MEETING_URL : " . $zoomMeeting->join_url . "<br>" .
569
                                " LABEL_ZOOM_MEETING_PASSWORD : " . $zoomMeeting->password . "<br>" .
570
                                "</a>";
571
 
572
                            array_push($events, [
573
                                'id'                => $zoomMeeting->id,
574
                                'title'             => $zoomMeeting->topic,
575
                                'agenda'            => $agenda,
576
                                'start'             => $start,
577
                                'end'               => $end,
578
                                'url'               => $zoomMeeting->join_url,
579
                                'backgroundColor'   => $backgroundColor,
580
                                'textColor'         => $textColor,
581
                                'type'              => 'event',
582
                            ]);
583
                        }
584
                        break;
585
 
586
 
587
                }
588
 
589
 
590
 
591
            }
592
 
593
 
594
 
595
 
121 efrain 596
            return new JsonModel([
597
                'success' => true,
598
                'data' => $events
599
            ]);
1 efrain 600
 
601
        } else {
602
            $response = [
603
                'success' => false,
604
                'data' => 'ERROR_METHOD_NOT_ALLOWED'
605
            ];
606
        }
607
 
608
        return new JsonModel($response);
609
    }
610
 
611
 
612
 
613
 
614
}