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