Proyectos de Subversion LeadersLinked - Services

Rev

Rev 129 | Rev 131 | 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
 
130 efrain 141
              echo 'year = ' . $year . ' month = ' . $month.  ' last_day = ' . $last_day;
142
 
1 efrain 143
              $start = mktime(0, 0, 0, $month, 1, $year);
144
              $start = date('Y-m-d H:i:s');
145
 
146
              $end = mktime(23, 56, 59, $month, $last_day, $year);
147
              $end = date('Y-m-d H:i:s');
148
 
149
            } else {
129 efrain 150
                echo 'Aqui2';
151
 
1 efrain 152
                $dtStart->setTime(0, 0, 0);
153
                $start = $dtStart->format('Y-m-d H:i:s');
154
 
155
                $dtEnd->setTime(23, 59, 59);
156
                $end  = $dtEnd->format('Y-m-d H:i:s');
157
            }
158
 
159
 
128 efrain 160
            echo 'start = ' . $start . ' end = ' . $end;
161
 
162
 
1 efrain 163
            $events = [];
164
 
165
 
166
 
167
            //3 días
168
            $expirePeriod = 86400 * 3;
169
            $t1 = time();
170
 
171
 
172
            $companies = [];
173
            $companyMapper = CompanyMapper::getInstance($this->adapter);
174
 
175
            $companyUsers = [];
176
            $companyUserMapper = CompanyUserMapper::getInstance($this->adapter);
177
            $records = $companyUserMapper->fetchAllByUserId($currentUser->id);
178
 
179
            foreach($records as $record) {
180
                $companyUsers[$record->company_id] = $record->backend == CompanyUser::BACKEND_YES;
181
             }
182
 
183
 
184
 
185
 
186
 
187
 
188
            $zoomMeetingMapper = ZoomMeetingMapper::getInstance($this->adapter);
189
            $recruitmentSelectionCandidateMapper = RecruitmentSelectionCandidateMapper::getInstance($this->adapter);
190
            $recruitmentSelectionVacancyMapper = RecruitmentSelectionVacancyMapper::getInstance($this->adapter);
191
            $recruitmentSelectionInterviewMapper = RecruitmentSelectionInterviewMapper::getInstance($this->adapter);
192
            $performanceEvaluationTestMapper = PerformanceEvaluationTestMapper::getInstance($this->adapter);
193
            $performanceEvaluationFormMapper = PerformanceEvaluationFormMapper::getInstance($this->adapter);
194
            $jobDescriptionMapper = JobDescriptionMapper::getInstance($this->adapter);
195
            $userMapper = UserMapper::getInstance($this->adapter);
196
 
127 efrain 197
 
1 efrain 198
 
123 efrain 199
 
128 efrain 200
 
125 efrain 201
 
127 efrain 202
            $calendarEventMapper = CalendarEventMapper::getInstance($this->adapter);
203
            $records = $calendarEventMapper->fetchAllByUserIdAndStartTimeAndEndTime($currentUser->id, $start, $end);
204
 
123 efrain 205
            print_r($records); exit;
206
 
1 efrain 207
            foreach($records as $record)
