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