ILIAS  release_8 Revision v8.25-1-g13de6a5eca6
class.ilObjCourse.php
Go to the documentation of this file.
1<?php
2
25{
26 public const CAL_REG_START = 1;
27 public const CAL_REG_END = 2;
28 public const CAL_ACTIVATION_START = 3;
29 public const CAL_ACTIVATION_END = 4;
30 public const CAL_COURSE_START = 5;
31 public const CAL_COURSE_END = 6;
32 public const CAL_COURSE_TIMING_START = 7;
33 public const CAL_COURSE_TIMING_END = 8;
34
35 public const STATUS_DETERMINATION_LP = 1;
37
38 private string $contact_consultation = '';
39 private string $contact_phone = '';
40 private string $contact_email = '';
41 private string $contact_name = '';
42 private string $contact_responsibility = '';
44 private int $subscription_start = 0;
45 private int $subscription_end = 0;
46 private int $subscription_type = 0;
47 private string $subscription_password = '';
48 private int $view_mode = 0;
49 private bool $waiting_list = false;
52 private bool $abo = true;
53 private bool $show_members = true;
54 private string $message = '';
55 private bool $course_start_time_indication = true;
57 private string $important = '';
58 private string $syllabus = '';
60 private string $latitude = '';
61 private string $longitude = '';
62 private int $locationzoom = 0;
63 private bool $enablemap = false;
64
65 private int $session_limit = 0;
66 private int $session_prev = -1;
67 private int $session_next = -1;
68
69 private string $reg_access_code = '';
70 private bool $reg_access_code_enabled = false;
71 private int $status_dt = 0;
72
74
75 private bool $crs_start_time_indication = false;
76
77 private ?ilDateTime $crs_start = null;
78 private ?ilDateTime $crs_end = null;
79 private ?ilDate $leave_end = null;
80 private int $min_members = 0;
81 private bool $auto_fill_from_waiting = false;
82 private bool $member_export = false;
84 private bool $auto_notification = true;
85 private ?string $target_group = null;
86 private int $activation_start = 0;
87 private int $activation_end = 0;
88 private bool $activation_visibility = false;
89
92
93 public function __construct(int $a_id = 0, bool $a_call_by_reference = true)
94 {
95 global $DIC;
96
97 $this->setStatusDetermination(self::STATUS_DETERMINATION_LP);
98
99 $this->type = "crs";
100 $this->course_logger = $DIC->logger()->crs();
101 parent::__construct($a_id, $a_call_by_reference);
102 }
103
104 public static function lookupShowMembersEnabled(int $a_obj_id): bool
105 {
106 $query = 'SELECT show_members FROM crs_settings ' .
107 'WHERE obj_id = ' . $GLOBALS['DIC']['ilDB']->quote($a_obj_id, 'integer');
108 $res = $GLOBALS['DIC']['ilDB']->query($query);
109 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
110 return (bool) $row->show_members;
111 }
112 return false;
113 }
114
115 public function getShowMembersExport(): bool
116 {
118 }
119
120 public function setShowMembersExport(bool $a_mem_export): void
121 {
122 $this->member_export = $a_mem_export;
123 }
124
125 public function getRegistrationAccessCode(): string
126 {
128 }
129
130 public function setRegistrationAccessCode(string $a_code): void
131 {
132 $this->reg_access_code = $a_code;
133 }
134
135 public function isRegistrationAccessCodeEnabled(): bool
136 {
138 }
139
140 public function enableRegistrationAccessCode(bool $a_status): void
141 {
142 $this->reg_access_code_enabled = $a_status;
143 }
144
145 public function getImportantInformation(): string
146 {
147 return $this->important;
148 }
149
150 public function setImportantInformation(string $a_info): void
151 {
152 $this->important = $a_info;
153 }
154
155 public function getSyllabus(): string
156 {
157 return $this->syllabus;
158 }
159
160 public function setSyllabus(string $a_syllabus): void
161 {
162 $this->syllabus = $a_syllabus;
163 }
164
165 public function getTargetGroup(): ?string
166 {
167 return $this->target_group;
168 }
169
170 public function setTargetGroup(?string $a_tg): void
171 {
172 $this->target_group = $a_tg;
173 }
174
175 public function getContactName(): string
176 {
177 return $this->contact_name;
178 }
179
180 public function setContactName(string $a_cn): void
181 {
182 $this->contact_name = $a_cn;
183 }
184
185 public function getContactConsultation(): string
186 {
188 }
189
190 public function setContactConsultation(string $a_value): void
191 {
192 $this->contact_consultation = $a_value;
193 }
194
195 public function getContactPhone(): string
196 {
198 }
199
200 public function setContactPhone(string $a_value): void
201 {
202 $this->contact_phone = $a_value;
203 }
204
205 public function getContactEmail(): string
206 {
208 }
209
210 public function setContactEmail(string $a_value): void
211 {
212 $this->contact_email = $a_value;
213 }
214
215 public function getContactResponsibility(): string
216 {
218 }
219
220 public function setContactResponsibility(string $a_value): void
221 {
222 $this->contact_responsibility = $a_value;
223 }
224
225 public function getActivationUnlimitedStatus(): bool
226 {
227 return !$this->getActivationStart() || !$this->getActivationEnd();
228 }
229
230 public function getActivationStart(): int
231 {
233 }
234
235 public function setActivationStart(int $a_value): void
236 {
237 $this->activation_start = $a_value;
238 }
239
240 public function getActivationEnd(): int
241 {
243 }
244
245 public function setActivationEnd(int $a_value): void
246 {
247 $this->activation_end = $a_value;
248 }
249
250 public function setActivationVisibility(bool $a_value): void
251 {
252 $this->activation_visibility = $a_value;
253 }
254
255 public function getActivationVisibility(): bool
256 {
258 }
259
261 {
263 }
264
265 public function setSubscriptionLimitationType(int $a_type): void
266 {
267 $this->subscription_limitation_type = $a_type;
268 }
269
270 public function getSubscriptionUnlimitedStatus(): bool
271 {
272 return $this->subscription_limitation_type == ilCourseConstants::IL_CRS_SUBSCRIPTION_UNLIMITED;
273 }
274
275 public function getSubscriptionStart(): int
276 {
278 }
279
280 public function setSubscriptionStart(int $a_value): void
281 {
282 $this->subscription_start = $a_value;
283 }
284
285 public function getSubscriptionEnd(): int
286 {
288 }
289
290 public function setSubscriptionEnd(int $a_value): void
291 {
292 $this->subscription_end = $a_value;
293 }
294
295 public function getSubscriptionType(): int
296 {
297 return $this->subscription_type ?: ilCourseConstants::IL_CRS_SUBSCRIPTION_DIRECT;
298 }
299
300 public function setSubscriptionType(int $a_value): void
301 {
302 $this->subscription_type = $a_value;
303 }
304
305 public function getSubscriptionPassword(): string
306 {
308 }
309
310 public function setSubscriptionPassword(string $a_value): void
311 {
312 $this->subscription_password = $a_value;
313 }
314
315 public function enabledObjectiveView(): bool
316 {
317 return $this->view_mode == ilCourseConstants::IL_CRS_VIEW_OBJECTIVE;
318 }
319
320 public function enabledWaitingList(): bool
321 {
322 return $this->waiting_list;
323 }
324
325 public function enableWaitingList(bool $a_status): void
326 {
327 $this->waiting_list = $a_status;
328 }
329
330 public function inSubscriptionTime(): bool
331 {
332 if ($this->getSubscriptionUnlimitedStatus()) {
333 return true;
334 }
335 if (time() > $this->getSubscriptionStart() and time() < $this->getSubscriptionEnd()) {
336 return true;
337 }
338 return false;
339 }
340
341 public function enableSessionLimit(int $a_status): void
342 {
343 $this->session_limit = $a_status;
344 }
345
346 public function isSessionLimitEnabled(): bool
347 {
348 return (bool) $this->session_limit;
349 }
350
351 public function enableSubscriptionMembershipLimitation(bool $a_status): void
352 {
353 $this->subscription_membership_limitation = $a_status;
354 }
355
356 public function setNumberOfPreviousSessions(int $a_num): void
357 {
358 $this->session_prev = $a_num;
359 }
360
362 {
363 return $this->session_prev;
364 }
365
366 public function setNumberOfNextSessions(int $a_num): void
367 {
368 $this->session_next = $a_num;
369 }
370
371 public function getNumberOfNextSessions(): int
372 {
373 return $this->session_next;
374 }
375
376 public function isSubscriptionMembershipLimited(): bool
377 {
379 }
380
382 {
384 }
385
386 public function setSubscriptionMaxMembers(int $a_value): void
387 {
388 $this->subscription_max_members = $a_value;
389 }
390
391 public static function _isSubscriptionNotificationEnabled(int $a_course_id): bool
392 {
393 global $DIC;
394
395 $ilDB = $DIC->database();
396 $query = "SELECT * FROM crs_settings " .
397 "WHERE obj_id = " . $ilDB->quote($a_course_id, 'integer') . " " .
398 "AND sub_notify = 1";
399 $res = $ilDB->query($query);
400 return (bool) $res->numRows();
401 }
402
403 public function getSubItems(
404 bool $a_admin_panel_enabled = false,
405 bool $a_include_side_block = false,
406 int $a_get_single = 0,
407 \ilContainerUserFilter $container_user_filter = null
408 ): array {
409 // Caching
410 if (isset($this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block])) {
411 return $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block];
412 }
413
414 // Results are stored in $this->items
415 parent::getSubItems($a_admin_panel_enabled, $a_include_side_block, $a_get_single);
416 $this->items = ilContainerSessionsContentGUI::prepareSessionPresentationLimitation(
417 $this->items,
418 $this,
419 $a_admin_panel_enabled,
420 $a_include_side_block
421 );
422 return $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block];
423 }
424
425 public function getSubscriptionNotify(): bool
426 {
427 return true;
428 }
429
430 public function setViewMode(int $a_mode): void
431 {
432 $this->view_mode = $a_mode;
433 }
434
435 public function getViewMode(): int
436 {
437 return $this->view_mode;
438 }
439
440 public static function lookupTimingMode(int $a_obj_id): int
441 {
442 global $DIC;
443
444 $ilDB = $DIC['ilDB'];
445
446 $query = 'SELECT timing_mode FROM crs_settings ' .
447 'WHERE obj_id = ' . $ilDB->quote($a_obj_id, 'integer');
448 $res = $ilDB->query($query);
449
450 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
451 return (int) $row->timing_mode;
452 }
454 }
455
456 public function setTimingMode(int $a_mode): void
457 {
458 $this->timing_mode = $a_mode;
459 }
460
461 public function getTimingMode(): int
462 {
463 return $this->timing_mode;
464 }
465
466 public static function _lookupViewMode(int $a_id): int
467 {
468 global $DIC;
469
470 $ilDB = $DIC['ilDB'];
471
472 $query = "SELECT view_mode FROM crs_settings WHERE obj_id = " . $ilDB->quote($a_id, 'integer') . " ";
473 $res = $ilDB->query($query);
474 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
475 return $row->view_mode;
476 }
477 return false;
478 }
479
480 public static function _lookupAboStatus(int $a_id): bool
481 {
482 global $DIC;
483
484 $ilDB = $DIC['ilDB'];
485
486 $query = "SELECT abo FROM crs_settings WHERE obj_id = " . $ilDB->quote($a_id, 'integer') . " ";
487 $res = $ilDB->query($query);
488 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
489 return $row->abo;
490 }
491 return false;
492 }
493
494 public function setAboStatus(bool $a_status): void
495 {
496 $this->abo = $a_status;
497 }
498
499 public function getAboStatus(): bool
500 {
501 return $this->abo;
502 }
503
504 public function setShowMembers(bool $a_status): void
505 {
506 $this->show_members = $a_status;
507 }
508
509 public function getShowMembers(): bool
510 {
511 return $this->show_members;
512 }
513
514 public function setMailToMembersType(int $a_type): void
515 {
516 $this->mail_members = $a_type;
517 }
518
519 public function getMailToMembersType(): int
520 {
521 return $this->mail_members;
522 }
523
524 public function getMessage(): string
525 {
526 return $this->message;
527 }
528
529 public function setMessage(string $a_message): void
530 {
531 $this->message = $a_message;
532 }
533
534 public function appendMessage(string $a_message): void
535 {
536 if ($this->getMessage()) {
537 $this->message .= "<br /> ";
538 }
539 $this->message .= $a_message;
540 }
541
542 public function isActivated(): bool
543 {
544 if ($this->getOfflineStatus()) {
545 return false;
546 }
547 if ($this->getActivationUnlimitedStatus()) {
548 return true;
549 }
550 if (time() < $this->getActivationStart() or
551 time() > $this->getActivationEnd()) {
552 return false;
553 }
554 return true;
555 }
556
560 public static function _isActivated(int $a_obj_id): bool
561 {
562 return ilObjCourseAccess::_isActivated($a_obj_id);
563 }
564
568 public static function _registrationEnabled(int $a_obj_id): bool
569 {
571 }
572
573 public function read(): void
574 {
575 parent::read();
576 $this->setOrderType(ilContainerSortingSettings::_lookupSortMode($this->getId()));
577 $this->__readSettings();
578 }
579
580 public function create($a_upload = false): int
581 {
582 global $DIC;
583
584 $ilAppEventHandler = $DIC['ilAppEventHandler'];
585
586 $id = parent::create($a_upload);
587
588 if (!$a_upload) {
589 $this->createMetaData();
590 }
591 $this->__createDefaultSettings();
592 $this->app_event_handler->raise(
593 'Modules/Course',
594 'create',
595 array('object' => $this,
596 'obj_id' => $this->getId(),
597 'appointments' => $this->prepareAppointments('create')
598 )
599 );
600
601 return $id;
602 }
603
604 public function setLatitude(string $a_latitude): void
605 {
606 $this->latitude = $a_latitude;
607 }
608
609 public function getLatitude(): string
610 {
611 return $this->latitude;
612 }
613
614 public function setLongitude(string $a_longitude): void
615 {
616 $this->longitude = $a_longitude;
617 }
618
619 public function getLongitude(): string
620 {
621 return $this->longitude;
622 }
623
624 public function setLocationZoom(int $a_locationzoom): void
625 {
626 $this->locationzoom = $a_locationzoom;
627 }
628
629 public function getLocationZoom(): int
630 {
631 return $this->locationzoom;
632 }
633
634 public function setEnableCourseMap(bool $a_enablemap): void
635 {
636 $this->enablemap = $a_enablemap;
637 }
638
639 public function getEnableMap(): bool
640 {
641 return $this->getEnableCourseMap();
642 }
643
644 public function getEnableCourseMap(): bool
645 {
646 return $this->enablemap;
647 }
648
649 public function setCoursePeriod(?ilDateTime $start = null, ?ilDateTime $end = null): void
650 {
651 if (
652 ($start instanceof \ilDate && !$end instanceof ilDate) ||
653 ($end instanceof \ilDate && !$start instanceof ilDate)
654 ) {
655 throw new InvalidArgumentException('Different date types not supported.');
656 }
657
658 if ($start instanceof \ilDate) {
659 $this->toggleCourseStartTimeIndication(false);
660 } else {
661 $this->toggleCourseStartTimeIndication(true);
662 }
663 $this->setCourseStart($start);
664 $this->setCourseEnd($end);
665 }
666
667 protected function toggleCourseStartTimeIndication(bool $time_indication): void
668 {
669 $this->course_start_time_indication = $time_indication;
670 }
671
672 public function getCourseStartTimeIndication(): bool
673 {
674 return $this->course_start_time_indication;
675 }
676
677 protected function setCourseStart(?ilDateTime $a_value = null): void
678 {
679 $this->crs_start = $a_value;
680 }
681
682 public function getCourseStart(): ?ilDateTime
683 {
684 return $this->crs_start;
685 }
686
687 protected function setCourseEnd(?ilDateTime $a_value = null): void
688 {
689 $this->crs_end = $a_value;
690 }
691
692 public function getCourseEnd(): ?ilDateTime
693 {
694 return $this->crs_end;
695 }
696
697 public function setCancellationEnd(?ilDate $a_value = null): void
698 {
699 $this->leave_end = $a_value;
700 }
701
702 public function getCancellationEnd(): ?ilDate
703 {
704 return $this->leave_end;
705 }
706
707 public function setSubscriptionMinMembers(int $a_value): void
708 {
709 if ($a_value !== null) {
710 $a_value = $a_value;
711 }
712 $this->min_members = $a_value;
713 }
714
716 {
717 return $this->min_members;
718 }
719
720 public function setWaitingListAutoFill(bool $a_value): void
721 {
722 $this->auto_fill_from_waiting = $a_value;
723 }
724
725 public function hasWaitingListAutoFill(): bool
726 {
727 return $this->auto_fill_from_waiting;
728 }
729
738 public function cloneObject(int $a_target_id, int $a_copy_id = 0, bool $a_omit_tree = false): ?ilObject
739 {
740 global $DIC;
741
742 $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
743
744 $this->cloneAutoGeneratedRoles($new_obj);
745 $this->cloneMetaData($new_obj);
746
747 $new_obj->getMemberObject()->add($this->user->getId(), ilParticipants::IL_CRS_ADMIN);
748 $new_obj->getMemberObject()->updateContact($this->user->getId(), 1);
749
750 $cwo = ilCopyWizardOptions::_getInstance($a_copy_id);
751 if ($cwo->isRootNode($this->getRefId())) {
752 $this->setOfflineStatus(true);
753 }
754
755 $this->cloneSettings($new_obj);
756 ilCourseDefinedFieldDefinition::_clone($this->getId(), $new_obj->getId());
757 ilCourseFile::_cloneFiles($this->getId(), $new_obj->getId());
758 $obj_settings = new ilLPObjSettings($this->getId());
759 $obj_settings->cloneSettings($new_obj->getId());
760 unset($obj_settings);
761 $pathFactory = new ilCertificatePathFactory();
762 $templateRepository = new ilCertificateTemplateDatabaseRepository($this->db);
763
764 $cloneAction = new ilCertificateCloneAction(
765 $this->db,
766 $pathFactory,
767 $templateRepository,
768 $DIC->filesystem()->web(),
769 null,
771 );
772 $cloneAction->cloneCertificate($this, $new_obj);
773
774 $book_service = new ilBookingService();
775 $book_service->cloneSettings($this->getId(), $new_obj->getId());
776
777 $badges = ilBadge::getInstancesByParentId($this->getId());
778 foreach ($badges as $badge) {
779 $badge->clone($new_obj->getId());
780 }
781
782 return $new_obj;
783 }
784
788 public function cloneDependencies(int $a_target_id, int $a_copy_id): bool
789 {
790 parent::cloneDependencies($a_target_id, $a_copy_id);
791
792 // Clone course start objects
793 $start = new ilContainerStartObjects($this->getRefId(), $this->getId());
794 $start->cloneDependencies($a_target_id, $a_copy_id);
795
796 // Clone course item settings
797 ilObjectActivation::cloneDependencies($this->getRefId(), $a_target_id, $a_copy_id);
798
799 // clone objective settings
800 ilLOSettings::cloneSettings($a_copy_id, $this->getId(), ilObject::_lookupObjId($a_target_id));
801
802 // Clone course learning objectives
803 $crs_objective = new ilCourseObjective($this);
804 $crs_objective->ilClone($a_target_id, $a_copy_id);
805
806 // clone membership limitation
807 foreach (\ilObjCourseGrouping::_getGroupings($this->getId()) as $grouping_id) {
808 $this->course_logger->info('Handling grouping id: ' . $grouping_id);
809 $grouping = new \ilObjCourseGrouping($grouping_id);
810 $grouping->cloneGrouping($a_target_id, $a_copy_id);
811 }
812 return true;
813 }
814
818 public function cloneAutoGeneratedRoles(ilObject $new_obj): void
819 {
820 $admin = $this->getDefaultAdminRole();
821 $new_admin = $new_obj->getDefaultAdminRole();
822
823 if (!$admin || !$new_admin || !$this->getRefId() || !$new_obj->getRefId()) {
824 $this->course_logger->debug('Error cloning auto generated role: il_crs_admin');
825 }
826 $this->rbac_admin->copyRolePermissions($admin, $this->getRefId(), $new_obj->getRefId(), $new_admin, true);
827 $this->course_logger->debug('Finished copying of role crs_admin.');
828
829 $tutor = $this->getDefaultTutorRole();
830 $new_tutor = $new_obj->getDefaultTutorRole();
831 if (!$tutor || !$new_tutor) {
832 $this->course_logger->info('Error cloning auto generated role: il_crs_tutor');
833 }
834 $this->rbac_admin->copyRolePermissions($tutor, $this->getRefId(), $new_obj->getRefId(), $new_tutor, true);
835 $this->course_logger->info('Finished copying of role crs_tutor.');
836
837 $member = $this->getDefaultMemberRole();
838 $new_member = $new_obj->getDefaultMemberRole();
839 if (!$member || !$new_member) {
840 $this->course_logger->debug('Error cloning auto generated role: il_crs_member');
841 }
842 $this->rbac_admin->copyRolePermissions($member, $this->getRefId(), $new_obj->getRefId(), $new_member, true);
843 $this->course_logger->debug('Finished copying of role crs_member.');
844 }
845
846 public function validate(): bool
847 {
848 $this->setMessage('');
849
850 if (($this->getSubscriptionLimitationType() == ilCourseConstants::IL_CRS_SUBSCRIPTION_LIMITED) and
851 $this->getSubscriptionStart() > $this->getSubscriptionEnd()) {
852 $this->appendMessage($this->lng->txt("subscription_times_not_valid"));
853 }
854 if ($this->getSubscriptionType() == ilCourseConstants::IL_CRS_SUBSCRIPTION_PASSWORD and !$this->getSubscriptionPassword()) {
855 $this->appendMessage($this->lng->txt("crs_password_required"));
856 }
857 if ($this->isSubscriptionMembershipLimited()) {
858 if ($this->getSubscriptionMinMembers() <= 0 && $this->getSubscriptionMaxMembers() <= 0) {
859 $this->appendMessage($this->lng->txt("crs_max_and_min_members_needed"));
860 }
861 if ($this->getSubscriptionMaxMembers() <= 0 && $this->enabledWaitingList()) {
862 $this->appendMessage($this->lng->txt("crs_max_members_needed"));
863 }
864 if ($this->getSubscriptionMaxMembers() > 0 && $this->getSubscriptionMinMembers() > $this->getSubscriptionMaxMembers()) {
865 $this->appendMessage($this->lng->txt("crs_max_and_min_members_invalid"));
866 }
867 }
868 if (!$this->getTitle() || !$this->getStatusDetermination()) {
869 $this->appendMessage($this->lng->txt('err_check_input'));
870 }
871 if (($this->getCourseStart() && !$this->getCourseEnd()) ||
872 (!$this->getCourseStart() && $this->getCourseEnd()) ||
873 ($this->getCourseStart() && $this->getCourseEnd() && $this->getCourseStart()->get(IL_CAL_UNIX) > $this->getCourseEnd()->get(IL_CAL_UNIX))) {
874 $this->appendMessage($this->lng->txt("crs_course_period_not_valid"));
875 }
876
877 return strlen($this->getMessage()) > 0;
878 }
879
880 public function validateInfoSettings(): bool
881 {
882 $error = false;
883 if ($this->getContactEmail()) {
884 $emails = explode(",", $this->getContactEmail());
885
886 foreach ($emails as $email) {
887 $email = trim($email);
889 $this->error->appendMessage($this->lng->txt('contact_email_not_valid') . " '" . $email . "'");
890 $error = true;
891 }
892 }
893 }
894 return !$error;
895 }
896
897 public function hasContactData(): bool
898 {
899 return strlen($this->getContactName()) || strlen($this->getContactResponsibility()) || strlen($this->getContactEmail()) || strlen($this->getContactPhone()) || strlen($this->getContactConsultation());
900 }
901
908 public function delete(): bool
909 {
910 // always call parent delete function first!!
911 if (!parent::delete()) {
912 return false;
913 }
914
915 // delete meta data
916 $this->deleteMetaData();
917
918 // put here course specific stuff
919
920 $this->__deleteSettings();
921
923
925
927
929
931
932 $this->app_event_handler->raise(
933 'Modules/Course',
934 'delete',
935 array('object' => $this,
936 'obj_id' => $this->getId(),
937 'appointments' => $this->prepareAppointments('delete')
938 )
939 );
940 return true;
941 }
942
946 public function update(): bool
947 {
948 $sorting = new ilContainerSortingSettings($this->getId());
949 $sorting->setSortMode($this->getOrderType());
950 $sorting->update();
951
952 $this->updateMetaData();
953 $this->updateSettings();
954 parent::update();
955
956 $this->app_event_handler->raise(
957 'Modules/Course',
958 'update',
959 array('object' => $this,
960 'obj_id' => $this->getId(),
961 'appointments' => $this->prepareAppointments('update')
962 )
963 );
964 return true;
965 }
966
969 public function updateSettings(): void
970 {
971 $query = "SELECT * FROM crs_settings WHERE obj_id = " . $this->db->quote($this->getId(), 'integer') . " ";
972 $res = $this->db->query($query);
973
974 if (!$res->numRows()) {
975 $this->__createDefaultSettings();
976 }
977
978 $query = "UPDATE crs_settings SET " .
979 "syllabus = " . $this->db->quote($this->getSyllabus(), 'text') . ", " .
980 "contact_name = " . $this->db->quote($this->getContactName(), 'text') . ", " .
981 "contact_responsibility = " . $this->db->quote($this->getContactResponsibility(), 'text') . ", " .
982 "contact_phone = " . $this->db->quote($this->getContactPhone(), 'text') . ", " .
983 "contact_email = " . $this->db->quote($this->getContactEmail(), 'text') . ", " .
984 "contact_consultation = " . $this->db->quote($this->getContactConsultation(), 'text') . ", " .
985 "activation_type = " . $this->db->quote(!$this->getOfflineStatus(), 'integer') . ", " .
986 "sub_limitation_type = " . $this->db->quote($this->getSubscriptionLimitationType(), 'integer') . ", " .
987 "sub_start = " . $this->db->quote($this->getSubscriptionStart(), 'integer') . ", " .
988 "sub_end = " . $this->db->quote($this->getSubscriptionEnd(), 'integer') . ", " .
989 "sub_type = " . $this->db->quote($this->getSubscriptionType(), 'integer') . ", " .
990 "sub_password = " . $this->db->quote($this->getSubscriptionPassword(), 'text') . ", " .
991 "sub_mem_limit = " . $this->db->quote((int) $this->isSubscriptionMembershipLimited(), 'integer') . ", " .
992 "sub_max_members = " . $this->db->quote($this->getSubscriptionMaxMembers(), 'integer') . ", " .
993 "sub_notify = " . $this->db->quote($this->getSubscriptionNotify(), 'integer') . ", " .
994 "view_mode = " . $this->db->quote($this->getViewMode(), 'integer') . ", " .
995 'timing_mode = ' . $this->db->quote($this->getTimingMode(), 'integer') . ', ' .
996 "abo = " . $this->db->quote($this->getAboStatus(), 'integer') . ", " .
997 "waiting_list = " . $this->db->quote($this->enabledWaitingList(), 'integer') . ", " .
998 "important = " . $this->db->quote($this->getImportantInformation(), 'text') . ", " .
999 'target_group = ' . $this->db->quote($this->getTargetGroup(), \ilDBConstants::T_TEXT) . ', ' .
1000 "show_members = " . $this->db->quote($this->getShowMembers(), 'integer') . ", " .
1001 "show_members_export = " . $this->db->quote($this->getShowMembersExport(), 'integer') . ", " .
1002 "latitude = " . $this->db->quote($this->getLatitude(), 'text') . ", " .
1003 "longitude = " . $this->db->quote($this->getLongitude(), 'text') . ", " .
1004 "location_zoom = " . $this->db->quote($this->getLocationZoom(), 'integer') . ", " .
1005 "enable_course_map = " . $this->db->quote((int) $this->getEnableCourseMap(), 'integer') . ", " .
1006 'session_limit = ' . $this->db->quote($this->isSessionLimitEnabled(), 'integer') . ', ' .
1007 'session_prev = ' . $this->db->quote($this->getNumberOfPreviousSessions(), 'integer') . ', ' .
1008 'session_next = ' . $this->db->quote($this->getNumberOfNextSessions(), 'integer') . ', ' .
1009 'reg_ac_enabled = ' . $this->db->quote($this->isRegistrationAccessCodeEnabled(), 'integer') . ', ' .
1010 'reg_ac = ' . $this->db->quote($this->getRegistrationAccessCode(), 'text') . ', ' .
1011 'auto_notification = ' . $this->db->quote((int) $this->getAutoNotification(), 'integer') . ', ' .
1012 'status_dt = ' . $this->db->quote($this->getStatusDetermination(), ilDBConstants::T_INTEGER) . ', ' .
1013 'mail_members_type = ' . $this->db->quote($this->getMailToMembersType(), 'integer') . ', ' .
1014 'period_start = ' . $this->db->quote(
1015 \ilCalendarUtil::convertDateToUtcDBTimestamp($this->getCourseStart()),
1017 ) . ', ' .
1018 'period_end = ' . $this->db->quote(
1019 \ilCalendarUtil::convertDateToUtcDBTimestamp($this->getCourseEnd()),
1021 ) . ', ' .
1022 'period_time_indication = ' . $this->db->quote(
1023 $this->getCourseStartTimeIndication() ? 1 : 0,
1025 ) . ', ' .
1026 'auto_wait = ' . $this->db->quote((int) $this->hasWaitingListAutoFill(), 'integer') . ', ' .
1027 'leave_end = ' . $this->db->quote(
1028 ($this->getCancellationEnd() && !$this->getCancellationEnd()->isNull()) ? $this->getCancellationEnd()->get(IL_CAL_UNIX) : null,
1029 'integer'
1030 ) . ', ' .
1031 'min_members = ' . $this->db->quote($this->getSubscriptionMinMembers(), 'integer') . ' ' .
1032 "WHERE obj_id = " . $this->db->quote($this->getId(), 'integer') . "";
1033
1034 $res = $this->db->manipulate($query);
1035
1036 // moved activation to ilObjectActivation
1037 if ($this->ref_id ?? false) {
1038 ilObjectActivation::getItem($this->ref_id);
1039
1040 $item = new ilObjectActivation();
1041 if (!$this->getActivationStart() || !$this->getActivationEnd()) {
1042 $item->setTimingType(ilObjectActivation::TIMINGS_DEACTIVATED);
1043 } else {
1044 $item->setTimingType(ilObjectActivation::TIMINGS_ACTIVATION);
1045 $item->setTimingStart($this->getActivationStart());
1046 $item->setTimingEnd($this->getActivationEnd());
1047 $item->toggleVisible($this->getActivationVisibility());
1048 }
1049 $item->update($this->ref_id);
1050 }
1051 }
1052
1053 public function cloneSettings(ilObject $new_obj): void
1054 {
1055 $new_obj->setSyllabus($this->getSyllabus());
1056 $new_obj->setContactName($this->getContactName());
1057 $new_obj->setContactResponsibility($this->getContactResponsibility());
1058 $new_obj->setContactPhone($this->getContactPhone());
1059 $new_obj->setContactEmail($this->getContactEmail());
1060 $new_obj->setContactConsultation($this->getContactConsultation());
1061 $new_obj->setOfflineStatus($this->getOfflineStatus()); // #9914
1062 $new_obj->setActivationStart($this->getActivationStart());
1063 $new_obj->setActivationEnd($this->getActivationEnd());
1064 $new_obj->setActivationVisibility($this->getActivationVisibility());
1065 $new_obj->setSubscriptionLimitationType($this->getSubscriptionLimitationType());
1066 $new_obj->setSubscriptionStart($this->getSubscriptionStart());
1067 $new_obj->setSubscriptionEnd($this->getSubscriptionEnd());
1068 $new_obj->setSubscriptionType($this->getSubscriptionType());
1069 $new_obj->setSubscriptionPassword($this->getSubscriptionPassword());
1070 $new_obj->enableSubscriptionMembershipLimitation($this->isSubscriptionMembershipLimited());
1071 $new_obj->setSubscriptionMaxMembers($this->getSubscriptionMaxMembers());
1072 $new_obj->setViewMode($this->getViewMode());
1073 $new_obj->setTimingMode($this->getTimingMode());
1074 $new_obj->setOrderType($this->getOrderType());
1075 $new_obj->setAboStatus($this->getAboStatus());
1076 $new_obj->enableWaitingList($this->enabledWaitingList());
1077 $new_obj->setImportantInformation($this->getImportantInformation());
1078 $new_obj->setTargetGroup($this->getTargetGroup());
1079 $new_obj->setShowMembers($this->getShowMembers());
1080 // patch mem_exp
1081 $new_obj->setShowMembersExport($this->getShowMembersExport());
1082 // patch mem_exp
1083 $new_obj->enableSessionLimit($this->isSessionLimitEnabled());
1084 $new_obj->setNumberOfPreviousSessions($this->getNumberOfPreviousSessions());
1085 $new_obj->setNumberOfNextSessions($this->getNumberOfNextSessions());
1086 $new_obj->setAutoNotification($this->getAutoNotification());
1087 $new_obj->enableRegistrationAccessCode($this->isRegistrationAccessCodeEnabled());
1088 $new_obj->setRegistrationAccessCode(ilMembershipRegistrationCodeUtils::generateCode());
1089 $new_obj->setStatusDetermination($this->getStatusDetermination());
1090 $new_obj->setMailToMembersType($this->getMailToMembersType());
1091 $new_obj->setCoursePeriod(
1092 $this->getCourseStart(),
1093 $this->getCourseEnd()
1094 );
1095 $new_obj->setCancellationEnd($this->getCancellationEnd());
1096 $new_obj->setWaitingListAutoFill($this->hasWaitingListAutoFill());
1097 $new_obj->setSubscriptionMinMembers($this->getSubscriptionMinMembers());
1098
1099 // #10271
1100 $new_obj->setEnableCourseMap($this->getEnableCourseMap());
1101 $new_obj->setLatitude($this->getLatitude());
1102 $new_obj->setLongitude($this->getLongitude());
1103 $new_obj->setLocationZoom($this->getLocationZoom());
1104
1105 $new_obj->update();
1106 }
1107
1108 public function __createDefaultSettings(): void
1109 {
1110 $this->setRegistrationAccessCode(ilMembershipRegistrationCodeUtils::generateCode());
1111
1112 $query = "INSERT INTO crs_settings (obj_id,syllabus,contact_name,contact_responsibility," .
1113 "contact_phone,contact_email,contact_consultation," .
1114 "sub_limitation_type,sub_start,sub_end,sub_type,sub_password,sub_mem_limit," .
1115 "sub_max_members,sub_notify,view_mode,timing_mode,abo," .
1116 "latitude,longitude,location_zoom,enable_course_map,waiting_list,show_members,show_members_export, " .
1117 "session_limit,session_prev,session_next, reg_ac_enabled, reg_ac, auto_notification, status_dt,mail_members_type) " .
1118 "VALUES( " .
1119 $this->db->quote($this->getId(), 'integer') . ", " .
1120 $this->db->quote($this->getSyllabus(), 'text') . ", " .
1121 $this->db->quote($this->getContactName(), 'text') . ", " .
1122 $this->db->quote($this->getContactResponsibility(), 'text') . ", " .
1123 $this->db->quote($this->getContactPhone(), 'text') . ", " .
1124 $this->db->quote($this->getContactEmail(), 'text') . ", " .
1125 $this->db->quote($this->getContactConsultation(), 'text') . ", " .
1126 $this->db->quote(ilCourseConstants::IL_CRS_SUBSCRIPTION_DEACTIVATED, 'integer') . ", " .
1127 $this->db->quote($this->getSubscriptionStart(), 'integer') . ", " .
1128 $this->db->quote($this->getSubscriptionEnd(), 'integer') . ", " .
1129 $this->db->quote(ilCourseConstants::IL_CRS_SUBSCRIPTION_DIRECT, 'integer') . ", " .
1130 $this->db->quote($this->getSubscriptionPassword(), 'text') . ", " .
1131 "0, " .
1132 $this->db->quote($this->getSubscriptionMaxMembers(), 'integer') . ", " .
1133 "1, " .
1134 "0, " .
1135 $this->db->quote(ilCourseConstants::IL_CRS_VIEW_TIMING_ABSOLUTE, 'integer') . ', ' .
1136 $this->db->quote($this->getAboStatus(), 'integer') . ", " .
1137 $this->db->quote($this->getLatitude(), 'text') . ", " .
1138 $this->db->quote($this->getLongitude(), 'text') . ", " .
1139 $this->db->quote($this->getLocationZoom(), 'integer') . ", " .
1140 $this->db->quote($this->getEnableCourseMap(), 'integer') . ", " .
1141 #"objective_view = '0', ".
1142 "1, " .
1143 "1," .
1144 '0,' .
1145 $this->db->quote($this->isSessionLimitEnabled(), 'integer') . ', ' .
1146 $this->db->quote($this->getNumberOfPreviousSessions(), 'integer') . ', ' .
1147 $this->db->quote($this->getNumberOfPreviousSessions(), 'integer') . ', ' .
1148 $this->db->quote($this->isRegistrationAccessCodeEnabled(), 'integer') . ', ' .
1149 $this->db->quote($this->getRegistrationAccessCode(), 'text') . ', ' .
1150 $this->db->quote((int) $this->getAutoNotification(), 'integer') . ', ' .
1151 $this->db->quote($this->getStatusDetermination(), 'integer') . ', ' .
1152 $this->db->quote($this->getMailToMembersType(), 'integer') . ' ' .
1153 ")";
1154
1155 $res = $this->db->manipulate($query);
1156 $this->__readSettings();
1157
1158 $sorting = new ilContainerSortingSettings($this->getId());
1159 $sorting->setSortMode(ilContainer::SORT_MANUAL);
1160 $sorting->update();
1161 }
1162
1163 public function __readSettings(): void
1164 {
1165 $query = "SELECT * FROM crs_settings WHERE obj_id = " . $this->db->quote($this->getId(), 'integer');
1166 $res = $this->db->query($query);
1167 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
1168 $this->setSyllabus((string) $row->syllabus);
1169 $this->setTargetGroup($row->target_group);
1170 $this->setContactName((string) $row->contact_name);
1171 $this->setContactResponsibility((string) $row->contact_responsibility);
1172 $this->setContactPhone((string) $row->contact_phone);
1173 $this->setContactEmail((string) $row->contact_email);
1174 $this->setContactConsultation((string) $row->contact_consultation);
1175 $this->setOfflineStatus(!(bool) $row->activation_type); // see below
1176 $this->setSubscriptionLimitationType((int) $row->sub_limitation_type);
1177 $this->setSubscriptionStart((int) $row->sub_start);
1178 $this->setSubscriptionEnd((int) $row->sub_end);
1179 $this->setSubscriptionType((int) $row->sub_type);
1180 $this->setSubscriptionPassword((string) $row->sub_password);
1181 $this->enableSubscriptionMembershipLimitation((bool) $row->sub_mem_limit);
1182 $this->setSubscriptionMaxMembers((int) $row->sub_max_members);
1183 $this->setViewMode((int) $row->view_mode);
1184 $this->setTimingMode((int) $row->timing_mode);
1185 $this->setAboStatus((bool) $row->abo);
1186 $this->enableWaitingList((bool) $row->waiting_list);
1187 $this->setImportantInformation((string) $row->important);
1188 $this->setShowMembers((bool) $row->show_members);
1189
1190 if (\ilPrivacySettings::getInstance()->participantsListInCoursesEnabled()) {
1191 $this->setShowMembersExport((bool) $row->show_members_export);
1192 } else {
1193 $this->setShowMembersExport(false);
1194 }
1195 $this->setLatitude((string) $row->latitude);
1196 $this->setLongitude((string) $row->longitude);
1197 $this->setLocationZoom((int) $row->location_zoom);
1198 $this->setEnableCourseMap((bool) $row->enable_course_map);
1199 $this->enableSessionLimit((int) $row->session_limit);
1200 $this->setNumberOfPreviousSessions((int) $row->session_prev);
1201 $this->setNumberOfNextSessions((int) $row->session_next);
1202 $this->enableRegistrationAccessCode((bool) $row->reg_ac_enabled);
1203 $this->setRegistrationAccessCode((string) $row->reg_ac);
1204 $this->setAutoNotification((bool) $row->auto_notification);
1205 $this->setStatusDetermination((int) $row->status_dt);
1206 $this->setMailToMembersType((int) $row->mail_members_type);
1207
1208 if ($row->period_time_indication) {
1209 $this->setCoursePeriod(
1210 new \ilDateTime($row->period_start, IL_CAL_DATETIME, \ilTimeZone::UTC),
1211 new \ilDateTime($row->period_end, IL_CAL_DATETIME, \ilTimeZone::UTC)
1212 );
1213 } elseif (!is_null($row->period_start) && !is_null($row->period_end)) {
1214 $this->setCoursePeriod(
1215 new \ilDate($row->period_start, IL_CAL_DATE),
1216 new \ilDate($row->period_end, IL_CAL_DATE)
1217 );
1218 }
1219 $this->toggleCourseStartTimeIndication((bool) $row->period_time_indication);
1220 $this->setCancellationEnd($row->leave_end ? new ilDate($row->leave_end, IL_CAL_UNIX) : null);
1221 $this->setWaitingListAutoFill((bool) $row->auto_wait);
1222 $this->setSubscriptionMinMembers((int) $row->min_members);
1223 }
1224
1225 // moved activation to ilObjectActivation
1226 if ($this->ref_id ?? false) {
1227 $activation = ilObjectActivation::getItem($this->ref_id);
1228 switch ($activation["timing_type"]) {
1230 $this->setActivationStart((int) $activation["timing_start"]);
1231 $this->setActivationEnd((int) $activation["timing_end"]);
1232 $this->setActivationVisibility((bool) $activation["visible"]);
1233 break;
1234 }
1235 }
1236 }
1237
1238 public function initWaitingList(): void
1239 {
1240 if (!$this->waiting_list_obj instanceof ilCourseWaitingList) {
1241 $this->waiting_list_obj = new ilCourseWaitingList($this->getId());
1242 }
1243 }
1244
1245 protected function initCourseMemberObject(): void
1246 {
1247 $this->member_obj = ilCourseParticipant::_getInstanceByObjId($this->getId(), $this->user->getId());
1248 }
1249
1250 protected function initCourseMembersObject(): void
1251 {
1252 $this->members_obj = ilCourseParticipants::_getInstanceByObjId($this->getId());
1253 }
1254
1256 {
1257 if (!$this->member_obj instanceof ilCourseParticipant) {
1258 $this->initCourseMemberObject();
1259 }
1260 return $this->member_obj;
1261 }
1262
1264 {
1265 if (!$this->members_obj instanceof ilCourseParticipants) {
1266 $this->initCourseMembersObject();
1267 }
1268 return $this->members_obj;
1269 }
1270
1271
1272 // RBAC METHODS
1273 public function initDefaultRoles(): void
1274 {
1276 'il_crs_admin_' . $this->getRefId(),
1277 "Admin of crs obj_no." . $this->getId(),
1278 'il_crs_admin',
1279 $this->getRefId()
1280 );
1282 'il_crs_tutor_' . $this->getRefId(),
1283 "Tutor of crs obj_no." . $this->getId(),
1284 'il_crs_tutor',
1285 $this->getRefId()
1286 );
1288 'il_crs_member_' . $this->getRefId(),
1289 "Member of crs obj_no." . $this->getId(),
1290 'il_crs_member',
1291 $this->getRefId()
1292 );
1293 }
1294
1302 public function setParentRolePermissions(int $a_parent_ref): bool
1303 {
1304 $parent_roles = $this->rbac_review->getParentRoleIds($a_parent_ref);
1305 foreach ($parent_roles as $parent_role) {
1306 $this->rbac_admin->initIntersectionPermissions(
1307 $this->getRefId(),
1308 $parent_role['obj_id'],
1309 $parent_role['parent'],
1310 $this->__getCrsNonMemberTemplateId(),
1312 );
1313 }
1314 return true;
1315 }
1316
1318 {
1319 $q = "SELECT obj_id FROM object_data WHERE type='rolt' AND title='il_crs_non_member'";
1320 $res = $this->ilias->db->query($q);
1321 $row = $res->fetchRow(ilDBConstants::FETCHMODE_ASSOC);
1322 return (int) $row["obj_id"];
1323 }
1324
1325 public static function lookupCourseNonMemberTemplatesId(): int
1326 {
1327 global $DIC;
1328
1329 $ilDB = $DIC->database();
1330
1331 $query = 'SELECT obj_id FROM object_data WHERE type = ' . $ilDB->quote(
1332 'rolt',
1333 'text'
1334 ) . ' AND title = ' . $ilDB->quote('il_crs_non_member', 'text');
1335 $res = $ilDB->query($query);
1336 $row = $res->fetchRow(ilDBConstants::FETCHMODE_ASSOC);
1337 return (int) $row['obj_id'];
1338 }
1339
1346 public function getLocalCourseRoles($a_translate = false): array
1347 {
1348 if (empty($this->local_roles)) {
1349 $this->local_roles = array();
1350 $role_arr = $this->rbac_review->getRolesOfRoleFolder($this->getRefId());
1351
1352 foreach ($role_arr as $role_id) {
1353 if ($this->rbac_review->isAssignable($role_id, $this->getRefId()) == true) {
1354 $role_Obj = ilObjectFactory::getInstanceByObjId($role_id);
1355 if ($a_translate) {
1356 $role_name = ilObjRole::_getTranslation($role_Obj->getTitle());
1357 } else {
1358 $role_name = $role_Obj->getTitle();
1359 }
1360 $this->local_roles[$role_name] = $role_Obj->getId();
1361 }
1362 }
1363 }
1364 return $this->local_roles;
1365 }
1366
1375 public function getDefaultCourseRoles(string $a_crs_id = ""): array
1376 {
1377 if (strlen($a_crs_id) > 0) {
1378 $crs_id = $a_crs_id;
1379 } else {
1380 $crs_id = $this->getRefId();
1381 }
1382
1383 $role_arr = $this->rbac_review->getRolesOfRoleFolder($crs_id);
1384
1385 $arr_crsDefaultRoles = [];
1386 foreach ($role_arr as $role_id) {
1387 $role_Obj = &$this->ilias->obj_factory->getInstanceByObjId($role_id);
1388
1389 $crs_Member = "il_crs_member_" . $crs_id;
1390 $crs_Admin = "il_crs_admin_" . $crs_id;
1391 $crs_Tutor = "il_crs_tutor_" . $crs_id;
1392
1393 if (strcmp($role_Obj->getTitle(), $crs_Member) == 0) {
1394 $arr_crsDefaultRoles["crs_member_role"] = $role_Obj->getId();
1395 }
1396
1397 if (strcmp($role_Obj->getTitle(), $crs_Admin) == 0) {
1398 $arr_crsDefaultRoles["crs_admin_role"] = $role_Obj->getId();
1399 }
1400
1401 if (strcmp($role_Obj->getTitle(), $crs_Tutor) == 0) {
1402 $arr_crsDefaultRoles["crs_tutor_role"] = $role_Obj->getId();
1403 }
1404 }
1405
1406 return $arr_crsDefaultRoles;
1407 }
1408
1412 public function __getLocalRoles(): array
1413 {
1414 return $this->rbac_review->getRolesOfRoleFolder($this->getRefId(), false);
1415 }
1416
1417 public function __deleteSettings(): void
1418 {
1419 $query = "DELETE FROM crs_settings " .
1420 "WHERE obj_id = " . $this->db->quote($this->getId(), 'integer') . " ";
1421 $this->db->manipulate($query);
1422 }
1423
1424 public function getDefaultMemberRole(): int
1425 {
1426 $local_roles = $this->__getLocalRoles();
1427 foreach ($local_roles as $role_id) {
1428 $title = ilObject::_lookupTitle($role_id);
1429 if (substr($title, 0, 8) == 'il_crs_m') {
1430 return $role_id;
1431 }
1432 }
1433 return 0;
1434 }
1435
1436 public function getDefaultTutorRole(): int
1437 {
1438 $local_roles = $this->__getLocalRoles();
1439 foreach ($local_roles as $role_id) {
1440 if ($tmp_role = ilObjectFactory::getInstanceByObjId($role_id, false)) {
1441 if (!strcmp($tmp_role->getTitle(), "il_crs_tutor_" . $this->getRefId())) {
1442 return $role_id;
1443 }
1444 }
1445 }
1446 return 0;
1447 }
1448
1449 public function getDefaultAdminRole(): int
1450 {
1451 $local_roles = $this->__getLocalRoles();
1452 foreach ($local_roles as $role_id) {
1453 if ($tmp_role = ilObjectFactory::getInstanceByObjId($role_id, false)) {
1454 if (!strcmp($tmp_role->getTitle(), "il_crs_admin_" . $this->getRefId())) {
1455 return $role_id;
1456 }
1457 }
1458 }
1459 return 0;
1460 }
1461
1462 public static function _deleteUser(int $a_usr_id): void
1463 {
1467 }
1468
1469 protected function doMDUpdateListener(string $a_element): void
1470 {
1471 switch ($a_element) {
1472 case 'General':
1473 // Update ecs content
1474 $ecs = new ilECSCourseSettings($this);
1475 $ecs->handleContentUpdate();
1476 break;
1477 }
1478 }
1479
1480 public function addAdditionalSubItemInformation(array &$object): void
1481 {
1483 }
1484
1488 protected function prepareAppointments(string $a_mode = 'create'): array
1489 {
1490 switch ($a_mode) {
1491 case 'create':
1492 case 'update':
1493 $apps = [];
1494 if (!$this->getActivationUnlimitedStatus() && !$this->getOfflineStatus()) {
1495 $app = new ilCalendarAppointmentTemplate(self::CAL_ACTIVATION_START);
1496 $app->setTitle($this->getTitle());
1497 $app->setSubtitle('crs_cal_activation_start');
1498 $app->setTranslationType(ilCalendarEntry::TRANSLATION_SYSTEM);
1499 $app->setDescription($this->getLongDescription());
1500 $app->setStart(new ilDateTime($this->getActivationStart(), IL_CAL_UNIX));
1501 $apps[] = $app;
1502
1503 $app = new ilCalendarAppointmentTemplate(self::CAL_ACTIVATION_END);
1504 $app->setTitle($this->getTitle());
1505 $app->setSubtitle('crs_cal_activation_end');
1506 $app->setTranslationType(ilCalendarEntry::TRANSLATION_SYSTEM);
1507 $app->setDescription($this->getLongDescription());
1508 $app->setStart(new ilDateTime($this->getActivationEnd(), IL_CAL_UNIX));
1509 $apps[] = $app;
1510 }
1511 if ($this->getSubscriptionLimitationType() == ilCourseConstants::IL_CRS_SUBSCRIPTION_LIMITED) {
1512 $app = new ilCalendarAppointmentTemplate(self::CAL_REG_START);
1513 $app->setTitle($this->getTitle());
1514 $app->setSubtitle('crs_cal_reg_start');
1515 $app->setTranslationType(ilCalendarEntry::TRANSLATION_SYSTEM);
1516 $app->setDescription($this->getLongDescription());
1517 $app->setStart(new ilDateTime($this->getSubscriptionStart(), IL_CAL_UNIX));
1518 $apps[] = $app;
1519
1520 $app = new ilCalendarAppointmentTemplate(self::CAL_REG_END);
1521 $app->setTitle($this->getTitle());
1522 $app->setSubtitle('crs_cal_reg_end');
1523 $app->setTranslationType(ilCalendarEntry::TRANSLATION_SYSTEM);
1524 $app->setDescription($this->getLongDescription());
1525 $app->setStart(new ilDateTime($this->getSubscriptionEnd(), IL_CAL_UNIX));
1526 $apps[] = $app;
1527 }
1528 if ($this->getCourseStart() && $this->getCourseEnd()) {
1529 $app = new ilCalendarAppointmentTemplate(self::CAL_COURSE_START);
1530 $app->setTitle($this->getTitle());
1531 $app->setSubtitle('crs_cal_start');
1532 $app->setTranslationType(ilCalendarEntry::TRANSLATION_SYSTEM);
1533 $app->setDescription($this->getLongDescription());
1534 $app->setStart($this->getCourseStart());
1535 $app->setFullday(!$this->getCourseStartTimeIndication());
1536 $apps[] = $app;
1537
1538 $app = new ilCalendarAppointmentTemplate(self::CAL_COURSE_END);
1539 $app->setTitle($this->getTitle());
1540 $app->setSubtitle('crs_cal_end');
1541 $app->setTranslationType(ilCalendarEntry::TRANSLATION_SYSTEM);
1542 $app->setDescription($this->getLongDescription());
1543 $app->setStart($this->getCourseEnd());
1544 $app->setFullday(!$this->getCourseStartTimeIndication());
1545 $apps[] = $app;
1546 }
1547 if (
1548 $this->getViewMode() == ilCourseConstants::IL_CRS_VIEW_TIMING
1549 ) {
1550 $active = ilObjectActivation::getTimingsItems($this->getRefId());
1551 foreach ($active as $null => $item) {
1552 if ($item['timing_type'] == ilObjectActivation::TIMINGS_PRESETTING) {
1553 // create calendar entry for fixed types
1554 $app = new ilCalendarAppointmentTemplate(self::CAL_COURSE_TIMING_START);
1555 $app->setContextInfo($item['ref_id']);
1556 $app->setTitle($item['title']);
1557 $app->setSubtitle('cal_crs_timing_start');
1558 $app->setTranslationType(ilCalendarEntry::TRANSLATION_SYSTEM);
1559 $app->setStart(new ilDate($item['suggestion_start'], IL_CAL_UNIX));
1560 $app->setFullday(true);
1561 $apps[] = $app;
1562
1563 $app = new ilCalendarAppointmentTemplate(self::CAL_COURSE_TIMING_END);
1564 $app->setContextInfo($item['ref_id']);
1565 $app->setTitle($item['title']);
1566 $app->setSubtitle('cal_crs_timing_end');
1567 $app->setTranslationType(ilCalendarEntry::TRANSLATION_SYSTEM);
1568 $app->setStart(new ilDate($item['suggestion_end'], IL_CAL_UNIX));
1569 $app->setFullday(true);
1570 $apps[] = $app;
1571 }
1572 }
1573 }
1574 return $apps;
1575
1576 case 'delete':
1577 // Nothing to do: The category and all assigned appointments will be deleted.
1578 return array();
1579 }
1580 return [];
1581 }
1582
1587 public static function lookupObjectsByCode(string $a_code): array
1588 {
1589 global $DIC;
1590
1591 $ilDB = $DIC->database();
1592
1593 $query = "SELECT obj_id FROM crs_settings " .
1594 "WHERE reg_ac_enabled = " . $ilDB->quote(1, 'integer') . " " .
1595 "AND reg_ac = " . $ilDB->quote($a_code, 'text');
1596 $res = $ilDB->query($query);
1597
1598 $obj_ids = array();
1599 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
1600 $obj_ids[] = (int) $row->obj_id;
1601 }
1602 return $obj_ids;
1603 }
1604
1609 public function register(
1610 int $a_user_id,
1611 int $a_role = ilCourseConstants::CRS_MEMBER,
1612 bool $a_force_registration = false
1613 ): void {
1614 if ($this->getMembersObject()->isAssigned($a_user_id)) {
1615 return;
1616 }
1617
1618 if (!$a_force_registration) {
1619 // offline
1620 if (ilObjCourseAccess::_isOffline($this->getId())) {
1622 "Can't register to course, course is offline.",
1624 );
1625 }
1626 // activation
1627 if (!ilObjCourseAccess::_isActivated($this->getId())) {
1629 "Can't register to course, course is not activated.",
1631 );
1632 }
1633
1634 if ($this->getSubscriptionLimitationType() == ilCourseConstants::IL_CRS_SUBSCRIPTION_DEACTIVATED) {
1637 'Cant registrate to course ' . $this->getId() .
1638 ', course subscription is deactivated.',
1640 );
1641 }
1642 }
1643
1644 // Time Limitation
1645 if ($this->getSubscriptionLimitationType() == ilCourseConstants::IL_CRS_SUBSCRIPTION_LIMITED) {
1646 if (!$this->inSubscriptionTime()) {
1648 'Cant registrate to course ' . $this->getId() .
1649 ', course is out of registration time.',
1651 );
1652 }
1653 }
1654
1655 // Max members
1656 if ($this->isSubscriptionMembershipLimited()) {
1657 $free = max(0, $this->getSubscriptionMaxMembers() - $this->getMembersObject()->getCountMembers());
1658 $waiting_list = new ilCourseWaitingList($this->getId());
1659 if ($this->enabledWaitingList() && (!$free || $waiting_list->getCountUsers())) {
1660 $waiting_list->addToList($a_user_id);
1661 $this->lng->loadLanguageModule("crs");
1662 $info = sprintf(
1663 $this->lng->txt('crs_added_to_list'),
1664 $waiting_list->getPosition($a_user_id)
1665 );
1666 $participants = ilCourseParticipants::_getInstanceByObjId($this->getId());
1667 $participants->sendNotification(
1669 $a_user_id
1670 );
1671
1673 $info,
1675 );
1676 }
1677
1678 if (!$this->enabledWaitingList() && !$free) {
1679 throw new ilMembershipRegistrationException('Cant registrate to course ' . $this->getId() .
1680 ', membership is limited.', ilMembershipRegistrationException::OBJECT_IS_FULL);
1681 }
1682 }
1683 }
1684
1685 $this->getMembersObject()->add($a_user_id, $a_role);
1686 $this->getMembersObject()->sendNotification(ilCourseMembershipMailNotification::TYPE_ADMISSION_MEMBER, $a_user_id);
1687 $this->getMembersObject()->sendNotification(ilCourseMembershipMailNotification::TYPE_NOTIFICATION_ADMINS, $a_user_id);
1688 ilForumNotification::checkForumsExistsInsert($this->getRefId(), $a_user_id);
1689 }
1690
1695 public function getAutoNotification(): bool
1696 {
1697 return $this->auto_notification;
1698 }
1699
1704 public function setAutoNotification(bool $value): void
1705 {
1706 $this->auto_notification = $value;
1707 }
1708
1712 public function setStatusDetermination(int $a_value): void
1713 {
1714 $a_value = $a_value;
1715
1716 // #13905
1717 if ($a_value == self::STATUS_DETERMINATION_LP) {
1719 $a_value = self::STATUS_DETERMINATION_MANUAL;
1720 }
1721 }
1722
1723 $this->status_dt = $a_value;
1724 }
1725
1729 public function getStatusDetermination(): int
1730 {
1731 return $this->status_dt;
1732 }
1733
1734 public function syncMembersStatusWithLP(): void
1735 {
1736 foreach ($this->getMembersObject()->getParticipants() as $user_id) {
1737 // #15529 - force raise on sync
1738 ilLPStatusWrapper::_updateStatus($this->getId(), $user_id, null, false, true);
1739 }
1740 }
1741
1746 public function checkLPStatusSync(int $a_member_id): void
1747 {
1748 // #11113
1750 $this->getStatusDetermination() == ilObjCourse::STATUS_DETERMINATION_LP) {
1751 // #13811 - we need to suppress creation if status entry
1752 $has_completed = (ilLPStatus::_lookupStatus(
1753 $this->getId(),
1754 $a_member_id,
1755 false
1757 $this->getMembersObject()->updatePassed($a_member_id, $has_completed, false, true);
1758 }
1759 }
1760
1761 public function getOrderType(): int
1762 {
1763 if ($this->enabledObjectiveView()) {
1765 }
1766 return parent::getOrderType();
1767 }
1768
1772 public function handleAutoFill(): void
1773 {
1774 if (
1775 !$this->enabledWaitingList() || !$this->hasWaitingListAutoFill()
1776 ) {
1777 $this->course_logger->debug('Waiting list or auto fill disabled.');
1778 return;
1779 }
1780
1781 $max = $this->getSubscriptionMaxMembers();
1782 $now = ilCourseParticipants::lookupNumberOfMembers($this->getRefId());
1783
1784 $this->course_logger->debug('Max members: ' . $max);
1785 $this->course_logger->debug('Current members: ' . $now);
1786
1787 if ($max <= $now) {
1788 return;
1789 }
1790
1791 // see assignFromWaitingListObject()
1792 $waiting_list = new ilCourseWaitingList($this->getId());
1793
1794 foreach ($waiting_list->getUserIds() as $user_id) {
1795 if (!$tmp_obj = ilObjectFactory::getInstanceByObjId($user_id, false)) {
1796 $this->course_logger->warning('Cannot create user instance for id: ' . $user_id);
1797 continue;
1798 }
1799 if ($this->getMembersObject()->isAssigned($user_id)) {
1800 $this->course_logger->warning('User is already assigned to course. uid: ' . $user_id . ' course_id: ' . $this->getRefId());
1801 continue;
1802 }
1803 $this->getMembersObject()->add($user_id, ilParticipants::IL_CRS_MEMBER);
1804 $this->getMembersObject()->sendNotification(ilCourseMembershipMailNotification::TYPE_ADMISSION_MEMBER, $user_id, true);
1805 $waiting_list->removeFromList($user_id);
1806 $this->checkLPStatusSync($user_id);
1807
1808 $this->course_logger->info('Assigned user from waiting list to course: ' . $this->getTitle());
1809 $now++;
1810 if ($now >= $max) {
1811 break;
1812 }
1813 }
1814 }
1815
1816 public static function mayLeave(int $a_course_id, int $a_user_id = 0, &$a_date = null): bool
1817 {
1818 global $DIC;
1819
1820 $ilUser = $DIC['ilUser'];
1821 $ilDB = $DIC['ilDB'];
1822
1823 if (!$a_user_id) {
1824 $a_user_id = $ilUser->getId();
1825 }
1826
1827 $set = $ilDB->query("SELECT leave_end" .
1828 " FROM crs_settings" .
1829 " WHERE obj_id = " . $ilDB->quote($a_course_id, "integer"));
1830 $row = $ilDB->fetchAssoc($set);
1831 if ($row && $row["leave_end"]) {
1832 // timestamp to date
1833 $limit = date("Ymd", $row["leave_end"]);
1834 if ($limit < date("Ymd")) {
1835 $a_date = new ilDate(date("Y-m-d", $row["leave_end"]), IL_CAL_DATE);
1836 return false;
1837 }
1838 }
1839 return true;
1840 }
1841
1842 public static function findCoursesWithNotEnoughMembers(): array
1843 {
1844 $ilDB = $GLOBALS['DIC']->database();
1845 $tree = $GLOBALS['DIC']->repositoryTree();
1846
1847 $res = array();
1848
1849 $before = new ilDateTime(time(), IL_CAL_UNIX);
1850 $now = $before->get(IL_CAL_UNIX);
1851 $now_dt = $before->get(IL_CAL_DATETIME, '', ilTimeZone::UTC);
1852
1853 $set = $ilDB->query("SELECT obj_id, min_members" .
1854 " FROM crs_settings" .
1855 " WHERE min_members > " . $ilDB->quote(0, "integer") .
1856 " AND sub_mem_limit = " . $ilDB->quote(1, "integer") . // #17206
1857 " AND ((leave_end IS NOT NULL" .
1858 " AND leave_end < " . $ilDB->quote($now, "text") . ")" .
1859 " OR (leave_end IS NULL" .
1860 " AND sub_end IS NOT NULL" .
1861 " AND sub_end < " . $ilDB->quote($now, "text") . "))" .
1862 " AND (period_start IS NULL OR period_start > " . $ilDB->quote($now_dt, ilDBConstants::T_TEXT) . ")");
1863 while ($row = $ilDB->fetchAssoc($set)) {
1864 $refs = ilObject::_getAllReferences((int) $row['obj_id']);
1865 $ref = end($refs);
1866
1867 if ($tree->isDeleted($ref)) {
1868 continue;
1869 }
1870
1871 $part = new ilCourseParticipants((int) $row["obj_id"]);
1872 $reci = $part->getNotificationRecipients();
1873 if ($reci !== []) {
1874 $missing = (int) $row["min_members"] - $part->getCountMembers();
1875 if ($missing > 0) {
1876 $res[(int) $row["obj_id"]] = array($missing, $reci);
1877 }
1878 }
1879 }
1880
1881 return $res;
1882 }
1883} //END class.ilObjCourse
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
const IL_CAL_DATE
const IL_CAL_UNIX
const IL_CAL_DATETIME
error(string $a_errmsg)
static getInstancesByParentId(int $a_parent_id, array $a_filter=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Apointment templates are used for automatic generated apointments.
static convertDateToUtcDBTimestamp(\ilDateTime $date=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getInstance(int $a_copy_id)
static _clone(int $a_source_id, int $a_target_id)
static _deleteByCourse(int $a_course_id)
static _cloneFiles(int $a_source_id, int $a_target_id)
static _deleteUser(int $a_usr_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _deleteAll(int $course_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getInstanceByObjId(int $a_obj_id, int $a_usr_id)
static _getInstanceByObjId(int $a_obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
@classDescription Date and time handling
Class for single dates.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static checkForumsExistsInsert(int $ref_id, int $user_id)
static cloneSettings(int $a_copy_id, int $a_container_id, int $a_new_container_id)
static deleteResultsForUser(int $a_user_id)
static _updateStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null, bool $a_percentage=false, bool $a_force_raise=false)
const LP_STATUS_COMPLETED_NUM
static _lookupStatus(int $a_obj_id, int $a_user_id, bool $a_create=true)
Lookup status.
Component logger with individual log levels by component id.
static generateCode()
Generate new registration key.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _registrationEnabled(int $a_obj_id)
static _isActivated(int $a_obj_id, ?bool &$a_visible_flag=null, bool $a_mind_member_view=true)
static _isOffline(int $obj_id)
Type-specific implementation of general status, has to be overwritten if object type does not support...
static _deleteAll(int $a_course_id)
static _getGroupings(int $a_course_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static lookupCourseNonMemberTemplatesId()
static _lookupAboStatus(int $a_id)
ilCourseWaitingList $waiting_list_obj
setSubscriptionMaxMembers(int $a_value)
setLongitude(string $a_longitude)
static _deleteUser(int $a_usr_id)
static _lookupViewMode(int $a_id)
__construct(int $a_id=0, bool $a_call_by_reference=true)
const STATUS_DETERMINATION_MANUAL
checkLPStatusSync(int $a_member_id)
sync course status from lp as lp data is not deleted on course exit new members may already have lp c...
bool $reg_access_code_enabled
prepareAppointments(string $a_mode='create')
Prepare calendar appointments.
ilCourseParticipants $members_obj
enableSubscriptionMembershipLimitation(bool $a_status)
setTargetGroup(?string $a_tg)
setSubscriptionLimitationType(int $a_type)
setNumberOfPreviousSessions(int $a_num)
bool $auto_fill_from_waiting
setContactEmail(string $a_value)
cloneObject(int $a_target_id, int $a_copy_id=0, bool $a_omit_tree=false)
Clone course (no member data)
const STATUS_DETERMINATION_LP
static lookupObjectsByCode(string $a_code)
setCoursePeriod(?ilDateTime $start=null, ?ilDateTime $end=null)
appendMessage(string $a_message)
ilDateTime $crs_start
static lookupShowMembersEnabled(int $a_obj_id)
setContactPhone(string $a_value)
string $reg_access_code
ilLogger $course_logger
bool $activation_visibility
setImportantInformation(string $a_info)
getDefaultCourseRoles(string $a_crs_id="")
get default course roles, returns the defaultlike create roles il_crs_tutor, il_crs_admin and il_crs_...
setShowMembersExport(bool $a_mem_export)
handleAutoFill()
Handle course auto fill.
update()
@inheritDoc
enableSessionLimit(int $a_status)
initDefaultRoles()
init default roles settings Purpose of this function is to create a local role folder and local roles...
cloneSettings(ilObject $new_obj)
setSubscriptionEnd(int $a_value)
setActivationVisibility(bool $a_value)
getLocalCourseRoles($a_translate=false)
get ALL local roles of course, also those created and defined afterwards only fetch data once from da...
setParentRolePermissions(int $a_parent_ref)
This method is called before "initDefaultRoles".
setLatitude(string $a_latitude)
int $subscription_max_members
enableRegistrationAccessCode(bool $a_status)
bool $subscription_membership_limitation
static _isSubscriptionNotificationEnabled(int $a_course_id)
setViewMode(int $a_mode)
setCourseStart(?ilDateTime $a_value=null)
static lookupTimingMode(int $a_obj_id)
getSubItems(bool $a_admin_panel_enabled=false, bool $a_include_side_block=false, int $a_get_single=0, \ilContainerUserFilter $container_user_filter=null)
setTimingMode(int $a_mode)
setContactConsultation(string $a_value)
doMDUpdateListener(string $a_element)
static findCoursesWithNotEnoughMembers()
setSubscriptionPassword(string $a_value)
setContactName(string $a_cn)
cloneDependencies(int $a_target_id, int $a_copy_id)
@inheritDoc
setNumberOfNextSessions(int $a_num)
create($a_upload=false)
setMailToMembersType(int $a_type)
static _registrationEnabled(int $a_obj_id)
Registration enabled? Method is in Access class, since it is needed by Access/ListGUI.
string $contact_responsibility
toggleCourseStartTimeIndication(bool $time_indication)
int $subscription_limitation_type
addAdditionalSubItemInformation(array &$object)
Add additional information to sub item, e.g.
setCourseEnd(?ilDateTime $a_value=null)
setActivationEnd(int $a_value)
const CAL_ACTIVATION_START
const CAL_COURSE_TIMING_START
static _isActivated(int $a_obj_id)
Is activated.
setSubscriptionStart(int $a_value)
setActivationStart(int $a_value)
setSubscriptionType(int $a_value)
setSyllabus(string $a_syllabus)
setMessage(string $a_message)
bool $crs_start_time_indication
setAboStatus(bool $a_status)
getStatusDetermination()
Get status determination mode.
ilDateTime $crs_end
static mayLeave(int $a_course_id, int $a_user_id=0, &$a_date=null)
setShowMembers(bool $a_status)
setEnableCourseMap(bool $a_enablemap)
bool $course_start_time_indication
string $contact_consultation
ilCourseParticipant $member_obj
setStatusDetermination(int $a_value)
Set status determination mode.
setLocationZoom(int $a_locationzoom)
setRegistrationAccessCode(string $a_code)
setCancellationEnd(?ilDate $a_value=null)
const CAL_COURSE_TIMING_END
string $subscription_password
setWaitingListAutoFill(bool $a_value)
const CAL_ACTIVATION_END
enableWaitingList(bool $a_status)
setContactResponsibility(string $a_value)
cloneAutoGeneratedRoles(ilObject $new_obj)
Clone automatic genrated roles (permissions and template permissions)
setSubscriptionMinMembers(int $a_value)
getAutoNotification()
Returns automatic notification status from $this->auto_notification.
setAutoNotification(bool $value)
Sets automatic notification status in $this->auto_notification, using given $status.
static createDefaultRole(string $a_title, string $a_description, string $a_tpl_name, int $a_ref_id)
static _getTranslation(string $a_role_title)
static getUserIdByLogin(string $a_login)
Class ilObjectActivation.
static cloneDependencies(int $ref_id, int $target_id, int $copy_id)
static getTimingsItems(int $container_ref_id)
Get (sub) item data for timings view (no session material, no side blocks)
static getItem(int $ref_id)
static addAdditionalSubItemInformation(array &$item)
Parse item data for list entries.
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getAllReferences(int $id)
get all reference ids for object ID
setOfflineStatus(bool $status)
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
static lookupNumberOfMembers(int $a_ref_id)
Lookup number of members.
static _deleteAllEntries(int $a_obj_id)
Delete all entries Normally called in case of object deletion.
static _deleteUser(int $a_usr_id)
Delete user data.
static is_email(string $a_email, ilMailRfc822AddressParserFactory $mailAddressParserFactory=null)
This preg-based function checks whether an e-mail address is formally valid.
$app
Definition: cli.php:39
if(!file_exists(getcwd() . '/ilias.ini.php'))
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: confirmReg.php:20
const ROLE_FOLDER_ID
Definition: constants.php:34
global $DIC
Definition: feed.php:28
$ilUser
Definition: imgupload.php:34
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$res
Definition: ltiservices.php:69
if( $orgName !==null) if($spconfig->hasValue('contacts')) $email
Definition: metadata.php:302
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
header include for all ilias files.
$query
$message
Definition: xapiexit.php:32