208
            {
209
                switch($record->type)
210
                {
211
                    case CalendarEvent::TYPE_SURVEY_NORMAL:
212
                        $backgroundColor = $currentNetwork->css_calendar_survey_bg_color;
213
                        $textColor = $currentNetwork->css_calendar_survey_text_color;
214
 
215
                        $surveyTestMapper = SurveyTestMapper::getInstance($this->adapter);
216
                        $surveyTest = $surveyTestMapper->fetchOne($record->relational_id);
217
 
218
                        if($surveyTest && $surveyTest->user_id == $currentUser->id) {
219
 
220
                            $surveyCampaingMapper = SurveyCampaignMapper::getInstance($this->adapter);
221
                            $surveyCampaing = $surveyCampaingMapper->fetchOne($surveyTest->campaign_id);
222
 
223
                            $url = '';
224
                            $hasLink = !empty($companyUsers[$surveyTest->company_id]);
225
 
226
                            if ($hasLink) {
227
 
228
                                if (!isset($companies[$surveyTest->company_id])) {
229
                                    $company  = $companyMapper->fetchOne($surveyTest->company_id);
230
 
231
                                    $companies[$company->id]  = $company;
232
                                } else {
233
                                    $company = $companies[$surveyTest->company_id];
234
                                }
235
 
236
 
237
                                $url = $this->url()->fromRoute('backend/signin-company', [
238
                                    'id' => $company->uuid,
239
                                    'relational' => $surveyTest->uuid,
240
                                    'type' => CalendarEvent::TYPE_SURVEY_ORGANIZATIONAL_CLIMATE,
241
                                ]);
242
                            }
243
 
244
                            $dtStart = \DateTime::createFromFormat('Y-m-d', $surveyCampaing->end_date);
245
 
246
 
247
                            array_push($events, [
248
                                'id'                => $surveyTest->uuid,
249
                                'title'             => $surveyCampaing->name,
250
                                'start'             => $dtStart->format('d/m/Y'),
251
                                'url'               => $url,
252
                                'backgroundColor'   => $backgroundColor,
253
                                'textColor'         => $textColor,
254
                                'allDay'            => true,
255
                                'type'              => 'task',
256
                            ]);
257
                        }
258
 
259
                        break;
260
 
261
                    case CalendarEvent::TYPE_SURVEY_ORGANIZATIONAL_CLIMATE:
262
                        $backgroundColor = $currentNetwork->css_calendar_organizational_climate_bg_color;
263
                        $textColor = $currentNetwork->css_calendar_organizational_climate_text_color;
264
 
265
                        $surveyTestMapper = SurveyTestMapper::getInstance($this->adapter);
266
                        $surveyTest = $surveyTestMapper->fetchOne($record->relational_id);
267
 
268
                        if($surveyTest && $surveyTest->user_id == $currentUser->id) {
269
 
270
                            $surveyCampaingMapper = SurveyCampaignMapper::getInstance($this->adapter);
271
                            $surveyCampaing = $surveyCampaingMapper->fetchOne($surveyTest->campaign_id);
272
 
273
                            $url = '';
274
                            $hasLink = !empty($companyUsers[$surveyTest->company_id]);
275
 
276
                            if ($hasLink) {
277
 
278
                                if (!isset($companies[$surveyTest->company_id])) {
279
                                    $company  = $companyMapper->fetchOne($surveyTest->company_id);
280
 
281
                                    $companies[$company->id]  = $company;
282
                                } else {
283
                                    $company = $companies[$surveyTest->company_id];
284
                                }
285
 
286
 
287
                                $url = $this->url()->fromRoute('backend/signin-company', [
288
                                    'id' => $company->uuid,
289
                                    'relational' => $surveyTest->uuid,
290
                                    'type' => CalendarEvent::TYPE_SURVEY_ORGANIZATIONAL_CLIMATE,
291
                                ]);
292
                            }
293
 
294
                            $dtStart = \DateTime::createFromFormat('Y-m-d', $surveyCampaing->end_date);
295
 
296
 
297
                            array_push($events, [
298
                                'id'                => $surveyTest->uuid,
299
                                'title'             => $surveyCampaing->name,
300
                                'start'             => $dtStart->format('d/m/Y'),
301
                                'url'               => $url,
302
                                'backgroundColor'   => $backgroundColor,
303
                                'textColor'         => $textColor,
304
                                'allDay'            => true,
305
                                'type'              => 'task',
306
                            ]);
307
                        }
308
 
309
                        break;
310
 
311
 
312
 
313
 
314
 
315
                    case CalendarEvent::TYPE_RECRUITMENT_SELECTION_INTERVIEW  :
316
                        $backgroundColor = $currentNetwork->css_calendar_recruitment_and_selection_bg_color ;
317
                        $textColor = $currentNetwork->css_calendar_recruitment_and_selection_text_color;
318
 
319
 
320
                        $recruitmentSelectionInterview = $recruitmentSelectionInterviewMapper->fetchOne($record->relational_id);
321
                        if($recruitmentSelectionInterview) {
322
 
323
                            $recruitmentSelectionVacancy = $recruitmentSelectionVacancyMapper->fetchOne($recruitmentSelectionInterview->vacancy_id);
324
 
325
 
326
 
327
                            $recruitmentSelectionCandidate = $recruitmentSelectionCandidateMapper->fetchOne($recruitmentSelectionInterview->candidate_id);
328
                            if($recruitmentSelectionVacancy && $recruitmentSelectionCandidate) {
329
                                $jobDescription = $jobDescriptionMapper->fetchOne($recruitmentSelectionVacancy->job_description_id);
330
                                if($jobDescription) {
331
                                    $url = '';
332
                                    $hasLink = !empty($companyUsers[$recruitmentSelectionInterview->company_id]);
333
 
334
 
335
 
336
                                    if($hasLink) {
337
 
338
                                        if(!isset($companies[$recruitmentSelectionInterview->company_id])) {
339
                                            $company  = $companyMapper->fetchOne($recruitmentSelectionInterview->company_id);
340
 
341
                                            $companies[ $company->id ]  = $company;
342
                                        } else {
343
                                            $company = $companies[ $recruitmentSelectionInterview->company_id ];
344
                                        }
345
 
346
 
347
                                        $url = $this->url()->fromRoute('backend/signin-company', [
348
                                            'id' => $company->uuid,
349
                                            'relational' => $recruitmentSelectionInterview->uuid,
350
                                            'type' => CalendarEvent::TYPE_RECRUITMENT_SELECTION_INTERVIEW
351
                                        ]);
352
                                    }
353
 
354
                                    $agenda = " LABEL_RECRUITMENT_SELECTION_JOB_DESCRIPTION : " . $jobDescription->name . "<br>";
355
                                    switch($recruitmentSelectionInterview->type)
356
                                    {
357
                                        case RecruitmentSelectionInterview::TYPE_BOSS :
358
                                            $agenda .= " LABEL_RECRUITMENT_SELECTION_TYPE : LABEL_RECRUITMENT_SELECTION_TYPE_BOSS_INTERVIEW <br>";
359
                                            break;
360
 
361
                                        case RecruitmentSelectionInterview::TYPE_HUMAN_RESOURCE :
362
                                            $agenda .= " LABEL_RECRUITMENT_SELECTION_TYPE : LABEL_RECRUITMENT_SELECTION_TYPE_HUMAN_RESOURCE <br>";
363
                                            break;
364
                                    }
365
 
366
                                    $agenda .= " LABEL_RECRUITMENT_SELECTION_CANDIDATE : " . trim($recruitmentSelectionCandidate->first_name . ' ' . $recruitmentSelectionCandidate->last_name) . " <br>";
367
 
368
 
369
 
370
                                    $dtStart = \DateTime::createFromFormat('Y-m-d', $recruitmentSelectionInterview->last_date);
371
                                    $agenda .= " LABEL_PERFORMANCE_EVALUATION_LAST_DATE : " . $dtStart->format('Y-m-d') . "<br>" ;
372
 
373
 
374
                                    array_push($events, [
375
                                        'id'                => $recruitmentSelectionInterview->uuid,
376
                                        'title'             => $recruitmentSelectionVacancy->name,
377
                                        'agenda'            => $agenda,
378
                                        'url'               => $url,
379
                                        'start'             => $dtStart->format('Y-m-d'),
380
                                        'url'               => '',
381
                                        'backgroundColor'   => $backgroundColor,
382
                                        'textColor'         => $textColor,
383
                                        'allDay'            => true,
384
                                        'type'              => 'task',
385
                                    ]);
386
                                }
387
                            }
388
                        }
389
 
390
 
391
                        break;
392
 
393
                    case CalendarEvent::TYPE_PERFORMANCE_EVALUATION :
394
 
395
 
396
                        $backgroundColor = $currentNetwork->css_calendar_performance_evaluation_bg_color ;
397
                        $textColor = $currentNetwork->css_calendar_performance_evaluation_text_color;
398
 
399
 
400
                        $performanceEvaluationTest = $performanceEvaluationTestMapper->fetchOne($record->relational_id);
401
                        if($performanceEvaluationTest) {
402
 
403
 
404
 
405
                            $performanceEvaluationForm = $performanceEvaluationFormMapper->fetchOne($performanceEvaluationTest->form_id);
406
                            if($performanceEvaluationForm) {
407
                                $jobDescription = $jobDescriptionMapper->fetchOne($performanceEvaluationForm->job_description_id);
408
                                if($jobDescription) {
409
                                    $url = '';
410
                                    if($performanceEvaluationTest->supervisor_id) {
411
                                        $supervisor = $userMapper->fetchOne($performanceEvaluationTest->supervisor_id);
412
                                    } else {
413
                                        $supervisor = '';
414
                                    }
415
 
416
                                    if($performanceEvaluationTest->employee_id) {
417
                                        $employee = $userMapper->fetchOne($performanceEvaluationTest->employee_id);
418
                                    } else {
419
                                        $employee = '';
420
                                    }
421
 
422
 
423
                                    $hasLink = !empty($companyUsers[$performanceEvaluationTest->company_id]);
424
 
425
                                    switch ($performanceEvaluationTest->type)
426
                                    {
427
                                        case PerformanceEvaluationTest::TYPE_SUPERVISOR :
428
                                        case PerformanceEvaluationTest::TYPE_BOTH  :
429
                                            if($performanceEvaluationTest->supervisor_id != $currentUser->id) {
430
                                                $hasLink = false;
431
                                            }
432
                                            break;
433
 
434
                                        case  PerformanceEvaluationTest::TYPE_EMPLOYEE  :
435
                                            if($performanceEvaluationTest->employee_id != $currentUser->id) {
436
                                                $hasLink = false;
437
                                            }
438
                                            break;
439
 
440
                                        default :
441
                                            $hasLink = false;
442
                                            break;
443
                                    }
444
 
445
 
446
 
447
                                    if($hasLink) {
448
 
449
                                        if(!isset($companies[$performanceEvaluationTest->company_id])) {
450
                                            $company  = $companyMapper->fetchOne($performanceEvaluationTest->company_id);
451
 
452
                                            $companies[ $company->id ]  = $company;
453
                                        } else {
454
                                            $company = $companies[ $performanceEvaluationTest->company_id ];
455
                                        }
456
 
457
 
458
                                        $url = $this->url()->fromRoute('backend/signin-company', [
459
                                            'id' => $company->uuid,
460
                                            'relational' => $performanceEvaluationTest->uuid,
461
                                            'type' => CalendarEvent::TYPE_PERFORMANCE_EVALUATION
462
                                        ]);
463
 
464
 
465
 
466
                                    }
467
 
468
                                    $agenda = " LABEL_PERFORMANCE_EVALUATION_FORM_NAME : " . $performanceEvaluationForm->name . "<br>";
469
                                    $agenda .= " LABEL_PERFORMANCE_EVALUATION_JOB_DESCRIPTION : " . $jobDescription->name . "<br>";
470
 
471
                                    switch($performanceEvaluationTest->type)
472
                                    {
473
                                        case PerformanceEvaluationTest::TYPE_BOTH :
474
                                            $agenda .= " LABEL_PERFORMANCE_EVALUATION_TYPE : LABEL_PERFORMANCE_EVALUATION_TYPE_BOTH <br>";
475
                                            break;
476
 
477
                                        case PerformanceEvaluationTest::TYPE_SUPERVISOR :
478
                                            $agenda .= " LABEL_PERFORMANCE_EVALUATION_TYPE : LABEL_PERFORMANCE_EVALUATION_TYPE_SUPERVISOR <br>";
479
                                            break;
480
 
481
                                        case PerformanceEvaluationTest::TYPE_EMPLOYEE :
482
                                            $agenda .= " LABEL_PERFORMANCE_EVALUATION_TYPE : LABEL_PERFORMANCE_EVALUATION_TYPE_EMPLOYEE <br>";
483
                                            break;
484
 
485
 
486
                                    }
487
 
488
                                    if($supervisor) {
489
                                        $agenda .= " LABEL_PERFORMANCE_EVALUATION_SUPERVISOR : " . trim($supervisor->first_name . ' ' . $supervisor->last_name) . " <br>";
490
 
491
                                    }
492
                                    if($employee) {
493
                                        $agenda .= " LABEL_PERFORMANCE_EVALUATION_EMPLOYEE : " . trim($employee->first_name . ' ' . $employee->last_name) . " <br>";
494
 
495
                                    }
496
 
497
                                    $dtStart = \DateTime::createFromFormat('Y-m-d', $performanceEvaluationTest->last_date);
498
                                    $agenda .= " LABEL_PERFORMANCE_EVALUATION_LAST_DATE : " . $dtStart->format('Y-m-d') . "<br>" ;
499
 
500
 
501
 
502
                                    array_push($events, [
503
                                        'id'                => $performanceEvaluationTest->uuid,
504
                                        'title'             =>  $performanceEvaluationForm->name,
505
                                        'agenda'            => $agenda,
506
                                        'start'             => $dtStart->format('Y-m-d'),
507
                                        'url'               => $url,
508
                                        'backgroundColor'   => $backgroundColor,
509
                                        'textColor'         => $textColor,
510
                                        'allDay'            => true,
511
                                        'type'              => 'task',
512
                                    ]);
513
                                }
514
                            }
515
 
516
                        }
517
 
518
 
519
 
520
 
521
 
522
                        break;
523
 
524
                    case CalendarEvent::TYPE_ZOOM :
525
                        $zoomMeeting = $zoomMeetingMapper->fetchOne($record->relational_id);
526
                        if($zoomMeeting) {
527
 
528
                            $backgroundColor = $currentNetwork->css_calendar_zoom_bg_color ;
529
                            $textColor = $currentNetwork->css_calendar_zoom_text_color;
530
 
531
                            $dtStart = \DateTime::createFromFormat('Y-m-d H:i:s', $zoomMeeting->start_time);
532
                            $t2 = $dtStart->getTimestamp();
533
 
534
                            if($t2 > $t1) {
535
 
536
                                $t3 = $t1 + $expirePeriod;
537
                                if($t3 > $t2) {
538
                                    $backgroundColor = $currentNetwork->css_calendar_expire_bg_color;
539
                                    $textColor = $currentNetwork->css_calendar_expire_text_color;
540
                                }
541
 
542
                            }
543
 
544
 
545
 
546
                            if($currentUser->timezone && $currentUser->timezone != $zoomMeeting->timezone) {
547
 
548
                                $start =  str_replace(' ', 'T', Functions::convertDateTimeBetweenTimeZones($zoomMeeting->start_time, $zoomMeeting->timezone, $currentUser->timezone));
549
                                $end =  str_replace(' ', 'T', Functions::convertDateTimeBetweenTimeZones($zoomMeeting->end_time, $zoomMeeting->timezone, $currentUser->timezone));
550
 
551
 
552
 
553
 
554
 
555
                            } else {
556
                                $start = str_replace(' ', 'T', $zoomMeeting->start_time);
557
                                $end = str_replace(' ', 'T', $zoomMeeting->end_time);
558
                            }
559
 
560
 
561
 
562
 
563
 
564
 
565
                            $agenda = "<a href=\"{$zoomMeeting->join_url}\" target=\"_blank\">" .  $zoomMeeting->agenda . "<br>" .
566
                                " LABEL_ZOOM_MEETING_START_DATE : " . $dtStart->format('Y-m-d') . "<br>" .
567
                                " LABEL_ZOOM_MEETING_START_TIME : " . $dtStart->format('H:i a') . "<br>" .
568
                                " LABEL_ZOOM_MEETING_TIMEZONE : " . $zoomMeeting->timezone . "<br>" .
569
                                " LABEL_ZOOM_MEETING_TITLE :  " . $zoomMeeting->topic  . "<br>" .
570
                                " LABEL_ZOOM_MEETING_URL : " . $zoomMeeting->join_url . "<br>" .
571
                                " LABEL_ZOOM_MEETING_PASSWORD : " . $zoomMeeting->password . "<br>" .
572
                                "</a>";
573
 
574
                            array_push($events, [
575
                                'id'                => $zoomMeeting->id,
576
                                'title'             => $zoomMeeting->topic,
577
                                'agenda'            => $agenda,
578
                                'start'             => $start,
579
                                'end'               => $end,
580
                                'url'               => $zoomMeeting->join_url,
581
                                'backgroundColor'   => $backgroundColor,
582
                                'textColor'         => $textColor,
583
                                'type'              => 'event',
584
                            ]);
585
                        }
586
                        break;
587
 
588
 
589
                }
590
 
591
 
592
 
593
            }
594
 
595
 
596
 
597
 
121 efrain 598
            return new JsonModel([
599
                'success' => true,
600
                'data' => $events
601
            ]);
1 efrain 602
 
603
        } else {
604
            $response = [
605
                'success' => false,
606
                'data' => 'ERROR_METHOD_NOT_ALLOWED'
607
            ];
608
        }
609
 
610
        return new JsonModel($response);
611
    }
612
 
613
 
614
 
615
 
616
}