ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 
5 include_once "./Services/Container/classes/class.ilContainerGUI.php";
6 include_once('./Modules/Group/classes/class.ilObjGroup.php');
7 
30 {
35  public function __construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output = false)
36  {
37  global $ilSetting;
38 
39  $this->type = "grp";
40  parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
41 
42  $this->lng->loadLanguageModule('grp');
43 
44  $this->setting = $ilSetting;
45  }
46 
47  public function executeCommand()
48  {
49  global $ilUser,$rbacsystem,$ilAccess, $ilNavigationHistory,$ilErr, $ilToolbar;
50 
51  $next_class = $this->ctrl->getNextClass($this);
52  $cmd = $this->ctrl->getCmd();
53  $this->prepareOutput();
54  // show repository tree
55  $this->showRepTree();
56 
57  // add entry to navigation history
58  if (!$this->getCreationMode() &&
59  $ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
60  include_once("./Services/Link/classes/class.ilLink.php");
61  $ilNavigationHistory->addItem(
62  $_GET["ref_id"],
63  ilLink::_getLink($_GET["ref_id"], "grp"),
64  "grp"
65  );
66  }
67 
68  // if news timeline is landing page, redirect if necessary
69  if ($next_class == "" && $cmd == "" && $this->object->isNewsTimelineLandingPageEffective()
70  && $ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
71  $this->ctrl->redirectbyclass("ilnewstimelinegui");
72  }
73 
74  switch ($next_class) {
75  case 'illtiproviderobjectsettinggui':
76  $this->setSubTabs('properties');
77  $this->tabs_gui->activateTab('settings');
78  $this->tabs_gui->activateSubTab('lti_provider');
79  $lti_gui = new ilLTIProviderObjectSettingGUI($this->object->getRefId());
80  $lti_gui->setCustomRolesForSelection($GLOBALS['DIC']->rbac()->review()->getLocalRoles($this->object->getRefId()));
81  $lti_gui->offerLTIRolesForSelection(false);
82  $this->ctrl->forwardCommand($lti_gui);
83  break;
84 
85 
86  case 'ilgroupmembershipgui':
87 
88  $this->tabs_gui->activateTab('members');
89 
90  include_once './Modules/Group/classes/class.ilGroupMembershipGUI.php';
91  $mem_gui = new ilGroupMembershipGUI($this, $this->object);
92  $this->ctrl->forwardCommand($mem_gui);
93  break;
94 
95 
96  case 'ilgroupregistrationgui':
97  $this->ctrl->setReturn($this, '');
98  $this->tabs_gui->setTabActive('join');
99  include_once('./Modules/Group/classes/class.ilGroupRegistrationGUI.php');
100  $registration = new ilGroupRegistrationGUI($this->object);
101  $this->ctrl->forwardCommand($registration);
102  break;
103 
104  case 'ilpermissiongui':
105  $this->tabs_gui->setTabActive('perm_settings');
106  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
107  $perm_gui = new ilPermissionGUI($this);
108  $ret =&$this->ctrl->forwardCommand($perm_gui);
109  break;
110 
111  case "ilinfoscreengui":
112  $ret =&$this->infoScreen();
113  break;
114 
115  case "illearningprogressgui":
116  include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
117 
118  $new_gui = new ilLearningProgressGUI(
120  $this->object->getRefId(),
121  $_GET['user_id'] ? $_GET['user_id'] : $ilUser->getId()
122  );
123  $this->ctrl->forwardCommand($new_gui);
124  $this->tabs_gui->setTabActive('learning_progress');
125  break;
126 
127  case 'ilobjcoursegroupinggui':
128  $this->setSubTabs('settings');
129 
130  include_once './Modules/Course/classes/class.ilObjCourseGroupingGUI.php';
131  $this->ctrl->setReturn($this, 'edit');
132  $crs_grp_gui = new ilObjCourseGroupingGUI($this->object, (int) $_GET['obj_id']);
133  $this->ctrl->forwardCommand($crs_grp_gui);
134 
135  $this->tabs_gui->setTabActive('settings');
136  $this->tabs_gui->setSubTabActive('groupings');
137  break;
138 
139  case 'ilcoursecontentgui':
140 
141  include_once './Modules/Course/classes/class.ilCourseContentGUI.php';
142  $course_content_obj = new ilCourseContentGUI($this);
143  $this->ctrl->forwardCommand($course_content_obj);
144  break;
145 
146  case 'ilpublicuserprofilegui':
147  require_once './Services/User/classes/class.ilPublicUserProfileGUI.php';
148  $this->setSubTabs('members');
149  $this->tabs_gui->setTabActive('group_members');
150  $this->tabs_gui->setSubTabActive('grp_members_gallery');
151  $profile_gui = new ilPublicUserProfileGUI($_GET["user"]);
152  if ($_GET["back_url"] == "") {
153  $profile_gui->setBackUrl($this->ctrl->getLinkTargetByClass(["ilGroupMembershipGUI", "ilUsersGalleryGUI"], 'view'));
154  }
155  $html = $this->ctrl->forwardCommand($profile_gui);
156  $this->tpl->setVariable("ADM_CONTENT", $html);
157  break;
158 
159  case "ilcolumngui":
160  $this->tabs_gui->setTabActive('none');
161  $this->checkPermission("read");
162  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
163  $this->tpl->setVariable(
164  "LOCATION_CONTENT_STYLESHEET",
165  ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId())
166  );
167  $this->renderObject();
168  break;
169 
170  // container page editing
171  case "ilcontainerpagegui":
172  $ret = $this->forwardToPageObject();
173  if ($ret != "") {
174  $this->tpl->setContent($ret);
175  }
176  break;
177 
178  case 'ilobjectcopygui':
179  include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
180  $cp = new ilObjectCopyGUI($this);
181  $cp->setType('grp');
182  $this->ctrl->forwardCommand($cp);
183  break;
184 
185  case "ilobjstylesheetgui":
186  $this->forwardToStyleSheet();
187  break;
188 
189  case 'ilobjectcustomuserfieldsgui':
190  include_once './Services/Membership/classes/class.ilObjectCustomUserFieldsGUI.php';
191  $cdf_gui = new ilObjectCustomUserFieldsGUI($this->object->getId());
192  $this->setSubTabs('settings');
193  $this->tabs_gui->setTabActive('settings');
194  $this->ctrl->forwardCommand($cdf_gui);
195  break;
196 
197  case 'ilmemberagreementgui':
198  include_once('Services/Membership/classes/class.ilMemberAgreementGUI.php');
199  $this->ctrl->setReturn($this, '');
200  $this->tabs_gui->setTabActive('view_content');
201  $agreement = new ilMemberAgreementGUI($this->object->getRefId());
202  $this->ctrl->forwardCommand($agreement);
203  break;
204 
205  case 'ilexportgui':
206  $this->tabs_gui->setTabActive('export');
207  include_once './Services/Export/classes/class.ilExportGUI.php';
208  $exp = new ilExportGUI($this);
209  $exp->addFormat('xml');
210  $this->ctrl->forwardCommand($exp);
211  break;
212 
213  case "ilcommonactiondispatchergui":
214  include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
216  $this->ctrl->forwardCommand($gui);
217  break;
218 
219  case 'ilobjectservicesettingsgui':
220  $this->ctrl->setReturn($this, 'edit');
221  $this->setSubTabs("settings");
222  $this->tabs_gui->activateTab('settings');
223  $this->tabs_gui->activateSubTab('tool_settings');
224 
225  include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
227  $this,
228  $this->object->getId(),
229  array(
231  )
232  );
233  $this->ctrl->forwardCommand($service);
234  break;
235 
236  case 'ilmailmembersearchgui':
237  include_once 'Services/Mail/classes/class.ilMail.php';
238  $mail = new ilMail($ilUser->getId());
239 
240  if (!($ilAccess->checkAccess('manage_members', '', $this->object->getRefId()) ||
241  $this->object->getMailToMembersType() == ilObjGroup::MAIL_ALLOWED_ALL) &&
242  $rbacsystem->checkAccess('internal_mail', $mail->getMailObjectReferenceId())) {
243  $ilErr->raiseError($this->lng->txt("msg_no_perm_read"), $ilErr->MESSAGE);
244  }
245 
246  $this->tabs_gui->setTabActive('members');
247 
248  include_once './Services/Contact/classes/class.ilMailMemberSearchGUI.php';
249  include_once './Services/Contact/classes/class.ilMailMemberGroupRoles.php';
250 
251  $mail_search = new ilMailMemberSearchGUI($this, $this->object->getRefId(), new ilMailMemberGroupRoles());
253  $this->ctrl->forwardCommand($mail_search);
254  break;
255 
256  case 'ilbadgemanagementgui':
257  $this->tabs_gui->setTabActive('obj_tool_setting_badges');
258  include_once 'Services/Badge/classes/class.ilBadgeManagementGUI.php';
259  $bgui = new ilBadgeManagementGUI($this->object->getRefId(), $this->object->getId(), 'grp');
260  $this->ctrl->forwardCommand($bgui);
261  break;
262 
263  case "ilcontainernewssettingsgui":
264  $this->setSubTabs("settings");
265  $this->tabs_gui->setTabActive('settings');
266  include_once("./Services/Container/classes/class.ilContainerNewsSettingsGUI.php");
267  $news_set_gui = new ilContainerNewsSettingsGUI($this);
268  $this->ctrl->forwardCommand($news_set_gui);
269  break;
270 
271  case "ilnewstimelinegui":
272  $this->checkPermission("read");
273  $this->tabs_gui->setTabActive('news_timeline');
274  include_once("./Services/News/classes/class.ilNewsTimelineGUI.php");
275  $t = ilNewsTimelineGUI::getInstance($this->object->getRefId(), $this->object->getNewsTimelineAutoENtries());
276  $t->setUserEditAll($ilAccess->checkAccess('write', '', $this->object->getRefId(), 'grp'));
277  $this->showPermanentLink($tpl);
278  $this->ctrl->forwardCommand($t);
279  include_once 'Services/Tracking/classes/class.ilLearningProgress.php';
281  $ilUser->getId(),
282  $this->object->getId(),
283  $this->object->getRefId(),
284  'grp'
285  );
286  break;
287 
288  case "ilcontainerskillgui":
289  $this->tabs_gui->activateTab('obj_tool_setting_skills');
290  include_once("./Services/Container/Skills/classes/class.ilContainerSkillGUI.php");
291  $gui = new ilContainerSkillGUI($this);
292  $this->ctrl->forwardCommand($gui);
293  break;
294 
295  case 'ilcalendarpresentationgui':
296  include_once('./Services/Calendar/classes/class.ilCalendarPresentationGUI.php');
297  $cal = new ilCalendarPresentationGUI($this->object->getRefId());
298  $ret = $this->ctrl->forwardCommand($cal);
299  break;
300 
301  default:
302 
303  // check visible permission
304  if (!$this->getCreationMode() and
305  !$ilAccess->checkAccess('visible', '', $this->object->getRefId(), 'grp') and
306  !$ilAccess->checkAccess('read', '', $this->object->getRefId(), 'grp')) {
307  $ilErr->raiseError($this->lng->txt("msg_no_perm_read"), $ilErr->MESSAGE);
308  }
309 
310  // #9401 - see also ilStartupGUI::_checkGoto()
311  if ($cmd == 'infoScreenGoto') {
312  if ($this->object->isRegistrationEnabled()) {
313  $cmd = 'join';
314  } else {
315  $cmd = 'infoScreen';
316  }
317  }
318 
319  // check read permission
320  if ((!$this->getCreationMode()
321  && !$rbacsystem->checkAccess('read', $this->object->getRefId()) && $cmd != 'infoScreen')
322  || $cmd == 'join') {
323  // no join permission -> redirect to info screen
324  if (!$rbacsystem->checkAccess('join', $this->object->getRefId())) {
325  $this->ctrl->redirect($this, "infoScreen");
326  } else { // no read -> show registration
327  include_once('./Modules/Group/classes/class.ilGroupRegistrationGUI.php');
328  $this->ctrl->redirectByClass("ilGroupRegistrationGUI", "show");
329  }
330  }
331  if (!$cmd) {
332  $cmd = 'view';
333  }
334  $cmd .= 'Object';
335  $this->$cmd();
336  break;
337  }
338 
339  $this->addHeaderAction();
340  }
341 
342  public function viewObject()
343  {
344  global $tree,$rbacsystem,$ilUser;
345 
346  include_once 'Services/Tracking/classes/class.ilLearningProgress.php';
348  $ilUser->getId(),
349  $this->object->getId(),
350  $this->object->getRefId(),
351  'grp'
352  );
353 
354  if (strtolower($_GET["baseClass"]) == "iladministrationgui") {
355  parent::viewObject();
356  return true;
357  }
358 
359  if (!$this->checkAgreement()) {
360  include_once('Services/Membership/classes/class.ilMemberAgreementGUI.php');
361  $this->tabs_gui->setTabActive('view_content');
362  $this->ctrl->setReturn($this, 'view');
363  $agreement = new ilMemberAgreementGUI($this->object->getRefId());
364  $this->ctrl->setCmdClass(get_class($agreement));
365  $this->ctrl->forwardCommand($agreement);
366  return true;
367  }
368 
369  $this->tabs_gui->setTabActive('view_content');
370  $this->renderObject();
371  }
372 
376  public function renderObject()
377  {
378  global $ilTabs;
379 
380  $ilTabs->activateTab("view_content");
381  $ret = parent::renderObject();
382  return $ret;
383  }
384 
392  public function modifyItemGUI($a_item_list_gui, $a_item_data, $a_show_path)
393  {
394  global $tree;
395 
396  // if folder is in a course, modify item list gui according to course requirements
397  if ($course_ref_id = $tree->checkForParentType($this->object->getRefId(), 'crs')) {
398  include_once("./Modules/Course/classes/class.ilObjCourse.php");
399  include_once("./Modules/Course/classes/class.ilObjCourseGUI.php");
400  $course_obj_id = ilObject::_lookupObjId($course_ref_id);
402  $a_item_list_gui,
403  'ilcoursecontentgui',
404  $a_item_data,
405  $a_show_path,
406  ilObjCourse::_lookupAboStatus($course_obj_id),
407  $course_ref_id,
408  $course_obj_id,
409  $this->object->getRefId()
410  );
411  }
412  }
413 
418  public function afterSave(\ilObject $new_object, $a_redirect = true)
419  {
420  global $ilUser, $ilSetting;
421 
422  $new_object->setRegistrationType(GRP_REGISTRATION_DIRECT);
423  $new_object->update();
424 
425  // check for parent group or course => SORT_INHERIT
426  $sort_mode = ilContainer::SORT_TITLE;
427  if (
428  $GLOBALS['tree']->checkForParentType($new_object->getRefId(), 'crs', true) ||
429  $GLOBALS['tree']->checkForParentType($new_object->getRefId(), 'grp', true)
430  ) {
431  $sort_mode = ilContainer::SORT_INHERIT;
432  }
433 
434  // Save sorting
435  include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
436  $sort = new ilContainerSortingSettings($new_object->getId());
437  $sort->setSortMode($sort_mode);
438  $sort->update();
439 
440 
441  // Add user as admin and enable notification
442  include_once './Modules/Group/classes/class.ilGroupParticipants.php';
443  $members_obj = ilGroupParticipants::_getInstanceByObjId($new_object->getId());
444  $members_obj->add($ilUser->getId(), IL_GRP_ADMIN);
445  $members_obj->updateNotification($ilUser->getId(), $ilSetting->get('mail_grp_admin_notification', true));
446 
447  ilUtil::sendSuccess($this->lng->txt("object_added"), true);
448  if ($a_redirect) {
449  $this->ctrl->setParameter($this, "ref_id", $new_object->getRefId());
450  $this->ctrl->redirect($this, 'edit');
451  }
452  }
453 
461  public function editObject(ilPropertyFormGUI $a_form = null)
462  {
463  $this->checkPermission("write");
464 
465  $this->setSubTabs('settings');
466  $this->tabs_gui->setTabActive('settings');
467  $this->tabs_gui->setSubTabActive('grp_settings');
468 
469  if (!$a_form) {
470  $a_form = $this->initForm('edit');
471  }
472 
473  $this->tpl->setVariable('ADM_CONTENT', $a_form->getHTML());
474  }
475 
483  public function updateGroupTypeObject()
484  {
485  include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateUtils.php';
487  $this->object->getRefId(),
488  (int) $_REQUEST['grp_type']
489  );
490 
491  ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
492  $this->ctrl->redirect($this, 'edit');
493  }
494 
495 
501  public function updateObject()
502  {
503  global $ilErr;
504 
505  $this->checkPermission('write');
506 
507  $form = $this->initForm();
508  if ($form->checkInput()) {
509  // handle group type settings
510  include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateObjSettings.php';
511  $old_type = ilDidacticTemplateObjSettings::lookupTemplateId($this->object->getRefId());
512 
513  $modified = false;
514  $new_type_info = $form->getInput('didactic_type');
515  if ($new_type_info) {
516  $new_type = explode('_', $form->getInput('didactic_type'));
517  $new_type = $new_type[1];
518 
519  $modified = ($new_type != $old_type);
520  ilLoggerFactory::getLogger('grp')->info('Switched group type from ' . $old_type . ' to ' . $new_type);
521  }
522 
523  $old_autofill = $this->object->hasWaitingListAutoFill();
524 
525  $this->object->setTitle(ilUtil::stripSlashes($form->getInput('title')));
526  $this->object->setDescription(ilUtil::stripSlashes($form->getInput('desc')));
527  $this->object->setGroupType(ilUtil::stripSlashes($form->getInput('grp_type')));
528  $this->object->setRegistrationType(ilUtil::stripSlashes($form->getInput('registration_type')));
529  $this->object->setPassword(ilUtil::stripSlashes($form->getInput('password')));
530  $this->object->enableUnlimitedRegistration((bool) !$form->getInput('reg_limit_time'));
531  $this->object->enableMembershipLimitation((bool) $form->getInput('registration_membership_limited'));
532  $this->object->setMinMembers((int) $form->getInput('registration_min_members'));
533  $this->object->setMaxMembers((int) $form->getInput('registration_max_members'));
534  $this->object->enableRegistrationAccessCode((bool) $form->getInput('reg_code_enabled'));
535  $this->object->setRegistrationAccessCode($form->getInput('reg_code'));
536  $this->object->setViewMode($form->getInput('view_mode'));
537  $this->object->setMailToMembersType((int) $form->getInput('mail_type'));
538  $this->object->setShowMembers((int) $form->getInput('show_members'));
539 
540  // group period
541  $period = $form->getItemByPostVar('period');
542  $this->object->setStart($period->getStart());
543  $this->object->setEnd($period->getEnd());
544 
545  $reg = $form->getItemByPostVar("reg");
546  if ($reg->getStart() instanceof ilDateTime && $reg->getEnd() instanceof ilDateTime) {
547  $this->object->enableUnlimitedRegistration(false);
548  } else {
549  $this->object->enableUnlimitedRegistration(true);
550  }
551 
552  $this->object->setRegistrationStart($reg->getStart());
553  $this->object->setRegistrationEnd($reg->getEnd());
554 
555  $cancel_end = $form->getItemByPostVar("cancel_end");
556  $this->object->setCancellationEnd($cancel_end->getDate());
557 
558  switch ((int) $_POST['waiting_list']) {
559  case 2:
560  $this->object->enableWaitingList(true);
561  $this->object->setWaitingListAutoFill(true);
562  break;
563 
564  case 1:
565  $this->object->enableWaitingList(true);
566  $this->object->setWaitingListAutoFill(false);
567  break;
568 
569  default:
570  $this->object->enableWaitingList(false);
571  $this->object->setWaitingListAutoFill(false);
572  break;
573  }
574 
575  // update object settings
576  $this->object->update();
577 
578 
579  include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
581  $this->object->getId(),
582  $form,
583  array(
591  )
592  );
593 
594  // Save sorting
595  $this->saveSortingSettings($form);
596  // if autofill has been activated trigger process
597  if (
598  !$old_autofill &&
599  $this->object->hasWaitingListAutoFill()) {
600  $this->object->handleAutoFill();
601  }
602 
603  // BEGIN ChangeEvents: Record update Object.
604  require_once('Services/Tracking/classes/class.ilChangeEvent.php');
605  global $ilUser;
607  $this->object->getId(),
608  $ilUser->getId(),
609  'update'
610  );
611  ilChangeEvent::_catchupWriteEvents($this->object->getId(), $ilUser->getId());
612  // END PATCH ChangeEvents: Record update Object.
613  // Update ecs export settings
614  include_once 'Modules/Group/classes/class.ilECSGroupSettings.php';
615  $ecs = new ilECSGroupSettings($this->object);
616  $ecs->handleSettingsUpdate();
617  } else {
618  ilUtil::sendFailure($GLOBALS['DIC']->language()->txt('err_check_input')); // #16975
619 
620  $form->setValuesByPost();
621  $this->editObject($form);
622  return true;
623  }
624 
625  // group type modified
626  if ($modified) {
627  if ($new_type == 0) {
628  $new_type_txt = $GLOBALS['lng']->txt('il_grp_status_open');
629  } else {
630  include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateSetting.php';
631  $dtpl = new ilDidacticTemplateSetting($new_type);
632  $new_type_txt = $dtpl->getPresentationTitle($GLOBALS['lng']->getLangKey());
633  }
634 
635 
636  include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
637  ilUtil::sendQuestion($this->lng->txt('grp_warn_grp_type_changed'));
638  $confirm = new ilConfirmationGUI();
639  $confirm->setFormAction($this->ctrl->getFormAction($this));
640  $confirm->addItem(
641  'grp_type',
642  $new_type,
643  $this->lng->txt('grp_info_new_grp_type') . ': ' . $new_type_txt
644  );
645  $confirm->addButton($this->lng->txt('grp_change_type'), 'updateGroupType');
646  $confirm->setCancel($this->lng->txt('cancel'), 'edit');
647 
648  $this->tpl->setContent($confirm->getHTML());
649  return true;
650  } else {
651  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
652  $this->ctrl->redirect($this, 'edit');
653  return true;
654  }
655  }
656 
660  public function editGroupIconsObject($a_form = null)
661  {
662  global $tpl;
663 
664  $this->checkPermission('write');
665 
666  $this->setSubTabs("settings");
667  $this->tabs_gui->setTabActive('settings');
668  $this->tabs_gui->setSubTabActive('grp_icon_settings');
669 
670  if (!$a_form) {
671  $a_form = $this->initGroupIconsForm();
672  }
673 
674  $tpl->setContent($a_form->getHTML());
675  }
676 
677  public function initGroupIconsForm()
678  {
679  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
680  $form = new ilPropertyFormGUI();
681  $form->setFormAction($this->ctrl->getFormAction($this));
682 
683  $this->showCustomIconsEditing(1, $form);
684 
685  // $form->setTitle($this->lng->txt('edit_grouping'));
686  $form->addCommandButton('updateGroupIcons', $this->lng->txt('save'));
687 
688  return $form;
689  }
690 
697  public function updateGroupIconsObject()
698  {
699  global $ilSetting;
700 
701  $this->checkPermission('write');
702 
703  $form = $this->initGroupIconsForm();
704  if ($form->checkInput()) {
705  //save custom icons
706  if ($ilSetting->get("custom_icons")) {
707  if ($_POST["cont_icon_delete"]) {
708  $this->object->removeCustomIcon();
709  }
710  $this->object->saveIcons($_FILES["cont_icon"]['tmp_name']);
711  }
712  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
713  $this->ctrl->redirect($this, "editGroupIcons");
714  }
715 
716  $form->setValuesByPost();
717  $this->editGroupIconsObject($form);
718  }
719 
723  public function editMapSettingsObject()
724  {
725  global $ilUser, $ilCtrl, $ilUser, $ilAccess;
726 
727  $this->setSubTabs("settings");
728  $this->tabs_gui->setTabActive('settings');
729  $this->tabs_gui->setSubTabActive('grp_map_settings');
730 
731  include_once('./Services/Maps/classes/class.ilMapUtil.php');
732  if (!ilMapUtil::isActivated() ||
733  !$ilAccess->checkAccess("write", "", $this->object->getRefId())) {
734  return;
735  }
736 
737  $latitude = $this->object->getLatitude();
738  $longitude = $this->object->getLongitude();
739  $zoom = $this->object->getLocationZoom();
740 
741  // Get Default settings, when nothing is set
742  if ($latitude == 0 && $longitude == 0 && $zoom == 0) {
744  $latitude = $def["latitude"];
745  $longitude = $def["longitude"];
746  $zoom = $def["zoom"];
747  }
748 
749 
750  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
751  $form = new ilPropertyFormGUI();
752  $form->setFormAction($ilCtrl->getFormAction($this));
753 
754  $form->setTitle($this->lng->txt("grp_map_settings"));
755 
756  // enable map
757  $public = new ilCheckboxInputGUI(
758  $this->lng->txt("grp_enable_map"),
759  "enable_map"
760  );
761  $public->setValue("1");
762  $public->setChecked($this->object->getEnableGroupMap());
763  $form->addItem($public);
764 
765  // map location
766  $loc_prop = new ilLocationInputGUI(
767  $this->lng->txt("grp_map_location"),
768  "location"
769  );
770  $loc_prop->setLatitude($latitude);
771  $loc_prop->setLongitude($longitude);
772  $loc_prop->setZoom($zoom);
773  $form->addItem($loc_prop);
774 
775  $form->addCommandButton("saveMapSettings", $this->lng->txt("save"));
776 
777  $this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
778  }
779 
780  public function saveMapSettingsObject()
781  {
782  global $ilCtrl, $ilUser;
783 
784  $this->object->setLatitude(ilUtil::stripSlashes($_POST["location"]["latitude"]));
785  $this->object->setLongitude(ilUtil::stripSlashes($_POST["location"]["longitude"]));
786  $this->object->setLocationZoom(ilUtil::stripSlashes($_POST["location"]["zoom"]));
787  $this->object->setEnableGroupMap(ilUtil::stripSlashes($_POST["enable_map"]));
788  $this->object->update();
789 
790  $ilCtrl->redirect($this, "editMapSettings");
791  }
792 
793 
800  public function editInfoObject()
801  {
802  global $ilErr,$ilAccess;
803 
804  $this->checkPermission('write');
805 
806  $this->setSubTabs('settings');
807  $this->tabs_gui->setTabActive('settings');
808  $this->tabs_gui->setSubTabActive('grp_info_settings');
809 
810  $form = $this->initInfoEditor();
811  $this->tpl->setContent($form->getHTML());
812  }
813 
820  protected function initInfoEditor()
821  {
822  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
823  $form = new ilPropertyFormGUI();
824  $form->setFormAction($this->ctrl->getFormAction($this, 'updateInfo'));
825  $form->setTitle($this->lng->txt('grp_general_informations'));
826  $form->addCommandButton('updateInfo', $this->lng->txt('save'));
827  $form->addCommandButton('cancel', $this->lng->txt('cancel'));
828 
829  $area = new ilTextAreaInputGUI($this->lng->txt('grp_information'), 'important');
830  $area->setInfo($this->lng->txt('grp_information_info'));
831  $area->setValue($this->object->getInformation());
832  $area->setRows(8);
833  $area->setCols(80);
834  $form->addItem($area);
835 
836  return $form;
837  }
838 
845  public function updateInfoObject()
846  {
847  $this->checkPermission('manage_members');
848 
849  $this->object->setInformation(ilUtil::stripSlashes($_POST['important']));
850  $this->object->update();
851 
852  ilUtil::sendSuccess($this->lng->txt("settings_saved"));
853  $this->editInfoObject();
854  return true;
855  }
856 
858  public function readMemberData($ids, $selected_columns = null)
859  {
860  include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
861  $privacy = ilPrivacySettings::_getInstance();
862 
863  include_once './Services/Tracking/classes/class.ilObjUserTracking.php';
864  $this->show_tracking =
865  (
868  );
869  if ($this->show_tracking) {
870  include_once('./Services/Object/classes/class.ilObjectLP.php');
871  $olp = ilObjectLP::getInstance($this->object->getId());
872  $this->show_tracking = $olp->isActive();
873  }
874 
875  if ($this->show_tracking) {
876  include_once 'Services/Tracking/classes/class.ilLPStatusWrapper.php';
877  $completed = ilLPStatusWrapper::_lookupCompletedForObject($this->object->getId());
878  $in_progress = ilLPStatusWrapper::_lookupInProgressForObject($this->object->getId());
880  }
881 
882  if ($privacy->enabledGroupAccessTimes()) {
883  include_once('./Services/Tracking/classes/class.ilLearningProgress.php');
884  $progress = ilLearningProgress::_lookupProgressByObjId($this->object->getId());
885  }
886 
887  $do_prtf = (is_array($selected_columns) &&
888  in_array('prtf', $selected_columns) &&
889  is_array($ids));
890  if ($do_prtf) {
891  include_once "Modules/Portfolio/classes/class.ilObjPortfolio.php";
893  $ids,
894  $this->ctrl->getLinkTarget($this, "members")
895  );
896  }
897 
898  $profile_data = ilObjUser::_readUsersProfileData($ids);
899  foreach ($ids as $usr_id) {
900  $name = ilObjUser::_lookupName($usr_id);
901  $tmp_data['firstname'] = $name['firstname'];
902  $tmp_data['lastname'] = $name['lastname'];
903  $tmp_data['login'] = ilObjUser::_lookupLogin($usr_id);
904  $tmp_data['notification'] = $this->object->members_obj->isNotificationEnabled($usr_id) ? 1 : 0;
905  $tmp_data['usr_id'] = $usr_id;
906  $tmp_data['login'] = ilObjUser::_lookupLogin($usr_id);
907 
908  foreach ((array) $profile_data[$usr_id] as $field => $value) {
909  $tmp_data[$field] = $value;
910  }
911 
912  if ($this->show_tracking) {
913  if (in_array($usr_id, $completed)) {
914  $tmp_data['progress'] = ilLPStatus::LP_STATUS_COMPLETED;
915  } elseif (in_array($usr_id, $in_progress)) {
916  $tmp_data['progress'] = ilLPStatus::LP_STATUS_IN_PROGRESS;
917  } elseif (in_array($usr_id, $failed)) {
918  $tmp_data['progress'] = ilLPStatus::LP_STATUS_FAILED;
919  } else {
920  $tmp_data['progress'] = ilLPStatus::LP_STATUS_NOT_ATTEMPTED;
921  }
922  }
923 
924  if ($privacy->enabledGroupAccessTimes()) {
925  if (isset($progress[$usr_id]['ts']) and $progress[$usr_id]['ts']) {
926  $tmp_data['access_time'] = ilDatePresentation::formatDate(
927  $tmp_date = new ilDateTime($progress[$usr_id]['ts'], IL_CAL_UNIX)
928  );
929  $tmp_data['access_time_unix'] = $tmp_date->get(IL_CAL_UNIX);
930  } else {
931  $tmp_data['access_time'] = $this->lng->txt('no_date');
932  $tmp_data['access_time_unix'] = 0;
933  }
934  }
935 
936  if ($do_prtf) {
937  $tmp_data['prtf'] = $all_prtf[$usr_id];
938  }
939 
940  $members[$usr_id] = $tmp_data;
941  }
942  return $members ? $members : array();
943  }
944 
949  public function leaveObject()
950  {
951  global $ilUser;
952 
953  $this->checkPermission('leave');
954 
955  $part = ilGroupParticipants::_getInstanceByObjId($this->object->getId());
956  if ($part->isLastAdmin($ilUser->getId())) {
957  ilUtil::sendFailure($this->lng->txt('grp_err_administrator_required'));
958  $this->viewObject();
959  return false;
960  }
961 
962  $this->tabs_gui->setTabActive('grp_btn_unsubscribe');
963 
964  include_once "Services/Utilities/classes/class.ilConfirmationGUI.php";
965  $cgui = new ilConfirmationGUI();
966  $cgui->setHeaderText($this->lng->txt('grp_dismiss_myself'));
967  $cgui->setFormAction($this->ctrl->getFormAction($this));
968  $cgui->setCancel($this->lng->txt("cancel"), "cancel");
969  $cgui->setConfirm($this->lng->txt("grp_btn_unsubscribe"), "unsubscribe");
970  $this->tpl->setContent($cgui->getHTML());
971  }
972 
979  public function unsubscribeObject()
980  {
981  global $ilUser,$tree, $ilCtrl;
982 
983  $this->checkPermission('leave');
984 
985  $this->object->members_obj->delete($ilUser->getId());
986 
987  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
988  $this->object->members_obj->sendNotification(
990  $ilUser->getId()
991  );
992  $this->object->members_obj->sendNotification(
994  $ilUser->getId()
995  );
996 
997  ilUtil::sendSuccess($this->lng->txt('grp_msg_membership_annulled'), true);
998  $ilCtrl->setParameterByClass(
999  "ilrepositorygui",
1000  "ref_id",
1001  $tree->getParentId($this->object->getRefId())
1002  );
1003  $ilCtrl->redirectByClass("ilrepositorygui", "");
1004  }
1005 
1012  public function addContentTab()
1013  {
1014  $this->tabs_gui->addTab(
1015  "view_content",
1016  $this->lng->txt("content"),
1017  $this->ctrl->getLinkTarget($this, "view")
1018  );
1019  }
1020 
1021 
1022  // get tabs
1023  public function getTabs()
1024  {
1025  global $rbacsystem, $ilUser, $ilAccess, $lng, $ilHelp;
1026 
1027  $ilHelp->setScreenIdComponent("grp");
1028 
1029  if ($ilAccess->checkAccess('read', '', $this->ref_id)) {
1030  if ($this->object->isNewsTimelineEffective()) {
1031  if (!$this->object->isNewsTimelineLandingPageEffective()) {
1032  $this->addContentTab();
1033  }
1034  $this->tabs_gui->addTab(
1035  "news_timeline",
1036  $lng->txt("cont_news_timeline_tab"),
1037  $this->ctrl->getLinkTargetByClass("ilnewstimelinegui", "show")
1038  );
1039  if ($this->object->isNewsTimelineLandingPageEffective()) {
1040  $this->addContentTab();
1041  }
1042  } else {
1043  $this->addContentTab();
1044  }
1045  }
1046  if (
1047  $ilAccess->checkAccess('visible', '', $this->ref_id) ||
1048  $ilAccess->checkAccess('join', '', $this->ref_id) ||
1049  $ilAccess->checkAccess('read', '', $this->ref_id)
1050  ) {
1051  $this->tabs_gui->addTarget(
1052  "info_short",
1053  $this->ctrl->getLinkTargetByClass(
1054  array("ilobjgroupgui", "ilinfoscreengui"),
1055  "showSummary"
1056  ),
1057  "infoScreen",
1058  "",
1059  "",
1060  false
1061  );
1062  }
1063 
1064 
1065  if ($ilAccess->checkAccess('write', '', $this->object->getRefId())) {
1066  $this->tabs_gui->addTarget(
1067  "settings",
1068  $this->ctrl->getLinkTarget($this, "edit"),
1069  array("edit", "editMapSettings"),
1070  get_class($this),
1071  ""
1072  );
1073  }
1074 
1075  include_once './Modules/Group/classes/class.ilGroupParticipants.php';
1076  $is_participant = ilGroupParticipants::_isParticipant($this->ref_id, $ilUser->getId());
1077 
1078  // Members
1079  include_once './Modules/Group/classes/class.ilGroupMembershipGUI.php';
1080  $membership_gui = new ilGroupMembershipGUI($this, $this->object);
1081  $membership_gui->addMemberTab($this->tabs_gui, $is_participant);
1082 
1083 
1084  // badges
1085  if ($ilAccess->checkAccess('write', '', $this->ref_id)) {
1086  include_once 'Services/Badge/classes/class.ilBadgeHandler.php';
1087  if (ilBadgeHandler::getInstance()->isObjectActive($this->object->getId())) {
1088  $this->tabs_gui->addTarget(
1089  "obj_tool_setting_badges",
1090  $this->ctrl->getLinkTargetByClass("ilbadgemanagementgui", ""),
1091  "",
1092  "ilbadgemanagementgui"
1093  );
1094  }
1095  }
1096 
1097  // skills
1098  include_once("./Services/Object/classes/class.ilObjectServiceSettingsGUI.php");
1099  if ($ilAccess->checkAccess('read', '', $this->ref_id) && ilContainer::_lookupContainerSetting(
1100  $this->object->getId(),
1102  false
1103  )) {
1104  $this->tabs_gui->addTarget(
1105  "obj_tool_setting_skills",
1106  $this->ctrl->getLinkTargetByClass(array("ilcontainerskillgui", "ilcontskillpresentationgui"), ""),
1107  "",
1108  array("ilcontainerskillgui", "ilcontskillpresentationgui", "ilcontskilladmingui")
1109  );
1110  }
1111 
1112  // learning progress
1113  include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
1114  if (ilLearningProgressAccess::checkAccess($this->object->getRefId(), $is_participant)) {
1115  $this->tabs_gui->addTarget(
1116  'learning_progress',
1117  $this->ctrl->getLinkTargetByClass(array('ilobjgroupgui','illearningprogressgui'), ''),
1118  '',
1119  array('illplistofobjectsgui','illplistofsettingsgui','illearningprogressgui','illplistofprogressgui')
1120  );
1121  }
1122 
1123 
1124  if ($ilAccess->checkAccess('write', '', $this->object->getRefId())) {
1125  $this->tabs_gui->addTarget(
1126  'export',
1127  $this->ctrl->getLinkTargetByClass('ilexportgui', ''),
1128  'export',
1129  'ilexportgui'
1130  );
1131  }
1132 
1133  // parent tabs (all container: edit_permission, clipboard, trash
1134  parent::getTabs();
1135 
1136  if ($ilAccess->checkAccess('join', '', $this->object->getRefId()) and
1137  !$this->object->members_obj->isAssigned($ilUser->getId())) {
1138  include_once './Modules/Group/classes/class.ilGroupWaitingList.php';
1139  if (ilGroupWaitingList::_isOnList($ilUser->getId(), $this->object->getId())) {
1140  $this->tabs_gui->addTab(
1141  'leave',
1142  $this->lng->txt('membership_leave'),
1143  $this->ctrl->getLinkTargetByClass('ilgroupregistrationgui', 'show', '')
1144  );
1145  } else {
1146  $this->tabs_gui->addTarget(
1147  "join",
1148  $this->ctrl->getLinkTargetByClass('ilgroupregistrationgui', "show"),
1149  'show',
1150  ""
1151  );
1152  }
1153  }
1154  if ($ilAccess->checkAccess('leave', '', $this->object->getRefId()) and
1155  $this->object->members_obj->isMember($ilUser->getId())) {
1156  $this->tabs_gui->addTarget(
1157  "grp_btn_unsubscribe",
1158  $this->ctrl->getLinkTarget($this, "leave"),
1159  '',
1160  ""
1161  );
1162  }
1163  }
1164 
1170  public function infoScreenObject()
1171  {
1172  $this->ctrl->setCmd("showSummary");
1173  $this->ctrl->setCmdClass("ilinfoscreengui");
1174  $this->infoScreen();
1175  }
1176 
1180  public function infoScreen()
1181  {
1182  global $rbacsystem, $ilUser, $ilSetting;
1183 
1184  $this->tabs_gui->setTabActive('info_short');
1185 
1186  if (!$this->checkPermissionBool('read')) {
1187  $this->checkPermission('visible');
1188  }
1189 
1190  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1191  $info = new ilInfoScreenGUI($this);
1192 
1193  if (strlen($this->object->getInformation())) {
1194  $info->addSection($this->lng->txt('grp_general_informations'));
1195  $info->addProperty($this->lng->txt('grp_information'), nl2br(
1196  ilUtil::makeClickable($this->object->getInformation(), true)
1197  ));
1198  }
1199 
1200  $info->enablePrivateNotes();
1201  $info->enableLearningProgress(true);
1202 
1203  $info->addSection($this->lng->txt('group_registration'));
1204  $info->showLDAPRoleGroupMappingInfo();
1205 
1206  if (!$this->object->isRegistrationEnabled()) {
1207  $info->addProperty(
1208  $this->lng->txt('group_registration_mode'),
1209  $this->lng->txt('grp_reg_deac_info_screen')
1210  );
1211  } else {
1212  switch ($this->object->getRegistrationType()) {
1214  $info->addProperty(
1215  $this->lng->txt('group_registration_mode'),
1216  $this->lng->txt('grp_reg_direct_info_screen')
1217  );
1218  break;
1219 
1221  $info->addProperty(
1222  $this->lng->txt('group_registration_mode'),
1223  $this->lng->txt('grp_reg_req_info_screen')
1224  );
1225  break;
1226 
1228  $info->addProperty(
1229  $this->lng->txt('group_registration_mode'),
1230  $this->lng->txt('grp_reg_passwd_info_screen')
1231  );
1232  break;
1233 
1234  }
1235  /*
1236  $info->addProperty($this->lng->txt('group_registration_time'),
1237  ilDatePresentation::formatPeriod(
1238  $this->object->getRegistrationStart(),
1239  $this->object->getRegistrationEnd()));
1240  */
1241  if ($this->object->isRegistrationUnlimited()) {
1242  $info->addProperty(
1243  $this->lng->txt('group_registration_time'),
1244  $this->lng->txt('grp_registration_unlimited')
1245  );
1246  } elseif ($this->object->getRegistrationStart()->getUnixTime() < time()) {
1247  $info->addProperty(
1248  $this->lng->txt("group_registration_time"),
1249  $this->lng->txt('cal_until') . ' ' .
1250  ilDatePresentation::formatDate($this->object->getRegistrationEnd())
1251  );
1252  } elseif ($this->object->getRegistrationStart()->getUnixTime() >= time()) {
1253  $info->addProperty(
1254  $this->lng->txt("group_registration_time"),
1255  $this->lng->txt('cal_from') . ' ' .
1256  ilDatePresentation::formatDate($this->object->getRegistrationStart())
1257  );
1258  }
1259  if ($this->object->isMembershipLimited()) {
1260  if ($this->object->getMinMembers()) {
1261  $info->addProperty(
1262  $this->lng->txt("mem_min_users"),
1263  $this->object->getMinMembers()
1264  );
1265  }
1266  if ($this->object->getMaxMembers()) {
1267  include_once './Modules/Group/classes/class.ilObjGroupAccess.php';
1268  $reg_info = ilObjGroupAccess::lookupRegistrationInfo($this->object->getId());
1269 
1270  $info->addProperty(
1271  $this->lng->txt('mem_free_places'),
1272  $reg_info['reg_info_free_places']
1273  );
1274  }
1275  }
1276 
1277  if ($this->object->getCancellationEnd()) {
1278  $info->addProperty(
1279  $this->lng->txt('grp_cancellation_end'),
1280  ilDatePresentation::formatDate($this->object->getCancellationEnd())
1281  );
1282  }
1283  }
1284 
1285  if ($this->object->getStart()) {
1286  $info->addProperty(
1287  $this->lng->txt('grp_period'),
1289  $this->object->getStart(),
1290  $this->object->getEnd()
1291  )
1292  );
1293  }
1294 
1295 
1296  // Confirmation
1297  include_once('Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
1298  $privacy = ilPrivacySettings::_getInstance();
1299 
1300  include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
1301  if ($privacy->groupConfirmationRequired() or ilCourseDefinedFieldDefinition::_getFields($this->object->getId()) or $privacy->enabledGroupExport()) {
1302  include_once('Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php');
1303 
1304  $field_info = ilExportFieldsInfo::_getInstanceByType($this->object->getType());
1305 
1306  $this->lng->loadLanguageModule('ps');
1307  $info->addSection($this->lng->txt('grp_user_agreement_info'));
1308  $info->addProperty($this->lng->txt('ps_export_data'), $field_info->exportableFieldsToInfoString());
1309 
1310  if ($fields = ilCourseDefinedFieldDefinition::_fieldsToInfoString($this->object->getId())) {
1311  $info->addProperty($this->lng->txt('ps_grp_user_fields'), $fields);
1312  }
1313  }
1314 
1315 
1316  // forward the command
1317  $this->ctrl->forwardCommand($info);
1318  }
1319 
1323  public function saveNotificationObject()
1324  {
1325  include_once "Services/Membership/classes/class.ilMembershipNotifications.php";
1326  $noti = new ilMembershipNotifications($this->ref_id);
1327  if ($noti->canCurrentUserEdit()) {
1328  if ((bool) $_REQUEST["grp_ntf"]) {
1329  $noti->activateUser();
1330  } else {
1331  $noti->deactivateUser();
1332  }
1333  }
1334  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
1335  $this->ctrl->redirect($this, "infoScreen");
1336  }
1337 
1341  protected function membersObject()
1342  {
1343  $GLOBALS['ilCtrl']->redirectByClass('ilgroupmembershipgui');
1344  }
1345 
1346 
1350  public static function _goto($a_target, $a_add = "")
1351  {
1352  global $ilAccess, $ilErr, $lng,$ilUser;
1353 
1354  include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
1355  if (substr($a_add, 0, 5) == 'rcode') {
1356  if ($ilUser->getId() == ANONYMOUS_USER_ID) {
1357  // Redirect to login for anonymous
1359  "login.php?target=" . $_GET["target"] . "&cmd=force_login&lang=" .
1360  $ilUser->getCurrentLanguage()
1361  );
1362  }
1363 
1364  // Redirects to target location after assigning user to group
1366  $a_target,
1368  substr($a_add, 5)
1369  );
1370  }
1371 
1372  if ($a_add == "mem" && $ilAccess->checkAccess("manage_members", "", $a_target)) {
1373  ilObjectGUI::_gotoRepositoryNode($a_target, "members");
1374  }
1375 
1376  if ($ilAccess->checkAccess("read", "", $a_target)) {
1378  } else {
1379  // to do: force flat view
1380  if ($ilAccess->checkAccess("visible", "", $a_target)) {
1381  ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreenGoto");
1382  } else {
1383  if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
1384  ilUtil::sendFailure(sprintf(
1385  $lng->txt("msg_no_perm_read_item"),
1387  ), true);
1389  }
1390  }
1391  }
1392  $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
1393  }
1394 
1395 
1403  public function initForm($a_mode = 'edit', $a_omit_form_action = false)
1404  {
1405  global $ilUser,$tpl,$tree;
1406 
1407  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
1408 
1409  $form = new ilPropertyFormGUI();
1410 
1411  if (!$a_omit_form_action) {
1412  switch ($a_mode) {
1413  case 'edit':
1414  $form->setFormAction($this->ctrl->getFormAction($this, 'update'));
1415  break;
1416 
1417  default:
1418  $form->setTableWidth('600px');
1419  $form->setFormAction($this->ctrl->getFormAction($this, 'save'));
1420  break;
1421  }
1422  }
1423 
1424  // title
1425  $title = new ilTextInputGUI($this->lng->txt('title'), 'title');
1426  $title->setSubmitFormOnEnter(true);
1427  if ($a_mode == "edit") {
1428  $title->setValue($this->object->getTitle());
1429  }
1430  $title->setSize(min(40, ilObject::TITLE_LENGTH));
1431  $title->setMaxLength(ilObject::TITLE_LENGTH);
1432  $title->setRequired(true);
1433  $form->addItem($title);
1434 
1435  // desc
1436  $desc = new ilTextAreaInputGUI($this->lng->txt('description'), 'desc');
1437  if ($a_mode == "edit") {
1438  $desc->setValue($this->object->getLongDescription());
1439  }
1440  $desc->setRows(2);
1441  $desc->setCols(40);
1442  $form->addItem($desc);
1443 
1444  $form = $this->initDidacticTemplate($form);
1445 
1446  if ($a_mode == 'edit') {
1447  // group period
1448  include_once 'Services/Form/classes/class.ilDateDurationInputGUI.php';
1449  $group_duration = new ilDateDurationInputGUI($this->lng->txt('grp_period'), 'period');
1450  $group_duration->setInfo($this->lng->txt('grp_period_info'));
1451  if ($this->object->getStart()) {
1452  $group_duration->setStart($this->object->getStart());
1453  }
1454  if ($this->object->getEnd()) {
1455  $group_duration->setEnd($this->object->getEnd());
1456  }
1457  $form->addItem($group_duration);
1458 
1459  // Group registration ############################################################
1460  $pres = new ilFormSectionHeaderGUI();
1461  $pres->setTitle($this->lng->txt('grp_setting_header_registration'));
1462  $form->addItem($pres);
1463 
1464  // Registration type
1465  $reg_type = new ilRadioGroupInputGUI($this->lng->txt('group_registration_mode'), 'registration_type');
1466  $reg_type->setValue($this->object->getRegistrationType());
1467 
1468  $opt_dir = new ilRadioOption($this->lng->txt('grp_reg_direct'), GRP_REGISTRATION_DIRECT);#$this->lng->txt('grp_reg_direct_info'));
1469  $reg_type->addOption($opt_dir);
1470 
1471  $opt_pass = new ilRadioOption($this->lng->txt('grp_pass_request'), GRP_REGISTRATION_PASSWORD);
1472  $pass = new ilTextInputGUI($this->lng->txt("password"), 'password');
1473  $pass->setRequired(true);
1474  $pass->setInfo($this->lng->txt('grp_reg_password_info'));
1475  $pass->setValue($this->object->getPassword());
1476  $pass->setSize(32);
1477  $pass->setMaxLength(32);
1478  $opt_pass->addSubItem($pass);
1479  $reg_type->addOption($opt_pass);
1480 
1481  $opt_req = new ilRadioOption($this->lng->txt('grp_reg_request'), GRP_REGISTRATION_REQUEST, $this->lng->txt('grp_reg_request_info'));
1482  $reg_type->addOption($opt_req);
1483 
1484  $opt_deact = new ilRadioOption($this->lng->txt('grp_reg_no_selfreg'), GRP_REGISTRATION_DEACTIVATED, $this->lng->txt('grp_reg_disabled_info'));
1485  $reg_type->addOption($opt_deact);
1486 
1487  // Registration codes
1488  $reg_code = new ilCheckboxInputGUI($this->lng->txt('grp_reg_code'), 'reg_code_enabled');
1489  $reg_code->setChecked($this->object->isRegistrationAccessCodeEnabled());
1490  $reg_code->setValue(1);
1491  $reg_code->setInfo($this->lng->txt('grp_reg_code_enabled_info'));
1492  $form->addItem($reg_type);
1493 
1494  // Registration codes
1495  if (!$this->object->getRegistrationAccessCode()) {
1496  include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
1497  $this->object->setRegistrationAccessCode(ilMembershipRegistrationCodeUtils::generateCode());
1498  }
1499  $reg_link = new ilHiddenInputGUI('reg_code');
1500  $reg_link->setValue($this->object->getRegistrationAccessCode());
1501  $form->addItem($reg_link);
1502 
1503  $link = new ilCustomInputGUI($this->lng->txt('grp_reg_code_link'));
1504  include_once './Services/Link/classes/class.ilLink.php';
1505  $val = ilLink::_getLink($this->object->getRefId(), $this->object->getType(), array(), '_rcode' . $this->object->getRegistrationAccessCode());
1506  $link->setHTML('<font class="small">' . $val . '</font>');
1507  $reg_code->addSubItem($link);
1508  $form->addItem($reg_code);
1509 
1510  // time limit
1511  $this->lng->loadLanguageModule('dateplaner');
1512  include_once './Services/Form/classes/class.ilDateDurationInputGUI.php';
1513  $dur = new ilDateDurationInputGUI($this->lng->txt('grp_reg_limited'), 'reg');
1514  $dur->setShowTime(true);
1515  $dur->setStart($this->object->getRegistrationStart());
1516  $dur->setEnd($this->object->getRegistrationEnd());
1517  $form->addItem($dur);
1518 
1519  // cancellation limit
1520  $cancel = new ilDateTimeInputGUI($this->lng->txt('grp_cancellation_end'), 'cancel_end');
1521  $cancel->setInfo($this->lng->txt('grp_cancellation_end_info'));
1522  $cancel->setDate($this->object->getCancellationEnd());
1523  $form->addItem($cancel);
1524 
1525  // max member
1526  $lim = new ilCheckboxInputGUI($this->lng->txt('reg_grp_max_members_short'), 'registration_membership_limited');
1527  $lim->setValue(1);
1528  // $lim->setOptionTitle($this->lng->txt('reg_grp_max_members'));
1529  $lim->setChecked($this->object->isMembershipLimited());
1530 
1531  $min = new ilTextInputGUI($this->lng->txt('reg_grp_min_members'), 'registration_min_members');
1532  $min->setSize(3);
1533  $min->setMaxLength(4);
1534  $min->setValue($this->object->getMinMembers() ? $this->object->getMinMembers() : '');
1535  $min->setInfo($this->lng->txt('grp_subscription_min_members_info'));
1536  $lim->addSubItem($min);
1537 
1538  $max = new ilTextInputGUI($this->lng->txt('reg_grp_max_members'), 'registration_max_members');
1539  $max->setValue($this->object->getMaxMembers() ? $this->object->getMaxMembers() : '');
1540  //$max->setTitle($this->lng->txt('members'));
1541  $max->setSize(3);
1542  $max->setMaxLength(4);
1543  $max->setInfo($this->lng->txt('grp_reg_max_members_info'));
1544  $lim->addSubItem($max);
1545 
1546  /*
1547  $wait = new ilCheckboxInputGUI($this->lng->txt('grp_waiting_list'),'waiting_list');
1548  $wait->setValue(1);
1549  //$wait->setOptionTitle($this->lng->txt('grp_waiting_list'));
1550  $wait->setInfo($this->lng->txt('grp_waiting_list_info'));
1551  $wait->setChecked($this->object->isWaitingListEnabled() ? true : false);
1552  $lim->addSubItem($wait);
1553  $form->addItem($lim);
1554  */
1555 
1556  $wait = new ilRadioGroupInputGUI($this->lng->txt('grp_waiting_list'), 'waiting_list');
1557 
1558  $option = new ilRadioOption($this->lng->txt('none'), 0);
1559  $wait->addOption($option);
1560 
1561  $option = new ilRadioOption($this->lng->txt('grp_waiting_list_no_autofill'), 1);
1562  $option->setInfo($this->lng->txt('grp_waiting_list_info'));
1563  $wait->addOption($option);
1564 
1565  $option = new ilRadioOption($this->lng->txt('grp_waiting_list_autofill'), 2);
1566  $option->setInfo($this->lng->txt('grp_waiting_list_autofill_info'));
1567  $wait->addOption($option);
1568 
1569  if ($this->object->hasWaitingListAutoFill()) {
1570  $wait->setValue(2);
1571  } elseif ($this->object->isWaitingListEnabled()) {
1572  $wait->setValue(1);
1573  }
1574 
1575  $lim->addSubItem($wait);
1576 
1577  $form->addItem($lim);
1578 
1579 
1580  // Group presentation
1581  $hasParentMembership =
1582  (
1583  $tree->checkForParentType($this->object->getRefId(), 'crs', true) ||
1584  $tree->checkForParentType($this->object->getRefId(), 'grp', true)
1585  );
1586 
1587  $pres = new ilFormSectionHeaderGUI();
1588  $pres->setTitle($this->lng->txt('grp_setting_header_presentation'));
1589  $form->addItem($pres);
1590 
1591  // presentation type
1592  $view_type = new ilRadioGroupInputGUI($this->lng->txt('grp_presentation_type'), 'view_mode');
1593  if ($hasParentMembership) {
1594  switch ($this->object->getViewMode()) {
1596  $course_view_mode = ': ' . $this->lng->txt('cntr_view_sessions');
1597  break;
1598 
1600  $course_view_mode = ': ' . $this->lng->txt('cntr_view_simple');
1601  break;
1602 
1604  $course_view_mode = ': ' . $this->lng->txt('cntr_view_by_type');
1605  break;
1606  }
1607 
1608  $opt = new ilRadioOption($this->lng->txt('grp_view_inherit') . $course_view_mode, ilContainer::VIEW_INHERIT);
1609  $opt->setInfo($this->lng->txt('grp_view_inherit_info'));
1610  $view_type->addOption($opt);
1611  }
1612 
1613  if ($hasParentMembership &&
1614  $this->object->getViewMode() == ilContainer::VIEW_INHERIT) {
1615  $view_type->setValue(ilContainer::VIEW_INHERIT);
1616  } else {
1617  $view_type->setValue(
1619  $this->object->getId(),
1620  $this->object->getViewMode(),
1621  $this->object->getRefId()
1622  )
1623  );
1624  }
1625 
1626  $opt = new ilRadioOption($this->lng->txt('cntr_view_simple'), ilContainer::VIEW_SIMPLE);
1627  $opt->setInfo($this->lng->txt('grp_view_info_simple'));
1628  $view_type->addOption($opt);
1629 
1630  $opt = new ilRadioOption($this->lng->txt('cntr_view_by_type'), ilContainer::VIEW_BY_TYPE);
1631  $opt->setInfo($this->lng->txt('grp_view_info_by_type'));
1632  $view_type->addOption($opt);
1633  $form->addItem($view_type);
1634 
1635 
1636  // Sorting
1637  $sorting_settings = array();
1638  if ($hasParentMembership) {
1639  $sorting_settings[] = ilContainer::SORT_INHERIT;
1640  }
1641  $sorting_settings[] = ilContainer::SORT_TITLE;
1642  $sorting_settings[] = ilContainer::SORT_CREATION;
1643  $sorting_settings[] = ilContainer::SORT_MANUAL;
1644  $this->initSortingForm($form, $sorting_settings);
1645 
1646  // additional features
1647  $feat = new ilFormSectionHeaderGUI();
1648  $feat->setTitle($this->lng->txt('obj_features'));
1649  $form->addItem($feat);
1650 
1651  include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
1653  $this->object->getId(),
1654  $form,
1655  array(
1663  )
1664  );
1665 
1666  // Notification Settings
1667  /*$notification = new ilFormSectionHeaderGUI();
1668  $notification->setTitle($this->lng->txt('grp_notification'));
1669  $form->addItem($notification);*/
1670 
1671  $mem = new ilCheckboxInputGUI($this->lng->txt('grp_show_members'), 'show_members');
1672  $mem->setChecked($this->object->getShowMembers());
1673  $mem->setInfo($this->lng->txt('grp_show_members_info'));
1674  $form->addItem($mem);
1675 
1676  // Show members type
1677  $mail_type = new ilRadioGroupInputGUI($this->lng->txt('grp_mail_type'), 'mail_type');
1678  $mail_type->setValue($this->object->getMailToMembersType());
1679 
1680  $mail_tutors = new ilRadioOption(
1681  $this->lng->txt('grp_mail_tutors_only'),
1683  $this->lng->txt('grp_mail_tutors_only_info')
1684  );
1685  $mail_type->addOption($mail_tutors);
1686 
1687  $mail_all = new ilRadioOption(
1688  $this->lng->txt('grp_mail_all'),
1690  $this->lng->txt('grp_mail_all_info')
1691  );
1692  $mail_type->addOption($mail_all);
1693  $form->addItem($mail_type);
1694  }
1695 
1696  switch ($a_mode) {
1697  case 'create':
1698  $form->setTitle($this->lng->txt('grp_new'));
1699  $form->setTitleIcon(ilUtil::getImagePath('icon_grp.svg'));
1700 
1701  $form->addCommandButton('save', $this->lng->txt('grp_new'));
1702  $form->addCommandButton('cancel', $this->lng->txt('cancel'));
1703  break;
1704 
1705  case 'edit':
1706  $form->setTitle($this->lng->txt('grp_edit'));
1707  $form->setTitleIcon(ilUtil::getImagePath('icon_grp.svg'));
1708 
1709  // Edit ecs export settings
1710  include_once 'Modules/Group/classes/class.ilECSGroupSettings.php';
1711  $ecs = new ilECSGroupSettings($this->object);
1712  $ecs->addSettingsToForm($form, 'grp');
1713 
1714  $form->addCommandButton('update', $this->lng->txt('save'));
1715  $form->addCommandButton('cancel', $this->lng->txt('cancel'));
1716  break;
1717  }
1718  return $form;
1719  }
1720 
1728  protected function setSubTabs($a_tab)
1729  {
1730  global $rbacsystem,$ilUser,$ilAccess;
1731 
1732  switch ($a_tab) {
1733 
1734  case 'settings':
1735  $this->tabs_gui->addSubTabTarget(
1736  "grp_settings",
1737  $this->ctrl->getLinkTarget($this, 'edit'),
1738  "edit",
1739  get_class($this)
1740  );
1741 
1742  $this->tabs_gui->addSubTabTarget(
1743  "grp_info_settings",
1744  $this->ctrl->getLinkTarget($this, 'editInfo'),
1745  "editInfo",
1746  get_class($this)
1747  );
1748 
1749  // custom icon
1750  if ($this->ilias->getSetting("custom_icons")) {
1751  $this->tabs_gui->addSubTabTarget(
1752  "grp_icon_settings",
1753  $this->ctrl->getLinkTarget($this, 'editGroupIcons'),
1754  "editGroupIcons",
1755  get_class($this)
1756  );
1757  }
1758 
1759  include_once("./Services/Maps/classes/class.ilMapUtil.php");
1760  if (ilMapUtil::isActivated()) {
1761  $this->tabs_gui->addSubTabTarget(
1762  "grp_map_settings",
1763  $this->ctrl->getLinkTarget($this, 'editMapSettings'),
1764  "editMapSettings",
1765  get_class($this)
1766  );
1767  }
1768 
1769  $this->tabs_gui->addSubTabTarget(
1770  'groupings',
1771  $this->ctrl->getLinkTargetByClass('ilobjcoursegroupinggui', 'listGroupings'),
1772  'listGroupings',
1773  get_class($this)
1774  );
1775 
1776  include_once('Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
1777  include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
1778  // only show if export permission is granted
1779  if (ilPrivacySettings::_getInstance()->checkExportAccess($this->object->getRefId()) or ilCourseDefinedFieldDefinition::_hasFields($this->object->getId())) {
1780  $this->tabs_gui->addSubTabTarget(
1781  'grp_custom_user_fields',
1782  $this->ctrl->getLinkTargetByClass('ilobjectcustomuserfieldsgui'),
1783  '',
1784  'ilobjectcustomuserfieldsgui'
1785  );
1786  }
1787 
1788  // news settings
1789  if ($this->object->getUseNews()) {
1790  $this->tabs_gui->addSubTab(
1791  'obj_news_settings',
1792  $this->lng->txt("cont_news_settings"),
1793  $this->ctrl->getLinkTargetByClass('ilcontainernewssettingsgui')
1794  );
1795  }
1796 
1797  $lti_settings = new ilLTIProviderObjectSettingGUI($this->object->getRefId());
1798  if ($lti_settings->hasSettingsAccess()) {
1799  $this->tabs_gui->addSubTabTarget(
1800  'lti_provider',
1801  $this->ctrl->getLinkTargetByClass(ilLTIProviderObjectSettingGUI::class)
1802  );
1803  }
1804 
1805 
1806  break;
1807 
1808 
1809  }
1810  }
1811 
1818  private function checkAgreement()
1819  {
1820  global $ilUser,$ilAccess;
1821 
1822  if ($ilAccess->checkAccess('write', '', $this->object->getRefId())) {
1823  return true;
1824  }
1825 
1826  // Disable aggrement if is not member of group
1827  if (!$this->object->members_obj->isAssigned($ilUser->getId())) {
1828  return true;
1829  }
1830 
1831  include_once './Services/Container/classes/class.ilMemberViewSettings.php';
1832  if (ilMemberViewSettings::getInstance()->isActive()) {
1833  return true;
1834  }
1835 
1836  include_once('Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
1837  include_once('Services/Membership/classes/class.ilMemberAgreement.php');
1838  $privacy = ilPrivacySettings::_getInstance();
1839 
1840  // Check agreement
1841  if (($privacy->groupConfirmationRequired() or ilCourseDefinedFieldDefinition::_hasFields($this->object->getId()))
1842  and !ilMemberAgreement::_hasAccepted($ilUser->getId(), $this->object->getId())) {
1843  return false;
1844  }
1845  // Check required fields
1846  include_once('Modules/Course/classes/Export/class.ilCourseUserData.php');
1847  if (!ilCourseUserData::_checkRequired($ilUser->getId(), $this->object->getId())) {
1848  return false;
1849  }
1850  return true;
1851  }
1852 
1853 
1858  public function prepareOutput($a_show_subobjects = true)
1859  {
1860  global $rbacsystem;
1861  if (!$this->getCreationMode()) {
1862  /*
1863  include_once './Services/Container/classes/class.ilMemberViewSettings.php';
1864  $settings = ilMemberViewSettings::getInstance();
1865  if($settings->isActive() and $settings->getContainer() != $this->object->getRefId())
1866  {
1867  $settings->setContainer($this->object->getRefId());
1868  $rbacsystem->initMemberView();
1869  }
1870  */
1871  }
1872  parent::prepareOutput($a_show_subobjects);
1873  }
1874 
1879  public function createMailSignature()
1880  {
1881  $link = chr(13) . chr(10) . chr(13) . chr(10);
1882  $link .= $this->lng->txt('grp_mail_permanent_link');
1883  $link .= chr(13) . chr(10) . chr(13) . chr(10);
1884  include_once 'Services/Link/classes/class.ilLink.php';
1885  $link .= ilLink::_getLink($this->object->getRefId());
1886  return rawurlencode(base64_encode($link));
1887  }
1888 
1889  protected function initHeaderAction($a_sub_type = null, $a_sub_id = null)
1890  {
1891  global $ilSetting, $ilUser;
1892 
1893  $lg = parent::initHeaderAction($a_sub_type, $a_sub_id);
1894 
1895  include_once('./Modules/Group/classes/class.ilGroupParticipants.php');
1896  if (ilGroupParticipants::_isParticipant($this->ref_id, $ilUser->getId())) {
1897  include_once "Services/Membership/classes/class.ilMembershipNotifications.php";
1899  $noti = new ilMembershipNotifications($this->ref_id);
1900  if (!$noti->isCurrentUserActive()) {
1901  $lg->addHeaderIcon(
1902  "not_icon",
1903  ilUtil::getImagePath("notification_off.svg"),
1904  $this->lng->txt("grp_notification_deactivated")
1905  );
1906 
1907  $this->ctrl->setParameter($this, "grp_ntf", 1);
1908  $caption = "grp_activate_notification";
1909  } else {
1910  $lg->addHeaderIcon(
1911  "not_icon",
1912  ilUtil::getImagePath("notification_on.svg"),
1913  $this->lng->txt("grp_notification_activated")
1914  );
1915 
1916  $this->ctrl->setParameter($this, "grp_ntf", 0);
1917  $caption = "grp_deactivate_notification";
1918  }
1919 
1920  if ($noti->canCurrentUserEdit()) {
1921  $lg->addCustomCommand(
1922  $this->ctrl->getLinkTarget($this, "saveNotification"),
1923  $caption
1924  );
1925  }
1926 
1927  $this->ctrl->setParameter($this, "grp_ntf", "");
1928  }
1929  }
1930 
1931  return $lg;
1932  }
1933 
1934 
1939  public function addCustomData($a_data)
1940  {
1941  // object defined fields
1942  include_once('Modules/Course/classes/Export/class.ilCourseUserData.php');
1943  $odfs = ilCourseUserData::_getValuesByObjId($this->object->getId());
1944 
1945  $res_data = array();
1946  foreach ($a_data as $usr_id => $user_data) {
1947  $res_data[$usr_id] = $user_data;
1948 
1949  // udf
1950  include_once './Services/User/classes/class.ilUserDefinedData.php';
1951  $udf_data = new ilUserDefinedData($usr_id);
1952  foreach ($udf_data->getAll() as $field => $value) {
1953  list($f, $field_id) = explode('_', $field);
1954  $res_data[$usr_id]['udf_' . $field_id] = (string) $value;
1955  }
1956 
1957  foreach ((array) $odfs[$usr_id] as $cdf_field => $cdf_value) {
1958  $res_data[$usr_id]['cdf_' . $cdf_field] = (string) $cdf_value;
1959  }
1960  }
1961 
1962  return $res_data;
1963  }
1964 
1969  public function getLocalRoles()
1970  {
1971  $local_roles = $this->object->getLocalGroupRoles(false);
1972  $grp_member = $this->object->getDefaultMemberRole();
1973  $grp_roles = array();
1974 
1975  //put the group member role to the top of the crs_roles array
1976  if (in_array($grp_member, $local_roles)) {
1977  $grp_roles[$grp_member] = ilObjRole::_getTranslation(array_search($grp_member, $local_roles));
1978  unset($local_roles[$grp_roles[$grp_member]]);
1979  }
1980 
1981  foreach ($local_roles as $title => $role_id) {
1982  $grp_roles[$role_id] = ilObjRole::_getTranslation($title);
1983  }
1984  return $grp_roles;
1985  }
1986 
1990  protected function jump2UsersGalleryObject()
1991  {
1992  $this->ctrl->redirectByClass('ilUsersGalleryGUI');
1993  }
1994 
1998  public function setSideColumnReturn()
1999  {
2000  $this->ctrl->setReturn($this, "view");
2001  }
2002 } // END class.ilObjGroupGUI
static lookupTemplateId($a_ref_id)
Lookup template id ilDB $ilDB.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static _lookupLogin($a_user_id)
lookup login
static _lookupName($a_user_id)
lookup user name
prepareOutput($a_show_subobjects=true)
Handle member view.
setLatitude($a_latitude)
Set Latitude.
This class represents an option in a radio group.
Add rich text string
$lg
Definition: example_018.php:62
static isActive()
Is feature active?
renderObject()
Render group.
setSideColumnReturn()
Set return point for side column actions.
static _isParticipant($a_ref_id, $a_usr_id)
Static function to check if a user is a participant of the container object.
Class ilInfoScreenGUI.
Class ilObjGroupGUI.
infoScreenObject()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually...
static _fieldsToInfoString($a_obj_id)
Fields to info string.
editInfoObject()
edit info
saveSortingSettings(ilPropertyFormGUI $form)
Save sorting settings.
Class ilUserDefinedData.
const GRP_REGISTRATION_DEACTIVATED
This class represents a property form user interface.
addContentTab()
Add content tab.
GUI class for the workflow of copying objects.
getLocalRoles()
returns all local roles [role_id] => title
const TITLE_LENGTH
max length of object title
const IL_GRP_ADMIN
$_GET["client_id"]
initInfoEditor()
init info editor
This class represents a section header in a property form.
static _getValuesByObjId($a_obj_id)
Get values by obj_id (for all users)
const LP_STATUS_NOT_ATTEMPTED
editGroupIconsObject($a_form=null)
edit container icons
static _recordWriteEvent($obj_id, $usr_id, $action, $parent_obj_id=null)
Records a write event.
unsubscribeObject()
unsubscribe from group
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
initForm($a_mode='edit', $a_omit_form_action=false)
init create/edit form
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
updateInfoObject()
update info
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
setValue($a_value)
Set Value.
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupFailedForObject($a_obj_id, $a_user_ids=null)
Get failed users for object.
static _tracProgress($a_user_id, $a_obj_id, $a_ref_id, $a_obj_type='')
This class represents a checkbox property in a property form.
static _lookupTitle($a_id)
lookup object title
editMapSettingsObject()
Edit Map Settings.
Class ilMailMemberSearchGUI.
$service
Definition: login.php:15
__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output=false)
Constructor public.
static handleCode($a_ref_id, $a_type, $a_code)
Handle target parameter.
const IL_CAL_UNIX
const GRP_REGISTRATION_PASSWORD
setInfo($a_info)
Set Info.
updateGroupTypeObject()
change group type
const GRP_REGISTRATION_REQUEST
static _readUsersProfileData($a_user_ids)
STATIC METHOD get user data of selected users.
static _hasAccepted($a_usr_id, $a_obj_id)
Check if user has accepted agreement.
Class ilMailMemberCourseRoles.
setSubTabs($a_tab)
set sub tabs
const LP_STATUS_IN_PROGRESS
This class represents a date/time property in a property form.
static _catchupWriteEvents($obj_id, $usr_id, $timestamp=null)
Catches up with all write events which occured before the specified timestamp.
global $ilCtrl
Definition: ilias.php:18
setInfo($a_info)
Set Information Text.
infoScreen()
show information screen
setChecked($a_checked)
Set Checked.
Export User Interface Class.
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
static _enabledUserRelatedData()
check wether user related tracking is enabled or not
setCustomRolesForSelection($a_roles)
Set custom roles for mapping to LTI roles.
This class represents a hidden form property in a property form.
static switchTemplate($a_ref_id, $a_new_tpl_id)
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.
input GUI for a time span (start and end date)
GUI class for public user profile presentation.
static _enabledLearningProgress()
check wether learing progress is enabled or not
if($format !==null) $name
Definition: metadata.php:146
static lookupRegistrationInfo($a_obj_id)
Lookup registration info ilDB $ilDB ilObjUser $ilUser ilLanguage $lng.
This class represents a property in a property form.
setValue($a_value)
Set Value.
const LP_STATUS_FAILED
static _lookupProgressByObjId($a_obj_id)
lookup progress for a specific object
showPermanentLink(&$tpl)
show permanent link
if(isset($_POST['submit'])) $form
getId()
get object id public
GUI class for LTI provider object settings.
addSubItem($a_item)
Add Subitem.
const MAIL_ALLOWED_TUTORS
showCustomIconsEditing($a_input_colspan=1, ilPropertyFormGUI $a_form=null, $a_as_section=true)
show edit section of custom icons for container
static _getInstanceByType($a_type)
Get Singleton Instance.
static _gotoRepositoryNode($a_ref_id, $a_cmd="frameset")
Goto repository root.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Class ilECSGroupSettings.
This class handles base functions for mail handling.
initDidacticTemplate(ilPropertyFormGUI $form)
Show didactic template types.
static _lookupObjId($a_id)
static makeClickable($a_text, $detectGotoLinks=false)
makeClickable In Texten enthaltene URLs und Mail-Adressen klickbar machen
Skills for container (course/group) (top gui class)
setValue($a_value)
Set Value.
static getDefaultSettings()
Get default longitude, latitude and zoom.
This class represents a location property in a property form.
setSize($a_size)
Set Size.
This class represents a text property in a property form.
Date and time handling
forwardToStyleSheet()
Forward to style object.
& forwardToPageObject()
forward command to page object
$ilUser
Definition: imgupload.php:18
redirection script todo: (a better solution should control the processing via a xml file) ...
editObject()
edit object
setShowTime($a_showtime)
Set Show Time Information.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
static getContentStylePath($a_style_id, $add_random=true)
get content style path
static getAvailablePortfolioLinksForUserIds(array $a_owner_ids, $a_back_url=null)
GUI class for group registrations.
static updateServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Update service settings.
static _checkRequired($a_usr_id, $a_obj_id)
Check required fields.
static _isOnList($a_usr_id, $a_obj_id)
Check if a user on the waiting list.
$failed
Definition: Utf8Test.php:85
static _getTranslation($a_role_title)
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
Class ilObjCourseGroupingGUI.
static _hasFields($a_container_id)
Check if there are any define fields.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
modifyItemGUI($a_item_list_gui, $a_item_data, $a_show_path)
Modify Item ListGUI for presentation in container type $tree.
GUI class for membership features.
static _lookupInProgressForObject($a_obj_id, $a_user_ids=null)
Get in progress users for object.
createMailSignature()
Create a course mail signature.
updateObject()
update group settings
static isActivated()
Checks whether Map feature is activated.
This class represents a custom property in a property form.
checkAgreement()
Check agreement and redirect if it is not accepted.
static generateCode()
Generate new registration key.
initHeaderAction($a_sub_type=null, $a_sub_id=null)
static _lookupAboStatus($a_id)
static formatPeriod(ilDateTime $start, ilDateTime $end, $a_skip_starting_day=false)
Format a period of two date Shows: 14.
afterSave(\ilObject $new_object, $a_redirect=true)
After object creation.
initSortingForm(ilPropertyFormGUI $form, array $a_sorting_settings)
Append sorting settings to property form.
static translateViewMode($a_obj_id, $a_view_mode, $a_ref_id=null)
translate view mode
static _goto($a_target, $a_add="")
goto target group
Create new PHPExcel object
obj_idprivate
global $ilSetting
Definition: privfeed.php:17
readMemberData($ids, $selected_columns=null)
static getInstance()
Get instance.
const MAIL_ALLOWED_ALL
This class represents a text area property in a property form.
Class ilCourseContentGUI.
$ret
Definition: parser.php:6
static initServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Init service settings form.
getCreationMode()
get creation mode
getRefId()
get reference id public
Class ilContainerGUI.
$def
Definition: croninfo.php:21
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
updateGroupIconsObject()
update group icons
static getLogger($a_component_id)
Get component logger.
static _getInstance()
Get instance of ilPrivacySettings.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
GUI class for service settings (calendar, notes, comments)
static _lookupCompletedForObject($a_obj_id, $a_user_ids=null)
Get completed users for object.
update()
update object in db
$info
Definition: index.php:5
setValue($a_value)
Set Value.
static redirect($a_script)
const LP_STATUS_COMPLETED
const GRP_REGISTRATION_DIRECT
static getInstance($a_obj_id)
addHeaderAction()
Add header action menu.
leaveObject()
leave Group public
Membership notification settings.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
Class ilObjUserTrackingGUI.
$_POST["username"]
$html
Definition: example_001.php:87
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.
editObject(ilPropertyFormGUI $a_form=null)
Edit object.
membersObject()
Called from goto?
Confirmation screen class.
static getInstance()
Constructor.
static getInstance($a_ref_id, $a_include_auto_entries)
Get instance.
static _getFields($a_container_id, $a_sort=IL_CDF_SORT_NAME)
Get all fields of a container.
saveNotificationObject()
:TEMP: Save notification setting (from infoscreen)