ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilObjGroupGUI.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5include_once "./Services/Container/classes/class.ilContainerGUI.php";
6include_once('./Modules/Group/classes/class.ilObjGroup.php');
7
31{
35 protected $news;
36
41 public function __construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output = false)
42 {
43 global $DIC;
44
45 $ilSetting = $DIC['ilSetting'];
46
47 $this->type = "grp";
48 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
49
50 $this->lng->loadLanguageModule('grp');
51 $this->lng->loadLanguageModule('obj');
52
53 $this->setting = $ilSetting;
54 $this->news = $DIC->news();
55 }
56
57 public function executeCommand()
58 {
59 global $DIC;
60
61 $ilUser = $DIC['ilUser'];
62 $rbacsystem = $DIC['rbacsystem'];
63 $ilAccess = $DIC['ilAccess'];
64 $ilNavigationHistory = $DIC['ilNavigationHistory'];
65 $ilErr = $DIC['ilErr'];
66 $ilToolbar = $DIC['ilToolbar'];
67
68 $next_class = $this->ctrl->getNextClass($this);
69 $cmd = $this->ctrl->getCmd();
70 $this->prepareOutput();
71
72 // add entry to navigation history
73 if (!$this->getCreationMode() &&
74 $ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
75 include_once("./Services/Link/classes/class.ilLink.php");
76 $ilNavigationHistory->addItem(
77 $_GET["ref_id"],
78 ilLink::_getLink($_GET["ref_id"], "grp"),
79 "grp"
80 );
81 }
82
83 // if news timeline is landing page, redirect if necessary
84 if ($next_class == "" && $cmd == "" && $this->object->isNewsTimelineLandingPageEffective()
85 && $ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
86 $this->ctrl->redirectbyclass("ilnewstimelinegui");
87 }
88
89 $header_action = true;
90 switch ($next_class) {
91 case 'ilreputilgui':
92 $ru = new \ilRepUtilGUI($this);
93 $this->ctrl->setReturn($this, 'trash');
94 $this->ctrl->forwardCommand($ru);
95 break;
96
97 case 'illtiproviderobjectsettinggui':
98 $this->setSubTabs('settings');
99 $this->tabs_gui->activateTab('settings');
100 $this->tabs_gui->activateSubTab('lti_provider');
101 $lti_gui = new ilLTIProviderObjectSettingGUI($this->object->getRefId());
102 $lti_gui->setCustomRolesForSelection($GLOBALS['DIC']->rbac()->review()->getLocalRoles($this->object->getRefId()));
103 $lti_gui->offerLTIRolesForSelection(false);
104 $this->ctrl->forwardCommand($lti_gui);
105 break;
106
107
108 case 'ilgroupmembershipgui':
109
110 $this->tabs_gui->activateTab('members');
111
112 include_once './Modules/Group/classes/class.ilGroupMembershipGUI.php';
113 $mem_gui = new ilGroupMembershipGUI($this, $this->object);
114 $this->ctrl->forwardCommand($mem_gui);
115 break;
116
117
118 case 'ilgroupregistrationgui':
119 $this->ctrl->setReturn($this, '');
120 $this->tabs_gui->setTabActive('join');
121 include_once('./Modules/Group/classes/class.ilGroupRegistrationGUI.php');
122 $registration = new ilGroupRegistrationGUI($this->object);
123 $this->ctrl->forwardCommand($registration);
124 break;
125
126 case 'ilpermissiongui':
127 $this->tabs_gui->activateTab('perm_settings');
128 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
129 $perm_gui = new ilPermissionGUI($this);
130 $ret = &$this->ctrl->forwardCommand($perm_gui);
131 break;
132
133 case "ilinfoscreengui":
134 $ret = &$this->infoScreen();
135 break;
136
137 case "illearningprogressgui":
138 include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
139
140 $new_gui = new ilLearningProgressGUI(
142 $this->object->getRefId(),
143 $_GET['user_id'] ? $_GET['user_id'] : $ilUser->getId()
144 );
145 $this->ctrl->forwardCommand($new_gui);
146 $this->tabs_gui->setTabActive('learning_progress');
147 break;
148
149 case 'ilobjcoursegroupinggui':
150 $this->setSubTabs('settings');
151
152 include_once './Modules/Course/classes/class.ilObjCourseGroupingGUI.php';
153 $this->ctrl->setReturn($this, 'edit');
154 $crs_grp_gui = new ilObjCourseGroupingGUI($this->object, (int) $_GET['obj_id']);
155 $this->ctrl->forwardCommand($crs_grp_gui);
156
157 $this->tabs_gui->setTabActive('settings');
158 $this->tabs_gui->setSubTabActive('groupings');
159 break;
160
161 case 'ilcoursecontentgui':
162
163 include_once './Modules/Course/classes/class.ilCourseContentGUI.php';
164 $course_content_obj = new ilCourseContentGUI($this);
165 $this->ctrl->forwardCommand($course_content_obj);
166 break;
167
168 case 'ilpublicuserprofilegui':
169 require_once './Services/User/classes/class.ilPublicUserProfileGUI.php';
170 $this->setSubTabs('members');
171 $this->tabs_gui->setTabActive('group_members');
172 $this->tabs_gui->setSubTabActive('grp_members_gallery');
173 $profile_gui = new ilPublicUserProfileGUI($_GET["user"]);
174 if ($_GET["back_url"] == "") {
175 $profile_gui->setBackUrl($this->ctrl->getLinkTargetByClass(["ilGroupMembershipGUI", "ilUsersGalleryGUI"], 'view'));
176 }
177 $html = $this->ctrl->forwardCommand($profile_gui);
178 $this->tpl->setVariable("ADM_CONTENT", $html);
179 break;
180
181 case "ilcolumngui":
182 $this->tabs_gui->setTabActive('none');
183 $this->checkPermission("read");
184 include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
185 $this->tpl->setVariable(
186 "LOCATION_CONTENT_STYLESHEET",
187 ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId())
188 );
189 $this->renderObject();
190 break;
191
192 // container page editing
193 case "ilcontainerpagegui":
194 $ret = $this->forwardToPageObject();
195 if ($ret != "") {
196 $this->tpl->setContent($ret);
197 }
198 $header_action = false;
199 break;
200
201 case 'ilobjectcopygui':
202 include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
203 $cp = new ilObjectCopyGUI($this);
204 $cp->setType('grp');
205 $this->ctrl->forwardCommand($cp);
206 break;
207
208 case "ilobjstylesheetgui":
209 $this->forwardToStyleSheet();
210 break;
211
212 case 'ilobjectcustomuserfieldsgui':
213 include_once './Services/Membership/classes/class.ilObjectCustomUserFieldsGUI.php';
214 $cdf_gui = new ilObjectCustomUserFieldsGUI($this->object->getId());
215 $this->setSubTabs('settings');
216 $this->tabs_gui->setTabActive('settings');
217 $this->tabs_gui->activateSubTab('grp_custom_user_fields');
218 $this->ctrl->forwardCommand($cdf_gui);
219 break;
220
221 case 'ilmemberagreementgui':
222 include_once('Services/Membership/classes/class.ilMemberAgreementGUI.php');
223 $this->ctrl->setReturn($this, '');
224 $this->tabs_gui->setTabActive('view_content');
225 $agreement = new ilMemberAgreementGUI($this->object->getRefId());
226 $this->ctrl->forwardCommand($agreement);
227 break;
228
229 case 'ilexportgui':
230 $this->tabs_gui->setTabActive('export');
231 include_once './Services/Export/classes/class.ilExportGUI.php';
232 $exp = new ilExportGUI($this);
233 $exp->addFormat('xml');
234 $this->ctrl->forwardCommand($exp);
235 break;
236
237 case "ilcommonactiondispatchergui":
238 include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
240 $this->ctrl->forwardCommand($gui);
241 break;
242
243 case 'ilobjectservicesettingsgui':
244 $this->ctrl->setReturn($this, 'edit');
245 $this->setSubTabs("settings");
246 $this->tabs_gui->activateTab('settings');
247 $this->tabs_gui->activateSubTab('tool_settings');
248
249 include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
251 $this,
252 $this->object->getId(),
253 array(
255 )
256 );
257 $this->ctrl->forwardCommand($service);
258 break;
259
260 case 'ilmailmembersearchgui':
261 include_once 'Services/Mail/classes/class.ilMail.php';
262 $mail = new ilMail($ilUser->getId());
263
264 if (!($ilAccess->checkAccess('manage_members', '', $this->object->getRefId()) ||
265 $this->object->getMailToMembersType() == ilObjGroup::MAIL_ALLOWED_ALL) &&
266 $rbacsystem->checkAccess('internal_mail', $mail->getMailObjectReferenceId())) {
267 $ilErr->raiseError($this->lng->txt("msg_no_perm_read"), $ilErr->MESSAGE);
268 }
269
270 $this->tabs_gui->setTabActive('members');
271
272 include_once './Services/Contact/classes/class.ilMailMemberSearchGUI.php';
273 include_once './Services/Contact/classes/class.ilMailMemberGroupRoles.php';
274
275 $mail_search = new ilMailMemberSearchGUI($this, $this->object->getRefId(), new ilMailMemberGroupRoles());
276 $mail_search->setObjParticipants(ilCourseParticipants::_getInstanceByObjId($this->object->getId()));
277 $this->ctrl->forwardCommand($mail_search);
278 break;
279
280 case 'ilbadgemanagementgui':
281 $this->tabs_gui->setTabActive('obj_tool_setting_badges');
282 include_once 'Services/Badge/classes/class.ilBadgeManagementGUI.php';
283 $bgui = new ilBadgeManagementGUI($this->object->getRefId(), $this->object->getId(), 'grp');
284 $this->ctrl->forwardCommand($bgui);
285 break;
286
287 case "ilcontainernewssettingsgui":
288 $this->setSubTabs("settings");
289 $this->tabs_gui->setTabActive('settings');
290 $this->tabs_gui->activateSubTab('obj_news_settings');
291 include_once("./Services/Container/classes/class.ilContainerNewsSettingsGUI.php");
292 $news_set_gui = new ilContainerNewsSettingsGUI($this);
293 $news_set_gui->setTimeline(true);
294 $news_set_gui->setCronNotifications(true);
295 $news_set_gui->setHideByDate(true);
296 $this->ctrl->forwardCommand($news_set_gui);
297 break;
298
299 case "ilnewstimelinegui":
300 $this->checkPermission("read");
301 $this->tabs_gui->setTabActive('news_timeline');
302 include_once("./Services/News/classes/class.ilNewsTimelineGUI.php");
303 $t = ilNewsTimelineGUI::getInstance($this->object->getRefId(), $this->object->getNewsTimelineAutoENtries());
304 $t->setUserEditAll($ilAccess->checkAccess('write', '', $this->object->getRefId(), 'grp'));
305 $this->showPermanentLink($tpl);
306 $this->ctrl->forwardCommand($t);
307 include_once 'Services/Tracking/classes/class.ilLearningProgress.php';
309 $ilUser->getId(),
310 $this->object->getId(),
311 $this->object->getRefId(),
312 'grp'
313 );
314 break;
315
316 case "ilcontainerskillgui":
317 $this->tabs_gui->activateTab('obj_tool_setting_skills');
318 include_once("./Services/Container/Skills/classes/class.ilContainerSkillGUI.php");
319 $gui = new ilContainerSkillGUI($this);
320 $this->ctrl->forwardCommand($gui);
321 break;
322
323 case 'ilcalendarpresentationgui':
324 include_once('./Services/Calendar/classes/class.ilCalendarPresentationGUI.php');
325 $cal = new ilCalendarPresentationGUI($this->object->getRefId());
326 $ret = $this->ctrl->forwardCommand($cal);
327 break;
328
329 case 'ilobjectmetadatagui':
330 if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
331 $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
332 }
333 $this->tabs_gui->activateTab('meta_data');
334 $this->ctrl->forwardCommand(new ilObjectMetaDataGUI($this->object));
335 break;
336
337
338 case 'ilobjecttranslationgui':
339 $this->checkPermissionBool("write");
340 $this->setSubTabs("settings");
341 $this->tabs->activateTab("settings");
342 include_once("./Services/Object/classes/class.ilObjectTranslationGUI.php");
343 $transgui = new ilObjectTranslationGUI($this);
344 $this->ctrl->forwardCommand($transgui);
345 break;
346
347 default:
348
349 // check visible permission
350 if (!$this->getCreationMode() and
351 !$ilAccess->checkAccess('visible', '', $this->object->getRefId(), 'grp') and
352 !$ilAccess->checkAccess('read', '', $this->object->getRefId(), 'grp')) {
353 $ilErr->raiseError($this->lng->txt("msg_no_perm_read"), $ilErr->MESSAGE);
354 }
355
356 // #9401 - see also ilStartupGUI::_checkGoto()
357 if ($cmd == 'infoScreenGoto') {
358 if ($this->object->isRegistrationEnabled()) {
359 $cmd = 'join';
360 } else {
361 $cmd = 'infoScreen';
362 }
363 }
364
365 // check read permission
366 if ((!$this->getCreationMode()
367 && !$rbacsystem->checkAccess('read', $this->object->getRefId()) && $cmd != 'infoScreen')
368 || $cmd == 'join') {
369 // no join permission -> redirect to info screen
370 if (!$rbacsystem->checkAccess('join', $this->object->getRefId())) {
371 $this->ctrl->redirect($this, "infoScreen");
372 } else { // no read -> show registration
373 include_once('./Modules/Group/classes/class.ilGroupRegistrationGUI.php');
374 $this->ctrl->redirectByClass("ilGroupRegistrationGUI", "show");
375 }
376 }
377 if (!$cmd) {
378 $cmd = 'view';
379 }
380 $cmd .= 'Object';
381 $this->$cmd();
382 break;
383 }
384
385 if ($header_action) {
386 $this->addHeaderAction();
387 }
388 }
389
390 public function viewObject()
391 {
392 global $DIC;
393
394 $tree = $DIC['tree'];
395 $rbacsystem = $DIC['rbacsystem'];
396 $ilUser = $DIC['ilUser'];
397
398 include_once 'Services/Tracking/classes/class.ilLearningProgress.php';
400 $ilUser->getId(),
401 $this->object->getId(),
402 $this->object->getRefId(),
403 'grp'
404 );
405
407 $this->object->getId(),
408 $this->object->getId(),
409 'grp'
410 );
411
412
413 if (strtolower($_GET["baseClass"]) == "iladministrationgui") {
414 parent::viewObject();
415 return true;
416 }
417
418 if (!$this->checkAgreement()) {
419 include_once('Services/Membership/classes/class.ilMemberAgreementGUI.php');
420 $this->tabs_gui->setTabActive('view_content');
421 $this->ctrl->setReturn($this, 'view');
422 $agreement = new ilMemberAgreementGUI($this->object->getRefId());
423 $this->ctrl->setCmdClass(get_class($agreement));
424 $this->ctrl->forwardCommand($agreement);
425 return true;
426 }
427
428 $this->tabs_gui->setTabActive('view_content');
429 $this->renderObject();
430 }
431
435 public function renderObject()
436 {
437 global $DIC;
438
439 $ilTabs = $DIC['ilTabs'];
440
441 $ilTabs->activateTab("view_content");
442 $ret = parent::renderObject();
443 return $ret;
444 }
445
453 public function modifyItemGUI($a_item_list_gui, $a_item_data, $a_show_path)
454 {
455 global $DIC;
456
457 $tree = $DIC['tree'];
458
459 // if folder is in a course, modify item list gui according to course requirements
460 if ($course_ref_id = $tree->checkForParentType($this->object->getRefId(), 'crs')) {
461 include_once("./Modules/Course/classes/class.ilObjCourse.php");
462 include_once("./Modules/Course/classes/class.ilObjCourseGUI.php");
463 $course_obj_id = ilObject::_lookupObjId($course_ref_id);
465 $a_item_list_gui,
466 'ilcoursecontentgui',
467 $a_item_data,
468 $a_show_path,
469 ilObjCourse::_lookupAboStatus($course_obj_id),
470 $course_ref_id,
471 $course_obj_id,
472 $this->object->getRefId()
473 );
474 }
475 }
476
481 public function afterSave(\ilObject $new_object, $a_redirect = true)
482 {
483 global $DIC;
484
485 $ilUser = $DIC['ilUser'];
486 $ilSetting = $DIC['ilSetting'];
487
488 $new_object->setRegistrationType(GRP_REGISTRATION_DIRECT);
489 $new_object->update();
490
491 // check for parent group or course => SORT_INHERIT
492 $sort_mode = ilContainer::SORT_TITLE;
493 if (
494 $GLOBALS['DIC']['tree']->checkForParentType($new_object->getRefId(), 'crs', true) ||
495 $GLOBALS['DIC']['tree']->checkForParentType($new_object->getRefId(), 'grp', true)
496 ) {
497 $sort_mode = ilContainer::SORT_INHERIT;
498 }
499
500 // Save sorting
501 include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
502 $sort = new ilContainerSortingSettings($new_object->getId());
503 $sort->setSortMode($sort_mode);
504 $sort->update();
505
506
507 // Add user as admin and enable notification
508 include_once './Modules/Group/classes/class.ilGroupParticipants.php';
509 $members_obj = ilGroupParticipants::_getInstanceByObjId($new_object->getId());
510 $members_obj->add($ilUser->getId(), IL_GRP_ADMIN);
511 $members_obj->updateNotification($ilUser->getId(), $ilSetting->get('mail_grp_admin_notification', true));
512 $members_obj->updateContact($ilUser->getId(), true);
513
514 ilUtil::sendSuccess($this->lng->txt("object_added"), true);
515 if ($a_redirect) {
516 $this->ctrl->setParameter($this, "ref_id", $new_object->getRefId());
517 $this->ctrl->redirect($this, 'edit');
518 }
519 }
520
528 public function editObject(ilPropertyFormGUI $a_form = null)
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
540 $this->tpl->setVariable('ADM_CONTENT', $a_form->getHTML());
541 }
542
550 public function updateGroupTypeObject()
551 {
552 include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateUtils.php';
554 $this->object->getRefId(),
555 (int) $_REQUEST['grp_type']
556 );
557
558 ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
559 $this->ctrl->redirect($this, 'edit');
560 }
561
562
568 public function updateObject()
569 {
570 $obj_service = $this->getObjectService();
571
572 $this->checkPermission('write');
573
574 $form = $this->initForm();
575 if ($form->checkInput()) {
576 // handle group type settings
577 include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateObjSettings.php';
578 $old_type = ilDidacticTemplateObjSettings::lookupTemplateId($this->object->getRefId());
579
580 $modified = false;
581 $new_type_info = $form->getInput('didactic_type');
582 if ($new_type_info) {
583 $new_type = explode('_', $form->getInput('didactic_type'));
584 $new_type = $new_type[1];
585
586 $modified = ($new_type != $old_type);
587 ilLoggerFactory::getLogger('grp')->info('Switched group type from ' . $old_type . ' to ' . $new_type);
588 }
589
590 // Additional checks: both tile and session limitation activated (not supported)
591 if (
592 $form->getInput('sl') == "1" &&
593 $form->getInput('list_presentation') == "tile") {
594 $form->setValuesByPost();
595 ilUtil::sendFailure($this->lng->txt('crs_tile_and_session_limit_not_supported'));
596 return $this->editObject($form);
597 }
598
599 $old_autofill = $this->object->hasWaitingListAutoFill();
600
601 $this->object->setTitle(ilUtil::stripSlashes($form->getInput('title')));
602 $this->object->setDescription(ilUtil::stripSlashes($form->getInput('desc')));
603 $this->object->setGroupType(ilUtil::stripSlashes($form->getInput('grp_type')));
604 $this->object->setRegistrationType(ilUtil::stripSlashes($form->getInput('registration_type')));
605 $this->object->setPassword(ilUtil::stripSlashes($form->getInput('password')));
606 $this->object->enableUnlimitedRegistration((bool) !$form->getInput('reg_limit_time'));
607 $this->object->enableMembershipLimitation((bool) $form->getInput('registration_membership_limited'));
608 $this->object->setMinMembers((int) $form->getInput('registration_min_members'));
609 $this->object->setMaxMembers((int) $form->getInput('registration_max_members'));
610 $this->object->enableRegistrationAccessCode((bool) $form->getInput('reg_code_enabled'));
611 $this->object->setRegistrationAccessCode($form->getInput('reg_code'));
612 $this->object->setViewMode($form->getInput('view_mode'));
613 $this->object->setMailToMembersType((int) $form->getInput('mail_type'));
614 $this->object->setShowMembers((int) $form->getInput('show_members'));
615 $this->object->setAutoNotification((bool) $form->getInput('auto_notification'));
616
617 // session limit
618 $this->object->enableSessionLimit((int) $form->getInput('sl'));
619 $session_sp = $form->getInput('sp');
620 $this->object->setNumberOfPreviousSessions(is_numeric($session_sp) ? (int) $session_sp : -1);
621 $session_sn = $form->getInput('sn');
622 $this->object->setNumberOfnextSessions(is_numeric($session_sn) ? (int) $session_sn : -1);
623
624 // period
625 $grp_period = $form->getItemByPostVar("period");
626
627
628 $this->object->setPeriod(
629 $grp_period->getStart(),
630 $grp_period->getEnd()
631 );
632
633 $reg = $form->getItemByPostVar("reg");
634 if ($reg->getStart() instanceof ilDateTime && $reg->getEnd() instanceof ilDateTime) {
635 $this->object->enableUnlimitedRegistration(false);
636 } else {
637 $this->object->enableUnlimitedRegistration(true);
638 }
639
640 $this->object->setRegistrationStart($reg->getStart());
641 $this->object->setRegistrationEnd($reg->getEnd());
642
643 $cancel_end = $form->getItemByPostVar("cancel_end");
644 $this->object->setCancellationEnd($cancel_end->getDate());
645
646 switch ((int) $_POST['waiting_list']) {
647 case 2:
648 $this->object->enableWaitingList(true);
649 $this->object->setWaitingListAutoFill(true);
650 break;
651
652 case 1:
653 $this->object->enableWaitingList(true);
654 $this->object->setWaitingListAutoFill(false);
655 break;
656
657 default:
658 $this->object->enableWaitingList(false);
659 $this->object->setWaitingListAutoFill(false);
660 break;
661 }
662
663 // title icon visibility
664 $obj_service->commonSettings()->legacyForm($form, $this->object)->saveTitleIconVisibility();
665
666 // top actions visibility
667 $obj_service->commonSettings()->legacyForm($form, $this->object)->saveTopActionsVisibility();
668
669 // custom icon
670 $obj_service->commonSettings()->legacyForm($form, $this->object)->saveIcon();
671
672 // tile image
673 $obj_service->commonSettings()->legacyForm($form, $this->object)->saveTileImage();
674
675 // list presentation
676 $this->saveListPresentation($form);
677
678 // update object settings
679 $this->object->update();
680
681
682 include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
684 $this->object->getId(),
685 $form,
686 $this->getSubServices()
687 );
688
689 // Save sorting
690 $this->saveSortingSettings($form);
691 // if autofill has been activated trigger process
692 if (
693 !$old_autofill &&
694 $this->object->hasWaitingListAutoFill()) {
695 $this->object->handleAutoFill();
696 }
697
698 // BEGIN ChangeEvents: Record update Object.
699 require_once('Services/Tracking/classes/class.ilChangeEvent.php');
700 global $DIC;
701
702 $ilUser = $DIC['ilUser'];
704 $this->object->getId(),
705 $ilUser->getId(),
706 'update'
707 );
708 ilChangeEvent::_catchupWriteEvents($this->object->getId(), $ilUser->getId());
709 // END PATCH ChangeEvents: Record update Object.
710 // Update ecs export settings
711 include_once 'Modules/Group/classes/class.ilECSGroupSettings.php';
712 $ecs = new ilECSGroupSettings($this->object);
713 $ecs->handleSettingsUpdate();
714 } else {
715 ilUtil::sendFailure($GLOBALS['DIC']->language()->txt('err_check_input')); // #16975
716
717 $form->setValuesByPost();
718 $this->editObject($form);
719 return true;
720 }
721
722 // group type modified
723 if ($modified) {
724 if ($new_type == 0) {
725 $new_type_txt = $GLOBALS['DIC']['lng']->txt('il_grp_status_open');
726 } else {
727 include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateSetting.php';
728 $dtpl = new ilDidacticTemplateSetting($new_type);
729 $new_type_txt = $dtpl->getPresentationTitle($GLOBALS['DIC']['lng']->getLangKey());
730 }
731
732
733 include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
734 ilUtil::sendQuestion($this->lng->txt('grp_warn_grp_type_changed'));
735 $confirm = new ilConfirmationGUI();
736 $confirm->setFormAction($this->ctrl->getFormAction($this));
737 $confirm->addItem(
738 'grp_type',
739 $new_type,
740 $this->lng->txt('grp_info_new_grp_type') . ': ' . $new_type_txt
741 );
742 $confirm->addButton($this->lng->txt('grp_change_type'), 'updateGroupType');
743 $confirm->setCancel($this->lng->txt('cancel'), 'edit');
744
745 $this->tpl->setContent($confirm->getHTML());
746 return true;
747 } else {
748 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
749 $this->ctrl->redirect($this, 'edit');
750 return true;
751 }
752 }
753
754 protected function getSubServices() : array
755 {
756 $subs = array(
765 );
766 if ($this->news->isGloballyActivated()) {
768 }
769
770 return $subs;
771 }
772
776 public function editMapSettingsObject()
777 {
778 global $DIC;
779
780 $ilUser = $DIC['ilUser'];
781 $ilCtrl = $DIC['ilCtrl'];
782 $ilUser = $DIC['ilUser'];
783 $ilAccess = $DIC['ilAccess'];
784
785 $this->setSubTabs("settings");
786 $this->tabs_gui->setTabActive('settings');
787 $this->tabs_gui->setSubTabActive('grp_map_settings');
788
789 include_once('./Services/Maps/classes/class.ilMapUtil.php');
790 if (!ilMapUtil::isActivated() ||
791 !$ilAccess->checkAccess("write", "", $this->object->getRefId())) {
792 return;
793 }
794
795 $latitude = $this->object->getLatitude();
796 $longitude = $this->object->getLongitude();
797 $zoom = $this->object->getLocationZoom();
798
799 // Get Default settings, when nothing is set
800 if ($latitude == 0 && $longitude == 0 && $zoom == 0) {
802 $latitude = $def["latitude"];
803 $longitude = $def["longitude"];
804 $zoom = $def["zoom"];
805 }
806
807
808 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
809 $form = new ilPropertyFormGUI();
810 $form->setFormAction($ilCtrl->getFormAction($this));
811
812 $form->setTitle($this->lng->txt("grp_map_settings"));
813
814 // enable map
815 $public = new ilCheckboxInputGUI(
816 $this->lng->txt("grp_enable_map"),
817 "enable_map"
818 );
819 $public->setValue("1");
820 $public->setChecked($this->object->getEnableGroupMap());
821 $form->addItem($public);
822
823 // map location
824 $loc_prop = new ilLocationInputGUI(
825 $this->lng->txt("grp_map_location"),
826 "location"
827 );
828 $loc_prop->setLatitude($latitude);
829 $loc_prop->setLongitude($longitude);
830 $loc_prop->setZoom($zoom);
831 $form->addItem($loc_prop);
832
833 $form->addCommandButton("saveMapSettings", $this->lng->txt("save"));
834
835 $this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
836 }
837
838 public function saveMapSettingsObject()
839 {
840 global $DIC;
841
842 $ilCtrl = $DIC['ilCtrl'];
843 $ilUser = $DIC['ilUser'];
844
845 $this->object->setLatitude(ilUtil::stripSlashes($_POST["location"]["latitude"]));
846 $this->object->setLongitude(ilUtil::stripSlashes($_POST["location"]["longitude"]));
847 $this->object->setLocationZoom(ilUtil::stripSlashes($_POST["location"]["zoom"]));
848 $this->object->setEnableGroupMap(ilUtil::stripSlashes($_POST["enable_map"]));
849 $this->object->update();
850
851 $ilCtrl->redirect($this, "editMapSettings");
852 }
853
854
861 public function editInfoObject()
862 {
863 global $DIC;
864
865 $ilErr = $DIC['ilErr'];
866 $ilAccess = $DIC['ilAccess'];
867
868 $this->checkPermission('write');
869
870 $this->setSubTabs('settings');
871 $this->tabs_gui->setTabActive('settings');
872 $this->tabs_gui->setSubTabActive('grp_info_settings');
873
874 $form = $this->initInfoEditor();
875 $this->tpl->setContent($form->getHTML());
876 }
877
884 protected function initInfoEditor()
885 {
886 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
887 $form = new ilPropertyFormGUI();
888 $form->setFormAction($this->ctrl->getFormAction($this, 'updateInfo'));
889 $form->setTitle($this->lng->txt('grp_general_informations'));
890 $form->addCommandButton('updateInfo', $this->lng->txt('save'));
891 $form->addCommandButton('cancel', $this->lng->txt('cancel'));
892
893 $area = new ilTextAreaInputGUI($this->lng->txt('grp_information'), 'important');
894 $area->setInfo($this->lng->txt('grp_information_info'));
895 $area->setValue($this->object->getInformation());
896 $area->setRows(8);
897 $area->setCols(80);
898 $form->addItem($area);
899
900 return $form;
901 }
902
909 public function updateInfoObject()
910 {
911 $this->checkPermission('manage_members');
912
913 $this->object->setInformation(ilUtil::stripSlashes($_POST['important']));
914 $this->object->update();
915
916 ilUtil::sendSuccess($this->lng->txt("settings_saved"));
917 $this->editInfoObject();
918 return true;
919 }
920
922 public function readMemberData($ids, $selected_columns = null)
923 {
924 include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
926
927 include_once './Services/Tracking/classes/class.ilObjUserTracking.php';
928 $this->show_tracking =
929 (
932 );
933 if ($this->show_tracking) {
934 include_once('./Services/Object/classes/class.ilObjectLP.php');
935 $olp = ilObjectLP::getInstance($this->object->getId());
936 $this->show_tracking = $olp->isActive();
937 }
938
939 if ($this->show_tracking) {
940 include_once 'Services/Tracking/classes/class.ilLPStatusWrapper.php';
941 $completed = ilLPStatusWrapper::_lookupCompletedForObject($this->object->getId());
942 $in_progress = ilLPStatusWrapper::_lookupInProgressForObject($this->object->getId());
943 $failed = ilLPStatusWrapper::_lookupFailedForObject($this->object->getId());
944 }
945
946 if ($privacy->enabledGroupAccessTimes()) {
947 include_once('./Services/Tracking/classes/class.ilLearningProgress.php');
948 $progress = ilLearningProgress::_lookupProgressByObjId($this->object->getId());
949 }
950
951 $do_prtf = (is_array($selected_columns) &&
952 in_array('prtf', $selected_columns) &&
953 is_array($ids));
954 if ($do_prtf) {
955 include_once "Modules/Portfolio/classes/class.ilObjPortfolio.php";
957 $ids,
958 $this->ctrl->getLinkTarget($this, "members")
959 );
960 }
961
967 $profile_data = ilObjUser::_readUsersProfileData($ids);
968 foreach ($ids as $usr_id) {
969 $tmp_data['notification'] = $this->object->members_obj->isNotificationEnabled($usr_id) ? 1 : 0;
970 $tmp_data['contact'] = $this->object->members_obj->isContact($usr_id) ? 1 : 0;
971
972 foreach ((array) $profile_data[$usr_id] as $field => $value) {
973 $tmp_data[$field] = $value;
974 }
975
976 if ($this->show_tracking) {
977 if (in_array($usr_id, $completed)) {
978 $tmp_data['progress'] = ilLPStatus::LP_STATUS_COMPLETED;
979 } elseif (in_array($usr_id, $in_progress)) {
980 $tmp_data['progress'] = ilLPStatus::LP_STATUS_IN_PROGRESS;
981 } elseif (in_array($usr_id, $failed)) {
982 $tmp_data['progress'] = ilLPStatus::LP_STATUS_FAILED;
983 } else {
984 $tmp_data['progress'] = ilLPStatus::LP_STATUS_NOT_ATTEMPTED;
985 }
986 }
987
988 if ($privacy->enabledGroupAccessTimes()) {
989 if (isset($progress[$usr_id]['ts']) and $progress[$usr_id]['ts']) {
990 $tmp_data['access_time'] = ilDatePresentation::formatDate(
991 $tmp_date = new ilDateTime($progress[$usr_id]['ts'], IL_CAL_UNIX)
992 );
993 $tmp_data['access_time_unix'] = $tmp_date->get(IL_CAL_UNIX);
994 } else {
995 $tmp_data['access_time'] = $this->lng->txt('no_date');
996 $tmp_data['access_time_unix'] = 0;
997 }
998 }
999
1000 if ($do_prtf) {
1001 $tmp_data['prtf'] = $all_prtf[$usr_id];
1002 }
1003
1004 $members[$usr_id] = $tmp_data;
1005 }
1006 return $members ? $members : array();
1007 }
1008
1013 public function leaveObject()
1014 {
1015 global $DIC;
1016
1017 $ilUser = $DIC['ilUser'];
1018
1019 $this->checkPermission('leave');
1020
1021 $part = ilGroupParticipants::_getInstanceByObjId($this->object->getId());
1022 if ($part->isLastAdmin($ilUser->getId())) {
1023 ilUtil::sendFailure($this->lng->txt('grp_err_administrator_required'));
1024 $this->viewObject();
1025 return false;
1026 }
1027
1028 $this->tabs_gui->setTabActive('grp_btn_unsubscribe');
1029
1030 include_once "Services/Utilities/classes/class.ilConfirmationGUI.php";
1031 $cgui = new ilConfirmationGUI();
1032 $cgui->setHeaderText($this->lng->txt('grp_dismiss_myself'));
1033 $cgui->setFormAction($this->ctrl->getFormAction($this));
1034 $cgui->setCancel($this->lng->txt("cancel"), "cancel");
1035 $cgui->setConfirm($this->lng->txt("grp_btn_unsubscribe"), "unsubscribe");
1036 $this->tpl->setContent($cgui->getHTML());
1037 }
1038
1045 public function unsubscribeObject()
1046 {
1047 global $DIC;
1048
1049 $ilUser = $DIC['ilUser'];
1050 $tree = $DIC['tree'];
1051 $ilCtrl = $DIC['ilCtrl'];
1052
1053 $this->checkPermission('leave');
1054
1055 $this->object->members_obj->delete($ilUser->getId());
1056
1057 include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1058 $this->object->members_obj->sendNotification(
1060 $ilUser->getId()
1061 );
1062 $this->object->members_obj->sendNotification(
1064 $ilUser->getId()
1065 );
1066
1067 ilUtil::sendSuccess($this->lng->txt('grp_msg_membership_annulled'), true);
1068 $ilCtrl->setParameterByClass(
1069 "ilrepositorygui",
1070 "ref_id",
1071 $tree->getParentId($this->object->getRefId())
1072 );
1073 $ilCtrl->redirectByClass("ilrepositorygui", "");
1074 }
1075
1082 public function addContentTab()
1083 {
1084 $this->tabs_gui->addTab(
1085 "view_content",
1086 $this->lng->txt("content"),
1087 $this->ctrl->getLinkTarget($this, "view")
1088 );
1089 }
1090
1091
1092 // get tabs
1093 public function getTabs()
1094 {
1095 global $DIC;
1096
1097 $rbacsystem = $DIC['rbacsystem'];
1098 $ilUser = $DIC['ilUser'];
1099 $ilAccess = $DIC['ilAccess'];
1100 $lng = $DIC['lng'];
1101 $ilHelp = $DIC['ilHelp'];
1102
1103 $ilHelp->setScreenIdComponent("grp");
1104
1105 if ($ilAccess->checkAccess('read', '', $this->ref_id)) {
1106 if ($this->object->isNewsTimelineEffective()) {
1107 if (!$this->object->isNewsTimelineLandingPageEffective()) {
1108 $this->addContentTab();
1109 }
1110 $this->tabs_gui->addTab(
1111 "news_timeline",
1112 $lng->txt("cont_news_timeline_tab"),
1113 $this->ctrl->getLinkTargetByClass("ilnewstimelinegui", "show")
1114 );
1115 if ($this->object->isNewsTimelineLandingPageEffective()) {
1116 $this->addContentTab();
1117 }
1118 } else {
1119 $this->addContentTab();
1120 }
1121 }
1122 if (
1123 $ilAccess->checkAccess('visible', '', $this->ref_id) ||
1124 $ilAccess->checkAccess('join', '', $this->ref_id) ||
1125 $ilAccess->checkAccess('read', '', $this->ref_id)
1126 ) {
1127 $this->tabs_gui->addTarget(
1128 "info_short",
1129 $this->ctrl->getLinkTargetByClass(
1130 array("ilobjgroupgui", "ilinfoscreengui"),
1131 "showSummary"
1132 ),
1133 "infoScreen",
1134 "",
1135 "",
1136 false
1137 );
1138 }
1139
1140
1141 if ($ilAccess->checkAccess('write', '', $this->object->getRefId())) {
1142 $this->tabs_gui->addTarget(
1143 "settings",
1144 $this->ctrl->getLinkTarget($this, "edit"),
1145 array("edit", "editMapSettings"),
1146 get_class($this),
1147 ""
1148 );
1149 }
1150
1151 include_once './Modules/Group/classes/class.ilGroupParticipants.php';
1152 $is_participant = ilGroupParticipants::_isParticipant($this->ref_id, $ilUser->getId());
1153
1154 // Members
1155 include_once './Modules/Group/classes/class.ilGroupMembershipGUI.php';
1156 $membership_gui = new ilGroupMembershipGUI($this, $this->object);
1157 $membership_gui->addMemberTab($this->tabs_gui, $is_participant);
1158
1159
1160 // badges
1161 if ($ilAccess->checkAccess('write', '', $this->ref_id)) {
1162 include_once 'Services/Badge/classes/class.ilBadgeHandler.php';
1163 if (ilBadgeHandler::getInstance()->isObjectActive($this->object->getId())) {
1164 $this->tabs_gui->addTarget(
1165 "obj_tool_setting_badges",
1166 $this->ctrl->getLinkTargetByClass("ilbadgemanagementgui", ""),
1167 "",
1168 "ilbadgemanagementgui"
1169 );
1170 }
1171 }
1172
1173 // skills
1174 include_once("./Services/Object/classes/class.ilObjectServiceSettingsGUI.php");
1175 if ($ilAccess->checkAccess('read', '', $this->ref_id) && ilContainer::_lookupContainerSetting(
1176 $this->object->getId(),
1178 false
1179 )) {
1180 $this->tabs_gui->addTarget(
1181 "obj_tool_setting_skills",
1182 $this->ctrl->getLinkTargetByClass(array("ilcontainerskillgui", "ilcontskillpresentationgui"), ""),
1183 "",
1184 array("ilcontainerskillgui", "ilcontskillpresentationgui", "ilcontskilladmingui")
1185 );
1186 }
1187
1188 // learning progress
1189 include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
1190 if (ilLearningProgressAccess::checkAccess($this->object->getRefId(), $is_participant)) {
1191 $this->tabs_gui->addTarget(
1192 'learning_progress',
1193 $this->ctrl->getLinkTargetByClass(array('ilobjgroupgui','illearningprogressgui'), ''),
1194 '',
1195 array('illplistofobjectsgui','illplistofsettingsgui','illearningprogressgui','illplistofprogressgui')
1196 );
1197 }
1198
1199 // meta data
1200 if ($ilAccess->checkAccess('write', '', $this->ref_id)) {
1201 $md_gui = new ilObjectMetaDataGUI($this->object);
1202 $tab_link = $md_gui->getTab();
1203 if ($tab_link !== null) {
1204 $this->tabs_gui->addTab(
1205 'meta_data',
1206 $this->lng->txt('meta_data'),
1207 $tab_link,
1208 '',
1209 'ilObjectMetaDataGUI'
1210 );
1211 }
1212 }
1213
1214
1215 if ($ilAccess->checkAccess('write', '', $this->object->getRefId())) {
1216 $this->tabs_gui->addTarget(
1217 'export',
1218 $this->ctrl->getLinkTargetByClass('ilexportgui', ''),
1219 'export',
1220 'ilexportgui'
1221 );
1222 }
1223
1224 // parent tabs (all container: edit_permission, clipboard, trash
1225 parent::getTabs();
1226
1227 if ($ilAccess->checkAccess('join', '', $this->object->getRefId()) and
1228 !$this->object->members_obj->isAssigned($ilUser->getId())) {
1229 include_once './Modules/Group/classes/class.ilGroupWaitingList.php';
1230 if (ilGroupWaitingList::_isOnList($ilUser->getId(), $this->object->getId())) {
1231 $this->tabs_gui->addTab(
1232 'leave',
1233 $this->lng->txt('membership_leave'),
1234 $this->ctrl->getLinkTargetByClass('ilgroupregistrationgui', 'show', '')
1235 );
1236 } else {
1237 $this->tabs_gui->addTarget(
1238 "join",
1239 $this->ctrl->getLinkTargetByClass('ilgroupregistrationgui', "show"),
1240 'show',
1241 ""
1242 );
1243 }
1244 }
1245 if ($ilAccess->checkAccess('leave', '', $this->object->getRefId()) and
1246 $this->object->members_obj->isMember($ilUser->getId())) {
1247 $this->tabs_gui->addTarget(
1248 "grp_btn_unsubscribe",
1249 $this->ctrl->getLinkTarget($this, "leave"),
1250 '',
1251 ""
1252 );
1253 }
1254 }
1255
1261 public function infoScreenObject()
1262 {
1263 $this->ctrl->setCmd("showSummary");
1264 $this->ctrl->setCmdClass("ilinfoscreengui");
1265 $this->infoScreen();
1266 }
1267
1271 public function infoScreen()
1272 {
1273 global $DIC;
1274
1275 $rbacsystem = $DIC['rbacsystem'];
1276 $ilUser = $DIC['ilUser'];
1277 $ilSetting = $DIC['ilSetting'];
1278
1279 $this->tabs_gui->setTabActive('info_short');
1280
1281 if (!$this->checkPermissionBool('read')) {
1282 $this->checkPermission('visible');
1283 }
1284
1286 $this->object->getId(),
1287 $this->object->getId(),
1288 'grp'
1289 );
1290
1291 include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1292 $info = new ilInfoScreenGUI($this);
1293
1294 if (strlen($this->object->getInformation())) {
1295 $info->addSection($this->lng->txt('grp_general_informations'));
1296 $info->addProperty($this->lng->txt('grp_information'), nl2br(
1297 ilUtil::makeClickable($this->object->getInformation(), true)
1298 ));
1299 }
1300
1301 $info->enablePrivateNotes();
1302 $info->enableLearningProgress(true);
1303
1304 $record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_INFO, 'grp', $this->object->getId());
1305 $record_gui->setInfoObject($info);
1306 $record_gui->parse();
1307
1308 // meta data
1309 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
1310
1311
1312 // support contacts
1313 $parts = ilParticipants::getInstance($this->object->getRefId());
1314 $contacts = $parts->getContacts();
1315 if (count($contacts) > 0) {
1316 $info->addSection($this->lng->txt("grp_mem_contacts"));
1317 foreach ($contacts as $c) {
1318 $pgui = new ilPublicUserProfileGUI($c);
1319 $pgui->setBackUrl($this->ctrl->getLinkTargetByClass("ilinfoscreengui"));
1320 $pgui->setEmbedded(true);
1321 $info->addProperty("", $pgui->getHTML());
1322 }
1323 }
1324
1325
1326 $info->addSection($this->lng->txt('group_registration'));
1327 $info->showLDAPRoleGroupMappingInfo();
1328
1329 if (!$this->object->isRegistrationEnabled()) {
1330 $info->addProperty(
1331 $this->lng->txt('group_registration_mode'),
1332 $this->lng->txt('grp_reg_deac_info_screen')
1333 );
1334 } else {
1335 switch ($this->object->getRegistrationType()) {
1337 $info->addProperty(
1338 $this->lng->txt('group_registration_mode'),
1339 $this->lng->txt('grp_reg_direct_info_screen')
1340 );
1341 break;
1342
1344 $info->addProperty(
1345 $this->lng->txt('group_registration_mode'),
1346 $this->lng->txt('grp_reg_req_info_screen')
1347 );
1348 break;
1349
1351 $info->addProperty(
1352 $this->lng->txt('group_registration_mode'),
1353 $this->lng->txt('grp_reg_passwd_info_screen')
1354 );
1355 break;
1356
1357 }
1358 /*
1359 $info->addProperty($this->lng->txt('group_registration_time'),
1360 ilDatePresentation::formatPeriod(
1361 $this->object->getRegistrationStart(),
1362 $this->object->getRegistrationEnd()));
1363 */
1364 if ($this->object->isRegistrationUnlimited()) {
1365 $info->addProperty(
1366 $this->lng->txt('group_registration_time'),
1367 $this->lng->txt('grp_registration_unlimited')
1368 );
1369 } elseif ($this->object->getRegistrationStart()->getUnixTime() < time()) {
1370 $info->addProperty(
1371 $this->lng->txt("group_registration_time"),
1372 $this->lng->txt('cal_until') . ' ' .
1373 ilDatePresentation::formatDate($this->object->getRegistrationEnd())
1374 );
1375 } elseif ($this->object->getRegistrationStart()->getUnixTime() >= time()) {
1376 $info->addProperty(
1377 $this->lng->txt("group_registration_time"),
1378 $this->lng->txt('cal_from') . ' ' .
1379 ilDatePresentation::formatDate($this->object->getRegistrationStart())
1380 );
1381 }
1382 if ($this->object->isMembershipLimited()) {
1383 if ($this->object->getMinMembers()) {
1384 $info->addProperty(
1385 $this->lng->txt("mem_min_users"),
1386 $this->object->getMinMembers()
1387 );
1388 }
1389 if ($this->object->getMaxMembers()) {
1390 include_once './Modules/Group/classes/class.ilObjGroupAccess.php';
1391 $reg_info = ilObjGroupAccess::lookupRegistrationInfo($this->object->getId());
1392
1393 $info->addProperty(
1394 $this->lng->txt('mem_free_places'),
1395 $reg_info['reg_info_free_places']
1396 );
1397 }
1398 }
1399
1400 if ($this->object->getCancellationEnd()) {
1401 $info->addProperty(
1402 $this->lng->txt('grp_cancellation_end'),
1403 ilDatePresentation::formatDate($this->object->getCancellationEnd())
1404 );
1405 }
1406 }
1407
1408 if ($this->object->getStart() instanceof ilDateTime &&
1409 !$this->object->getStart()->isNull()
1410 ) {
1411 $info->addProperty(
1412 $this->lng->txt('grp_period'),
1414 $this->object->getStart(),
1415 $this->object->getEnd()
1416 )
1417 );
1418 }
1419
1420 // Confirmation
1421 include_once('Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
1423
1424 include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
1425 if ($privacy->groupConfirmationRequired() or ilCourseDefinedFieldDefinition::_getFields($this->object->getId()) or $privacy->enabledGroupExport()) {
1426 include_once('Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php');
1427
1428 $field_info = ilExportFieldsInfo::_getInstanceByType($this->object->getType());
1429
1430 $this->lng->loadLanguageModule('ps');
1431 $info->addSection($this->lng->txt('grp_user_agreement_info'));
1432 $info->addProperty($this->lng->txt('ps_export_data'), $field_info->exportableFieldsToInfoString());
1433
1434 if ($fields = ilCourseDefinedFieldDefinition::_fieldsToInfoString($this->object->getId())) {
1435 $info->addProperty($this->lng->txt('ps_grp_user_fields'), $fields);
1436 }
1437 }
1438
1439
1440 // forward the command
1441 $this->ctrl->forwardCommand($info);
1442 }
1443
1447 public function saveNotificationObject()
1448 {
1449 include_once "Services/Membership/classes/class.ilMembershipNotifications.php";
1450 $noti = new ilMembershipNotifications($this->ref_id);
1451 if ($noti->canCurrentUserEdit()) {
1452 if ((bool) $_REQUEST["grp_ntf"]) {
1453 $noti->activateUser();
1454 } else {
1455 $noti->deactivateUser();
1456 }
1457 }
1458 ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
1459 $this->ctrl->redirect($this, "");
1460 }
1461
1465 protected function membersObject()
1466 {
1467 $GLOBALS['DIC']['ilCtrl']->redirectByClass('ilgroupmembershipgui');
1468 }
1469
1470
1474 public static function _goto($a_target, $a_add = "")
1475 {
1476 global $DIC;
1477
1478 $ilAccess = $DIC['ilAccess'];
1479 $ilErr = $DIC['ilErr'];
1480 $lng = $DIC['lng'];
1481 $ilUser = $DIC['ilUser'];
1482
1483 include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
1484 if (substr($a_add, 0, 5) == 'rcode') {
1485 if ($ilUser->getId() == ANONYMOUS_USER_ID) {
1486 // Redirect to login for anonymous
1488 "login.php?target=" . $_GET["target"] . "&cmd=force_login&lang=" .
1489 $ilUser->getCurrentLanguage()
1490 );
1491 }
1492
1493 // Redirects to target location after assigning user to group
1495 $a_target,
1497 substr($a_add, 5)
1498 );
1499 }
1500
1501 if ($a_add == "mem" && $ilAccess->checkAccess("manage_members", "", $a_target)) {
1502 ilObjectGUI::_gotoRepositoryNode($a_target, "members");
1503 }
1504
1505 if ($a_add == "comp" && ilContSkillPresentationGUI::isAccessible($a_target)) {
1506 ilObjectGUI::_gotoRepositoryNode($a_target, "competences");
1507 }
1508
1509 if ($ilAccess->checkAccess("read", "", $a_target)) {
1511 } else {
1512 // to do: force flat view
1513 if ($ilAccess->checkAccess("visible", "", $a_target)) {
1514 ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreenGoto");
1515 } else {
1516 if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
1517 ilUtil::sendFailure(sprintf(
1518 $lng->txt("msg_no_perm_read_item"),
1520 ), true);
1522 }
1523 }
1524 }
1525 $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
1526 }
1527
1528
1536 public function initForm($a_mode = 'edit', $a_omit_form_action = false)
1537 {
1538 global $DIC;
1539
1540 $obj_service = $this->getObjectService();
1541
1542 $tree = $DIC['tree'];
1543
1544 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
1545
1546 $form = new ilPropertyFormGUI();
1547
1548 if (!$a_omit_form_action) {
1549 switch ($a_mode) {
1550 case 'edit':
1551 $form->setFormAction($this->ctrl->getFormAction($this, 'update'));
1552 break;
1553
1554 default:
1555 $form->setTableWidth('600px');
1556 $form->setFormAction($this->ctrl->getFormAction($this, 'save'));
1557 break;
1558 }
1559 }
1560
1561 // title/description
1562 $this->initFormTitleDescription($form);
1563
1564 $form = $this->initDidacticTemplate($form);
1565
1566 if ($a_mode == 'edit') {
1567 // group period
1568 $cdur = new ilDateDurationInputGUI($this->lng->txt('grp_period'), 'period');
1569 $this->lng->loadLanguageModule('mem');
1570 $cdur->enableToggleFullTime(
1571 $this->lng->txt('mem_period_without_time'),
1572 !$this->object->getStartTimeIndication()
1573 );
1574 $cdur->setShowTime(true);
1575 $cdur->setInfo($this->lng->txt('grp_period_info'));
1576 $cdur->setStart($this->object->getStart());
1577 $cdur->setEnd($this->object->getEnd());
1578 $form->addItem($cdur);
1579
1580 // Group registration ############################################################
1581 $pres = new ilFormSectionHeaderGUI();
1582 $pres->setTitle($this->lng->txt('grp_setting_header_registration'));
1583 $form->addItem($pres);
1584
1585 // Registration type
1586 $reg_type = new ilRadioGroupInputGUI($this->lng->txt('group_registration_mode'), 'registration_type');
1587 $reg_type->setValue($this->object->getRegistrationType());
1588
1589 $opt_dir = new ilRadioOption($this->lng->txt('grp_reg_direct'), GRP_REGISTRATION_DIRECT);#$this->lng->txt('grp_reg_direct_info'));
1590 $reg_type->addOption($opt_dir);
1591
1592 $opt_pass = new ilRadioOption($this->lng->txt('grp_pass_request'), GRP_REGISTRATION_PASSWORD);
1593 $pass = new ilTextInputGUI($this->lng->txt("password"), 'password');
1594 $pass->setRequired(true);
1595 $pass->setInfo($this->lng->txt('grp_reg_password_info'));
1596 $pass->setValue($this->object->getPassword());
1597 $pass->setSize(32);
1598 $pass->setMaxLength(32);
1599 $opt_pass->addSubItem($pass);
1600 $reg_type->addOption($opt_pass);
1601
1602 $opt_req = new ilRadioOption($this->lng->txt('grp_reg_request'), GRP_REGISTRATION_REQUEST, $this->lng->txt('grp_reg_request_info'));
1603 $reg_type->addOption($opt_req);
1604
1605 $opt_deact = new ilRadioOption($this->lng->txt('grp_reg_no_selfreg'), GRP_REGISTRATION_DEACTIVATED, $this->lng->txt('grp_reg_disabled_info'));
1606 $reg_type->addOption($opt_deact);
1607
1608 // Registration codes
1609 $reg_code = new ilCheckboxInputGUI($this->lng->txt('grp_reg_code'), 'reg_code_enabled');
1610 $reg_code->setChecked($this->object->isRegistrationAccessCodeEnabled());
1611 $reg_code->setValue(1);
1612 $reg_code->setInfo($this->lng->txt('grp_reg_code_enabled_info'));
1613 $form->addItem($reg_type);
1614
1615 // Registration codes
1616 if (!$this->object->getRegistrationAccessCode()) {
1617 include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
1618 $this->object->setRegistrationAccessCode(ilMembershipRegistrationCodeUtils::generateCode());
1619 }
1620 $reg_link = new ilHiddenInputGUI('reg_code');
1621 $reg_link->setValue($this->object->getRegistrationAccessCode());
1622 $form->addItem($reg_link);
1623
1624 $link = new ilCustomInputGUI($this->lng->txt('grp_reg_code_link'));
1625 include_once './Services/Link/classes/class.ilLink.php';
1626 $val = ilLink::_getLink($this->object->getRefId(), $this->object->getType(), array(), '_rcode' . $this->object->getRegistrationAccessCode());
1627 $link->setHTML('<span class="small">' . $val . '</span>');
1628 $reg_code->addSubItem($link);
1629 $form->addItem($reg_code);
1630
1631 // time limit
1632 $this->lng->loadLanguageModule('dateplaner');
1633 include_once './Services/Form/classes/class.ilDateDurationInputGUI.php';
1634 $dur = new ilDateDurationInputGUI($this->lng->txt('grp_reg_limited'), 'reg');
1635 $dur->setShowTime(true);
1636 $dur->setStart($this->object->getRegistrationStart());
1637 $dur->setEnd($this->object->getRegistrationEnd());
1638 $form->addItem($dur);
1639
1640 // cancellation limit
1641 $cancel = new ilDateTimeInputGUI($this->lng->txt('grp_cancellation_end'), 'cancel_end');
1642 $cancel->setInfo($this->lng->txt('grp_cancellation_end_info'));
1643 $cancel->setDate($this->object->getCancellationEnd());
1644 $form->addItem($cancel);
1645
1646 // max member
1647 $lim = new ilCheckboxInputGUI($this->lng->txt('reg_grp_max_members_short'), 'registration_membership_limited');
1648 $lim->setValue(1);
1649 // $lim->setOptionTitle($this->lng->txt('reg_grp_max_members'));
1650 $lim->setChecked($this->object->isMembershipLimited());
1651
1652 $min = new ilTextInputGUI($this->lng->txt('reg_grp_min_members'), 'registration_min_members');
1653 $min->setSize(3);
1654 $min->setMaxLength(4);
1655 $min->setValue($this->object->getMinMembers() ? $this->object->getMinMembers() : '');
1656 $min->setInfo($this->lng->txt('grp_subscription_min_members_info'));
1657 $lim->addSubItem($min);
1658
1659 $max = new ilTextInputGUI($this->lng->txt('reg_grp_max_members'), 'registration_max_members');
1660 $max->setValue($this->object->getMaxMembers() ? $this->object->getMaxMembers() : '');
1661 //$max->setTitle($this->lng->txt('members'));
1662 $max->setSize(3);
1663 $max->setMaxLength(4);
1664 $max->setInfo($this->lng->txt('grp_reg_max_members_info'));
1665 $lim->addSubItem($max);
1666
1667 /*
1668 $wait = new ilCheckboxInputGUI($this->lng->txt('grp_waiting_list'),'waiting_list');
1669 $wait->setValue(1);
1670 //$wait->setOptionTitle($this->lng->txt('grp_waiting_list'));
1671 $wait->setInfo($this->lng->txt('grp_waiting_list_info'));
1672 $wait->setChecked($this->object->isWaitingListEnabled() ? true : false);
1673 $lim->addSubItem($wait);
1674 $form->addItem($lim);
1675 */
1676
1677 $wait = new ilRadioGroupInputGUI($this->lng->txt('grp_waiting_list'), 'waiting_list');
1678
1679 $option = new ilRadioOption($this->lng->txt('none'), 0);
1680 $wait->addOption($option);
1681
1682 $option = new ilRadioOption($this->lng->txt('grp_waiting_list_no_autofill'), 1);
1683 $option->setInfo($this->lng->txt('grp_waiting_list_info'));
1684 $wait->addOption($option);
1685
1686 $option = new ilRadioOption($this->lng->txt('grp_waiting_list_autofill'), 2);
1687 $option->setInfo($this->lng->txt('grp_waiting_list_autofill_info'));
1688 $wait->addOption($option);
1689
1690 if ($this->object->hasWaitingListAutoFill()) {
1691 $wait->setValue(2);
1692 } elseif ($this->object->isWaitingListEnabled()) {
1693 $wait->setValue(1);
1694 }
1695
1696 $lim->addSubItem($wait);
1697
1698 $form->addItem($lim);
1699
1700
1701 // Group presentation
1702 $parent_membership_ref_id = 0;
1703 $hasParentMembership =
1704 (
1705 $parent_membership_ref_id = $tree->checkForParentType($this->object->getRefId(), 'crs', true)
1706 );
1707
1708 $pres = new ilFormSectionHeaderGUI();
1709 $pres->setTitle($this->lng->txt('grp_setting_header_presentation'));
1710 $form->addItem($pres);
1711
1712 // title and icon visibility
1713 $form = $obj_service->commonSettings()->legacyForm($form, $this->object)->addTitleIconVisibility();
1714
1715 // top actions visibility
1716 $form = $obj_service->commonSettings()->legacyForm($form, $this->object)->addTopActionsVisibility();
1717
1718 // custom icon
1719 $form = $obj_service->commonSettings()->legacyForm($form, $this->object)->addIcon();
1720
1721 // tile image
1722 $form = $obj_service->commonSettings()->legacyForm($form, $this->object)->addTileImage();
1723
1724 // list presentation
1725 $form = $this->initListPresentationForm($form);
1726
1727
1728 // presentation type
1729 $view_type = new ilRadioGroupInputGUI($this->lng->txt('grp_presentation_type'), 'view_mode');
1730 if ($hasParentMembership) {
1731 $parent_view_mode = ilObjCourseAccess::_lookupViewMode(ilObject::_lookupObjId($parent_membership_ref_id));
1732 $course_view_mode = '';
1733 switch ($parent_view_mode) {
1735 $course_view_mode = ': ' . $this->lng->txt('cntr_view_sessions');
1736 break;
1737
1739 $course_view_mode = ': ' . $this->lng->txt('cntr_view_simple');
1740 break;
1741
1743 $course_view_mode = ': ' . $this->lng->txt('cntr_view_by_type');
1744 break;
1745 }
1746 if ($course_view_mode) {
1747 $opt = new ilRadioOption($this->lng->txt('grp_view_inherit') . $course_view_mode, ilContainer::VIEW_INHERIT);
1748 $opt->setInfo($this->lng->txt('grp_view_inherit_info'));
1749 $view_type->addOption($opt);
1750 }
1751 }
1752
1753 if ($hasParentMembership && ilObjGroup::lookupViewMode($this->object->getId()) == ilContainer::VIEW_INHERIT) {
1754 $view_type->setValue(ilContainer::VIEW_INHERIT);
1755 } else {
1756 $view_type->setValue(ilObjGroup::lookupViewMode($this->object->getId()));
1757 }
1758
1759 $opt = new ilRadioOption($this->lng->txt('cntr_view_sessions'), ilContainer::VIEW_SESSIONS);
1760 $opt->setInfo($this->lng->txt('cntr_view_info_sessions'));
1761 $view_type->addOption($opt);
1762
1763 // Limited sessions
1764 $this->lng->loadLanguageModule('crs');
1765 $sess = new ilCheckboxInputGUI($this->lng->txt('sess_limit'), 'sl');
1766 $sess->setValue(1);
1767 $sess->setChecked($this->object->isSessionLimitEnabled());
1768 $sess->setInfo($this->lng->txt('sess_limit_info'));
1769
1770 $prev = new ilNumberInputGUI($this->lng->txt('sess_num_prev'), 'sp');
1771 $prev->setMinValue(0);
1772 $prev->setValue(
1773 $this->object->getNumberOfPreviousSessions() == -1 ?
1774 '' :
1775 $this->object->getNumberOfPreviousSessions()
1776 );
1777 $prev->setSize(2);
1778 $prev->setMaxLength(3);
1779 $sess->addSubItem($prev);
1780
1781 $next = new ilNumberInputGUI($this->lng->txt('sess_num_next'), 'sn');
1782 $next->setMinValue(0);
1783 $next->setValue(
1784 $this->object->getNumberOfNextSessions() == -1 ?
1785 '' :
1786 $this->object->getNumberOfNextSessions()
1787 );
1788 $next->setSize(2);
1789 $next->setMaxLength(3);
1790 $sess->addSubItem($next);
1791 $opt->addSubItem($sess);
1792
1793 $opt = new ilRadioOption($this->lng->txt('cntr_view_simple'), ilContainer::VIEW_SIMPLE);
1794 $opt->setInfo($this->lng->txt('grp_view_info_simple'));
1795 $view_type->addOption($opt);
1796
1797 $opt = new ilRadioOption($this->lng->txt('cntr_view_by_type'), ilContainer::VIEW_BY_TYPE);
1798 $opt->setInfo($this->lng->txt('grp_view_info_by_type'));
1799 $view_type->addOption($opt);
1800 $form->addItem($view_type);
1801
1802
1803 // Sorting
1804 $sorting_settings = array();
1805 if ($hasParentMembership) {
1806 $sorting_settings[] = ilContainer::SORT_INHERIT;
1807 }
1808 $sorting_settings[] = ilContainer::SORT_TITLE;
1809 $sorting_settings[] = ilContainer::SORT_CREATION;
1810 $sorting_settings[] = ilContainer::SORT_MANUAL;
1811 $this->initSortingForm($form, $sorting_settings);
1812
1813 // additional features
1814 $feat = new ilFormSectionHeaderGUI();
1815 $feat->setTitle($this->lng->txt('obj_features'));
1816 $form->addItem($feat);
1817
1818 include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
1820 $this->object->getId(),
1821 $form,
1822 $this->getSubServices()
1823 );
1824
1825
1826 $mem = new ilCheckboxInputGUI($this->lng->txt('grp_show_members'), 'show_members');
1827 $mem->setChecked($this->object->getShowMembers());
1828 $mem->setInfo($this->lng->txt('grp_show_members_info'));
1829 $form->addItem($mem);
1830
1831 // Show members type
1832 $mail_type = new ilRadioGroupInputGUI($this->lng->txt('grp_mail_type'), 'mail_type');
1833 $mail_type->setValue($this->object->getMailToMembersType());
1834
1835 $mail_tutors = new ilRadioOption(
1836 $this->lng->txt('grp_mail_tutors_only'),
1838 $this->lng->txt('grp_mail_tutors_only_info')
1839 );
1840 $mail_type->addOption($mail_tutors);
1841
1842 $mail_all = new ilRadioOption(
1843 $this->lng->txt('grp_mail_all'),
1845 $this->lng->txt('grp_mail_all_info')
1846 );
1847 $mail_type->addOption($mail_all);
1848 $form->addItem($mail_type);
1849
1850 // Self notification
1851 $not = new ilCheckboxInputGUI($this->lng->txt('grp_auto_notification'), 'auto_notification');
1852 $not->setValue(1);
1853 $not->setInfo($this->lng->txt('grp_auto_notification_info'));
1854 $not->setChecked($this->object->getAutoNotification());
1855 $form->addItem($not);
1856 }
1857
1858 switch ($a_mode) {
1859 case 'create':
1860 $form->setTitle($this->lng->txt('grp_new'));
1861 $form->setTitleIcon(ilUtil::getImagePath('icon_grp.svg'));
1862
1863 $form->addCommandButton('save', $this->lng->txt('grp_new'));
1864 $form->addCommandButton('cancel', $this->lng->txt('cancel'));
1865 break;
1866
1867 case 'edit':
1868 $form->setTitle($this->lng->txt('grp_edit'));
1869 $form->setTitleIcon(ilUtil::getImagePath('icon_grp.svg'));
1870
1871 // Edit ecs export settings
1872 include_once 'Modules/Group/classes/class.ilECSGroupSettings.php';
1873 $ecs = new ilECSGroupSettings($this->object);
1874 $ecs->addSettingsToForm($form, 'grp');
1875
1876 $form->addCommandButton('update', $this->lng->txt('save'));
1877 $form->addCommandButton('cancel', $this->lng->txt('cancel'));
1878 break;
1879 }
1880 return $form;
1881 }
1882
1890 protected function setSubTabs($a_tab)
1891 {
1892 global $DIC;
1893
1894 $rbacsystem = $DIC['rbacsystem'];
1895 $ilUser = $DIC['ilUser'];
1896 $ilAccess = $DIC['ilAccess'];
1897
1898 switch ($a_tab) {
1899
1900 case 'settings':
1901 $this->tabs_gui->addSubTabTarget(
1902 "grp_settings",
1903 $this->ctrl->getLinkTarget($this, 'edit'),
1904 "edit",
1905 get_class($this)
1906 );
1907
1908 $this->tabs_gui->addSubTabTarget(
1909 "grp_info_settings",
1910 $this->ctrl->getLinkTarget($this, 'editInfo'),
1911 "editInfo",
1912 get_class($this)
1913 );
1914
1915 include_once("./Services/Maps/classes/class.ilMapUtil.php");
1916 if (ilMapUtil::isActivated()) {
1917 $this->tabs_gui->addSubTabTarget(
1918 "grp_map_settings",
1919 $this->ctrl->getLinkTarget($this, 'editMapSettings'),
1920 "editMapSettings",
1921 get_class($this)
1922 );
1923 }
1924
1925 $this->tabs_gui->addSubTabTarget(
1926 'groupings',
1927 $this->ctrl->getLinkTargetByClass('ilobjcoursegroupinggui', 'listGroupings'),
1928 'listGroupings',
1929 get_class($this)
1930 );
1931
1932 include_once('Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
1933 include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
1934 // only show if export permission is granted
1935 if (ilPrivacySettings::_getInstance()->checkExportAccess($this->object->getRefId()) or ilCourseDefinedFieldDefinition::_hasFields($this->object->getId())) {
1936 $this->tabs_gui->addSubTabTarget(
1937 'grp_custom_user_fields',
1938 $this->ctrl->getLinkTargetByClass('ilobjectcustomuserfieldsgui'),
1939 '',
1940 'ilobjectcustomuserfieldsgui'
1941 );
1942 }
1943
1944 // news settings
1945 if ($this->object->getUseNews()) {
1946 $this->tabs_gui->addSubTab(
1947 'obj_news_settings',
1948 $this->lng->txt("cont_news_settings"),
1949 $this->ctrl->getLinkTargetByClass('ilcontainernewssettingsgui')
1950 );
1951 }
1952
1953 $lti_settings = new ilLTIProviderObjectSettingGUI($this->object->getRefId());
1954 if ($lti_settings->hasSettingsAccess()) {
1955 $this->tabs_gui->addSubTabTarget(
1956 'lti_provider',
1957 $this->ctrl->getLinkTargetByClass(ilLTIProviderObjectSettingGUI::class)
1958 );
1959 }
1960
1961 $this->tabs_gui->addSubTabTarget(
1962 "obj_multilinguality",
1963 $this->ctrl->getLinkTargetByClass("ilobjecttranslationgui", ""),
1964 "",
1965 "ilobjecttranslationgui"
1966 );
1967
1968
1969 break;
1970
1971
1972 }
1973 }
1974
1981 private function checkAgreement()
1982 {
1983 global $DIC;
1984
1985 $ilUser = $DIC['ilUser'];
1986 $ilAccess = $DIC['ilAccess'];
1987
1988 if ($ilAccess->checkAccess('write', '', $this->object->getRefId())) {
1989 return true;
1990 }
1991
1992 // Disable aggrement if is not member of group
1993 if (!$this->object->members_obj->isAssigned($ilUser->getId())) {
1994 return true;
1995 }
1996
1997 include_once './Services/Container/classes/class.ilMemberViewSettings.php';
1998 if (ilMemberViewSettings::getInstance()->isActive()) {
1999 return true;
2000 }
2001
2002 include_once('Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
2003 include_once('Services/Membership/classes/class.ilMemberAgreement.php');
2005
2006 // Check agreement
2007 if (($privacy->groupConfirmationRequired() or ilCourseDefinedFieldDefinition::_hasFields($this->object->getId()))
2008 and !ilMemberAgreement::_hasAccepted($ilUser->getId(), $this->object->getId())) {
2009 return false;
2010 }
2011 // Check required fields
2012 include_once('Modules/Course/classes/Export/class.ilCourseUserData.php');
2013 if (!ilCourseUserData::_checkRequired($ilUser->getId(), $this->object->getId())) {
2014 return false;
2015 }
2016 return true;
2017 }
2018
2019
2024 public function prepareOutput($a_show_subobjects = true)
2025 {
2026 global $DIC;
2027
2028 $rbacsystem = $DIC['rbacsystem'];
2029 if (!$this->getCreationMode()) {
2030 /*
2031 include_once './Services/Container/classes/class.ilMemberViewSettings.php';
2032 $settings = ilMemberViewSettings::getInstance();
2033 if($settings->isActive() and $settings->getContainer() != $this->object->getRefId())
2034 {
2035 $settings->setContainer($this->object->getRefId());
2036 $rbacsystem->initMemberView();
2037 }
2038 */
2039 }
2040 parent::prepareOutput($a_show_subobjects);
2041 }
2042
2047 public function createMailSignature()
2048 {
2049 $link = chr(13) . chr(10) . chr(13) . chr(10);
2050 $link .= $this->lng->txt('grp_mail_permanent_link');
2051 $link .= chr(13) . chr(10) . chr(13) . chr(10);
2052 include_once 'Services/Link/classes/class.ilLink.php';
2053 $link .= ilLink::_getLink($this->object->getRefId());
2054 return rawurlencode(base64_encode($link));
2055 }
2056
2057 protected function initHeaderAction($a_sub_type = null, $a_sub_id = null)
2058 {
2059 global $DIC;
2060
2061 $ilSetting = $DIC['ilSetting'];
2062 $ilUser = $DIC['ilUser'];
2063
2064 $lg = parent::initHeaderAction($a_sub_type, $a_sub_id);
2065
2066 include_once('./Modules/Group/classes/class.ilGroupParticipants.php');
2067 if (ilGroupParticipants::_isParticipant($this->ref_id, $ilUser->getId())) {
2068 include_once "Services/Membership/classes/class.ilMembershipNotifications.php";
2070 $noti = new ilMembershipNotifications($this->ref_id);
2071 if (!$noti->isCurrentUserActive()) {
2072 $lg->addHeaderIcon(
2073 "not_icon",
2074 ilUtil::getImagePath("notification_off.svg"),
2075 $this->lng->txt("grp_notification_deactivated")
2076 );
2077
2078 $this->ctrl->setParameter($this, "grp_ntf", 1);
2079 $caption = "grp_activate_notification";
2080 } else {
2081 $lg->addHeaderIcon(
2082 "not_icon",
2083 ilUtil::getImagePath("notification_on.svg"),
2084 $this->lng->txt("grp_notification_activated")
2085 );
2086
2087 $this->ctrl->setParameter($this, "grp_ntf", 0);
2088 $caption = "grp_deactivate_notification";
2089 }
2090
2091 if ($noti->canCurrentUserEdit()) {
2092 $lg->addCustomCommand(
2093 $this->ctrl->getLinkTarget($this, "saveNotification"),
2094 $caption
2095 );
2096 }
2097
2098 $this->ctrl->setParameter($this, "grp_ntf", "");
2099 }
2100 }
2101
2102 return $lg;
2103 }
2104
2105
2110 public function addCustomData($a_data)
2111 {
2112 // object defined fields
2113 include_once('Modules/Course/classes/Export/class.ilCourseUserData.php');
2114 $odfs = ilCourseUserData::_getValuesByObjId($this->object->getId());
2115
2116 $res_data = array();
2117 foreach ($a_data as $usr_id => $user_data) {
2118 $res_data[$usr_id] = $user_data;
2119
2120 // udf
2121 include_once './Services/User/classes/class.ilUserDefinedData.php';
2122 $udf_data = new ilUserDefinedData($usr_id);
2123 foreach ($udf_data->getAll() as $field => $value) {
2124 list($f, $field_id) = explode('_', $field);
2125 $res_data[$usr_id]['udf_' . $field_id] = (string) $value;
2126 }
2127
2128 foreach ((array) $odfs[$usr_id] as $cdf_field => $cdf_value) {
2129 $res_data[$usr_id]['cdf_' . $cdf_field] = (string) $cdf_value;
2130 }
2131 }
2132
2133 return $res_data;
2134 }
2135
2140 public function getLocalRoles()
2141 {
2142 $local_roles = $this->object->getLocalGroupRoles(false);
2143 $grp_member = $this->object->getDefaultMemberRole();
2144 $grp_roles = array();
2145
2146 //put the group member role to the top of the crs_roles array
2147 if (in_array($grp_member, $local_roles)) {
2148 $grp_roles[$grp_member] = ilObjRole::_getTranslation(array_search($grp_member, $local_roles));
2149 unset($local_roles[$grp_roles[$grp_member]]);
2150 }
2151
2152 foreach ($local_roles as $title => $role_id) {
2153 $grp_roles[$role_id] = ilObjRole::_getTranslation($title);
2154 }
2155 return $grp_roles;
2156 }
2157
2161 protected function jump2UsersGalleryObject()
2162 {
2163 $this->ctrl->redirectByClass('ilUsersGalleryGUI');
2164 }
2165
2169 public function setSideColumnReturn()
2170 {
2171 $this->ctrl->setReturn($this, "view");
2172 }
2173} // END class.ilObjGroupGUI
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
$failed
Definition: Utf8Test.php:85
$_GET["client_id"]
$_POST["username"]
An exception for terminatinating execution or to throw for unit testing.
const IL_CAL_UNIX
const GRP_REGISTRATION_DIRECT
const GRP_REGISTRATION_PASSWORD
const GRP_REGISTRATION_DEACTIVATED
const GRP_REGISTRATION_REQUEST
const IL_GRP_ADMIN
static getInstance()
Constructor.
Class ilBadgeManagementGUI.
static _catchupWriteEvents($obj_id, $usr_id, $timestamp=null)
Catches up with all write events which occured before the specified timestamp.
static _recordWriteEvent($obj_id, $usr_id, $action, $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
Confirmation screen class.
static isAccessible($ref_id)
Is container skill presentation accessible.
Class ilContainerGUI.
& forwardToPageObject()
forward command to page object
initSortingForm(ilPropertyFormGUI $form, array $a_sorting_settings)
Append sorting settings to property form.
showPermanentLink()
show permanent link
saveListPresentation(ilPropertyFormGUI $form)
Save list presentation setting.
forwardToStyleSheet()
Forward to style object.
initListPresentationForm(ilPropertyFormGUI $form)
Add list presentation settings to form.
saveSortingSettings(ilPropertyFormGUI $form)
Save sorting settings.
Skills for container (course/group) (top gui class)
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.
Class ilCourseContentGUI.
static _getFields($a_container_id, $a_sort=IL_CDF_SORT_NAME)
Get all fields of a container.
static _hasFields($a_container_id)
Check if there are any define fields.
static _fieldsToInfoString($a_obj_id)
Fields to info string.
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static _getValuesByObjId($a_obj_id)
Get values by obj_id (for all users)
static _checkRequired($a_usr_id, $a_obj_id)
Check required fields.
This class represents a custom property in a property form.
input GUI for a time span (start and end date)
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
static formatPeriod(ilDateTime $start, ilDateTime $end, $a_skip_starting_day=false)
Format a period of two date Shows: 14.
This class represents a date/time property in a property form.
@classDescription Date and time handling
isNull()
Check if a date is null (Datetime == '0000-00-00 00:00:00', unixtime == 0,...)
static lookupTemplateId($a_ref_id)
Lookup template id @global ilDB $ilDB.
static switchTemplate($a_ref_id, $a_new_tpl_id)
Class ilECSGroupSettings.
static _getInstanceByType($a_type)
Get Singleton Instance.
Export User Interface Class.
This class represents a section header in a property form.
GUI class for membership features.
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static _isParticipant($a_ref_id, $a_usr_id)
Static function to check if a user is a participant of the container object.
GUI class for group registrations.
This class represents a hidden form property in a property form.
Class ilInfoScreenGUI.
static _lookupCompletedForObject($a_obj_id, $a_user_ids=null)
Get completed users for object.
static _lookupFailedForObject($a_obj_id, $a_user_ids=null)
Get failed users for object.
static _lookupInProgressForObject($a_obj_id, $a_user_ids=null)
Get in progress users for object.
const LP_STATUS_COMPLETED
const LP_STATUS_FAILED
const LP_STATUS_NOT_ATTEMPTED
const LP_STATUS_IN_PROGRESS
GUI class for LTI provider object settings.
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
Class ilObjUserTrackingGUI.
static _tracProgress($a_user_id, $a_obj_id, $a_ref_id, $a_obj_type='')
static _lookupProgressByObjId($a_obj_id)
lookup progress for a specific object
This class represents a location property in a property form.
static getLogger($a_component_id)
Get component logger.
static _fillHTMLMetaTags($a_rbac_id, $a_obj_id, $a_type)
Fill html meta tags.
Class ilMailMemberCourseRoles.
Class ilMailMemberSearchGUI.
static isActivated()
Checks whether Map feature is activated.
static getDefaultSettings()
Get default longitude, latitude and zoom.
static _hasAccepted($a_usr_id, $a_obj_id)
Check if user has accepted agreement.
Membership notification settings.
static handleCode($a_ref_id, $a_type, $a_code)
Handle target parameter.
static generateCode()
Generate new registration key.
static getInstance($a_ref_id, $a_include_auto_entries)
Get instance.
This class represents a number property in a property form.
static _lookupViewMode($a_id)
Lookup view mode.
static _modifyItemGUI( $a_item_list_gui, $a_cmd_class, $a_item_data, $a_show_path, $a_abo_status, $a_course_ref_id, $a_course_obj_id, $a_parent_ref_id=0)
We need a static version of this, e.g.
Class ilObjCourseGroupingGUI.
static _lookupAboStatus($a_id)
static lookupRegistrationInfo($a_obj_id)
Lookup registration info @global ilDB $ilDB @global ilObjUser $ilUser @global ilLanguage $lng.
Class ilObjGroupGUI.
saveNotificationObject()
:TEMP: Save notification setting (from infoscreen)
initInfoEditor()
init info editor
initForm($a_mode='edit', $a_omit_form_action=false)
init create/edit form
membersObject()
Called from goto?
prepareOutput($a_show_subobjects=true)
Handle member view.
renderObject()
Render group.
infoScreen()
show information screen
updateObject()
update group settings
getTabs()
common tabs for all container objects (should be called at the end of child getTabs() method
checkAgreement()
Check agreement and redirect if it is not accepted.
editInfoObject()
edit info
__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output=false)
Constructor @access public.
infoScreenObject()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually,...
editMapSettingsObject()
Edit Map Settings.
modifyItemGUI($a_item_list_gui, $a_item_data, $a_show_path)
Modify Item ListGUI for presentation in container @global type $tree.
createMailSignature()
Create a course mail signature.
addContentTab()
Add content tab.
setSubTabs($a_tab)
set sub tabs
afterSave(\ilObject $new_object, $a_redirect=true)
After object creation.
unsubscribeObject()
unsubscribe from group
readMemberData($ids, $selected_columns=null)
updateGroupTypeObject()
change group type
static _goto($a_target, $a_add="")
goto target group
editObject(ilPropertyFormGUI $a_form=null)
Edit object.
viewObject()
viewObject container presentation for "administration -> repository, trash, permissions"
setSideColumnReturn()
Set return point for side column actions.
getLocalRoles()
returns all local roles [role_id] => title
leaveObject()
leave Group @access public
initHeaderAction($a_sub_type=null, $a_sub_id=null)
Add file manager link.
executeCommand()
execute command note: this method is overwritten in all container objects
updateInfoObject()
update info
static lookupViewMode($a_obj_id)
lookup view mode @global $ilDB
const MAIL_ALLOWED_TUTORS
const MAIL_ALLOWED_ALL
static getAvailablePortfolioLinksForUserIds(array $a_owner_ids, $a_back_url=null)
static _getTranslation($a_role_title)
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
static _enabledLearningProgress()
check wether learing progress is enabled or not
static _enabledUserRelatedData()
check wether user related tracking is enabled or not
static _readUsersProfileData($a_user_ids)
STATIC METHOD get user data of selected users.
GUI class for the workflow of copying objects.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
static _gotoRepositoryNode($a_ref_id, $a_cmd="frameset")
Goto repository root.
editObject()
edit object
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
getCreationMode()
get creation mode
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
initDidacticTemplate(ilPropertyFormGUI $form)
Show didactic template types.
addHeaderAction()
Add header action menu.
getObjectService()
Get object service.
static getInstance($a_obj_id)
Class ilObjectMetaDataGUI.
GUI class for service settings (calendar, notes, comments)
static initServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Init service settings form.
static updateServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Update service settings.
GUI class for object translation handling.
Class ilObject Basic functions for all objects.
static _lookupObjId($a_id)
update()
update object in db
static _lookupTitle($a_id)
lookup object title
getRefId()
get reference id @access public
getId()
get object id @access public
static _lookupType($a_id, $a_reference=false)
lookup object type
static getInstance($a_ref_id)
Get instance by ref_id.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static _getInstance()
Get instance of ilPrivacySettings.
This class represents a property form user interface.
GUI class for public user profile presentation.
This class represents a property in a property form.
This class represents an option in a radio group.
This class represents a text area property in a property form.
This class represents a text property in a property form.
Class ilUserDefinedData.
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
static redirect($a_script)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static makeClickable($a_text, $detectGotoLinks=false)
makeClickable In Texten enthaltene URLs und Mail-Adressen klickbar machen
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static _isOnList($a_usr_id, $a_obj_id)
Check if a user on the waiting list.
$c
Definition: cli.php:37
const ANONYMOUS_USER_ID
Definition: constants.php:25
const ROOT_FOLDER_ID
Definition: constants.php:30
global $DIC
Definition: goto.php:24
$ilUser
Definition: imgupload.php:18
language()
Definition: language.php:2
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$ret
Definition: parser.php:6
global $ilSetting
Definition: privfeed.php:17
$service
Definition: result.php:17