ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilObjGroupGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22use ILIAS\News\Service as News;
26use ILIAS\User\Profile\Data as ProfileData;
27
49{
50 protected bool $show_tracking = false;
51
52 protected Factory $refinery;
54 protected News $news;
55 protected Profile $profile;
56
60 public function __construct($a_data, int $a_id, bool $a_call_by_reference, bool $a_prepare_output = false)
61 {
62 global $DIC;
63
64 $this->type = "grp";
65 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
66
67 $this->lng->loadLanguageModule('grp');
68 $this->lng->loadLanguageModule('obj');
69 $this->refinery = $DIC->refinery();
70 $this->rbacsystem = $DIC->rbac()->system();
71 $this->news = $DIC->news();
72 $this->profile = $DIC['user']->getProfile();
73 }
74
75 protected function initRefIdFromQuery(): int
76 {
77 if ($this->http->wrapper()->query()->has('ref_id')) {
78 return $this->http->wrapper()->query()->retrieve(
79 'ref_id',
80 $this->refinery->kindlyTo()->int()
81 );
82 }
83 return 0;
84 }
85
89 public function executeCommand(): void
90 {
91 global $DIC;
92
93 $ilNavigationHistory = $DIC['ilNavigationHistory'];
94
95 $ref_id = $this->initRefIdFromQuery();
96
97 $next_class = $this->ctrl->getNextClass($this);
98 $cmd = $this->ctrl->getCmd();
99 $this->prepareOutput();
100
101 // add entry to navigation history
102 if (!$this->getCreationMode() && $this->access->checkAccess("read", "", $ref_id)) {
103 $ilNavigationHistory->addItem(
104 $ref_id,
105 ilLink::_getLink($ref_id, "grp"),
106 "grp"
107 );
108 }
109
110 // if news timeline is landing page, redirect if necessary
111 if ($next_class == "" && $cmd == "" && $this->object->isNewsTimelineLandingPageEffective()
112 && $this->access->checkAccess("read", "", $ref_id)) {
113 $this->ctrl->redirectByClass("ilnewstimelinegui");
114 }
115
116 $header_action = true;
117 switch ($next_class) {
118 case strtolower(ilRepositoryTrashGUI::class):
119 $ru = new \ilRepositoryTrashGUI($this);
120 $this->ctrl->setReturn($this, 'trash');
121 $this->ctrl->forwardCommand($ru);
122 break;
123
124 case 'illtiproviderobjectsettinggui':
125 $this->setSubTabs('settings');
126 $this->tabs_gui->activateTab('settings');
127 $this->tabs_gui->activateSubTab('lti_provider');
128 $lti_gui = new ilLTIProviderObjectSettingGUI($this->object->getRefId());
129 $lti_gui->setCustomRolesForSelection($GLOBALS['DIC']->rbac()->review()->getLocalRoles($this->object->getRefId()));
130 $lti_gui->offerLTIRolesForSelection(false);
131 $this->ctrl->forwardCommand($lti_gui);
132 break;
133
134
135 case 'ilgroupmembershipgui':
136
137 $this->tabs_gui->activateTab('members');
138
139 $mem_gui = new ilGroupMembershipGUI($this, $this->object);
140 $this->ctrl->forwardCommand($mem_gui);
141 break;
142
143
144 case 'ilgroupregistrationgui':
145 $this->ctrl->setReturn($this, '');
146 $this->tabs_gui->setTabActive('join');
147 $registration = new ilGroupRegistrationGUI($this->object);
148 $this->ctrl->forwardCommand($registration);
149 break;
150
151 case 'ilpermissiongui':
152 $this->tabs_gui->activateTab('perm_settings');
153 $perm_gui = new ilPermissionGUI($this);
154 $this->ctrl->forwardCommand($perm_gui);
155 break;
156
157 case "ilinfoscreengui":
158 $this->infoScreen();
159 break;
160
161 case "illearningprogressgui":
162 $user_id = $this->user->getId();
163 if ($this->http->wrapper()->query()->has('user_id')) {
164 $user_id = $this->http->wrapper()->query()->retrieve(
165 'user_id',
166 $this->refinery->kindlyTo()->int()
167 );
168 }
169 $new_gui = new ilLearningProgressGUI(
171 $this->object->getRefId(),
173 );
174 $this->ctrl->forwardCommand($new_gui);
175 $this->tabs_gui->setTabActive('learning_progress');
176 break;
177
178 case 'ilobjcoursegroupinggui':
179 $this->setSubTabs('settings');
180 $this->ctrl->setReturn($this, 'edit');
181 $obj_id = 0;
182 if ($this->http->wrapper()->query()->has('obj_id')) {
183 $obj_id = $this->http->wrapper()->query()->retrieve(
184 'obj_id',
185 $this->refinery->kindlyTo()->int()
186 );
187 }
188 $crs_grp_gui = new ilObjCourseGroupingGUI($this->object, $obj_id);
189 $this->ctrl->forwardCommand($crs_grp_gui);
190 $this->tabs_gui->setTabActive('settings');
191 $this->tabs_gui->setSubTabActive('groupings');
192 break;
193
194 case 'ilcoursecontentgui':
195 $course_content_obj = new ilCourseContentGUI($this);
196 $this->ctrl->forwardCommand($course_content_obj);
197 break;
198
199 case strtolower(PublicProfileGUI::class):
200 $this->setSubTabs('members');
201 $this->tabs_gui->setTabActive('group_members');
202 $this->tabs_gui->setSubTabActive('grp_members_gallery');
203 $usr_id = 0;
204 if ($this->http->wrapper()->query()->has('user')) {
205 $usr_id = $this->http->wrapper()->query()->retrieve(
206 'user',
207 $this->refinery->kindlyTo()->int()
208 );
209 }
210 $profile_gui = new PublicProfileGUI($usr_id);
211 $back_url = '';
212 if ($this->http->wrapper()->query()->has('back_url')) {
213 $back_url = $this->http->wrapper()->query()->retrieve(
214 'back_url',
215 $this->refinery->kindlyTo()->string()
216 );
217 }
218 if ($back_url == '') {
219 $profile_gui->setBackUrl($this->ctrl->getLinkTargetByClass(["ilGroupMembershipGUI", "ilUsersGalleryGUI"], 'view'));
220 }
221 $html = $this->ctrl->forwardCommand($profile_gui);
222 $this->tpl->setVariable("ADM_CONTENT", $html);
223 break;
224
225 case "ilcolumngui":
226 $this->tabs_gui->setTabActive('none');
227 $this->checkPermission("read");
228 $this->tpl->setVariable(
229 "LOCATION_CONTENT_STYLESHEET",
230 ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId())
231 );
232 $this->renderObject();
233 break;
234
235 // container page editing
236 case "ilcontainerpagegui":
237 $ret = $this->forwardToPageObject();
238 if ($ret != "") {
239 $this->tpl->setContent($ret);
240 }
241 $header_action = false;
242 break;
243
244 case 'ilobjectcopygui':
245 $cp = new ilObjectCopyGUI($this);
246 $cp->setType('grp');
247 $this->ctrl->forwardCommand($cp);
248 break;
249
250 case "ilobjectcontentstylesettingsgui":
251 global $DIC;
252
253 $this->checkPermission("write");
254 $this->setTitleAndDescription();
255 $this->showContainerPageTabs();
256 $settings_gui = $DIC->contentStyle()->gui()
257 ->objectSettingsGUIForRefId(
258 null,
259 $this->object->getRefId()
260 );
261 $this->ctrl->forwardCommand($settings_gui);
262 break;
263
264 case 'ilobjectcustomuserfieldsgui':
265 $cdf_gui = new ilObjectCustomUserFieldsGUI($this->object->getId());
266 $this->setSubTabs('settings');
267 $this->tabs_gui->setTabActive('settings');
268 $this->tabs_gui->activateSubTab('grp_custom_user_fields');
269 $this->ctrl->forwardCommand($cdf_gui);
270 break;
271
272 case 'ilmemberagreementgui':
273 $this->ctrl->setReturn($this, '');
274 $this->tabs_gui->setTabActive('view_content');
275 $agreement = new ilMemberAgreementGUI($this->object->getRefId());
276 $this->ctrl->forwardCommand($agreement);
277 break;
278
279 case 'ilexportgui':
280 $this->tabs_gui->setTabActive('export');
281 $exp = new ilExportGUI($this);
282 $exp->addFormat('xml');
283 $this->ctrl->forwardCommand($exp);
284 break;
285
286 case "ilcommonactiondispatchergui":
288 $this->ctrl->forwardCommand($gui);
289 break;
290
291 case 'ilobjectservicesettingsgui':
292 $this->ctrl->setReturn($this, 'edit');
293 $this->setSubTabs("settings");
294 $this->tabs_gui->activateTab('settings');
295 $this->tabs_gui->activateSubTab('tool_settings');
296
298 $this,
299 $this->object->getId(),
300 array(
302 )
303 );
304 $this->ctrl->forwardCommand($service);
305 break;
306
307 case 'ilmailmembersearchgui':
308 $mail = new ilMail($this->user->getId());
309
310 if (!($this->access->checkAccess('manage_members', '', $this->object->getRefId()) ||
311 $this->object->getMailToMembersType() == ilObjGroup::MAIL_ALLOWED_ALL) &&
312 $this->rbacsystem->checkAccess('internal_mail', $mail->getMailObjectReferenceId())) {
313 $this->error->raiseError($this->lng->txt("msg_no_perm_read"), $this->error->MESSAGE);
314 }
315
316 $this->tabs_gui->setTabActive('members');
317
318
319 $mail_search = new ilMailMemberSearchGUI($this, $this->object->getRefId(), new ilMailMemberGroupRoles());
320 $mail_search->setObjParticipants(ilCourseParticipants::_getInstanceByObjId($this->object->getId()));
321 $this->ctrl->forwardCommand($mail_search);
322 break;
323
324 case 'ilbadgemanagementgui':
325 $this->tabs_gui->setTabActive('obj_tool_setting_badges');
326 $bgui = new ilBadgeManagementGUI($this->object->getRefId(), $this->object->getId(), 'grp');
327 $this->ctrl->forwardCommand($bgui);
328 break;
329
330 case "ilcontainernewssettingsgui":
331 $this->setSubTabs("settings");
332 $this->tabs_gui->setTabActive('settings');
333 $this->tabs_gui->activateSubTab('obj_news_settings');
334 $news_set_gui = new ilContainerNewsSettingsGUI($this);
335 $news_set_gui->setTimeline(true);
336 $news_set_gui->setCronNotifications(true);
337 $news_set_gui->setHideByDate(true);
338 $this->ctrl->forwardCommand($news_set_gui);
339 break;
340
341 case "ilnewstimelinegui":
342 $this->checkPermission("read");
343 $this->tabs_gui->setTabActive('news_timeline');
344 $t = ilNewsTimelineGUI::getInstance($this->object->getRefId(), $this->object->getNewsTimelineAutoENtries());
345 $t->setUserEditAll($this->access->checkAccess('write', '', $this->object->getRefId(), 'grp'));
346 $this->showPermanentLink();
347 $this->ctrl->forwardCommand($t);
349 $this->user->getId(),
350 $this->object->getId(),
351 $this->object->getRefId(),
352 'grp'
353 );
354 break;
355
356 case "ilcontainerskillgui":
357 $this->tabs_gui->activateTab('obj_tool_setting_skills');
358 $gui = new ilContainerSkillGUI($this);
359 $this->ctrl->forwardCommand($gui);
360 break;
361
362 case 'ilcalendarpresentationgui':
363 $cal = new ilCalendarPresentationGUI($this->object->getRefId());
364 $this->ctrl->forwardCommand($cal);
365 break;
366
367 case 'ilobjectmetadatagui':
368 if (!$this->access->checkAccess('write', '', $this->object->getRefId())) {
369 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->WARNING);
370 }
371 $this->tabs_gui->activateTab('meta_data');
372 $this->ctrl->forwardCommand(new ilObjectMetaDataGUI($this->object));
373 break;
374
375
376 case strtolower(TranslationGUI::class):
377 $this->checkPermissionBool("write");
378 $this->setSubTabs("settings");
379 $this->tabs->activateTab("settings");
380 $transgui = new TranslationGUI(
381 $this->getObject(),
382 $this->lng,
383 $this->access,
384 $this->user,
385 $this->ctrl,
386 $this->tpl,
387 $this->ui_factory,
388 $this->ui_renderer,
389 $this->http,
390 $this->refinery,
391 $this->toolbar
392 );
393 $this->ctrl->forwardCommand($transgui);
394 break;
395
396 default:
397
398 // check visible permission
399 if (!$this->getCreationMode() and
400 !$this->access->checkAccess('visible', '', $this->object->getRefId(), 'grp') and
401 !$this->access->checkAccess('read', '', $this->object->getRefId(), 'grp')) {
402 $this->error->raiseError($this->lng->txt("msg_no_perm_read"), $this->error->MESSAGE);
403 }
404
405 // #9401 - see also ilStartupGUI::_checkGoto()
406 if ($cmd == 'infoScreenGoto') {
407 if ($this->object->isRegistrationEnabled()) {
408 $cmd = 'join';
409 } else {
410 $cmd = 'infoScreen';
411 }
412 }
413
414 // check read permission
415 if ((!$this->getCreationMode()
416 && !$this->rbacsystem->checkAccess('read', $this->object->getRefId()) && $cmd != 'infoScreen')
417 || $cmd == 'join'
418 || $cmd === 'leaveWaitList') {
419 // no join permission -> redirect to info screen
420 if (!$this->rbacsystem->checkAccess('join', $this->object->getRefId())) {
421 $this->ctrl->redirect($this, "infoScreen");
422 } else { // no read -> show registration
423 $this->ctrl->redirectByClass("ilGroupRegistrationGUI", "show");
424 }
425 }
426 if (!$cmd) {
427 $cmd = 'view';
428 }
429 $cmd .= 'Object';
430 $this->$cmd();
431 break;
432 }
433
434 if ($header_action) {
435 $this->addHeaderAction();
436 }
437 }
438
439 public function enableAdministrationPanelObject(): void
440 {
441 $this->getModeManager()->setAdminMode();
442 $this->ctrl->redirect($this, "");
443 }
444
445 public function disableAdministrationPanelObject(): void
446 {
447 $this->getModeManager()->setContentMode();
448 $this->ctrl->redirect($this, "");
449 }
450
454 public function viewObject(): void
455 {
457 $this->user->getId(),
458 $this->object->getId(),
459 $this->object->getRefId(),
460 'grp'
461 );
462
463 if ($this->isActiveAdministrationPanel()) {
464 parent::renderObject();
466 return;
467 }
468
469 if (!$this->checkAgreement()) {
470 $this->ctrl->redirectByClass(ilMemberAgreementGUI::class);
471 }
472
473 $this->tabs_gui->setTabActive('view_content');
474 $this->renderObject();
475 }
476
477 public function renderObject(): void
478 {
479 $this->tabs->activateTab("view_content");
480 parent::renderObject();
481 }
482
486 public function modifyItemGUI(ilObjectListGUI $a_item_list_gui, array $a_item_data): void
487 {
488 // if folder is in a course, modify item list gui according to course requirements
489 if ($course_ref_id = $this->tree->checkForParentType($this->object->getRefId(), 'crs')) {
490 $course_obj_id = ilObject::_lookupObjId($course_ref_id);
492 $a_item_list_gui,
493 'ilcoursecontentgui',
494 $a_item_data,
495 ilObjCourse::_lookupAboStatus($course_obj_id),
496 $course_ref_id,
497 $course_obj_id,
498 $this->object->getRefId()
499 );
500 }
501 }
502
508 public function afterSave(ilObject $new_object, bool $redirect = true): void
509 {
510 $new_object->setRegistrationType(
512 );
513 $new_object->update();
514
515 // check for parent group or course => SORT_INHERIT
516 $sort_mode = ilContainer::SORT_TITLE;
517 if (
518 $this->tree->checkForParentType($new_object->getRefId(), 'crs', true) ||
519 $this->tree->checkForParentType($new_object->getRefId(), 'grp', true)
520 ) {
521 $sort_mode = ilContainer::SORT_INHERIT;
522 }
523
524 // Save sorting
525 $sort = new ilContainerSortingSettings($new_object->getId());
526 $sort->setSortMode($sort_mode);
527 $sort->update();
528
529
530 // Add user as admin and enable notification
531 $members_obj = ilGroupParticipants::_getInstanceByObjId($new_object->getId());
532 $members_obj->add($this->user->getId(), ilParticipants::IL_GRP_ADMIN);
533 $members_obj->updateNotification($this->user->getId(), (bool) $this->settings->get('mail_grp_admin_notification', '1'));
534 $members_obj->updateContact($this->user->getId(), true);
535
536 $this->tpl->setOnScreenMessage('success', $this->lng->txt("object_added"), true);
537 if ($redirect) {
538 $this->ctrl->setParameter($this, "ref_id", $new_object->getRefId());
539 $this->ctrl->redirect($this, 'edit');
540 }
541 }
542
546 public function editObject(?ilPropertyFormGUI $a_form = null): void
547 {
548 $this->checkPermission("write");
549
550 $this->setSubTabs('settings');
551 $this->tabs_gui->setTabActive('settings');
552 $this->tabs_gui->setSubTabActive('general');
553
554 if (!$a_form) {
555 $a_form = $this->initForm('edit');
556 }
557 $this->tpl->setVariable('ADM_CONTENT', $a_form->getHTML());
558 }
559
560 public function updateGroupTypeObject(): void
561 {
563 $this->object->getRefId(),
564 (int) $_REQUEST['grp_type']
565 );
566
567 $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
568 $this->ctrl->redirect($this, 'edit');
569 }
570
571
572 public function updateObject(): void
573 {
574 $obj_service = $this->getObjectService();
575 $this->checkPermission('write');
576
577 $form = $this->initForm();
578 $new_type = 0;
579 if ($form->checkInput()) {
580 // handle group type settings
581 $old_type = ilDidacticTemplateObjSettings::lookupTemplateId($this->object->getRefId());
582
583 $modified = false;
584 $new_type_info = $form->getInput('didactic_type');
585 if ($new_type_info) {
586 $new_type = explode('_', $form->getInput('didactic_type'));
587 $new_type = (int) $new_type[1];
588
589 $modified = ($new_type !== $old_type);
590 ilLoggerFactory::getLogger('grp')->info('Switched group type from ' . $old_type . ' to ' . $new_type);
591 }
592
593 // Additional checks: both tile and session limitation activated (not supported)
594 if (
595 $form->getInput('sl') == "1" &&
596 $form->getInput('list_presentation') == "tile") {
598 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('crs_tile_and_session_limit_not_supported'));
599 $this->editObject($form);
600 return;
601 }
602
603 $this->object->setTitle($form->getInput('title'));
604 $this->object->setDescription($form->getInput('desc'));
605 $this->object->setGroupType((int) $form->getInput('grp_type'));
606 $this->object->setRegistrationType((int) $form->getInput('registration_type'));
607 $this->object->setPassword($form->getInput('password'));
608 $this->object->enableUnlimitedRegistration(!$form->getInput('reg_limit_time'));
609 $this->object->enableMembershipLimitation((bool) $form->getInput('registration_membership_limited'));
610 $this->object->setMinMembers((int) $form->getInput('registration_min_members'));
611 $this->object->setMaxMembers((int) $form->getInput('registration_max_members'));
612 $this->object->enableRegistrationAccessCode((bool) $form->getInput('reg_code_enabled'));
613 $this->object->setRegistrationAccessCode($form->getInput('reg_code'));
614 $this->object->setViewMode((int) $form->getInput('view_mode'));
615 $this->object->setMailToMembersType((int) $form->getInput('mail_type'));
616 $this->object->setShowMembers((bool) $form->getInput('show_members'));
617 $this->object->setAutoNotification((bool) $form->getInput('auto_notification'));
618
619 // session limit
620 $this->object->enableSessionLimit((bool) $form->getInput('sl'));
621 $session_sp = $form->getInput('sp');
622 $this->object->setNumberOfPreviousSessions(is_numeric($session_sp) ? (int) $session_sp : -1);
623 $session_sn = $form->getInput('sn');
624 $this->object->setNumberOfnextSessions(is_numeric($session_sn) ? (int) $session_sn : -1);
625
626 // period
627 $grp_period = $form->getItemByPostVar("period");
628 $this->object->setPeriod(
629 $grp_period->getStart(),
630 $grp_period->getEnd()
631 );
632
633 $reg = $form->getItemByPostVar("reg");
634 if ($reg->getStart() instanceof ilDateTime && $reg->getEnd() instanceof ilDateTime) {
635 $this->object->enableUnlimitedRegistration(false);
636 } else {
637 $this->object->enableUnlimitedRegistration(true);
638 }
639
640 $this->object->setRegistrationStart($reg->getStart());
641 $this->object->setRegistrationEnd($reg->getEnd());
642
643 $cancel_end = $form->getItemByPostVar("cancel_end");
644 $this->object->setCancellationEnd($cancel_end->getDate());
645
646 $waiting_list = 0;
647 if ($this->http->wrapper()->post()->has('waiting_list')) {
648 $waiting_list = $this->http->wrapper()->post()->retrieve(
649 'waiting_list',
650 $this->refinery->kindlyTo()->int()
651 );
652 }
653 switch ($waiting_list) {
654 case 2:
655 $this->object->enableWaitingList(true);
656 $this->object->setWaitingListAutoFill(true);
657 break;
658
659 case 1:
660 $this->object->enableWaitingList(true);
661 $this->object->setWaitingListAutoFill(false);
662 break;
663
664 default:
665 $this->object->enableWaitingList(false);
666 $this->object->setWaitingListAutoFill(false);
667 break;
668 }
669 $this->object->handleAutoFill();
670
671 // activation
672 $property_online = $this->object->getObjectProperties()->getPropertyIsOnline();
673 $online = $form->getInput('activation_online') ?
674 $property_online->withOnline() :
675 $property_online->withOffline();
676 $this->object->getObjectProperties()->storePropertyIsOnline($online);
677
678 // update object settings
679 $this->object->update();
680
681 // title icon visibility
682 $obj_service->commonSettings()->legacyForm($form, $this->object)->saveTitleIconVisibility();
683
684 // top actions visibility
685 $obj_service->commonSettings()->legacyForm($form, $this->object)->saveTopActionsVisibility();
686
687 // custom icon
688 $obj_service->commonSettings()->legacyForm($form, $this->object)->saveIcon();
689
690 // tile image
691 $obj_service->commonSettings()->legacyForm($form, $this->object)->saveTileImage();
692
693 // list presentation
695
697 $this->object->getId(),
698 $form,
699 $this->getSubServices()
700 );
701
702 // Save sorting
704
705 // BEGIN ChangeEvents: Record update Object.
707 $this->object->getId(),
708 $this->user->getId(),
709 'update'
710 );
711 ilChangeEvent::_catchupWriteEvents($this->object->getId(), $this->user->getId());
712 // END PATCH ChangeEvents: Record update Object.
713 // Update ecs export settings
714 $ecs = new ilECSGroupSettings($this->object);
715 $ecs->handleSettingsUpdate($form);
716 } else {
717 $this->tpl->setOnScreenMessage('failure', $GLOBALS['DIC']->language()->txt('err_check_input')); // #16975
718
720 $this->editObject($form);
721 return;
722 }
723
724 // group type modified
725 if ($modified) {
726 if ($new_type == 0) {
727 $new_type_txt = $GLOBALS['DIC']['lng']->txt('il_grp_status_open');
728 } else {
729 $dtpl = new ilDidacticTemplateSetting($new_type);
730 $new_type_txt = $dtpl->getPresentationTitle($GLOBALS['DIC']['lng']->getLangKey());
731 }
732
733
734 $confirm = new ilConfirmationGUI();
735 $confirm->setHeaderText($this->lng->txt('grp_warn_grp_type_changed'));
736 $confirm->setFormAction($this->ctrl->getFormAction($this));
737 $confirm->addItem(
738 'grp_type',
739 (string) $new_type,
740 $this->lng->txt('grp_info_new_grp_type') . ': ' . $new_type_txt
741 );
742 $confirm->setConfirm($this->lng->txt('grp_change_type'), 'updateGroupType');
743 $confirm->setCancel($this->lng->txt('cancel'), 'edit');
744
745 $this->tpl->setContent($confirm->getHTML());
746 } else {
747 $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
748 $this->ctrl->redirect($this, 'edit');
749 }
750 }
751
752 protected function getSubServices(): array
753 {
754 $subs = array(
763 );
764 if ($this->news->isGloballyActivated()) {
766 }
767
768 return $subs;
769 }
770
774 public function editMapSettingsObject(): void
775 {
776 $this->setSubTabs("settings");
777 $this->tabs_gui->setTabActive('settings');
778 $this->tabs_gui->setSubTabActive('grp_map_settings');
779
780 if (!ilMapUtil::isActivated() ||
781 !$this->access->checkAccess("write", "", $this->object->getRefId())) {
782 return;
783 }
784
785 $latitude = $this->object->getLatitude();
786 $longitude = $this->object->getLongitude();
787 $zoom = $this->object->getLocationZoom();
788
789 // Get Default settings, when nothing is set
790 if ($latitude == 0 && $longitude == 0 && $zoom == 0) {
792 $latitude = $def["latitude"];
793 $longitude = $def["longitude"];
794 $zoom = $def["zoom"];
795 }
796
797
798 $form = new ilPropertyFormGUI();
799 $form->setFormAction($this->ctrl->getFormAction($this));
800
801 $form->setTitle($this->lng->txt("grp_map_settings"));
802
803 // enable map
804 $public = new ilCheckboxInputGUI(
805 $this->lng->txt("grp_enable_map"),
806 "enable_map"
807 );
808 $public->setValue("1");
809 $public->setChecked($this->object->getEnableGroupMap());
810 $form->addItem($public);
811
812 // map location
813 $loc_prop = new ilLocationInputGUI(
814 $this->lng->txt("grp_map_location"),
815 "location"
816 );
817 $loc_prop->setLatitude((float) $latitude);
818 $loc_prop->setLongitude((float) $longitude);
819 $loc_prop->setZoom((int) $zoom);
820 $form->addItem($loc_prop);
821
822 $form->addCommandButton("saveMapSettings", $this->lng->txt("save"));
823
824 $this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
825 }
826
830 public function saveMapSettingsObject(): void
831 {
832 $location = [];
833 if ($this->http->wrapper()->post()->has('location')) {
834 $custom_transformer = $this->refinery->custom()->transformation(
835 function ($array) {
836 return $array;
837 }
838 );
839 $location = $this->http->wrapper()->post()->retrieve(
840 'location',
841 $custom_transformer
842 );
843 }
844 $enable_map = false;
845 if ($this->http->wrapper()->post()->has('enable_map')) {
846 $enable_map = $this->http->wrapper()->post()->retrieve(
847 'enable_map',
848 $this->refinery->kindlyTo()->bool()
849 );
850 }
851
852 $this->object->setLatitude((string) $location['latitude']);
853 $this->object->setLongitude((string) $location['longitude']);
854 $this->object->setLocationZoom((int) $location['zoom']);
855 $this->object->setEnableGroupMap($enable_map);
856 $this->object->update();
857 $this->ctrl->redirect($this, "editMapSettings");
858 }
859
860
861
862 public function editInfoObject(): void
863 {
864 $this->checkPermission('write');
865
866 $this->setSubTabs('settings');
867 $this->tabs_gui->setTabActive('settings');
868 $this->tabs_gui->setSubTabActive('grp_info_settings');
869
870 $form = $this->initInfoEditor();
871 $this->tpl->setContent($form->getHTML());
872 }
873
874 protected function initInfoEditor(): ilPropertyFormGUI
875 {
876 $form = new ilPropertyFormGUI();
877 $form->setFormAction($this->ctrl->getFormAction($this, 'updateInfo'));
878 $form->setTitle($this->lng->txt('grp_general_informations'));
879 $form->addCommandButton('updateInfo', $this->lng->txt('save'));
880 $form->addCommandButton('cancel', $this->lng->txt('cancel'));
881
882 $area = new ilTextAreaInputGUI($this->lng->txt('grp_information'), 'important');
883 $area->setInfo($this->lng->txt('grp_information_info'));
884 $area->setValue($this->object->getInformation());
885 $area->setRows(8);
886 $area->setCols(80);
887 $form->addItem($area);
888
889 return $form;
890 }
891
892 public function updateInfoObject(): void
893 {
894 $this->checkPermission('manage_members');
895
896 $important = '';
897 if ($this->http->wrapper()->post()->has('important')) {
898 $important = $this->http->wrapper()->post()->retrieve(
899 'important',
900 $this->refinery->kindlyTo()->string()
901 );
902 }
903 $this->object->setInformation($important);
904 $this->object->update();
905 $this->tpl->setOnScreenMessage('success', $this->lng->txt("settings_saved"));
906 $this->editInfoObject();
907 }
908
909 public function readMemberData(array $ids, ?array $selected_columns = null): array
910 {
912
913 $this->show_tracking =
914 (
916 );
917
918 $completed = $in_progress = $failed = [];
919 if ($this->show_tracking) {
920 $olp = ilObjectLP::getInstance($this->object->getId());
921 $this->show_tracking = $olp->isActive();
922 }
923
924 if ($this->show_tracking) {
925 $completed = ilLPStatusWrapper::_lookupCompletedForObject($this->object->getId());
926 $in_progress = ilLPStatusWrapper::_lookupInProgressForObject($this->object->getId());
927 $failed = ilLPStatusWrapper::_lookupFailedForObject($this->object->getId());
928 }
929
930 if ($privacy->enabledGroupAccessTimes()) {
931 $progress = ilLearningProgress::_lookupProgressByObjId($this->object->getId());
932 }
933
934 $do_prtf = (is_array($selected_columns) &&
935 in_array('prtf', $selected_columns) &&
936 is_array($ids));
937 if ($do_prtf) {
939 $ids,
940 $this->ctrl->getLinkTarget($this, "members")
941 );
942 }
943
949 $profile_data = ilObjUser::_readUsersProfileData($ids);
950 $members = [];
951 foreach ($ids as $usr_id) {
952 $tmp_data['notification'] = (bool) $this->object->members_obj->isNotificationEnabled((int) $usr_id) ? 1 : 0;
953 $tmp_data['contact'] = (bool) $this->object->members_obj->isContact((int) $usr_id) ? 1 : 0;
954
955 foreach ((array) ($profile_data[$usr_id] ?? []) as $field => $value) {
956 $tmp_data[$field] = $value;
957 }
958
959 if ($this->show_tracking) {
960 $tmp_data['progress'] = '';
961 if (in_array($usr_id, $completed)) {
962 $tmp_data['progress'] = ilLPStatus::LP_STATUS_COMPLETED;
963 } elseif (in_array($usr_id, $in_progress)) {
964 $tmp_data['progress'] = ilLPStatus::LP_STATUS_IN_PROGRESS;
965 } elseif (in_array($usr_id, $failed)) {
966 $tmp_data['progress'] = ilLPStatus::LP_STATUS_FAILED;
967 } else {
968 $tmp_data['progress'] = ilLPStatus::LP_STATUS_NOT_ATTEMPTED;
969 }
970 }
971
972 if ($privacy->enabledGroupAccessTimes()) {
973 if (isset($progress[$usr_id]['ts']) && ($progress[$usr_id]['ts'] ?? false)) {
974 $tmp_data['access_time'] = ilDatePresentation::formatDate(
975 $tmp_date = new ilDateTime($progress[$usr_id]['ts'], IL_CAL_UNIX)
976 );
977 $tmp_data['access_time_unix'] = $tmp_date->get(IL_CAL_UNIX);
978 } else {
979 $tmp_data['access_time'] = $this->lng->txt('no_date');
980 $tmp_data['access_time_unix'] = 0;
981 }
982 }
983 $tmp_data['prtf'] = [];
984 if ($do_prtf) {
985 $tmp_data['prtf'] = ($all_prtf[$usr_id] ?? []);
986 }
987 $members[$usr_id] = $tmp_data;
988 }
989 return $members;
990 }
991
992 public function leaveObject(): void
993 {
994 $this->checkPermission('leave');
995
996 $part = ilGroupParticipants::_getInstanceByObjId($this->object->getId());
997 if ($part->isLastAdmin($this->user->getId())) {
998 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('grp_err_administrator_required'));
999 $this->viewObject();
1000 return;
1001 }
1002
1003 $this->tabs_gui->setTabActive('grp_btn_unsubscribe');
1004
1005 $cgui = new ilConfirmationGUI();
1006 $cgui->setHeaderText($this->lng->txt('grp_dismiss_myself'));
1007 $cgui->setFormAction($this->ctrl->getFormAction($this));
1008 $cgui->setCancel($this->lng->txt("cancel"), "cancel");
1009 $cgui->setConfirm($this->lng->txt("grp_btn_unsubscribe"), "unsubscribe");
1010 $this->tpl->setContent($cgui->getHTML());
1011 }
1012
1013 public function unsubscribeObject(): void
1014 {
1015 $this->checkPermission('leave');
1016 $this->object->members_obj->delete($this->user->getId());
1017 $this->object->members_obj->sendNotification(
1019 $this->user->getId()
1020 );
1021 $this->object->members_obj->sendNotification(
1023 $this->user->getId()
1024 );
1025
1026 $this->tpl->setOnScreenMessage('success', $this->lng->txt('grp_msg_membership_annulled'), true);
1027 $this->ctrl->setParameterByClass(
1028 "ilrepositorygui",
1029 "ref_id",
1030 $this->tree->getParentId($this->object->getRefId())
1031 );
1032 $this->ctrl->redirectByClass("ilrepositorygui", "");
1033 }
1034
1035 public function addContentTab(): void
1036 {
1037 $this->tabs_gui->addTab(
1038 "view_content",
1039 $this->lng->txt("content"),
1040 $this->ctrl->getLinkTarget($this, "view")
1041 );
1042 }
1043
1047 protected function getTabs(): void
1048 {
1049 global $DIC;
1050
1051 $ilHelp = $DIC['ilHelp'];
1052 $ilHelp->setScreenIdComponent("grp");
1053
1054 if ($this->access->checkAccess('read', '', $this->ref_id)) {
1055 if ($this->object->isNewsTimelineEffective()) {
1056 if (!$this->object->isNewsTimelineLandingPageEffective()) {
1057 $this->addContentTab();
1058 }
1059 $this->tabs_gui->addTab(
1060 "news_timeline",
1061 $this->lng->txt("cont_news_timeline_tab"),
1062 $this->ctrl->getLinkTargetByClass("ilnewstimelinegui", "show")
1063 );
1064 if ($this->object->isNewsTimelineLandingPageEffective()) {
1065 $this->addContentTab();
1066 }
1067 } else {
1068 $this->addContentTab();
1069 }
1070 }
1071 if (
1072 $this->access->checkAccess('visible', '', $this->ref_id) ||
1073 $this->access->checkAccess('join', '', $this->ref_id) ||
1074 $this->access->checkAccess('read', '', $this->ref_id)
1075 ) {
1076 $this->tabs_gui->addTarget(
1077 "info_short",
1078 $this->ctrl->getLinkTargetByClass(
1079 array("ilobjgroupgui", "ilinfoscreengui"),
1080 "showSummary"
1081 ),
1082 "infoScreen",
1083 "",
1084 "",
1085 false
1086 );
1087 }
1088
1089
1090 if ($this->access->checkAccess('write', '', $this->object->getRefId())) {
1091 $this->tabs_gui->addTarget(
1092 "settings",
1093 $this->ctrl->getLinkTarget($this, "edit"),
1094 array("edit", "editMapSettings"),
1095 get_class($this),
1096 ""
1097 );
1098 }
1099
1100 $is_participant = ilGroupParticipants::_isParticipant($this->ref_id, $this->user->getId());
1101
1102 // Members
1103 $membership_gui = new ilGroupMembershipGUI($this, $this->object);
1104 $membership_gui->addMemberTab($this->tabs_gui, $is_participant);
1105
1106
1107 // badges
1108 if ($this->access->checkAccess('write', '', $this->ref_id)) {
1109 if (ilBadgeHandler::getInstance()->isObjectActive($this->object->getId())) {
1110 $this->tabs_gui->addTarget(
1111 "obj_tool_setting_badges",
1112 $this->ctrl->getLinkTargetByClass("ilbadgemanagementgui", ""),
1113 "",
1114 "ilbadgemanagementgui"
1115 );
1116 }
1117 }
1118
1119 // skills
1120 if ($this->access->checkAccess('read', '', $this->ref_id) && ilContainer::_lookupContainerSetting(
1121 $this->object->getId(),
1123 ''
1124 )) {
1125 $this->tabs_gui->addTarget(
1126 "obj_tool_setting_skills",
1127 $this->ctrl->getLinkTargetByClass(array("ilcontainerskillgui", "ilcontskillpresentationgui"), ""),
1128 "",
1129 array("ilcontainerskillgui", "ilcontskillpresentationgui", "ilcontskilladmingui")
1130 );
1131 }
1132
1133 // learning progress
1134 if (ilLearningProgressAccess::checkAccess($this->object->getRefId(), $is_participant)) {
1135 $this->tabs_gui->addTarget(
1136 'learning_progress',
1137 $this->ctrl->getLinkTargetByClass(array('ilobjgroupgui','illearningprogressgui'), ''),
1138 '',
1139 array('illplistofobjectsgui','illplistofsettingsgui','illearningprogressgui','illplistofprogressgui')
1140 );
1141 }
1142
1143 // meta data
1144 if ($this->access->checkAccess('write', '', $this->ref_id)) {
1145 $md_gui = new ilObjectMetaDataGUI($this->object);
1146 $tab_link = $md_gui->getTab();
1147 if ($tab_link !== null) {
1148 $this->tabs_gui->addTab(
1149 'meta_data',
1150 $this->lng->txt('meta_data'),
1151 $tab_link,
1152 ''
1153 );
1154 }
1155 }
1156
1157
1158 if ($this->access->checkAccess('write', '', $this->object->getRefId())) {
1159 $this->tabs_gui->addTarget(
1160 'export',
1161 $this->ctrl->getLinkTargetByClass('ilexportgui', ''),
1162 'export',
1163 'ilexportgui'
1164 );
1165 }
1166
1167 // parent tabs (all container: edit_permission, clipboard, trash
1168 parent::getTabs();
1169
1170 if ($this->access->checkAccess('join', '', $this->object->getRefId()) and
1171 !$this->object->members_obj->isAssigned($this->user->getId())) {
1172 if (ilGroupWaitingList::_isOnList($this->user->getId(), $this->object->getId())) {
1173 $this->tabs_gui->addTab(
1174 'leave',
1175 $this->lng->txt('membership_leave'),
1176 $this->ctrl->getLinkTargetByClass('ilgroupregistrationgui', 'show', '')
1177 );
1178 } else {
1179 $this->tabs_gui->addTarget(
1180 "join",
1181 $this->ctrl->getLinkTargetByClass('ilgroupregistrationgui', "show"),
1182 'show',
1183 ""
1184 );
1185 }
1186 }
1187 if ($this->access->checkAccess('leave', '', $this->object->getRefId()) and
1188 $this->object->members_obj->isMember($this->user->getId())) {
1189 $this->tabs_gui->addTarget(
1190 "grp_btn_unsubscribe",
1191 $this->ctrl->getLinkTarget($this, "leave"),
1192 '',
1193 ""
1194 );
1195 }
1196 }
1197
1198 public function infoScreenObject(): void
1199 {
1200 $this->ctrl->redirectByClass(ilInfoScreenGUI::class, "showSummary");
1201 }
1202
1203 public function infoScreen(): void
1204 {
1205 $this->tabs_gui->setTabActive('info_short');
1206
1207 if (!$this->checkPermissionBool('read')) {
1208 $this->checkPermission('visible');
1209 }
1210
1211 $info = new ilInfoScreenGUI($this);
1212
1213 if (strlen($this->object->getInformation())) {
1214 $info->addSection($this->lng->txt('grp_general_informations'));
1215 $info->addProperty($this->lng->txt('grp_information'), nl2br(
1216 ilUtil::makeClickable($this->object->getInformation(), true)
1217 ));
1218 }
1219
1220 $info->enablePrivateNotes();
1221 $info->enableLearningProgress(true);
1222
1223 $record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_INFO, 'grp', $this->object->getId());
1224 $record_gui->setInfoObject($info);
1225 $record_gui->parse();
1226
1227 // meta data
1228 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
1229
1230
1231 // support contacts
1232 $parts = ilParticipants::getInstance($this->object->getRefId());
1233 $contacts = $parts->getContacts();
1234 if (count($contacts) > 0) {
1235 $info->addSection($this->lng->txt("grp_mem_contacts"));
1236 foreach ($contacts as $c) {
1237 $pgui = new PublicProfileGUI($c);
1238 $pgui->setBackUrl($this->ctrl->getLinkTargetByClass("ilinfoscreengui"));
1239 $pgui->setEmbedded(true);
1240 $info->addProperty("", $pgui->getHTML());
1241 }
1242 }
1243
1244
1245 $info->addSection($this->lng->txt('group_registration'));
1246 $info->showLDAPRoleGroupMappingInfo();
1247
1248 if (!$this->object->isRegistrationEnabled()) {
1249 $info->addProperty(
1250 $this->lng->txt('group_registration_mode'),
1251 $this->lng->txt('grp_reg_deac_info_screen')
1252 );
1253 } else {
1254 switch ($this->object->getRegistrationType()) {
1256 $info->addProperty(
1257 $this->lng->txt('group_registration_mode'),
1258 $this->lng->txt('grp_reg_direct_info_screen')
1259 );
1260 break;
1261
1263 $info->addProperty(
1264 $this->lng->txt('group_registration_mode'),
1265 $this->lng->txt('grp_reg_req_info_screen')
1266 );
1267 break;
1268
1270 $info->addProperty(
1271 $this->lng->txt('group_registration_mode'),
1272 $this->lng->txt('grp_reg_passwd_info_screen')
1273 );
1274 break;
1275 }
1276 /*
1277 $info->addProperty($this->lng->txt('group_registration_time'),
1278 ilDatePresentation::formatPeriod(
1279 $this->object->getRegistrationStart(),
1280 $this->object->getRegistrationEnd()));
1281 */
1282 if ($this->object->isRegistrationUnlimited()) {
1283 $info->addProperty(
1284 $this->lng->txt('group_registration_time'),
1285 $this->lng->txt('grp_registration_unlimited')
1286 );
1287 } elseif ($this->object->getRegistrationStart()->getUnixTime() < time()) {
1288 $info->addProperty(
1289 $this->lng->txt("group_registration_time"),
1290 $this->lng->txt('cal_until') . ' ' .
1291 ilDatePresentation::formatDate($this->object->getRegistrationEnd())
1292 );
1293 } elseif ($this->object->getRegistrationStart()->getUnixTime() >= time()) {
1294 $info->addProperty(
1295 $this->lng->txt("group_registration_time"),
1296 $this->lng->txt('cal_from') . ' ' .
1297 ilDatePresentation::formatDate($this->object->getRegistrationStart())
1298 );
1299 }
1300 if ($this->object->isMembershipLimited()) {
1301 if ($this->object->getMinMembers()) {
1302 $info->addProperty(
1303 $this->lng->txt("mem_min_users"),
1304 (string) $this->object->getMinMembers()
1305 );
1306 }
1307 if ($this->object->getMaxMembers()) {
1308 $reg_info = ilObjGroupAccess::lookupRegistrationInfo($this->object->getId());
1309
1310 $info->addProperty(
1311 $this->lng->txt('mem_free_places'),
1312 (string) ($reg_info['reg_info_free_places'] ?? '0')
1313 );
1314 }
1315 }
1316
1317 if ($this->object->getCancellationEnd()) {
1318 $info->addProperty(
1319 $this->lng->txt('grp_cancellation_end'),
1320 ilDatePresentation::formatDate($this->object->getCancellationEnd())
1321 );
1322 }
1323 }
1324
1325 if ($this->object->getStart() instanceof ilDateTime &&
1326 !$this->object->getStart()->isNull()
1327 ) {
1328 $info->addProperty(
1329 $this->lng->txt('grp_period'),
1331 $this->object->getStart(),
1332 $this->object->getEnd()
1333 )
1334 );
1335 }
1336
1337 // Confirmation
1338 $privacy = ilPrivacySettings::getInstance();
1339
1340 if ($privacy->groupConfirmationRequired() or ilCourseDefinedFieldDefinition::_getFields($this->object->getId()) or $privacy->enabledGroupExport()) {
1341 $field_info = ilExportFieldsInfo::_getInstanceByType($this->object->getType());
1342
1343 $this->lng->loadLanguageModule('ps');
1344 $info->addSection($this->lng->txt('grp_user_agreement_info'));
1345 $info->addProperty($this->lng->txt('ps_export_data'), $field_info->exportableFieldsToInfoString());
1346
1347 if ($fields = ilCourseDefinedFieldDefinition::_fieldsToInfoString($this->object->getId())) {
1348 $info->addProperty($this->lng->txt('ps_grp_user_fields'), $fields);
1349 }
1350 }
1351
1352
1353 // forward the command
1354 $this->ctrl->forwardCommand($info);
1355 }
1356
1357 public function saveNotificationObject(): void
1358 {
1359 $noti = new ilMembershipNotifications($this->ref_id);
1360
1361 $grp_notification = false;
1362 if ($this->http->wrapper()->query()->has('grp_ntf')) {
1363 $grp_notification = $this->http->wrapper()->query()->retrieve(
1364 'grp_ntf',
1365 $this->refinery->kindlyTo()->bool()
1366 );
1367 }
1368
1369 if ($noti->canCurrentUserEdit()) {
1370 if ($grp_notification) {
1371 $noti->activateUser();
1372 } else {
1373 $noti->deactivateUser();
1374 }
1375 }
1376 $this->tpl->setOnScreenMessage('success', $this->lng->txt("settings_saved"), true);
1377 $this->ctrl->redirect($this, "");
1378 }
1379
1380 protected function membersObject(): void
1381 {
1382 $this->ctrl->redirectByClass('ilgroupmembershipgui');
1383 }
1384
1385
1386 public static function _goto(string $a_target, string $a_add = ""): void
1387 {
1388 global $DIC;
1389 $main_tpl = $DIC->ui()->mainTemplate();
1390 $a_target = (int) $a_target;
1391
1392 $ilUser = $DIC->user();
1393 $ilAccess = $DIC->access();
1394 $lng = $DIC->language();
1395 $ilErr = $DIC['ilErr'];
1396 $http = $DIC->http();
1397 $refinery = $DIC->refinery();
1398
1399 $target = '';
1400 if ($http->wrapper()->query()->has('target')) {
1401 $target = $http->wrapper()->query()->retrieve(
1402 'target',
1403 $refinery->kindlyTo()->string()
1404 );
1405 }
1406 if (substr($a_add, 0, 5) == 'rcode') {
1407 if ($ilUser->getId() == ANONYMOUS_USER_ID) {
1408 // Redirect to login for anonymous
1410 "login.php?target=" . $target . "&cmd=force_login&lang=" .
1411 $ilUser->getCurrentLanguage()
1412 );
1413 }
1414
1415 // Redirects to target location after assigning user to group
1417 $a_target,
1419 substr($a_add, 5)
1420 );
1421 }
1422
1423 if ($a_add == "mem" && $ilAccess->checkAccess("manage_members", "", $a_target)) {
1424 ilObjectGUI::_gotoRepositoryNode($a_target, "members");
1425 }
1426
1427 if ($a_add == "comp" && ilContSkillPresentationGUI::isAccessible($a_target)) {
1428 ilObjectGUI::_gotoRepositoryNode($a_target, "competences");
1429 }
1430
1431 if ($ilAccess->checkAccess("read", "", $a_target)) {
1433 } else {
1434 // to do: force flat view
1435 if ($ilAccess->checkAccess("visible", "", $a_target)) {
1436 ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreenGoto");
1437 } else {
1438 if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
1439 $main_tpl->setOnScreenMessage('failure', sprintf(
1440 $lng->txt("msg_no_perm_read_item"),
1442 ), true);
1444 }
1445 }
1446 }
1447 $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
1448 }
1449
1450
1451 public function initForm(string $a_mode = 'edit', bool $a_omit_form_action = false): ilPropertyFormGUI
1452 {
1453 $obj_service = $this->getObjectService();
1454 $form = new ilPropertyFormGUI();
1455
1456 if (!$a_omit_form_action) {
1457 switch ($a_mode) {
1458 case 'edit':
1459 $form->setFormAction($this->ctrl->getFormAction($this, 'update'));
1460 break;
1461
1462 default:
1463 $form->setTableWidth('600px');
1464 $form->setFormAction($this->ctrl->getFormAction($this, 'save'));
1465 break;
1466 }
1467 }
1468
1469 // title/description
1470 $this->initFormTitleDescription($form);
1471
1473
1474 if ($a_mode == 'edit') {
1475 // group period
1476 $cdur = new ilDateDurationInputGUI($this->lng->txt('grp_period'), 'period');
1477 $this->lng->loadLanguageModule('mem');
1478 $cdur->enableToggleFullTime(
1479 $this->lng->txt('mem_period_without_time'),
1480 !$this->object->getStartTimeIndication()
1481 );
1482 $cdur->setShowTime(true);
1483 $cdur->setInfo($this->lng->txt('grp_period_info'));
1484 $cdur->setStart($this->object->getStart());
1485 $cdur->setEnd($this->object->getEnd());
1486 $form->addItem($cdur);
1487
1488 // activation
1489 $this->lng->loadLanguageModule('rep');
1490
1491 $section = new ilFormSectionHeaderGUI();
1492 $section->setTitle($this->lng->txt('rep_activation_availability'));
1493 $form->addItem($section);
1494
1495 $online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'activation_online');
1496 $online->setChecked(!$this->object->getOfflineStatus());
1497 $online->setInfo($this->lng->txt('grp_activation_online_info'));
1498 $form->addItem($online);
1499
1500
1501 // Group registration ############################################################
1502 $pres = new ilFormSectionHeaderGUI();
1503 $pres->setTitle($this->lng->txt('grp_setting_header_registration'));
1504 $form->addItem($pres);
1505
1506 // Registration type
1507 $reg_type = new ilRadioGroupInputGUI($this->lng->txt('group_registration_mode'), 'registration_type');
1508 $reg_type->setValue((string) $this->object->getRegistrationType());
1509
1510 $opt_dir = new ilRadioOption(
1511 $this->lng->txt('grp_reg_direct'),
1513 );#$this->lng->txt('grp_reg_direct_info'));
1514 $reg_type->addOption($opt_dir);
1515
1516 $opt_pass = new ilRadioOption(
1517 $this->lng->txt('grp_pass_request'),
1519 );
1520 $pass = new ilTextInputGUI($this->lng->txt("password"), 'password');
1521 $pass->setRequired(true);
1522 $pass->setInfo($this->lng->txt('grp_reg_password_info'));
1523 $pass->setValue($this->object->getPassword());
1524 $pass->setSize(32);
1525 $pass->setMaxLength(32);
1526 $opt_pass->addSubItem($pass);
1527 $reg_type->addOption($opt_pass);
1528
1529 $opt_req = new ilRadioOption($this->lng->txt('grp_reg_request'), (string) ilGroupConstants::GRP_REGISTRATION_REQUEST, $this->lng->txt('grp_reg_request_info'));
1530 $reg_type->addOption($opt_req);
1531
1532 $opt_deact = new ilRadioOption($this->lng->txt('grp_reg_no_selfreg'), (string) ilGroupConstants::GRP_REGISTRATION_DEACTIVATED, $this->lng->txt('grp_reg_disabled_info'));
1533 $reg_type->addOption($opt_deact);
1534
1535 // Registration codes
1536 $reg_code = new ilCheckboxInputGUI($this->lng->txt('grp_reg_code'), 'reg_code_enabled');
1537 $reg_code->setChecked($this->object->isRegistrationAccessCodeEnabled());
1538 $reg_code->setValue('1');
1539 $reg_code->setInfo($this->lng->txt('grp_reg_code_enabled_info'));
1540 $form->addItem($reg_type);
1541
1542 // Registration codes
1543 if (!$this->object->getRegistrationAccessCode()) {
1544 $this->object->setRegistrationAccessCode(ilMembershipRegistrationCodeUtils::generateCode());
1545 }
1546 $reg_link = new ilHiddenInputGUI('reg_code');
1547 $reg_link->setValue($this->object->getRegistrationAccessCode());
1548 $form->addItem($reg_link);
1549
1550 $link = new ilCustomInputGUI($this->lng->txt('grp_reg_code_link'));
1551 $val = ilLink::_getLink($this->object->getRefId(), $this->object->getType(), array(), 'rcode' . $this->object->getRegistrationAccessCode());
1552 $link->setHTML('<span class="small">' . $val . '</span>');
1553 $reg_code->addSubItem($link);
1554 $form->addItem($reg_code);
1555
1556 // time limit
1557 $this->lng->loadLanguageModule('dateplaner');
1558 $dur = new ilDateDurationInputGUI($this->lng->txt('grp_reg_limited'), 'reg');
1559 $dur->setShowTime(true);
1560 $dur->setStart($this->object->getRegistrationStart());
1561 $dur->setEnd($this->object->getRegistrationEnd());
1562 $form->addItem($dur);
1563
1564 // cancellation limit
1565 $cancel = new ilDateTimeInputGUI($this->lng->txt('grp_cancellation_end'), 'cancel_end');
1566 $cancel->setInfo($this->lng->txt('grp_cancellation_end_info'));
1567 $cancel->setDate($this->object->getCancellationEnd());
1568 $form->addItem($cancel);
1569
1570 // max member
1571 $lim = new ilCheckboxInputGUI($this->lng->txt('reg_grp_max_members_short'), 'registration_membership_limited');
1572 $lim->setValue('1');
1573 // $lim->setOptionTitle($this->lng->txt('reg_grp_max_members'));
1574 $lim->setChecked($this->object->isMembershipLimited());
1575
1576 $min = new ilTextInputGUI($this->lng->txt('reg_grp_min_members'), 'registration_min_members');
1577 $min->setSize(3);
1578 $min->setMaxLength(4);
1579 $min->setValue($this->object->getMinMembers() ?: '');
1580 $min->setInfo($this->lng->txt('grp_subscription_min_members_info'));
1581 $lim->addSubItem($min);
1582
1583 $max = new ilTextInputGUI($this->lng->txt('reg_grp_max_members'), 'registration_max_members');
1584 $max->setValue($this->object->getMaxMembers() ?: '');
1585 //$max->setTitle($this->lng->txt('members'));
1586 $max->setSize(3);
1587 $max->setMaxLength(4);
1588 $max->setInfo($this->lng->txt('grp_reg_max_members_info'));
1589 $lim->addSubItem($max);
1590
1591 /*
1592 $wait = new ilCheckboxInputGUI($this->lng->txt('grp_waiting_list'),'waiting_list');
1593 $wait->setValue(1);
1594 //$wait->setOptionTitle($this->lng->txt('grp_waiting_list'));
1595 $wait->setInfo($this->lng->txt('grp_waiting_list_info'));
1596 $wait->setChecked($this->object->isWaitingListEnabled() ? true : false);
1597 $lim->addSubItem($wait);
1598 $form->addItem($lim);
1599 */
1600
1601 $wait = new ilRadioGroupInputGUI($this->lng->txt('grp_waiting_list'), 'waiting_list');
1602
1603 $option = new ilRadioOption($this->lng->txt('none'), '0');
1604 $wait->addOption($option);
1605
1606 $option = new ilRadioOption($this->lng->txt('grp_waiting_list_no_autofill'), '1');
1607 $option->setInfo($this->lng->txt('grp_waiting_list_info'));
1608 $wait->addOption($option);
1609
1610 $option = new ilRadioOption($this->lng->txt('grp_waiting_list_autofill'), '2');
1611 $option->setInfo($this->lng->txt('grp_waiting_list_autofill_info'));
1612 $wait->addOption($option);
1613
1614 if ($this->object->hasWaitingListAutoFill()) {
1615 $wait->setValue('2');
1616 } elseif ($this->object->isWaitingListEnabled()) {
1617 $wait->setValue('1');
1618 } else {
1619 $wait->setValue('0');
1620 }
1621
1622 $lim->addSubItem($wait);
1623
1624 $form->addItem($lim);
1625
1626
1627 // Group presentation
1628 $parent_membership_ref_id = 0;
1629 $hasParentMembership =
1630 (
1631 $parent_membership_ref_id = $this->tree->checkForParentType($this->object->getRefId(), 'crs', true)
1632 );
1633
1634 $pres = new ilFormSectionHeaderGUI();
1635 $pres->setTitle($this->lng->txt('grp_setting_header_presentation'));
1636 $form->addItem($pres);
1637
1638 // title and icon visibility
1639 $form = $obj_service->commonSettings()->legacyForm($form, $this->object)->addTitleIconVisibility();
1640
1641 // top actions visibility
1642 $form = $obj_service->commonSettings()->legacyForm($form, $this->object)->addTopActionsVisibility();
1643
1644 // custom icon
1645 $form = $obj_service->commonSettings()->legacyForm($form, $this->object)->addIcon();
1646
1647 // tile image
1648 $form = $obj_service->commonSettings()->legacyForm($form, $this->object)->addTileImage();
1649
1650 // list presentation
1652
1653
1654 // presentation type
1655 $view_type = new ilRadioGroupInputGUI($this->lng->txt('grp_presentation_type'), 'view_mode');
1656 if ($hasParentMembership) {
1657 $parent_view_mode = ilObjCourseAccess::_lookupViewMode(ilObject::_lookupObjId($parent_membership_ref_id));
1658 $course_view_mode = '';
1659 switch ($parent_view_mode) {
1661 $course_view_mode = ': ' . $this->lng->txt('cntr_view_sessions');
1662 break;
1663
1665 $course_view_mode = ': ' . $this->lng->txt('cntr_view_simple');
1666 break;
1667
1669 $course_view_mode = ': ' . $this->lng->txt('cntr_view_by_type');
1670 break;
1671 }
1672 if ($course_view_mode) {
1673 $opt = new ilRadioOption($this->lng->txt('grp_view_inherit') . $course_view_mode, (string) ilContainer::VIEW_INHERIT);
1674 $opt->setInfo($this->lng->txt('grp_view_inherit_info'));
1675 $view_type->addOption($opt);
1676 }
1677 }
1678
1679 if ($hasParentMembership && ilObjGroup::lookupViewMode($this->object->getId()) == ilContainer::VIEW_INHERIT) {
1680 $view_type->setValue((string) ilContainer::VIEW_INHERIT);
1681 } else {
1682 $view_type->setValue((string) ilObjGroup::lookupViewMode($this->object->getId()));
1683 }
1684
1685 $opt = new ilRadioOption($this->lng->txt('cntr_view_sessions'), (string) ilContainer::VIEW_SESSIONS);
1686 $opt->setInfo($this->lng->txt('cntr_view_info_sessions'));
1687 $view_type->addOption($opt);
1688
1689 // Limited sessions
1690 $this->lng->loadLanguageModule('crs');
1691 $sess = new ilCheckboxInputGUI($this->lng->txt('sess_limit'), 'sl');
1692 $sess->setValue('1');
1693 $sess->setChecked($this->object->isSessionLimitEnabled());
1694 $sess->setInfo($this->lng->txt('sess_limit_info'));
1695
1696 $prev = new ilNumberInputGUI($this->lng->txt('sess_num_prev'), 'sp');
1697 $prev->setMinValue(0);
1698 $prev->setValue((string) (
1699 $this->object->getNumberOfPreviousSessions() == -1 ?
1700 '' :
1701 $this->object->getNumberOfPreviousSessions()
1702 ));
1703 $prev->setSize(2);
1704 $prev->setMaxLength(3);
1705 $sess->addSubItem($prev);
1706
1707 $next = new ilNumberInputGUI($this->lng->txt('sess_num_next'), 'sn');
1708 $next->setMinValue(0);
1709 $next->setValue((string) (
1710 $this->object->getNumberOfNextSessions() == -1 ?
1711 '' :
1712 $this->object->getNumberOfNextSessions()
1713 ));
1714 $next->setSize(2);
1715 $next->setMaxLength(3);
1716 $sess->addSubItem($next);
1717 $opt->addSubItem($sess);
1718
1719 $opt = new ilRadioOption($this->lng->txt('cntr_view_simple'), (string) ilContainer::VIEW_SIMPLE);
1720 $opt->setInfo($this->lng->txt('grp_view_info_simple'));
1721 $view_type->addOption($opt);
1722
1723 $opt = new ilRadioOption($this->lng->txt('cntr_view_by_type'), (string) ilContainer::VIEW_BY_TYPE);
1724 $opt->setInfo($this->lng->txt('grp_view_info_by_type'));
1725 $view_type->addOption($opt);
1726 $form->addItem($view_type);
1727
1728
1729 // Sorting
1730 $sorting_settings = array();
1731 if ($hasParentMembership) {
1732 $sorting_settings[] = ilContainer::SORT_INHERIT;
1733 }
1734 $sorting_settings[] = ilContainer::SORT_TITLE;
1735 $sorting_settings[] = ilContainer::SORT_CREATION;
1736 $sorting_settings[] = ilContainer::SORT_MANUAL;
1737 $this->initSortingForm($form, $sorting_settings);
1738
1739 // additional features
1740 $feat = new ilFormSectionHeaderGUI();
1741 $feat->setTitle($this->lng->txt('obj_features'));
1742 $form->addItem($feat);
1743
1745 $this->object->getId(),
1746 $form,
1747 $this->getSubServices()
1748 );
1749
1750
1751 $mem = new ilCheckboxInputGUI($this->lng->txt('grp_show_members'), 'show_members');
1752 $mem->setChecked($this->object->getShowMembers());
1753 $mem->setInfo($this->lng->txt('grp_show_members_info'));
1754 $form->addItem($mem);
1755
1756 // Show members type
1757 $mail_type = new ilRadioGroupInputGUI($this->lng->txt('grp_mail_type'), 'mail_type');
1758 $mail_type->setValue((string) $this->object->getMailToMembersType());
1759
1760 $mail_tutors = new ilRadioOption(
1761 $this->lng->txt('grp_mail_tutors_only'),
1763 $this->lng->txt('grp_mail_tutors_only_info')
1764 );
1765 $mail_type->addOption($mail_tutors);
1766
1767 $mail_all = new ilRadioOption(
1768 $this->lng->txt('grp_mail_all'),
1770 $this->lng->txt('grp_mail_all_info')
1771 );
1772 $mail_type->addOption($mail_all);
1773 $form->addItem($mail_type);
1774
1775 // Self notification
1776 $not = new ilCheckboxInputGUI($this->lng->txt('grp_auto_notification'), 'auto_notification');
1777 $not->setValue('1');
1778 $not->setInfo($this->lng->txt('grp_auto_notification_info'));
1779 $not->setChecked($this->object->getAutoNotification());
1780 $form->addItem($not);
1781 }
1782
1783 switch ($a_mode) {
1784 case 'create':
1785 $form->setTitle($this->lng->txt('grp_new'));
1786 $form->setTitleIcon(ilUtil::getImagePath('standard/icon_grp.svg'));
1787
1788 $form->addCommandButton('save', $this->lng->txt('grp_new'));
1789 $form->addCommandButton('cancel', $this->lng->txt('cancel'));
1790 break;
1791
1792 case 'edit':
1793 $form->setTitle($this->lng->txt('grp_edit'));
1794 $form->setTitleIcon(ilUtil::getImagePath('standard/icon_grp.svg'));
1795
1796 // Edit ecs export settings
1797 $ecs = new ilECSGroupSettings($this->object);
1798 $ecs->addSettingsToForm($form, 'grp');
1799
1800 $form->addCommandButton('update', $this->lng->txt('save'));
1801 $form->addCommandButton('cancel', $this->lng->txt('cancel'));
1802 break;
1803 }
1804 return $form;
1805 }
1806
1807 protected function setSubTabs(string $a_tab): void
1808 {
1809 switch ($a_tab) {
1810 case 'settings':
1811 $this->tabs_gui->addSubTabTarget(
1812 "grp_settings",
1813 $this->ctrl->getLinkTarget($this, 'edit'),
1814 "edit",
1815 get_class($this)
1816 );
1817
1818 $this->tabs_gui->addSubTabTarget(
1819 "grp_info_settings",
1820 $this->ctrl->getLinkTarget($this, 'editInfo'),
1821 "editInfo",
1822 get_class($this)
1823 );
1824
1825 if (ilMapUtil::isActivated()) {
1826 $this->tabs_gui->addSubTabTarget(
1827 "grp_map_settings",
1828 $this->ctrl->getLinkTarget($this, 'editMapSettings'),
1829 "editMapSettings",
1830 get_class($this)
1831 );
1832 }
1833
1834 $this->tabs_gui->addSubTabTarget(
1835 'groupings',
1836 $this->ctrl->getLinkTargetByClass('ilobjcoursegroupinggui', 'listGroupings'),
1837 'listGroupings',
1838 get_class($this)
1839 );
1840
1841 // only show if export permission is granted
1842 if (ilPrivacySettings::getInstance()->checkExportAccess($this->object->getRefId()) or ilCourseDefinedFieldDefinition::_hasFields($this->object->getId())) {
1843 $this->tabs_gui->addSubTabTarget(
1844 'grp_custom_user_fields',
1845 $this->ctrl->getLinkTargetByClass('ilobjectcustomuserfieldsgui'),
1846 '',
1847 'ilobjectcustomuserfieldsgui'
1848 );
1849 }
1850
1851 // news settings
1852 if ($this->object->getUseNews()) {
1853 $this->tabs_gui->addSubTab(
1854 'obj_news_settings',
1855 $this->lng->txt("cont_news_settings"),
1856 $this->ctrl->getLinkTargetByClass('ilcontainernewssettingsgui')
1857 );
1858 }
1859
1860 $lti_settings = new ilLTIProviderObjectSettingGUI($this->object->getRefId());
1861 if ($lti_settings->hasSettingsAccess()) {
1862 $this->tabs_gui->addSubTabTarget(
1863 'lti_provider',
1864 $this->ctrl->getLinkTargetByClass(ilLTIProviderObjectSettingGUI::class)
1865 );
1866 }
1867
1868 $this->tabs_gui->addSubTabTarget(
1869 "obj_multilinguality",
1870 $this->ctrl->getLinkTargetByClass(TranslationGUI::class, ""),
1871 "",
1872 TranslationGUI::class
1873 );
1874
1875
1876 break;
1877 }
1878 }
1879
1880 private function checkAgreement(): bool
1881 {
1882 if ($this->access->checkAccess('write', '', $this->object->getRefId())) {
1883 return true;
1884 }
1885
1886 // Disable aggrement if is not member of group
1887 if (!$this->object->members_obj->isAssigned($this->user->getId())) {
1888 return true;
1889 }
1890
1891 if (ilMemberViewSettings::getInstance()->isActive()) {
1892 return true;
1893 }
1894
1895 $privacy = ilPrivacySettings::getInstance();
1896
1897 // Check agreement
1898 if (($privacy->groupConfirmationRequired() or ilCourseDefinedFieldDefinition::_hasFields($this->object->getId()))
1899 and !ilMemberAgreement::_hasAccepted($this->user->getId(), $this->object->getId())) {
1900 return false;
1901 }
1902 // Check required fields
1903 if (!ilCourseUserData::_checkRequired($this->user->getId(), $this->object->getId())) {
1904 return false;
1905 }
1906 return true;
1907 }
1908
1912 public function prepareOutput(bool $show_subobjects = true): bool
1913 {
1914 return parent::prepareOutput($show_subobjects);
1915 }
1916
1917 public function createMailSignature(): string
1918 {
1919 $link = chr(13) . chr(10) . chr(13) . chr(10);
1920 $link .= $this->lng->txt('grp_mail_permanent_link');
1921 $link .= chr(13) . chr(10) . chr(13) . chr(10);
1922 $link .= ilLink::_getLink($this->object->getRefId());
1923 return rawurlencode(base64_encode($link));
1924 }
1925
1929 protected function initHeaderAction(?string $sub_type = null, ?int $sub_id = null): ?ilObjectListGUI
1930 {
1931 global $DIC;
1932
1933 $ilSetting = $DIC['ilSetting'];
1934 $ilUser = $DIC['ilUser'];
1935
1936 $lg = parent::initHeaderAction($sub_type, $sub_id);
1937
1938 if (ilGroupParticipants::_isParticipant($this->ref_id, $ilUser->getId())) {
1940 $noti = new ilMembershipNotifications($this->ref_id);
1941 if (!$noti->isCurrentUserActive()) {
1942 $lg->addHeaderIcon(
1943 "not_icon",
1944 ilUtil::getImagePath("object/notification_off.svg"),
1945 $this->lng->txt("grp_notification_deactivated")
1946 );
1947
1948 $this->ctrl->setParameter($this, "grp_ntf", 1);
1949 $caption = "grp_activate_notification";
1950 } else {
1951 $lg->addHeaderIcon(
1952 "not_icon",
1953 ilUtil::getImagePath("object/notification_on.svg"),
1954 $this->lng->txt("grp_notification_activated")
1955 );
1956
1957 $this->ctrl->setParameter($this, "grp_ntf", 0);
1958 $caption = "grp_deactivate_notification";
1959 }
1960
1961 if ($noti->canCurrentUserEdit()) {
1962 $lg->addCustomCommand(
1963 $this->ctrl->getLinkTarget($this, "saveNotification"),
1964 $caption
1965 );
1966 }
1967
1968 $this->ctrl->setParameter($this, "grp_ntf", "");
1969 }
1970 }
1971
1972 return $lg;
1973 }
1974
1975
1976 public function addCustomData(array $a_data): array
1977 {
1978 // object defined fields
1979 $odfs = ilCourseUserData::_getValuesByObjId($this->object->getId());
1980 $udfs = $this->profile->getAllUserDefinedFields();
1981
1982 return array_reduce(
1983 $this->profile->getDataForMultiple(array_keys($a_data)),
1984 function (array $c, ProfileData $v) use ($a_data, $udfs, $odfs): array {
1985 $c[$v->getId()] = $a_data[$v->getId()];
1986
1987 foreach ($udfs as $field) {
1988 $field_id = $field->getIdentifier();
1989 $c[$v->getId()]['udf_' . $field_id] = (string) $v->getAdditionalFieldByIdentifier($field_id);
1990 }
1991
1992 foreach ((array) ($odfs[$v->getId()] ?? []) as $cdf_field => $cdf_value) {
1993 $c[$v->getId()]['cdf_' . $cdf_field] = (string) $cdf_value;
1994 }
1995 },
1996 []
1997 );
1998 }
1999
2000 public function getLocalRoles(): array
2001 {
2002 $local_roles = $this->object->getLocalGroupRoles();
2003 $grp_member = $this->object->getDefaultMemberRole();
2004 $grp_roles = array();
2005
2006 //put the group member role to the top of the crs_roles array
2007 if (in_array($grp_member, $local_roles)) {
2008 $grp_roles[$grp_member] = ilObjRole::_getTranslation(array_search($grp_member, $local_roles));
2009 unset($local_roles[$grp_roles[$grp_member]]);
2010 }
2011
2012 foreach ($local_roles as $title => $role_id) {
2013 $grp_roles[(int) $role_id] = ilObjRole::_getTranslation($title);
2014 }
2015 return $grp_roles;
2016 }
2017
2018 protected function jump2UsersGalleryObject(): void
2019 {
2020 $this->ctrl->redirectByClass('ilUsersGalleryGUI');
2021 }
2022
2026 public function setSideColumnReturn(): void
2027 {
2028 $this->ctrl->setReturn($this, "view");
2029 }
2030} // END class.ilObjGroupGUI
$location
Definition: buildRTE.php:22
Builds data types.
Definition: Factory.php:36
kindlyTo()
Combined validations and transformations for primitive data types that establish a baseline for furth...
Definition: Factory.php:55
GUI class for public user profile presentation.
const IL_CAL_UNIX
error(string $a_errmsg)
@ilCtrl_Calls ilBadgeManagementGUI: ilPropertyFormGUI
static _catchupWriteEvents(int $obj_id, int $usr_id, ?string $timestamp=null)
Catches up with all write events which occured before the specified timestamp.
static _recordWriteEvent(int $obj_id, int $usr_id, string $action, ?int $parent_obj_id=null)
Records a write event.
This class represents a checkbox property in a property form.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilContainerGUI This is a base GUI class for all container objects in ILIAS: root folder,...
ILIAS Container InternalGUIService $gui
initSortingForm(ilPropertyFormGUI $form, array $a_sorting_settings)
Append sorting settings to property form.
ilPropertyFormGUI $form
saveListPresentation(ilPropertyFormGUI $form)
initListPresentationForm(ilPropertyFormGUI $form)
Add list presentation settings to form.
saveSortingSettings(ilPropertyFormGUI $form)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Skills for container (course/group) (top gui class)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupContainerSetting(int $a_id, string $a_keyword, ?string $a_default_value=null)
Class ilCourseContentGUI.
static _getFields(int $a_container_id, $a_sort=self::IL_CDF_SORT_NAME)
Get all fields of a container.
static _hasFields(int $a_container_id)
Check if there are any define fields.
static _getInstanceByObjId(int $a_obj_id)
static _getValuesByObjId(int $a_obj_id)
static _checkRequired(int $a_usr_id, int $a_obj_id)
This class represents a custom property in a property form.
input GUI for a time span (start and end date)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
static formatPeriod(ilDateTime $start, ilDateTime $end, bool $a_skip_starting_day=false, ?ilObjUser $user=null)
Format a period of two dates Shows: 14.
This class represents a date/time property in a property form.
@classDescription Date and time handling
isNull()
Check if a date is null (Datetime == '0000-00-00 00:00:00', unixtime == 0,...)
static switchTemplate(int $a_ref_id, int $a_new_tpl_id)
Class ilECSGroupSettings.
static _getInstanceByType(string $a_type)
Get Singleton Instance.
Export User Interface Class.
setFormAction(string $a_formaction)
This class represents a section header in a property form.
GUI class for membership features.
static _isParticipant(int $a_ref_id, int $a_usr_id)
Static function to check if a user is a participant of the container object.
static _getInstanceByObjId(int $a_obj_id)
Get singleton instance.
GUI class for group registrations.
This class represents a hidden form property in a property form.
Class ilInfoScreenGUI.
static _lookupCompletedForObject(int $a_obj_id, ?array $a_user_ids=null)
static _lookupFailedForObject(int $a_obj_id, ?array $a_user_ids=null)
static _lookupInProgressForObject(int $a_obj_id, ?array $a_user_ids=null)
const LP_STATUS_COMPLETED
const LP_STATUS_FAILED
const LP_STATUS_NOT_ATTEMPTED
const LP_STATUS_IN_PROGRESS
GUI class for LTI provider object settings.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static checkAccess(int $a_ref_id, bool $a_allow_only_read=true)
check access to learning progress
Class ilObjUserTrackingGUI.
static _lookupProgressByObjId(int $a_obj_id)
lookup progress for a specific object
static _tracProgress(int $a_user_id, int $a_obj_id, int $a_ref_id, string $a_obj_type='')
This class represents a location property in a property form.
static getLogger(string $a_component_id)
Get component logger.
Class ilMailMemberCourseRoles.
static isActivated()
Checks whether Map feature is activated.
static getDefaultSettings()
Get default longitude, latitude and zoom.
static _hasAccepted(int $a_usr_id, int $a_obj_id)
Check if user has accepted agreement.
Membership notification settings.
static generateCode()
Generate new registration key.
static handleCode(int $a_ref_id, string $a_type, string $a_code)
static getInstance(int $a_ref_id, bool $a_include_auto_entries)
This class represents a number property in a property form.
static _lookupViewMode(int $a_id)
static _modifyItemGUI(ilObjectListGUI $a_item_list_gui, string $a_cmd_class, array $a_item_data, bool $a_abo_status, int $a_course_ref_id, int $a_course_obj_id, int $a_parent_ref_id=0)
Class ilObjCourseGroupingGUI.
static _lookupAboStatus(int $a_id)
static lookupRegistrationInfo(int $a_obj_id)
Class ilObjGroupGUI.
setSubTabs(string $a_tab)
__construct($a_data, int $a_id, bool $a_call_by_reference, bool $a_prepare_output=false)
@inheritDoc
addCustomData(array $a_data)
initHeaderAction(?string $sub_type=null, ?int $sub_id=null)
@inheritDoc
updateObject()
updates object entry in object_data
editObject(?ilPropertyFormGUI $a_form=null)
@inheritDoc
static _goto(string $a_target, string $a_add="")
initForm(string $a_mode='edit', bool $a_omit_form_action=false)
ilRbacSystem $rbacsystem
editMapSettingsObject()
Edit Map Settings.
prepareOutput(bool $show_subobjects=true)
@inheritDoc
viewObject()
@inheritDoc
setSideColumnReturn()
@inheritDoc
readMemberData(array $ids, ?array $selected_columns=null)
afterSave(ilObject $new_object, bool $redirect=true)
@inheritDoc @access public
modifyItemGUI(ilObjectListGUI $a_item_list_gui, array $a_item_data)
@inheritDoc
executeCommand()
@inheritDoc
static lookupViewMode($a_obj_id)
const MAIL_ALLOWED_TUTORS
const MAIL_ALLOWED_ALL
static getAvailablePortfolioLinksForUserIds(array $a_owner_ids, ?string $a_back_url=null)
static _getTranslation(string $a_role_title)
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
static _readUsersProfileData(array $a_user_ids)
GUI class for the workflow of copying objects.
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
GlobalHttpState $http
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
initDidacticTemplate(ilPropertyFormGUI $form)
addHeaderAction()
Add header action menu.
static _gotoRepositoryNode(int $ref_id, string $cmd="")
ilLanguage $lng
static getInstance(int $obj_id)
Class ilObjectMetaDataGUI.
GUI class for service settings (calendar, notes, comments)
static updateServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)
static initServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)
Class ilObject Basic functions for all objects.
static _lookupType(int $id, bool $reference=false)
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
static getInstance(int $a_ref_id)
This class represents a property form user interface.
setTableWidth(string $a_width)
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
setTitleIcon(string $a_titleicon)
getItemByPostVar(string $a_post_var)
This class represents a property in a property form.
This class represents an option in a radio group.
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
This class represents a text area property in a property form.
This class represents a text property in a property form.
static makeClickable(string $a_text, bool $detectGotoLinks=false, ?string $ilias_http_path=null)
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static redirect(string $a_script)
static _isOnList(int $a_usr_id, int $a_obj_id)
const ANONYMOUS_USER_ID
Definition: constants.php:27
const ROOT_FOLDER_ID
Definition: constants.php:32
$c
Definition: deliver.php:25
$info
Definition: entry_point.php:21
$service
Definition: ltiresult.php:36
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:61
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $ilSetting
Definition: privfeed.php:31
$ilErr
Definition: raiseError.php:33
global $DIC
Definition: shib_login.php:26
$GLOBALS["DIC"]
Definition: wac.php:54