ILIAS  trunk Revision v12.0_alpha-1227-g7ff6d300864
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::class);
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 strtolower(ilNewsTimelineGUI::class):
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 $this->renderObject();
466 return;
467 }
468
469 if (!$this->checkAgreement()) {
470 $this->ctrl->redirectByClass(ilMemberAgreementGUI::class);
471 }
472
473 $this->renderObject();
474 }
475
476 public function renderObject(): void
477 {
478 $this->tabs->activateTab("view_content");
479 parent::renderObject();
480 }
481
485 public function modifyItemGUI(ilObjectListGUI $a_item_list_gui, array $a_item_data): void
486 {
487 // if folder is in a course, modify item list gui according to course requirements
488 if ($course_ref_id = $this->tree->checkForParentType($this->object->getRefId(), 'crs')) {
489 $course_obj_id = ilObject::_lookupObjId($course_ref_id);
491 $a_item_list_gui,
492 'ilcoursecontentgui',
493 $a_item_data,
494 ilObjCourse::_lookupAboStatus($course_obj_id),
495 $course_ref_id,
496 $course_obj_id,
497 $this->object->getRefId()
498 );
499 }
500 }
501
507 public function afterSave(ilObject $new_object, bool $redirect = true): void
508 {
509 $new_object->setRegistrationType(
511 );
512 $new_object->update();
513
514 // check for parent group or course => SORT_INHERIT
515 $sort_mode = ilContainer::SORT_TITLE;
516 if (
517 $this->tree->checkForParentType($new_object->getRefId(), 'crs', true) ||
518 $this->tree->checkForParentType($new_object->getRefId(), 'grp', true)
519 ) {
520 $sort_mode = ilContainer::SORT_INHERIT;
521 }
522
523 // Save sorting
524 $sort = new ilContainerSortingSettings($new_object->getId());
525 $sort->setSortMode($sort_mode);
526 $sort->update();
527
528
529 // Add user as admin and enable notification
530 $members_obj = ilGroupParticipants::_getInstanceByObjId($new_object->getId());
531 $members_obj->add($this->user->getId(), ilParticipants::IL_GRP_ADMIN);
532 $members_obj->updateNotification($this->user->getId(), (bool) $this->settings->get('mail_grp_admin_notification', '1'));
533 $members_obj->updateContact($this->user->getId(), true);
534
535 $this->tpl->setOnScreenMessage('success', $this->lng->txt("object_added"), true);
536 if ($redirect) {
537 $this->ctrl->setParameter($this, "ref_id", $new_object->getRefId());
538 $this->ctrl->redirect($this, 'edit');
539 }
540 }
541
545 public function editObject(?ilPropertyFormGUI $a_form = null): void
546 {
547 $this->checkPermission("write");
548
549 $this->setSubTabs('settings');
550 $this->tabs_gui->setTabActive('settings');
551 $this->tabs_gui->setSubTabActive('general');
552
553 if (!$a_form) {
554 $a_form = $this->initForm('edit');
555 }
556 $this->tpl->setVariable('ADM_CONTENT', $a_form->getHTML());
557 }
558
559 public function updateGroupTypeObject(): void
560 {
562 $this->object->getRefId(),
563 (int) $_REQUEST['grp_type']
564 );
565
566 $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
567 $this->ctrl->redirect($this, 'edit');
568 }
569
570
571 public function updateObject(): void
572 {
573 $obj_service = $this->getObjectService();
574 $this->checkPermission('write');
575
576 $form = $this->initForm();
577 $new_type = 0;
578 if ($form->checkInput()) {
579 // handle group type settings
580 $old_type = ilDidacticTemplateObjSettings::lookupTemplateId($this->object->getRefId());
581
582 $modified = false;
583 $new_type_info = $form->getInput('didactic_type');
584 if ($new_type_info) {
585 $new_type = explode('_', $form->getInput('didactic_type'));
586 $new_type = (int) $new_type[1];
587
588 $modified = ($new_type !== $old_type);
589 ilLoggerFactory::getLogger('grp')->info('Switched group type from ' . $old_type . ' to ' . $new_type);
590 }
591
592 // Additional checks: both tile and session limitation activated (not supported)
593 if (
594 $form->getInput('sl') == "1" &&
595 $form->getInput('list_presentation') == "tile") {
597 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('crs_tile_and_session_limit_not_supported'));
598 $this->editObject($form);
599 return;
600 }
601
602 $this->object->setTitle($form->getInput('title'));
603 $this->object->setDescription($form->getInput('desc'));
604 $this->object->setGroupType((int) $form->getInput('grp_type'));
605 $this->object->setRegistrationType((int) $form->getInput('registration_type'));
606 $this->object->setPassword($form->getInput('password'));
607 $this->object->enableUnlimitedRegistration(!$form->getInput('reg_limit_time'));
608 $this->object->enableMembershipLimitation((bool) $form->getInput('registration_membership_limited'));
609 $this->object->setMinMembers((int) $form->getInput('registration_min_members'));
610 $this->object->setMaxMembers((int) $form->getInput('registration_max_members'));
611 $this->object->enableRegistrationAccessCode((bool) $form->getInput('reg_code_enabled'));
612 $this->object->setRegistrationAccessCode($form->getInput('reg_code'));
613 $this->object->setViewMode((int) $form->getInput('view_mode'));
614 $this->object->setMailToMembersType((int) $form->getInput('mail_type'));
615 $this->object->setShowMembers((bool) $form->getInput('show_members'));
616 $this->object->setAutoNotification((bool) $form->getInput('auto_notification'));
617
618 // session limit
619 $this->object->enableSessionLimit((bool) $form->getInput('sl'));
620 $session_sp = $form->getInput('sp');
621 $this->object->setNumberOfPreviousSessions(is_numeric($session_sp) ? (int) $session_sp : -1);
622 $session_sn = $form->getInput('sn');
623 $this->object->setNumberOfnextSessions(is_numeric($session_sn) ? (int) $session_sn : -1);
624
625 // period
626 $grp_period = $form->getItemByPostVar("period");
627 $this->object->setPeriod(
628 $grp_period->getStart(),
629 $grp_period->getEnd()
630 );
631
632 $reg = $form->getItemByPostVar("reg");
633 if ($reg->getStart() instanceof ilDateTime && $reg->getEnd() instanceof ilDateTime) {
634 $this->object->enableUnlimitedRegistration(false);
635 } else {
636 $this->object->enableUnlimitedRegistration(true);
637 }
638
639 $this->object->setRegistrationStart($reg->getStart());
640 $this->object->setRegistrationEnd($reg->getEnd());
641
642 $cancel_end = $form->getItemByPostVar("cancel_end");
643 $this->object->setCancellationEnd($cancel_end->getDate());
644
645 $waiting_list = 0;
646 if ($this->http->wrapper()->post()->has('waiting_list')) {
647 $waiting_list = $this->http->wrapper()->post()->retrieve(
648 'waiting_list',
649 $this->refinery->kindlyTo()->int()
650 );
651 }
652 switch ($waiting_list) {
653 case 2:
654 $this->object->enableWaitingList(true);
655 $this->object->setWaitingListAutoFill(true);
656 break;
657
658 case 1:
659 $this->object->enableWaitingList(true);
660 $this->object->setWaitingListAutoFill(false);
661 break;
662
663 default:
664 $this->object->enableWaitingList(false);
665 $this->object->setWaitingListAutoFill(false);
666 break;
667 }
668 $this->object->handleAutoFill();
669
670 // activation
671 $property_online = $this->object->getObjectProperties()->getPropertyIsOnline();
672 $online = $form->getInput('activation_online') ?
673 $property_online->withOnline() :
674 $property_online->withOffline();
675 $this->object->getObjectProperties()->storePropertyIsOnline($online);
676
677 // update object settings
678 $this->object->update();
679
680 // title icon visibility
681 $obj_service->commonSettings()->legacyForm($form, $this->object)->saveTitleIconVisibility();
682
683 // top actions visibility
684 $obj_service->commonSettings()->legacyForm($form, $this->object)->saveTopActionsVisibility();
685
686 // custom icon
687 $obj_service->commonSettings()->legacyForm($form, $this->object)->saveIcon();
688
689 // tile image
690 $obj_service->commonSettings()->legacyForm($form, $this->object)->saveTileImage();
691
692 // list presentation
694
696 $this->object->getId(),
697 $form,
698 $this->getSubServices()
699 );
700
701 // Save sorting
703
704 // BEGIN ChangeEvents: Record update Object.
706 $this->object->getId(),
707 $this->user->getId(),
708 'update'
709 );
710 // END PATCH ChangeEvents: Record update Object.
711 // Update ecs export settings
712 $ecs = new ilECSGroupSettings($this->object);
713 $ecs->handleSettingsUpdate($form);
714 } else {
715 $this->tpl->setOnScreenMessage('failure', $GLOBALS['DIC']->language()->txt('err_check_input')); // #16975
716
718 $this->editObject($form);
719 return;
720 }
721
722 // group type modified
723 if ($modified) {
724 if ($new_type == 0) {
725 $new_type_txt = $GLOBALS['DIC']['lng']->txt('il_grp_status_open');
726 } else {
727 $dtpl = new ilDidacticTemplateSetting($new_type);
728 $new_type_txt = $dtpl->getPresentationTitle($GLOBALS['DIC']['lng']->getLangKey());
729 }
730
731
732 $confirm = new ilConfirmationGUI();
733 $confirm->setHeaderText($this->lng->txt('grp_warn_grp_type_changed'));
734 $confirm->setFormAction($this->ctrl->getFormAction($this));
735 $confirm->addItem(
736 'grp_type',
737 (string) $new_type,
738 $this->lng->txt('grp_info_new_grp_type') . ': ' . $new_type_txt
739 );
740 $confirm->setConfirm($this->lng->txt('grp_change_type'), 'updateGroupType');
741 $confirm->setCancel($this->lng->txt('cancel'), 'edit');
742
743 $this->tpl->setContent($confirm->getHTML());
744 } else {
745 $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
746 $this->ctrl->redirect($this, 'edit');
747 }
748 }
749
750 protected function getSubServices(): array
751 {
752 $subs = array(
761 );
762 if ($this->news->isGloballyActivated()) {
764 }
765
766 return $subs;
767 }
768
772 public function editMapSettingsObject(): void
773 {
774 $this->setSubTabs("settings");
775 $this->tabs_gui->setTabActive('settings');
776 $this->tabs_gui->setSubTabActive('grp_map_settings');
777
778 if (!ilMapUtil::isActivated() ||
779 !$this->access->checkAccess("write", "", $this->object->getRefId())) {
780 return;
781 }
782
783 $latitude = $this->object->getLatitude();
784 $longitude = $this->object->getLongitude();
785 $zoom = $this->object->getLocationZoom();
786
787 // Get Default settings, when nothing is set
788 if ($latitude == 0 && $longitude == 0 && $zoom == 0) {
790 $latitude = $def["latitude"];
791 $longitude = $def["longitude"];
792 $zoom = $def["zoom"];
793 }
794
795
796 $form = new ilPropertyFormGUI();
797 $form->setFormAction($this->ctrl->getFormAction($this));
798
799 $form->setTitle($this->lng->txt("grp_map_settings"));
800
801 // enable map
802 $public = new ilCheckboxInputGUI(
803 $this->lng->txt("grp_enable_map"),
804 "enable_map"
805 );
806 $public->setValue("1");
807 $public->setChecked($this->object->getEnableGroupMap());
808 $form->addItem($public);
809
810 // map location
811 $loc_prop = new ilLocationInputGUI(
812 $this->lng->txt("grp_map_location"),
813 "location"
814 );
815 $loc_prop->setLatitude((float) $latitude);
816 $loc_prop->setLongitude((float) $longitude);
817 $loc_prop->setZoom((int) $zoom);
818 $form->addItem($loc_prop);
819
820 $form->addCommandButton("saveMapSettings", $this->lng->txt("save"));
821
822 $this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
823 }
824
828 public function saveMapSettingsObject(): void
829 {
830 $location = [];
831 if ($this->http->wrapper()->post()->has('location')) {
832 $custom_transformer = $this->refinery->custom()->transformation(
833 function ($array) {
834 return $array;
835 }
836 );
837 $location = $this->http->wrapper()->post()->retrieve(
838 'location',
839 $custom_transformer
840 );
841 }
842 $enable_map = false;
843 if ($this->http->wrapper()->post()->has('enable_map')) {
844 $enable_map = $this->http->wrapper()->post()->retrieve(
845 'enable_map',
846 $this->refinery->kindlyTo()->bool()
847 );
848 }
849
850 $this->object->setLatitude((string) $location['latitude']);
851 $this->object->setLongitude((string) $location['longitude']);
852 $this->object->setLocationZoom((int) $location['zoom']);
853 $this->object->setEnableGroupMap($enable_map);
854 $this->object->update();
855 $this->ctrl->redirect($this, "editMapSettings");
856 }
857
858
859
860 public function editInfoObject(): void
861 {
862 $this->checkPermission('write');
863
864 $this->setSubTabs('settings');
865 $this->tabs_gui->setTabActive('settings');
866 $this->tabs_gui->setSubTabActive('grp_info_settings');
867
868 $form = $this->initInfoEditor();
869 $this->tpl->setContent($form->getHTML());
870 }
871
872 protected function initInfoEditor(): ilPropertyFormGUI
873 {
874 $form = new ilPropertyFormGUI();
875 $form->setFormAction($this->ctrl->getFormAction($this, 'updateInfo'));
876 $form->setTitle($this->lng->txt('grp_general_informations'));
877 $form->addCommandButton('updateInfo', $this->lng->txt('save'));
878 $form->addCommandButton('cancel', $this->lng->txt('cancel'));
879
880 $area = new ilTextAreaInputGUI($this->lng->txt('grp_information'), 'important');
881 $area->setInfo($this->lng->txt('grp_information_info'));
882 $area->setValue($this->object->getInformation());
883 $area->setRows(8);
884 $area->setCols(80);
885 $form->addItem($area);
886
887 return $form;
888 }
889
890 public function updateInfoObject(): void
891 {
892 $this->checkPermission('manage_members');
893
894 $important = '';
895 if ($this->http->wrapper()->post()->has('important')) {
896 $important = $this->http->wrapper()->post()->retrieve(
897 'important',
898 $this->refinery->kindlyTo()->string()
899 );
900 }
901 $this->object->setInformation($important);
902 $this->object->update();
903 $this->tpl->setOnScreenMessage('success', $this->lng->txt("settings_saved"));
904 $this->editInfoObject();
905 }
906
907 public function readMemberData(array $ids, ?array $selected_columns = null): array
908 {
910
911 $this->show_tracking =
912 (
914 );
915
916 $completed = $in_progress = $failed = [];
917 if ($this->show_tracking) {
918 $olp = ilObjectLP::getInstance($this->object->getId());
919 $this->show_tracking = $olp->isActive();
920 }
921
922 if ($this->show_tracking) {
923 $completed = ilLPStatusWrapper::_lookupCompletedForObject($this->object->getId());
924 $in_progress = ilLPStatusWrapper::_lookupInProgressForObject($this->object->getId());
925 $failed = ilLPStatusWrapper::_lookupFailedForObject($this->object->getId());
926 }
927
928 if ($privacy->enabledGroupAccessTimes()) {
929 $progress = ilLearningProgress::_lookupProgressByObjId($this->object->getId());
930 }
931
932 $do_prtf = (is_array($selected_columns) &&
933 in_array('prtf', $selected_columns) &&
934 is_array($ids));
935 if ($do_prtf) {
937 $ids
938 );
939 }
940
946 $profile_data = ilObjUser::_readUsersProfileData($ids);
947 $members = [];
948 foreach ($ids as $usr_id) {
949 $tmp_data['notification'] = (bool) $this->object->members_obj->isNotificationEnabled((int) $usr_id) ? 1 : 0;
950 $tmp_data['contact'] = (bool) $this->object->members_obj->isContact((int) $usr_id) ? 1 : 0;
951
952 foreach ((array) ($profile_data[$usr_id] ?? []) as $field => $value) {
953 $tmp_data[$field] = $value;
954 }
955
956 if ($this->show_tracking) {
957 $tmp_data['progress'] = '';
958 if (in_array($usr_id, $completed)) {
959 $tmp_data['progress'] = ilLPStatus::LP_STATUS_COMPLETED;
960 } elseif (in_array($usr_id, $in_progress)) {
961 $tmp_data['progress'] = ilLPStatus::LP_STATUS_IN_PROGRESS;
962 } elseif (in_array($usr_id, $failed)) {
963 $tmp_data['progress'] = ilLPStatus::LP_STATUS_FAILED;
964 } else {
965 $tmp_data['progress'] = ilLPStatus::LP_STATUS_NOT_ATTEMPTED;
966 }
967 }
968
969 if ($privacy->enabledGroupAccessTimes()) {
970 if (isset($progress[$usr_id]['ts']) && ($progress[$usr_id]['ts'] ?? false)) {
971 $tmp_data['access_time'] = ilDatePresentation::formatDate(
972 $tmp_date = new ilDateTime($progress[$usr_id]['ts'], IL_CAL_UNIX)
973 );
974 $tmp_data['access_time_unix'] = $tmp_date->get(IL_CAL_UNIX);
975 } else {
976 $tmp_data['access_time'] = $this->lng->txt('no_date');
977 $tmp_data['access_time_unix'] = 0;
978 }
979 }
980 $tmp_data['prtf'] = [];
981 if ($do_prtf) {
982 $tmp_data['prtf'] = ($all_prtf[$usr_id] ?? []);
983 }
984 $members[$usr_id] = $tmp_data;
985 }
986 return $members;
987 }
988
989 public function leaveObject(): void
990 {
991 $this->checkPermission('leave');
992
993 $part = ilGroupParticipants::_getInstanceByObjId($this->object->getId());
994 if ($part->isLastAdmin($this->user->getId())) {
995 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('grp_err_administrator_required'));
996 $this->viewObject();
997 return;
998 }
999
1000 $this->tabs_gui->setTabActive('grp_btn_unsubscribe');
1001
1002 $cgui = new ilConfirmationGUI();
1003 $cgui->setHeaderText($this->lng->txt('grp_dismiss_myself'));
1004 $cgui->setFormAction($this->ctrl->getFormAction($this));
1005 $cgui->setCancel($this->lng->txt("cancel"), "cancel");
1006 $cgui->setConfirm($this->lng->txt("grp_btn_unsubscribe"), "unsubscribe");
1007 $this->tpl->setContent($cgui->getHTML());
1008 }
1009
1010 public function unsubscribeObject(): void
1011 {
1012 $this->checkPermission('leave');
1013 $this->object->members_obj->delete($this->user->getId());
1014 $this->object->members_obj->sendNotification(
1016 $this->user->getId()
1017 );
1018 $this->object->members_obj->sendNotification(
1020 $this->user->getId()
1021 );
1022
1023 $this->tpl->setOnScreenMessage('success', $this->lng->txt('grp_msg_membership_annulled'), true);
1024 $this->ctrl->setParameterByClass(
1025 "ilrepositorygui",
1026 "ref_id",
1027 $this->tree->getParentId($this->object->getRefId())
1028 );
1029 $this->ctrl->redirectByClass("ilrepositorygui", "");
1030 }
1031
1032 public function addContentTab(): void
1033 {
1034 $this->tabs_gui->addTab(
1035 "view_content",
1036 $this->lng->txt("content"),
1037 $this->ctrl->getLinkTarget($this, "view")
1038 );
1039 }
1040
1044 protected function getTabs(): void
1045 {
1046 global $DIC;
1047
1048 $ilHelp = $DIC['ilHelp'];
1049 $ilHelp->setScreenIdComponent("grp");
1050
1051 if ($this->access->checkAccess('read', '', $this->ref_id)) {
1052 if ($this->object->isNewsTimelineEffective()) {
1053 if (!$this->object->isNewsTimelineLandingPageEffective()) {
1054 $this->addContentTab();
1055 }
1056 $this->tabs_gui->addTab(
1057 "news_timeline",
1058 $this->lng->txt("cont_news_timeline_tab"),
1059 $this->ctrl->getLinkTargetByClass(ilNewsTimelineGUI::class, "show")
1060 );
1061 if ($this->object->isNewsTimelineLandingPageEffective()) {
1062 $this->addContentTab();
1063 }
1064 } else {
1065 $this->addContentTab();
1066 }
1067 }
1068 if (
1069 $this->access->checkAccess('visible', '', $this->ref_id) ||
1070 $this->access->checkAccess('join', '', $this->ref_id) ||
1071 $this->access->checkAccess('read', '', $this->ref_id)
1072 ) {
1073 $this->tabs_gui->addTarget(
1074 "info_short",
1075 $this->ctrl->getLinkTargetByClass(
1076 array("ilobjgroupgui", "ilinfoscreengui"),
1077 "showSummary"
1078 ),
1079 "infoScreen",
1080 "",
1081 "",
1082 false
1083 );
1084 }
1085
1086
1087 if ($this->access->checkAccess('write', '', $this->object->getRefId())) {
1088 $this->tabs_gui->addTarget(
1089 "settings",
1090 $this->ctrl->getLinkTarget($this, "edit"),
1091 array("edit", "editMapSettings"),
1092 get_class($this),
1093 ""
1094 );
1095 }
1096
1097 $is_participant = ilGroupParticipants::_isParticipant($this->ref_id, $this->user->getId());
1098
1099 // Members
1100 $membership_gui = new ilGroupMembershipGUI($this, $this->object);
1101 $membership_gui->addMemberTab($this->tabs_gui, $is_participant);
1102
1103
1104 // badges
1105 if ($this->access->checkAccess('write', '', $this->ref_id)) {
1106 if (ilBadgeHandler::getInstance()->isObjectActive($this->object->getId())) {
1107 $this->tabs_gui->addTarget(
1108 "obj_tool_setting_badges",
1109 $this->ctrl->getLinkTargetByClass("ilbadgemanagementgui", ""),
1110 "",
1111 "ilbadgemanagementgui"
1112 );
1113 }
1114 }
1115
1116 // skills
1117 if ($this->access->checkAccess('read', '', $this->ref_id) && ilContainer::_lookupContainerSetting(
1118 $this->object->getId(),
1120 ''
1121 )) {
1122 $this->tabs_gui->addTarget(
1123 "obj_tool_setting_skills",
1124 $this->ctrl->getLinkTargetByClass(array("ilcontainerskillgui", "ilcontskillpresentationgui"), ""),
1125 "",
1126 array("ilcontainerskillgui", "ilcontskillpresentationgui", "ilcontskilladmingui")
1127 );
1128 }
1129
1130 // learning progress
1131 if (ilLearningProgressAccess::checkAccess($this->object->getRefId(), $is_participant)) {
1132 $this->tabs_gui->addTarget(
1133 'learning_progress',
1134 $this->ctrl->getLinkTargetByClass(array('ilobjgroupgui','illearningprogressgui'), ''),
1135 '',
1136 array('illplistofobjectsgui','illplistofsettingsgui','illearningprogressgui','illplistofprogressgui')
1137 );
1138 }
1139
1140 // meta data
1141 if ($this->access->checkAccess('write', '', $this->ref_id)) {
1142 $md_gui = new ilObjectMetaDataGUI($this->object);
1143 $tab_link = $md_gui->getTab();
1144 if ($tab_link !== null) {
1145 $this->tabs_gui->addTab(
1146 'meta_data',
1147 $this->lng->txt('meta_data'),
1148 $tab_link,
1149 ''
1150 );
1151 }
1152 }
1153
1154
1155 if ($this->access->checkAccess('write', '', $this->object->getRefId())) {
1156 $this->tabs_gui->addTarget(
1157 'export',
1158 $this->ctrl->getLinkTargetByClass('ilexportgui', ''),
1159 'export',
1160 'ilexportgui'
1161 );
1162 }
1163
1164 // parent tabs (all container: edit_permission, clipboard, trash
1165 parent::getTabs();
1166
1167 if ($this->access->checkAccess('join', '', $this->object->getRefId()) and
1168 !$this->object->members_obj->isAssigned($this->user->getId())) {
1169 if (ilGroupWaitingList::_isOnList($this->user->getId(), $this->object->getId())) {
1170 $this->tabs_gui->addTab(
1171 'leave',
1172 $this->lng->txt('membership_leave'),
1173 $this->ctrl->getLinkTargetByClass('ilgroupregistrationgui', 'show', '')
1174 );
1175 } else {
1176 $this->tabs_gui->addTarget(
1177 "join",
1178 $this->ctrl->getLinkTargetByClass('ilgroupregistrationgui', "show"),
1179 'show',
1180 ""
1181 );
1182 }
1183 }
1184 if ($this->access->checkAccess('leave', '', $this->object->getRefId()) and
1185 $this->object->members_obj->isMember($this->user->getId())) {
1186 $this->tabs_gui->addTarget(
1187 "grp_btn_unsubscribe",
1188 $this->ctrl->getLinkTarget($this, "leave"),
1189 '',
1190 ""
1191 );
1192 }
1193 }
1194
1195 public function infoScreenObject(): void
1196 {
1197 $this->ctrl->redirectByClass(ilInfoScreenGUI::class, "showSummary");
1198 }
1199
1200 public function infoScreen(): void
1201 {
1202 $this->tabs_gui->setTabActive('info_short');
1203
1204 if (!$this->checkPermissionBool('read')) {
1205 $this->checkPermission('visible');
1206 }
1207
1208 $info = new ilInfoScreenGUI($this);
1209
1210 if (strlen($this->object->getInformation())) {
1211 $info->addSection($this->lng->txt('grp_general_informations'));
1212 $info->addProperty($this->lng->txt('grp_information'), nl2br(
1213 ilUtil::makeClickable($this->object->getInformation(), true)
1214 ));
1215 }
1216
1217 $info->enablePrivateNotes();
1218 $info->enableLearningProgress(true);
1219
1220 $record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_INFO, 'grp', $this->object->getId());
1221 $record_gui->setInfoObject($info);
1222 $record_gui->parse();
1223
1224 // meta data
1225 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
1226
1227
1228 // support contacts
1229 $parts = ilParticipants::getInstance($this->object->getRefId());
1230 $contacts = $parts->getContacts();
1231 if (count($contacts) > 0) {
1232 $info->addSection($this->lng->txt("grp_mem_contacts"));
1233 foreach ($contacts as $c) {
1234 $pgui = new PublicProfileGUI($c);
1235 $pgui->setBackUrl($this->ctrl->getLinkTargetByClass("ilinfoscreengui"));
1236 $pgui->setEmbedded(true);
1237 $info->addProperty("", $pgui->getHTML());
1238 }
1239 }
1240
1241
1242 $info->addSection($this->lng->txt('group_registration'));
1243 $info->showLDAPRoleGroupMappingInfo();
1244
1245 if (!$this->object->isRegistrationEnabled()) {
1246 $info->addProperty(
1247 $this->lng->txt('group_registration_mode'),
1248 $this->lng->txt('grp_reg_deac_info_screen')
1249 );
1250 } else {
1251 switch ($this->object->getRegistrationType()) {
1253 $info->addProperty(
1254 $this->lng->txt('group_registration_mode'),
1255 $this->lng->txt('grp_reg_direct_info_screen')
1256 );
1257 break;
1258
1260 $info->addProperty(
1261 $this->lng->txt('group_registration_mode'),
1262 $this->lng->txt('grp_reg_req_info_screen')
1263 );
1264 break;
1265
1267 $info->addProperty(
1268 $this->lng->txt('group_registration_mode'),
1269 $this->lng->txt('grp_reg_passwd_info_screen')
1270 );
1271 break;
1272 }
1273 /*
1274 $info->addProperty($this->lng->txt('group_registration_time'),
1275 ilDatePresentation::formatPeriod(
1276 $this->object->getRegistrationStart(),
1277 $this->object->getRegistrationEnd()));
1278 */
1279 if ($this->object->isRegistrationUnlimited()) {
1280 $info->addProperty(
1281 $this->lng->txt('group_registration_time'),
1282 $this->lng->txt('grp_registration_unlimited')
1283 );
1284 } elseif ($this->object->getRegistrationStart()->getUnixTime() < time()) {
1285 $info->addProperty(
1286 $this->lng->txt("group_registration_time"),
1287 $this->lng->txt('cal_until') . ' ' .
1288 ilDatePresentation::formatDate($this->object->getRegistrationEnd())
1289 );
1290 } elseif ($this->object->getRegistrationStart()->getUnixTime() >= time()) {
1291 $info->addProperty(
1292 $this->lng->txt("group_registration_time"),
1293 $this->lng->txt('cal_from') . ' ' .
1294 ilDatePresentation::formatDate($this->object->getRegistrationStart())
1295 );
1296 }
1297 if ($this->object->isMembershipLimited()) {
1298 if ($this->object->getMinMembers()) {
1299 $info->addProperty(
1300 $this->lng->txt("mem_min_users"),
1301 (string) $this->object->getMinMembers()
1302 );
1303 }
1304 if ($this->object->getMaxMembers()) {
1305 $reg_info = ilObjGroupAccess::lookupRegistrationInfo($this->object->getId());
1306
1307 $info->addProperty(
1308 $this->lng->txt('mem_free_places'),
1309 (string) ($reg_info['reg_info_free_places'] ?? '0')
1310 );
1311 }
1312 }
1313
1314 if ($this->object->getCancellationEnd()) {
1315 $info->addProperty(
1316 $this->lng->txt('grp_cancellation_end'),
1317 ilDatePresentation::formatDate($this->object->getCancellationEnd())
1318 );
1319 }
1320 }
1321
1322 if ($this->object->getStart() instanceof ilDateTime &&
1323 !$this->object->getStart()->isNull()
1324 ) {
1325 $info->addProperty(
1326 $this->lng->txt('grp_period'),
1328 $this->object->getStart(),
1329 $this->object->getEnd()
1330 )
1331 );
1332 }
1333
1334 // Confirmation
1335 $privacy = ilPrivacySettings::getInstance();
1336
1337 if ($privacy->groupConfirmationRequired() or ilCourseDefinedFieldDefinition::_getFields($this->object->getId()) or $privacy->enabledGroupExport()) {
1338 $field_info = ilExportFieldsInfo::_getInstanceByType($this->object->getType());
1339
1340 $this->lng->loadLanguageModule('ps');
1341 $info->addSection($this->lng->txt('grp_user_agreement_info'));
1342 $info->addProperty($this->lng->txt('ps_export_data'), $field_info->exportableFieldsToInfoString());
1343
1344 if ($fields = ilCourseDefinedFieldDefinition::_fieldsToInfoString($this->object->getId())) {
1345 $info->addProperty($this->lng->txt('ps_grp_user_fields'), $fields);
1346 }
1347 }
1348
1349
1350 // forward the command
1351 $this->ctrl->forwardCommand($info);
1352 }
1353
1354 public function saveNotificationObject(): void
1355 {
1356 $noti = new ilMembershipNotifications($this->ref_id);
1357
1358 $grp_notification = false;
1359 if ($this->http->wrapper()->query()->has('grp_ntf')) {
1360 $grp_notification = $this->http->wrapper()->query()->retrieve(
1361 'grp_ntf',
1362 $this->refinery->kindlyTo()->bool()
1363 );
1364 }
1365
1366 if ($noti->canCurrentUserEdit()) {
1367 if ($grp_notification) {
1368 $noti->activateUser();
1369 } else {
1370 $noti->deactivateUser();
1371 }
1372 }
1373 $this->tpl->setOnScreenMessage('success', $this->lng->txt("settings_saved"), true);
1374 $this->ctrl->redirect($this, "");
1375 }
1376
1377 protected function membersObject(): void
1378 {
1379 $this->ctrl->redirectByClass('ilgroupmembershipgui');
1380 }
1381
1382
1383 public static function _goto(string $a_target, string $a_add = ""): void
1384 {
1385 global $DIC;
1386 $main_tpl = $DIC->ui()->mainTemplate();
1387 $a_target = (int) $a_target;
1388
1389 $ilUser = $DIC->user();
1390 $ilAccess = $DIC->access();
1391 $lng = $DIC->language();
1392 $ilErr = $DIC['ilErr'];
1393 $http = $DIC->http();
1394 $refinery = $DIC->refinery();
1395
1396 $target = '';
1397 if ($http->wrapper()->query()->has('target')) {
1398 $target = $http->wrapper()->query()->retrieve(
1399 'target',
1400 $refinery->kindlyTo()->string()
1401 );
1402 }
1403 if (substr($a_add, 0, 5) == 'rcode') {
1404 if ($ilUser->getId() == ANONYMOUS_USER_ID) {
1405 // Redirect to login for anonymous
1407 "login.php?target=" . $target . "&cmd=force_login&lang=" .
1408 $ilUser->getCurrentLanguage()
1409 );
1410 }
1411
1412 // Redirects to target location after assigning user to group
1414 $a_target,
1416 substr($a_add, 5)
1417 );
1418 }
1419
1420 if ($a_add == "mem" && $ilAccess->checkAccess("manage_members", "", $a_target)) {
1421 ilObjectGUI::_gotoRepositoryNode($a_target, "members");
1422 }
1423
1424 if ($a_add == "comp" && ilContSkillPresentationGUI::isAccessible($a_target)) {
1425 ilObjectGUI::_gotoRepositoryNode($a_target, "competences");
1426 }
1427
1428 if ($ilAccess->checkAccess("read", "", $a_target)) {
1430 } else {
1431 // to do: force flat view
1432 if ($ilAccess->checkAccess("visible", "", $a_target)) {
1433 ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreenGoto");
1434 } else {
1435 if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
1436 $main_tpl->setOnScreenMessage('failure', sprintf(
1437 $lng->txt("msg_no_perm_read_item"),
1439 ), true);
1441 }
1442 }
1443 }
1444 $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
1445 }
1446
1447
1448 public function initForm(string $a_mode = 'edit', bool $a_omit_form_action = false): ilPropertyFormGUI
1449 {
1450 $obj_service = $this->getObjectService();
1451 $form = new ilPropertyFormGUI();
1452
1453 if (!$a_omit_form_action) {
1454 switch ($a_mode) {
1455 case 'edit':
1456 $form->setFormAction($this->ctrl->getFormAction($this, 'update'));
1457 break;
1458
1459 default:
1460 $form->setTableWidth('600px');
1461 $form->setFormAction($this->ctrl->getFormAction($this, 'save'));
1462 break;
1463 }
1464 }
1465
1466 // title/description
1467 $this->initFormTitleDescription($form);
1468
1470
1471 if ($a_mode == 'edit') {
1472 // group period
1473 $cdur = new ilDateDurationInputGUI($this->lng->txt('grp_period'), 'period');
1474 $this->lng->loadLanguageModule('mem');
1475 $cdur->enableToggleFullTime(
1476 $this->lng->txt('mem_period_without_time'),
1477 !$this->object->getStartTimeIndication()
1478 );
1479 $cdur->setShowTime(true);
1480 $cdur->setInfo($this->lng->txt('grp_period_info'));
1481 $cdur->setStart($this->object->getStart());
1482 $cdur->setEnd($this->object->getEnd());
1483 $form->addItem($cdur);
1484
1485 // activation
1486 $this->lng->loadLanguageModule('rep');
1487
1488 $section = new ilFormSectionHeaderGUI();
1489 $section->setTitle($this->lng->txt('rep_activation_availability'));
1490 $form->addItem($section);
1491
1492 $online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'activation_online');
1493 $online->setChecked(!$this->object->getOfflineStatus());
1494 $online->setInfo($this->lng->txt('grp_activation_online_info'));
1495 $form->addItem($online);
1496
1497
1498 // Group registration ############################################################
1499 $pres = new ilFormSectionHeaderGUI();
1500 $pres->setTitle($this->lng->txt('grp_setting_header_registration'));
1501 $form->addItem($pres);
1502
1503 // Registration type
1504 $reg_type = new ilRadioGroupInputGUI($this->lng->txt('group_registration_mode'), 'registration_type');
1505 $reg_type->setValue((string) $this->object->getRegistrationType());
1506
1507 $opt_dir = new ilRadioOption(
1508 $this->lng->txt('grp_reg_direct'),
1510 );#$this->lng->txt('grp_reg_direct_info'));
1511 $reg_type->addOption($opt_dir);
1512
1513 $opt_pass = new ilRadioOption(
1514 $this->lng->txt('grp_pass_request'),
1516 );
1517 $pass = new ilTextInputGUI($this->lng->txt("password"), 'password');
1518 $pass->setRequired(true);
1519 $pass->setInfo($this->lng->txt('grp_reg_password_info'));
1520 $pass->setValue($this->object->getPassword());
1521 $pass->setSize(32);
1522 $pass->setMaxLength(32);
1523 $opt_pass->addSubItem($pass);
1524 $reg_type->addOption($opt_pass);
1525
1526 $opt_req = new ilRadioOption($this->lng->txt('grp_reg_request'), (string) ilGroupConstants::GRP_REGISTRATION_REQUEST, $this->lng->txt('grp_reg_request_info'));
1527 $reg_type->addOption($opt_req);
1528
1529 $opt_deact = new ilRadioOption($this->lng->txt('grp_reg_no_selfreg'), (string) ilGroupConstants::GRP_REGISTRATION_DEACTIVATED, $this->lng->txt('grp_reg_disabled_info'));
1530 $reg_type->addOption($opt_deact);
1531
1532 // Registration codes
1533 $reg_code = new ilCheckboxInputGUI($this->lng->txt('grp_reg_code'), 'reg_code_enabled');
1534 $reg_code->setChecked($this->object->isRegistrationAccessCodeEnabled());
1535 $reg_code->setValue('1');
1536 $reg_code->setInfo($this->lng->txt('grp_reg_code_enabled_info'));
1537 $form->addItem($reg_type);
1538
1539 // Registration codes
1540 if (!$this->object->getRegistrationAccessCode()) {
1541 $this->object->setRegistrationAccessCode(ilMembershipRegistrationCodeUtils::generateCode());
1542 }
1543 $reg_link = new ilHiddenInputGUI('reg_code');
1544 $reg_link->setValue($this->object->getRegistrationAccessCode());
1545 $form->addItem($reg_link);
1546
1547 $link = new ilCustomInputGUI($this->lng->txt('grp_reg_code_link'));
1548 $val = ilLink::_getLink($this->object->getRefId(), $this->object->getType(), array(), 'rcode' . $this->object->getRegistrationAccessCode());
1549 $link->setHTML('<span class="small">' . $val . '</span>');
1550 $reg_code->addSubItem($link);
1551 $form->addItem($reg_code);
1552
1553 // time limit
1554 $this->lng->loadLanguageModule('dateplaner');
1555 $dur = new ilDateDurationInputGUI($this->lng->txt('grp_reg_limited'), 'reg');
1556 $dur->setShowTime(true);
1557 $dur->setStart($this->object->getRegistrationStart());
1558 $dur->setEnd($this->object->getRegistrationEnd());
1559 $form->addItem($dur);
1560
1561 // cancellation limit
1562 $cancel = new ilDateTimeInputGUI($this->lng->txt('grp_cancellation_end'), 'cancel_end');
1563 $cancel->setInfo($this->lng->txt('grp_cancellation_end_info'));
1564 $cancel->setDate($this->object->getCancellationEnd());
1565 $form->addItem($cancel);
1566
1567 // max member
1568 $lim = new ilCheckboxInputGUI($this->lng->txt('reg_grp_max_members_short'), 'registration_membership_limited');
1569 $lim->setValue('1');
1570 // $lim->setOptionTitle($this->lng->txt('reg_grp_max_members'));
1571 $lim->setChecked($this->object->isMembershipLimited());
1572
1573 $min = new ilTextInputGUI($this->lng->txt('reg_grp_min_members'), 'registration_min_members');
1574 $min->setSize(3);
1575 $min->setMaxLength(4);
1576 $min->setValue($this->object->getMinMembers() ?: '');
1577 $min->setInfo($this->lng->txt('grp_subscription_min_members_info'));
1578 $lim->addSubItem($min);
1579
1580 $max = new ilTextInputGUI($this->lng->txt('reg_grp_max_members'), 'registration_max_members');
1581 $max->setValue($this->object->getMaxMembers() ?: '');
1582 //$max->setTitle($this->lng->txt('members'));
1583 $max->setSize(3);
1584 $max->setMaxLength(4);
1585 $max->setInfo($this->lng->txt('grp_reg_max_members_info'));
1586 $lim->addSubItem($max);
1587
1588 /*
1589 $wait = new ilCheckboxInputGUI($this->lng->txt('grp_waiting_list'),'waiting_list');
1590 $wait->setValue(1);
1591 //$wait->setOptionTitle($this->lng->txt('grp_waiting_list'));
1592 $wait->setInfo($this->lng->txt('grp_waiting_list_info'));
1593 $wait->setChecked($this->object->isWaitingListEnabled() ? true : false);
1594 $lim->addSubItem($wait);
1595 $form->addItem($lim);
1596 */
1597
1598 $wait = new ilRadioGroupInputGUI($this->lng->txt('grp_waiting_list'), 'waiting_list');
1599
1600 $option = new ilRadioOption($this->lng->txt('none'), '0');
1601 $wait->addOption($option);
1602
1603 $option = new ilRadioOption($this->lng->txt('grp_waiting_list_no_autofill'), '1');
1604 $option->setInfo($this->lng->txt('grp_waiting_list_info'));
1605 $wait->addOption($option);
1606
1607 $option = new ilRadioOption($this->lng->txt('grp_waiting_list_autofill'), '2');
1608 $option->setInfo($this->lng->txt('grp_waiting_list_autofill_info'));
1609 $wait->addOption($option);
1610
1611 if ($this->object->hasWaitingListAutoFill()) {
1612 $wait->setValue('2');
1613 } elseif ($this->object->isWaitingListEnabled()) {
1614 $wait->setValue('1');
1615 } else {
1616 $wait->setValue('0');
1617 }
1618
1619 $lim->addSubItem($wait);
1620
1621 $form->addItem($lim);
1622
1623
1624 // Group presentation
1625 $parent_membership_ref_id = 0;
1626 $hasParentMembership =
1627 (
1628 $parent_membership_ref_id = $this->tree->checkForParentType($this->object->getRefId(), 'crs', true)
1629 );
1630
1631 $pres = new ilFormSectionHeaderGUI();
1632 $pres->setTitle($this->lng->txt('grp_setting_header_presentation'));
1633 $form->addItem($pres);
1634
1635 // title and icon visibility
1636 $form = $obj_service->commonSettings()->legacyForm($form, $this->object)->addTitleIconVisibility();
1637
1638 // top actions visibility
1639 $form = $obj_service->commonSettings()->legacyForm($form, $this->object)->addTopActionsVisibility();
1640
1641 // custom icon
1642 $form = $obj_service->commonSettings()->legacyForm($form, $this->object)->addIcon();
1643
1644 // tile image
1645 $form = $obj_service->commonSettings()->legacyForm($form, $this->object)->addTileImage();
1646
1647 // list presentation
1649
1650
1651 // presentation type
1652 $view_type = new ilRadioGroupInputGUI($this->lng->txt('grp_presentation_type'), 'view_mode');
1653 if ($hasParentMembership) {
1654 $parent_view_mode = ilObjCourseAccess::_lookupViewMode(ilObject::_lookupObjId($parent_membership_ref_id));
1655 $course_view_mode = '';
1656 switch ($parent_view_mode) {
1658 $course_view_mode = ': ' . $this->lng->txt('cntr_view_sessions');
1659 break;
1660
1662 $course_view_mode = ': ' . $this->lng->txt('cntr_view_simple');
1663 break;
1664
1666 $course_view_mode = ': ' . $this->lng->txt('cntr_view_by_type');
1667 break;
1668 }
1669 if ($course_view_mode) {
1670 $opt = new ilRadioOption($this->lng->txt('grp_view_inherit') . $course_view_mode, (string) ilContainer::VIEW_INHERIT);
1671 $opt->setInfo($this->lng->txt('grp_view_inherit_info'));
1672 $view_type->addOption($opt);
1673 }
1674 }
1675
1676 if ($hasParentMembership && ilObjGroup::lookupViewMode($this->object->getId()) == ilContainer::VIEW_INHERIT) {
1677 $view_type->setValue((string) ilContainer::VIEW_INHERIT);
1678 } else {
1679 $view_type->setValue((string) ilObjGroup::lookupViewMode($this->object->getId()));
1680 }
1681
1682 $opt = new ilRadioOption($this->lng->txt('cntr_view_sessions'), (string) ilContainer::VIEW_SESSIONS);
1683 $opt->setInfo($this->lng->txt('cntr_view_info_sessions'));
1684 $view_type->addOption($opt);
1685
1686 // Limited sessions
1687 $this->lng->loadLanguageModule('crs');
1688 $sess = new ilCheckboxInputGUI($this->lng->txt('sess_limit'), 'sl');
1689 $sess->setValue('1');
1690 $sess->setChecked($this->object->isSessionLimitEnabled());
1691 $sess->setInfo($this->lng->txt('sess_limit_info'));
1692
1693 $prev = new ilNumberInputGUI($this->lng->txt('sess_num_prev'), 'sp');
1694 $prev->setMinValue(0);
1695 $prev->setValue((string) (
1696 $this->object->getNumberOfPreviousSessions() == -1 ?
1697 '' :
1698 $this->object->getNumberOfPreviousSessions()
1699 ));
1700 $prev->setSize(2);
1701 $prev->setMaxLength(3);
1702 $sess->addSubItem($prev);
1703
1704 $next = new ilNumberInputGUI($this->lng->txt('sess_num_next'), 'sn');
1705 $next->setMinValue(0);
1706 $next->setValue((string) (
1707 $this->object->getNumberOfNextSessions() == -1 ?
1708 '' :
1709 $this->object->getNumberOfNextSessions()
1710 ));
1711 $next->setSize(2);
1712 $next->setMaxLength(3);
1713 $sess->addSubItem($next);
1714 $opt->addSubItem($sess);
1715
1716 $opt = new ilRadioOption($this->lng->txt('cntr_view_simple'), (string) ilContainer::VIEW_SIMPLE);
1717 $opt->setInfo($this->lng->txt('grp_view_info_simple'));
1718 $view_type->addOption($opt);
1719
1720 $opt = new ilRadioOption($this->lng->txt('cntr_view_by_type'), (string) ilContainer::VIEW_BY_TYPE);
1721 $opt->setInfo($this->lng->txt('grp_view_info_by_type'));
1722 $view_type->addOption($opt);
1723 $form->addItem($view_type);
1724
1725
1726 // Sorting
1727 $sorting_settings = array();
1728 if ($hasParentMembership) {
1729 $sorting_settings[] = ilContainer::SORT_INHERIT;
1730 }
1731 $sorting_settings[] = ilContainer::SORT_TITLE;
1732 $sorting_settings[] = ilContainer::SORT_CREATION;
1733 $sorting_settings[] = ilContainer::SORT_MANUAL;
1734 $this->initSortingForm($form, $sorting_settings);
1735
1736 // additional features
1737 $feat = new ilFormSectionHeaderGUI();
1738 $feat->setTitle($this->lng->txt('obj_features'));
1739 $form->addItem($feat);
1740
1742 $this->object->getId(),
1743 $form,
1744 $this->getSubServices()
1745 );
1746
1747
1748 $mem = new ilCheckboxInputGUI($this->lng->txt('grp_show_members'), 'show_members');
1749 $mem->setChecked($this->object->getShowMembers());
1750 $mem->setInfo($this->lng->txt('grp_show_members_info'));
1751 $form->addItem($mem);
1752
1753 // Show members type
1754 $mail_type = new ilRadioGroupInputGUI($this->lng->txt('grp_mail_type'), 'mail_type');
1755 $mail_type->setValue((string) $this->object->getMailToMembersType());
1756
1757 $mail_tutors = new ilRadioOption(
1758 $this->lng->txt('grp_mail_tutors_only'),
1760 $this->lng->txt('grp_mail_tutors_only_info')
1761 );
1762 $mail_type->addOption($mail_tutors);
1763
1764 $mail_all = new ilRadioOption(
1765 $this->lng->txt('grp_mail_all'),
1767 $this->lng->txt('grp_mail_all_info')
1768 );
1769 $mail_type->addOption($mail_all);
1770 $form->addItem($mail_type);
1771
1772 // Self notification
1773 $not = new ilCheckboxInputGUI($this->lng->txt('grp_auto_notification'), 'auto_notification');
1774 $not->setValue('1');
1775 $not->setInfo($this->lng->txt('grp_auto_notification_info'));
1776 $not->setChecked($this->object->getAutoNotification());
1777 $form->addItem($not);
1778 }
1779
1780 switch ($a_mode) {
1781 case 'create':
1782 $form->setTitle($this->lng->txt('grp_new'));
1783 $form->setTitleIcon(ilUtil::getImagePath('standard/icon_grp.svg'));
1784
1785 $form->addCommandButton('save', $this->lng->txt('grp_new'));
1786 $form->addCommandButton('cancel', $this->lng->txt('cancel'));
1787 break;
1788
1789 case 'edit':
1790 $form->setTitle($this->lng->txt('grp_edit'));
1791 $form->setTitleIcon(ilUtil::getImagePath('standard/icon_grp.svg'));
1792
1793 // Edit ecs export settings
1794 $ecs = new ilECSGroupSettings($this->object);
1795 $ecs->addSettingsToForm($form, 'grp');
1796
1797 $form->addCommandButton('update', $this->lng->txt('save'));
1798 $form->addCommandButton('cancel', $this->lng->txt('cancel'));
1799 break;
1800 }
1801 return $form;
1802 }
1803
1804 protected function setSubTabs(string $a_tab): void
1805 {
1806 switch ($a_tab) {
1807 case 'settings':
1808 $this->tabs_gui->addSubTabTarget(
1809 "general",
1810 $this->ctrl->getLinkTarget($this, 'edit'),
1811 "edit",
1812 get_class($this)
1813 );
1814
1815 $this->tabs_gui->addSubTabTarget(
1816 "grp_info_settings",
1817 $this->ctrl->getLinkTarget($this, 'editInfo'),
1818 "editInfo",
1819 get_class($this)
1820 );
1821
1822 if (ilMapUtil::isActivated()) {
1823 $this->tabs_gui->addSubTabTarget(
1824 "grp_map_settings",
1825 $this->ctrl->getLinkTarget($this, 'editMapSettings'),
1826 "editMapSettings",
1827 get_class($this)
1828 );
1829 }
1830
1831 $this->tabs_gui->addSubTabTarget(
1832 'groupings',
1833 $this->ctrl->getLinkTargetByClass('ilobjcoursegroupinggui', 'listGroupings'),
1834 'listGroupings',
1835 get_class($this)
1836 );
1837
1838 // only show if export permission is granted
1839 if (ilPrivacySettings::getInstance()->checkExportAccess($this->object->getRefId()) or ilCourseDefinedFieldDefinition::_hasFields($this->object->getId())) {
1840 $this->tabs_gui->addSubTabTarget(
1841 'grp_custom_user_fields',
1842 $this->ctrl->getLinkTargetByClass('ilobjectcustomuserfieldsgui'),
1843 '',
1844 'ilobjectcustomuserfieldsgui'
1845 );
1846 }
1847
1848 // news settings
1849 if ($this->object->getUseNews()) {
1850 $this->tabs_gui->addSubTab(
1851 'obj_news_settings',
1852 $this->lng->txt("cont_news_settings"),
1853 $this->ctrl->getLinkTargetByClass('ilcontainernewssettingsgui')
1854 );
1855 }
1856
1857 $lti_settings = new ilLTIProviderObjectSettingGUI($this->object->getRefId());
1858 if ($lti_settings->hasSettingsAccess()) {
1859 $this->tabs_gui->addSubTabTarget(
1860 'lti_provider',
1861 $this->ctrl->getLinkTargetByClass(ilLTIProviderObjectSettingGUI::class)
1862 );
1863 }
1864
1865 $this->tabs_gui->addSubTabTarget(
1866 "obj_multilinguality",
1867 $this->ctrl->getLinkTargetByClass(TranslationGUI::class, ""),
1868 "",
1869 TranslationGUI::class
1870 );
1871
1872
1873 break;
1874 }
1875 }
1876
1877 private function checkAgreement(): bool
1878 {
1879 if ($this->access->checkAccess('write', '', $this->object->getRefId())) {
1880 return true;
1881 }
1882
1883 // Disable aggrement if is not member of group
1884 if (!$this->object->members_obj->isAssigned($this->user->getId())) {
1885 return true;
1886 }
1887
1888 if (ilMemberViewSettings::getInstance()->isActive()) {
1889 return true;
1890 }
1891
1892 $privacy = ilPrivacySettings::getInstance();
1893
1894 // Check agreement
1895 if (($privacy->groupConfirmationRequired() or ilCourseDefinedFieldDefinition::_hasFields($this->object->getId()))
1896 and !ilMemberAgreement::_hasAccepted($this->user->getId(), $this->object->getId())) {
1897 return false;
1898 }
1899 // Check required fields
1900 if (!ilCourseUserData::_checkRequired($this->user->getId(), $this->object->getId())) {
1901 return false;
1902 }
1903 return true;
1904 }
1905
1909 public function prepareOutput(bool $show_subobjects = true): bool
1910 {
1911 return parent::prepareOutput($show_subobjects);
1912 }
1913
1914 public function createMailSignature(): string
1915 {
1916 $link = chr(13) . chr(10) . chr(13) . chr(10);
1917 $link .= $this->lng->txt('grp_mail_permanent_link');
1918 $link .= chr(13) . chr(10) . chr(13) . chr(10);
1919 $link .= ilLink::_getLink($this->object->getRefId());
1920 return rawurlencode(base64_encode($link));
1921 }
1922
1926 protected function initHeaderAction(?string $sub_type = null, ?int $sub_id = null): ?ilObjectListGUI
1927 {
1928 global $DIC;
1929
1930 $ilSetting = $DIC['ilSetting'];
1931 $ilUser = $DIC['ilUser'];
1932
1933 $lg = parent::initHeaderAction($sub_type, $sub_id);
1934
1935 if (ilGroupParticipants::_isParticipant($this->ref_id, $ilUser->getId())) {
1937 $noti = new ilMembershipNotifications($this->ref_id);
1938 if (!$noti->isCurrentUserActive()) {
1939 $lg->addHeaderIcon(
1940 "not_icon",
1941 ilUtil::getImagePath("object/notification_off.svg"),
1942 $this->lng->txt("grp_notification_deactivated")
1943 );
1944
1945 $this->ctrl->setParameter($this, "grp_ntf", 1);
1946 $caption = "grp_activate_notification";
1947 } else {
1948 $lg->addHeaderIcon(
1949 "not_icon",
1950 ilUtil::getImagePath("object/notification_on.svg"),
1951 $this->lng->txt("grp_notification_activated")
1952 );
1953
1954 $this->ctrl->setParameter($this, "grp_ntf", 0);
1955 $caption = "grp_deactivate_notification";
1956 }
1957
1958 if ($noti->canCurrentUserEdit()) {
1959 $lg->addCustomCommand(
1960 $this->ctrl->getLinkTarget($this, "saveNotification"),
1961 $caption
1962 );
1963 }
1964
1965 $this->ctrl->setParameter($this, "grp_ntf", "");
1966 }
1967 }
1968
1969 return $lg;
1970 }
1971
1972
1973 public function addCustomData(array $a_data): array
1974 {
1975 // object defined fields
1976 $odfs = ilCourseUserData::_getValuesByObjId($this->object->getId());
1977 $udfs = $this->profile->getAllUserDefinedFields();
1978
1979 return array_reduce(
1980 iterator_to_array($this->profile->getDataForMultiple(array_keys($a_data))),
1981 function (array $c, ProfileData $v) use ($a_data, $udfs, $odfs): array {
1982 $c[$v->getId()] = $a_data[$v->getId()];
1983
1984 foreach ($udfs as $field) {
1985 $field_id = $field->getIdentifier();
1986 $c[$v->getId()]['udf_' . $field_id] = implode(', ', $v->getAdditionalFieldByIdentifier($field_id) ?? []);
1987 }
1988
1989 foreach ((array) ($odfs[$v->getId()] ?? []) as $cdf_field => $cdf_value) {
1990 $c[$v->getId()]['cdf_' . $cdf_field] = (string) $cdf_value;
1991 }
1992 return $c;
1993 },
1994 []
1995 );
1996 }
1997
1998 public function getLocalRoles(): array
1999 {
2000 $local_roles = $this->object->getLocalGroupRoles();
2001 $grp_member = $this->object->getDefaultMemberRole();
2002 $grp_roles = array();
2003
2004 //put the group member role to the top of the crs_roles array
2005 if (in_array($grp_member, $local_roles)) {
2006 $grp_roles[$grp_member] = ilObjRole::_getTranslation(array_search($grp_member, $local_roles));
2007 unset($local_roles[$grp_roles[$grp_member]]);
2008 }
2009
2010 foreach ($local_roles as $title => $role_id) {
2011 $grp_roles[(int) $role_id] = ilObjRole::_getTranslation($title);
2012 }
2013 return $grp_roles;
2014 }
2015
2016 protected function jump2UsersGalleryObject(): void
2017 {
2018 $this->ctrl->redirectByClass('ilUsersGalleryGUI');
2019 }
2020
2024 public function setSideColumnReturn(): void
2025 {
2026 $this->ctrl->setReturn($this, "view");
2027 }
2028} // 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 _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)
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