Proyectos de Subversion LeadersLinked - Services

Rev

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