ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
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 
26 {
31  public function __construct($a_data,$a_id,$a_call_by_reference,$a_prepare_output = false)
32  {
33  $this->type = "grp";
34  $this->ilContainerGUI($a_data,$a_id,$a_call_by_reference,$a_prepare_output);
35 
36  $this->lng->loadLanguageModule('grp');
37  }
38 
39  function &executeCommand()
40  {
41  global $ilUser,$rbacsystem,$ilAccess, $ilNavigationHistory,$ilErr, $ilCtrl;
42 
43  $next_class = $this->ctrl->getNextClass($this);
44  $cmd = $this->ctrl->getCmd();
45  $this->prepareOutput();
46 
47  // show repository tree
48  $this->showRepTree(true);
49 
50  // add entry to navigation history
51  if (!$this->getCreationMode() &&
52  $ilAccess->checkAccess("read", "", $_GET["ref_id"]))
53  {
54  $ilNavigationHistory->addItem($_GET["ref_id"],
55  $ilCtrl->getLinkTargetByClass("ilrepositorygui", "frameset"), "grp");
56  }
57 
58  switch($next_class)
59  {
60  case 'ilgroupregistrationgui':
61  $this->ctrl->setReturn($this,'');
62  $this->tabs_gui->setTabActive('join');
63  include_once('./Modules/Group/classes/class.ilGroupRegistrationGUI.php');
64  $registration = new ilGroupRegistrationGUI($this->object);
65  $this->ctrl->forwardCommand($registration);
66  break;
67 
68  case 'ilpermissiongui':
69  $this->tabs_gui->setTabActive('perm_settings');
70  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
71  $perm_gui =& new ilPermissionGUI($this);
72  $ret =& $this->ctrl->forwardCommand($perm_gui);
73  break;
74 
75  case 'ilrepositorysearchgui':
76  include_once('./Services/Search/classes/class.ilRepositorySearchGUI.php');
77  $rep_search =& new ilRepositorySearchGUI();
78  $rep_search->setCallback($this,
79  'addUserObject',
80  array(
81  ilObjGroup::GRP_MEMBER => $this->lng->txt('il_grp_member'),
82  ilObjGroup::GRP_ADMIN => $this->lng->txt('il_grp_admin')
83  ));
84 
85  // Set tabs
86  $this->tabs_gui->setTabActive('members');
87  $this->ctrl->setReturn($this,'members');
88  $ret =& $this->ctrl->forwardCommand($rep_search);
89  $this->setSubTabs('members');
90  $this->tabs_gui->setSubTabActive('members');
91  break;
92 
93  case "ilinfoscreengui":
94  $ret =& $this->infoScreen();
95  break;
96 
97  case "illearningprogressgui":
98  include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
99 
101  $this->object->getRefId(),
102  $_GET['user_id'] ? $_GET['user_id'] : $ilUser->getId());
103  $this->ctrl->forwardCommand($new_gui);
104  $this->tabs_gui->setTabActive('learning_progress');
105  break;
106 
107  case 'ilobjcoursegroupinggui':
108  $this->setSubTabs('settings');
109 
110  include_once './Modules/Course/classes/class.ilObjCourseGroupingGUI.php';
111  $this->ctrl->setReturn($this,'edit');
112  $crs_grp_gui =& new ilObjCourseGroupingGUI($this->object,(int) $_GET['obj_id']);
113  $this->ctrl->forwardCommand($crs_grp_gui);
114 
115  $this->tabs_gui->setTabActive('settings');
116  $this->tabs_gui->setSubTabActive('groupings');
117  break;
118 
119  case 'ilcoursecontentgui':
120 
121  include_once './Modules/Course/classes/class.ilCourseContentGUI.php';
122  $course_content_obj = new ilCourseContentGUI($this);
123  $this->ctrl->forwardCommand($course_content_obj);
124  break;
125 
126  case 'ilpublicuserprofilegui':
127  require_once './Services/User/classes/class.ilPublicUserProfileGUI.php';
128  $this->setSubTabs('members');
129  $this->tabs_gui->setTabActive('group_members');
130  $this->tabs_gui->setSubTabActive('grp_members_gallery');
131  $profile_gui = new ilPublicUserProfileGUI($_GET["user"]);
132  $profile_gui->setBackUrl($ilCtrl->getLinkTarget($this, "membersGallery"));
133  $html = $this->ctrl->forwardCommand($profile_gui);
134  $this->tpl->setVariable("ADM_CONTENT", $html);
135  break;
136 
137  case "ilcolumngui":
138  $this->tabs_gui->setTabActive('none');
139  $this->checkPermission("read");
140  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
141  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
142  ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId()));
143  $this->renderObject();
144  break;
145 
146  // container page editing
147  case "ilcontainerpagegui":
148  $ret = $this->forwardToPageObject();
149  if ($ret != "")
150  {
151  $this->tpl->setContent($ret);
152  }
153  break;
154 
155  case 'ilobjectcopygui':
156  include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
157  $cp = new ilObjectCopyGUI($this);
158  $cp->setType('grp');
159  $this->ctrl->forwardCommand($cp);
160  break;
161 
162  case "ilobjstylesheetgui":
163  $this->forwardToStyleSheet();
164  break;
165 
166  case 'ilobjectcustomuserfieldsgui':
167  include_once './Services/Membership/classes/class.ilObjectCustomUserFieldsGUI.php';
168  $cdf_gui = new ilObjectCustomUserFieldsGUI($this->object->getId());
169  $this->setSubTabs('settings');
170  $this->tabs_gui->setTabActive('settings');
171  $this->ctrl->forwardCommand($cdf_gui);
172  break;
173 
174  case 'ilmemberagreementgui':
175  include_once('Services/Membership/classes/class.ilMemberAgreementGUI.php');
176  $this->ctrl->setReturn($this,'');
177  $this->tabs_gui->setTabActive('view_content');
178  $agreement = new ilMemberAgreementGUI($this->object->getRefId());
179  $this->ctrl->forwardCommand($agreement);
180  break;
181 
182  case 'ilexportgui':
183  $this->tabs_gui->setTabActive('export');
184  include_once './Services/Export/classes/class.ilExportGUI.php';
185  $exp = new ilExportGUI($this);
186  $exp->addFormat('xml');
187  $this->ctrl->forwardCommand($exp);
188  break;
189 
190  case 'ilmemberexportgui':
191  include_once('./Services/Membership/classes/Export/class.ilMemberExportGUI.php');
192 
193  $this->setSubTabs('members');
194  $this->tabs_gui->setTabActive('members');
195  $this->tabs_gui->setSubTabActive('export_members');
196  $export = new ilMemberExportGUI($this->object->getRefId());
197  $this->ctrl->forwardCommand($export);
198  break;
199 
200  case "ilcommonactiondispatchergui":
201  include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
203  $this->ctrl->forwardCommand($gui);
204  break;
205 
206  case 'ilobjectservicesettingsgui':
207  $this->ctrl->setReturn($this,'edit');
208  $this->setSubTabs("settings");
209  $this->tabs_gui->activateTab('settings');
210  $this->tabs_gui->activateSubTab('tool_settings');
211 
212  include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
213  $service = new ilObjectServiceSettingsGUI(
214  $this,
215  $this->object->getId(),
216  array(
218  ));
219  $this->ctrl->forwardCommand($service);
220  break;
221 
222  case 'ilsessionoverviewgui':
223  $this->setSubTabs('members');
224  $this->tabs_gui->setTabActive('members');
225  $this->tabs_gui->setSubTabActive('events');
226 
227  include_once './Modules/Group/classes/class.ilGroupParticipants.php';
228  $prt = ilGroupParticipants::_getInstanceByObjId($this->object->getId());
229 
230  include_once('./Modules/Session/classes/class.ilSessionOverviewGUI.php');
231  $overview = new ilSessionOverviewGUI($this->object->getRefId(), $prt);
232  $this->ctrl->forwardCommand($overview);
233  break;
234 
235  default:
236 
237  // check visible permission
238  if (!$this->getCreationMode() and !$ilAccess->checkAccess('visible','',$this->object->getRefId(),'grp'))
239  {
240  $ilErr->raiseError($this->lng->txt("msg_no_perm_read"),$ilErr->MESSAGE);
241  }
242 
243  // #9401 - see also ilStartupGUI::_checkGoto()
244  if($cmd == 'infoScreenGoto')
245  {
246  if($this->object->isRegistrationEnabled())
247  {
248  $cmd = 'join';
249  }
250  else
251  {
252  $cmd = 'infoScreen';
253  }
254  }
255 
256  // check read permission
257  if ((!$this->getCreationMode()
258  && !$rbacsystem->checkAccess('read',$this->object->getRefId()) && $cmd != 'infoScreen')
259  || $cmd == 'join')
260  {
261  // no join permission -> redirect to info screen
262  if (!$rbacsystem->checkAccess('join',$this->object->getRefId()))
263  {
264  $this->ctrl->redirect($this, "infoScreen");
265  }
266  else // no read -> show registration
267  {
268  include_once('./Modules/Group/classes/class.ilGroupRegistrationGUI.php');
269  $this->ctrl->redirectByClass("ilGroupRegistrationGUI", "show");
270  }
271  }
272  if(!$cmd)
273  {
274  $cmd = 'view';
275  }
276  $cmd .= 'Object';
277  $this->$cmd();
278  break;
279  }
280 
281  $this->addHeaderAction();
282  }
283 
284  function viewObject()
285  {
286  global $tree,$rbacsystem,$ilUser;
287 
288  include_once 'Services/Tracking/classes/class.ilLearningProgress.php';
289  ilLearningProgress::_tracProgress($ilUser->getId(),$this->object->getId(),
290  $this->object->getRefId(),'grp');
291 
292  if (strtolower($_GET["baseClass"]) == "iladministrationgui")
293  {
294  parent::viewObject();
295  return true;
296  }
297 
298  if(!$this->checkAgreement())
299  {
300  include_once('Services/Membership/classes/class.ilMemberAgreementGUI.php');
301  $this->tabs_gui->setTabActive('view_content');
302  $this->ctrl->setReturn($this,'view');
303  $agreement = new ilMemberAgreementGUI($this->object->getRefId());
304  $this->ctrl->setCmdClass(get_class($agreement));
305  $this->ctrl->forwardCommand($agreement);
306  return true;
307  }
308 
309  $this->tabs_gui->setTabActive('view_content');
310  $this->renderObject();
311  }
312 
316  function renderObject()
317  {
318  global $ilTabs;
319 
320  $ilTabs->activateTab("view_content");
321  $ret = parent::renderObject();
322  return $ret;
323 
324  }
325 
329  function modifyItemGUI($a_item_list_gui, $a_item_data, $a_show_path)
330  {
331  global $tree;
332 
333  // if folder is in a course, modify item list gui according to course requirements
334  if ($course_ref_id = $tree->checkForParentType($this->object->getRefId(),'crs'))
335  {
336  include_once("./Modules/Course/classes/class.ilObjCourse.php");
337  include_once("./Modules/Course/classes/class.ilObjCourseGUI.php");
338  $course_obj_id = ilObject::_lookupObjId($course_ref_id);
339  ilObjCourseGUI::_modifyItemGUI($a_item_list_gui,'ilcoursecontentgui',$a_item_data, $a_show_path,
340  ilObjCourse::_lookupAboStatus($course_obj_id), $course_ref_id, $course_obj_id,
341  $this->object->getRefId());
342  }
343  }
344 
345  protected function initCreateForm($a_new_type)
346  {
347  if(!is_object($this->object))
348  {
349  $this->object = new ilObjGroup();
350  }
351 
352  $this->initForm('create');
353  return $this->form;
354  }
355 
363  public function saveObject()
364  {
365  global $ilErr,$ilUser,$tree;
366 
367  $this->object = new ilObjGroup();
368 
369  // we reduced the form, only 3 values left
370  // $this->load();
371 
372  $grp_type = ilUtil::stripSlashes($_POST['grp_type']);
373  switch($grp_type)
374  {
375  case GRP_TYPE_PUBLIC:
376  $this->object->setRegistrationType(GRP_REGISTRATION_DIRECT);
377  break;
378 
379  default:
380  $this->object->setRegistrationType(GRP_REGISTRATION_DEACTIVATED);
381  break;
382  }
383  $this->object->setTitle(ilUtil::stripSlashes($_POST['title']));
384  $this->object->setDescription(ilUtil::stripSlashes($_POST['desc']));
385  $this->object->setGroupType(ilUtil::stripSlashes($_POST['grp_type']));
386  $this->object->setViewMode(ilContainer::VIEW_INHERIT);
387 
388  $ilErr->setMessage('');
389 
390  if(!$this->object->validate())
391  {
392  $err = $this->lng->txt('err_check_input');
393  ilUtil::sendFailure($err);
394  $err = $ilErr->getMessage();
395  ilUtil::sendInfo($err);
396  $this->createObject();
397  return true;
398  }
399 
400  $this->object->create();
401  $this->putObjectInTree($this->object, $_GET["ref_id"]);
402  $this->object->initGroupStatus($this->object->getGroupType());
403 
404  // check for parent group or course => SORT_INHERIT
405  $sort_mode = ilContainer::SORT_TITLE;
406  if(
407  $GLOBALS['tree']->checkForParentType($this->object->getRefId(),'crs') ||
408  $GLOBALS['tree']->checkForParentType($this->object->getRefId(),'grp')
409  )
410  {
411  $sort_mode = ilContainer::SORT_INHERIT;
412  }
413  // Save sorting
414  include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
415  $sort = new ilContainerSortingSettings($this->object->getId());
416  $sort->setSortMode($sort_mode);
417  $sort->update();
418 
419 
420  // Add user as admin and enable notification
421  include_once('./Modules/Group/classes/class.ilGroupParticipants.php');
422  $members_obj = ilGroupParticipants::_getInstanceByObjId($this->object->getId());
423  $members_obj->add($ilUser->getId(),IL_GRP_ADMIN);
424  $members_obj->updateNotification($ilUser->getId(),1);
425 
426 
427  ilUtil::sendSuccess($this->lng->txt("grp_added"),true);
428  $this->ctrl->setParameter($this,'ref_id',$this->object->getRefId());
429  $this->ctrl->redirect($this, "edit");
430  }
431 
439  public function editObject()
440  {
441  $this->checkPermission("write");
442 
443  $this->setSubTabs('settings');
444  $this->tabs_gui->setTabActive('settings');
445  $this->tabs_gui->setSubTabActive('grp_settings');
446 
447  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.grp_edit.html','Modules/Group');
448  if($_GET['group_type_changed'])
449  {
450  $this->ctrl->clearParameters($this);
451  $this->tpl->setVariable('GRP_FORMACTION',$this->ctrl->getFormAction($this));
452  $this->tpl->setVariable('TXT_SW_GRP_TYPE_S',$this->lng->txt('grp_change_type'));
453  $this->tpl->setVariable('TXT_SW_GRP_TYPE_C',$this->lng->txt('cancel'));
454  $this->initForm('update_group_type');
455  }
456  else
457  {
458  $this->initForm('edit');
459  }
460  $this->tpl->setVariable('EDIT_FORM',$this->form->getHTML());
461  }
462 
470  public function updateGroupTypeObject()
471  {
472  $type = $this->object->getGroupType() ?
473  $this->object->getGroupType() :
474  $this->object->readGroupStatus();
475 
476  if($type == GRP_TYPE_PUBLIC)
477  {
478  $this->object->setGroupType(GRP_TYPE_CLOSED);
479  }
480  else
481  {
482  $this->object->setGroupType(GRP_TYPE_PUBLIC);
483  }
484  $this->object->updateGroupType();
485  $this->object->update();
486  ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
487  $this->ctrl->redirect($this,'edit');
488  }
489 
490 
496  public function updateObject()
497  {
498  global $ilErr;
499 
500  $this->checkPermission('write');
501 
502 
503  $this->initForm();
504  $this->form->checkInput();
505 
506  $old_type = $this->object->getGroupType();
507 
508  $this->load();
509  $ilErr->setMessage('');
510 
511  if(!$this->object->validate())
512  {
513  $err = $this->lng->txt('err_check_input');
514  ilUtil::sendFailure($err);
515  $err = $ilErr->getMessage();
516  ilUtil::sendInfo($err);
517  $this->editObject();
518  return true;
519  }
520 
521  $modified = false;
522  if($this->object->isGroupTypeModified($old_type) and !$update_group_type)
523  {
524  $modified = true;
525  $this->object->setGroupType($old_type);
526  }
527 
528  $this->object->update();
529 
530 
531  include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
533  $this->object->getId(),
534  $this->form,
535  array(
539  )
540  );
541 
542 
543  // Save sorting
544  include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
545  $sort = new ilContainerSortingSettings($this->object->getId());
546  $sort->setSortMode((int) $_POST['sor']);
547  $sort->update();
548 
549  // BEGIN ChangeEvents: Record update Object.
550  require_once('Services/Tracking/classes/class.ilChangeEvent.php');
551  global $ilUser;
552  ilChangeEvent::_recordWriteEvent($this->object->getId(), $ilUser->getId(), 'update');
553  ilChangeEvent::_catchupWriteEvents($this->object->getId(), $ilUser->getId());
554  // END PATCH ChangeEvents: Record update Object.
555 
556  // Update ecs export settings
557  include_once 'Modules/Group/classes/class.ilECSGroupSettings.php';
558  $ecs = new ilECSGroupSettings($this->object);
559  $ecs->handleSettingsUpdate();
560 
561  if($modified)
562  {
563  include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
564  ilUtil::sendQuestion($this->lng->txt('grp_warn_grp_type_changed'));
565  $confirm = new ilConfirmationGUI();
566  $confirm->setFormAction($this->ctrl->getFormAction($this));
567  $confirm->addItem(
568  'grp_type',
569  $this->object->getGroupType(),
570  $this->lng->txt('grp_info_new_grp_type').': '.($this->object->getGroupType() == GRP_TYPE_CLOSED ? $this->lng->txt('il_grp_status_open') : $this->lng->txt('il_grp_status_closed'))
571  );
572  $confirm->addButton($this->lng->txt('grp_change_type'), 'updateGroupType');
573  $confirm->setCancel($this->lng->txt('cancel'), 'edit');
574 
575  $this->tpl->setContent($confirm->getHTML());
576  return true;
577  }
578  else
579  {
580  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"),true);
581  $this->ctrl->redirect($this,'edit');
582  return true;
583  }
584  }
585 
589  public function editGroupIconsObject($a_form = null)
590  {
591  global $tpl;
592 
593  $this->checkPermission('write');
594 
595  $this->setSubTabs("settings");
596  $this->tabs_gui->setTabActive('settings');
597  $this->tabs_gui->setSubTabActive('grp_icon_settings');
598 
599  if(!$a_form)
600  {
601  $a_form = $this->initGroupIconsForm();
602  }
603 
604  $tpl->setContent($a_form->getHTML());
605  }
606 
608  {
609  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
610  $form = new ilPropertyFormGUI();
611  $form->setFormAction($this->ctrl->getFormAction($this));
612 
613  $this->showCustomIconsEditing(1, $form);
614 
615  // $form->setTitle($this->lng->txt('edit_grouping'));
616  $form->addCommandButton('updateGroupIcons', $this->lng->txt('save'));
617 
618  return $form;
619  }
620 
627  public function updateGroupIconsObject()
628  {
629  $this->checkPermission('write');
630 
631  $form = $this->initGroupIconsForm();
632  if($form->checkInput())
633  {
634  //save custom icons
635  if ($this->ilias->getSetting("custom_icons"))
636  {
637  if($_POST["cont_big_icon_delete"])
638  {
639  $this->object->removeBigIcon();
640  }
641  if($_POST["cont_small_icon_delete"])
642  {
643  $this->object->removeSmallIcon();
644  }
645  if($_POST["cont_tiny_icon_delete"])
646  {
647  $this->object->removeTinyIcon();
648  }
649  $this->object->saveIcons($_FILES["cont_big_icon"]['tmp_name'],
650  $_FILES["cont_small_icon"]['tmp_name'], $_FILES["cont_tiny_icon"]['tmp_name']);
651  }
652 
653  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"),true);
654  $this->ctrl->redirect($this,"editGroupIcons");
655  }
656 
657  $form->setValuesByPost();
658  $this->editGroupIconsObject($form);
659  }
660 
664  public function editMapSettingsObject()
665  {
666  global $ilUser, $ilCtrl, $ilUser, $ilAccess;
667 
668  $this->setSubTabs("settings");
669  $this->tabs_gui->setTabActive('settings');
670  $this->tabs_gui->setSubTabActive('grp_map_settings');
671 
672  include_once('./Services/GoogleMaps/classes/class.ilGoogleMapUtil.php');
674  !$ilAccess->checkAccess("write", "", $this->object->getRefId()))
675  {
676  return;
677  }
678 
679  $latitude = $this->object->getLatitude();
680  $longitude = $this->object->getLongitude();
681  $zoom = $this->object->getLocationZoom();
682 
683  // Get Default settings, when nothing is set
684  if ($latitude == 0 && $longitude == 0 && $zoom == 0)
685  {
687  $latitude = $def["latitude"];
688  $longitude = $def["longitude"];
689  $zoom = $def["zoom"];
690  }
691 
692 
693  //$this->tpl->setTitleIcon(ilUtil::getImagePath("icon_pd_b.png"), $this->lng->txt("personal_desktop"));
694  //$this->tpl->setVariable("HEADER", $this->lng->txt("personal_desktop"));
695 
696  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
697  $form = new ilPropertyFormGUI();
698  $form->setFormAction($ilCtrl->getFormAction($this));
699 
700  $form->setTitle($this->lng->txt("grp_map_settings"));
701 
702  // enable map
703  $public = new ilCheckboxInputGUI($this->lng->txt("grp_enable_map"),
704  "enable_map");
705  $public->setValue("1");
706  $public->setChecked($this->object->getEnableGroupMap());
707  $form->addItem($public);
708 
709  // map location
710  $loc_prop = new ilLocationInputGUI($this->lng->txt("grp_map_location"),
711  "location");
712  $loc_prop->setLatitude($latitude);
713  $loc_prop->setLongitude($longitude);
714  $loc_prop->setZoom($zoom);
715  $form->addItem($loc_prop);
716 
717  $form->addCommandButton("saveMapSettings", $this->lng->txt("save"));
718 
719  $this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
720  }
721 
722  public function saveMapSettingsObject()
723  {
724  global $ilCtrl, $ilUser;
725 
726  $this->object->setLatitude(ilUtil::stripSlashes($_POST["location"]["latitude"]));
727  $this->object->setLongitude(ilUtil::stripSlashes($_POST["location"]["longitude"]));
728  $this->object->setLocationZoom(ilUtil::stripSlashes($_POST["location"]["zoom"]));
729  $this->object->setEnableGroupMap(ilUtil::stripSlashes($_POST["enable_map"]));
730  $this->object->update();
731 
732  $ilCtrl->redirect($this, "editMapSettings");
733  }
734 
738  public function membersMapObject()
739  {
740  global $tpl;
741 
742  $this->setSubTabs('members');
743  $this->tabs_gui->setTabActive('members');
744 
745  include_once("./Services/GoogleMaps/classes/class.ilGoogleMapUtil.php");
746  if (!ilGoogleMapUtil::isActivated() || !$this->object->getEnableGroupMap())
747  {
748  return;
749  }
750 
751  include_once("./Services/GoogleMaps/classes/class.ilGoogleMapGUI.php");
752  $map = new ilGoogleMapGUI();
753  $map->setMapId("group_map");
754  $map->setWidth("700px");
755  $map->setHeight("500px");
756  $map->setLatitude($this->object->getLatitude());
757  $map->setLongitude($this->object->getLongitude());
758  $map->setZoom($this->object->getLocationZoom());
759  $map->setEnableTypeControl(true);
760  $map->setEnableNavigationControl(true);
761  $map->setEnableCentralMarker(true);
762 
763 
764  $member_ids = $this->object->getGroupMemberIds();
765  $admin_ids = $this->object->getGroupAdminIds();
766 
767  // fetch all users data in one shot to improve performance
768  $members = $this->object->getGroupMemberData($member_ids);
769  foreach($member_ids as $user_id)
770  {
771  $map->addUserMarker($user_id);
772  }
773  $tpl->setContent($map->getHTML());
774  $tpl->setLeftContent($map->getUserListHTML());
775  }
776 
777 
784  public function editInfoObject()
785  {
786  global $ilErr,$ilAccess;
787 
788  $this->checkPermission('write');
789 
790  $this->setSubTabs('settings');
791  $this->tabs_gui->setTabActive('settings');
792  $this->tabs_gui->setSubTabActive('grp_info_settings');
793 
794  $this->initInfoEditor();
795  $this->tpl->setContent($this->form->getHTML());
796  }
797 
804  protected function initInfoEditor()
805  {
806  if(is_object($this->form))
807  {
808  return true;
809  }
810 
811  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
812  $this->form = new ilPropertyFormGUI();
813  $this->form->setFormAction($this->ctrl->getFormAction($this,'updateInfo'));
814  $this->form->setTitle($this->lng->txt('grp_general_informations'));
815  $this->form->addCommandButton('updateInfo',$this->lng->txt('save'));
816  $this->form->addCommandButton('cancel',$this->lng->txt('cancel'));
817 
818  $area = new ilTextAreaInputGUI($this->lng->txt('grp_information'),'important');
819  $area->setInfo($this->lng->txt('grp_information_info'));
820  $area->setValue($this->object->getInformation());
821  $area->setRows(8);
822  $area->setCols(80);
823  $this->form->addItem($area);
824  }
825 
832  public function updateInfoObject()
833  {
834  $this->checkPermission('write');
835 
836  $this->object->setInformation(ilUtil::stripSlashes($_POST['important']));
837  $this->object->update();
838 
839  ilUtil::sendSuccess($this->lng->txt("settings_saved"));
840  $this->editInfoObject();
841  return true;
842  }
843 
845 
850  public function membersGalleryObject()
851  {
852  global $rbacsystem, $ilAccess, $ilUser;
853 
854  $is_admin = (bool) $rbacsystem->checkAccess("write", $this->object->getRefId());
855 
856  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.crs_members_gallery.html','Modules/Course');
857 
858  $this->setSubTabs('members');
859  $this->tabs_gui->setTabActive('members');
860 
861  $member_ids = $this->object->getGroupMemberIds();
862  $admin_ids = $this->object->getGroupAdminIds();
863 
864  // fetch all users data in one shot to improve performance
865  $members = $this->object->getGroupMemberData($member_ids);
866 
867  // MEMBERS
868  if(count($members))
869  {
870  $ordered_members = array();
871 
872  foreach($members as $member)
873  {
874  // get user object
875  if(!($usr_obj = ilObjectFactory::getInstanceByObjId($member["id"],false)))
876  {
877  continue;
878  }
879 
880  if(!$usr_obj->getActive())
881  {
882  continue;
883  }
884 
885  // please do not use strtoupper on first/last name for output
886  // this messes up with some unicode characters, i guess
887  // depending on php verion, alex
888  array_push($ordered_members,array("id" => $member["id"],
889  "login" => $usr_obj->getLogin(),
890  "lastname" => $usr_obj->getLastName(),
891  "firstname" => $usr_obj->getFirstName(),
892  "sortlastname" => strtoupper($usr_obj->getLastName()).strtoupper($usr_obj->getFirstName()),
893  "usr_obj" => $usr_obj));
894  }
895 
896  $ordered_members=ilUtil::sortArray($ordered_members,"sortlastname","asc");
897 
898  foreach($ordered_members as $member) {
899 
900  $usr_obj = $member["usr_obj"];
901 
902  $public_profile = $usr_obj->getPref("public_profile");
903  if ($public_profile == "g")
904  {
905  $public_profile = "y";
906  }
907 
908  // SET LINK TARGET FOR USER PROFILE
909  $this->ctrl->setParameterByClass("ilpublicuserprofilegui", "user", $member["id"]);
910  $profile_target = $this->ctrl->getLinkTargetByClass("ilpublicuserprofilegui","getHTML");
911 
912  // GET USER IMAGE
913  $file = $usr_obj->getPersonalPicturePath("xsmall");
914 
915  switch(in_array($member["id"],$admin_ids))
916  {
917  //admins
918  case 1:
919  if ($public_profile == "y")
920  {
921  $this->tpl->setCurrentBlock("member_linked");
922  $this->tpl->setVariable("LINK_PROFILE", $profile_target);
923  $this->tpl->setVariable("SRC_USR_IMAGE", $file);
924  $this->tpl->parseCurrentBlock();
925  }
926  else
927  {
928  $this->tpl->setCurrentBlock("member_not_linked");
929  $this->tpl->setVariable("SRC_USR_IMAGE", $file);
930  $this->tpl->parseCurrentBlock();
931  }
932  $this->tpl->setCurrentBlock("member");
933  break;
934 
935  case 0:
936  if ($public_profile == "y")
937  {
938  $this->tpl->setCurrentBlock("member_linked");
939  $this->tpl->setVariable("LINK_PROFILE", $profile_target);
940  $this->tpl->setVariable("SRC_USR_IMAGE", $file);
941  $this->tpl->parseCurrentBlock();
942  }
943  else
944  {
945  $this->tpl->setCurrentBlock("member_not_linked");
946  $this->tpl->setVariable("SRC_USR_IMAGE", $file);
947  $this->tpl->parseCurrentBlock();
948  }
949  $this->tpl->setCurrentBlock("member");
950  break;
951  }
952 
953  if (in_array($member["id"],$admin_ids)) {
954  $this->tpl->setVariable("MEMBER_CLASS", "il_Admin");
955  }
956  else {
957  $this->tpl->setVariable("MEMBER_CLASS", "il_Member");
958  }
959 
960 
961  // do not show name, if public profile is not activated
962  if ($public_profile == "y")
963  {
964  $this->tpl->setVariable("FIRSTNAME", $member["firstname"]);
965  $this->tpl->setVariable("LASTNAME", $member["lastname"]);
966  }
967  $this->tpl->setVariable("LOGIN", $usr_obj->getLogin());
968  $this->tpl->parseCurrentBlock();
969  }
970  $this->tpl->setCurrentBlock("members");
971  //$this->tpl->setVariable("MEMBERS_TABLE_HEADER",$this->lng->txt('crs_members_title'));
972  $this->tpl->parseCurrentBlock();
973  }
974 
975  $this->tpl->setVariable("TITLE",$this->lng->txt('crs_members_print_title'));
976  $this->tpl->setVariable("CSS_PATH",ilUtil::getStyleSheetLocation());
977  }
978 
979 
980  public function readMemberData($ids,$role = 'admin',$selected_columns = null)
981  {
982  include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
983  $privacy = ilPrivacySettings::_getInstance();
984 
985  if($this->show_tracking)
986  {
987  include_once 'Services/Tracking/classes/class.ilLPStatusWrapper.php';
988  $completed = ilLPStatusWrapper::_lookupCompletedForObject($this->object->getId());
989  $in_progress = ilLPStatusWrapper::_lookupInProgressForObject($this->object->getId());
990  $failed = ilLPStatusWrapper::_lookupFailedForObject($this->object->getId());
991  }
992 
993  if($privacy->enabledGroupAccessTimes())
994  {
995  include_once('./Services/Tracking/classes/class.ilLearningProgress.php');
996  $progress = ilLearningProgress::_lookupProgressByObjId($this->object->getId());
997  }
998 
999  $do_prtf = (is_array($selected_columns) &&
1000  in_array('prtf', $selected_columns) &&
1001  is_array($ids));
1002  if($do_prtf)
1003  {
1004  include_once "Modules/Portfolio/classes/class.ilObjPortfolio.php";
1006  $this->ctrl->getLinkTarget($this, "members"));
1007  }
1008 
1009  foreach($ids as $usr_id)
1010  {
1011  $name = ilObjUser::_lookupName($usr_id);
1012  $tmp_data['firstname'] = $name['firstname'];
1013  $tmp_data['lastname'] = $name['lastname'];
1014  $tmp_data['login'] = ilObjUser::_lookupLogin($usr_id);
1015  $tmp_data['notification'] = $this->object->members_obj->isNotificationEnabled($usr_id) ? 1 : 0;
1016  $tmp_data['usr_id'] = $usr_id;
1017  $tmp_data['login'] = ilObjUser::_lookupLogin($usr_id);
1018 
1019  if($this->show_tracking)
1020  {
1021  if(in_array($usr_id,$completed))
1022  {
1023  $tmp_data['progress'] = ilLPStatus::LP_STATUS_COMPLETED;
1024  }
1025  elseif(in_array($usr_id,$in_progress))
1026  {
1027  $tmp_data['progress'] = ilLPStatus::LP_STATUS_IN_PROGRESS;
1028  }
1029  elseif(in_array($usr_id,$failed))
1030  {
1031  $tmp_data['progress'] = ilLPStatus::LP_STATUS_FAILED;
1032  }
1033  else
1034  {
1035  $tmp_data['progress'] = ilLPStatus::LP_STATUS_NOT_ATTEMPTED;
1036  }
1037  }
1038 
1039  if($privacy->enabledGroupAccessTimes())
1040  {
1041  if(isset($progress[$usr_id]['ts']) and $progress[$usr_id]['ts'])
1042  {
1043  $tmp_data['access_time'] = ilDatePresentation::formatDate(
1044  $tmp_date = new ilDateTime($progress[$usr_id]['ts'],IL_CAL_UNIX));
1045  $tmp_data['access_time_unix'] = $tmp_date->get(IL_CAL_UNIX);
1046  }
1047  else
1048  {
1049  $tmp_data['access_time'] = $this->lng->txt('no_date');
1050  $tmp_data['access_time_unix'] = 0;
1051  }
1052  }
1053 
1054  if($do_prtf)
1055  {
1056  $tmp_data['prtf'] = $all_prtf[$usr_id];
1057  }
1058 
1059  $members[$usr_id] = $tmp_data;
1060  }
1061  return $members ? $members : array();
1062  }
1063 
1070  public function membersObject()
1071  {
1072  global $ilUser, $ilToolbar, $lng, $ilCtrl;
1073 
1074  include_once('./Modules/Group/classes/class.ilGroupParticipants.php');
1075  include_once('./Modules/Group/classes/class.ilGroupParticipantsTableGUI.php');
1076 
1077  $this->checkPermission('write');
1078 
1079  include_once './Services/Tracking/classes/class.ilObjUserTracking.php';
1080  $this->show_tracking = (ilObjUserTracking::_enabledLearningProgress() and
1082  if($this->show_tracking)
1083  {
1084  include_once('./Services/Object/classes/class.ilObjectLP.php');
1085  $olp = ilObjectLP::getInstance($this->object->getId());
1086  $this->show_tracking = $olp->isActive();
1087  }
1088 
1089  $part = ilGroupParticipants::_getInstanceByObjId($this->object->getId());
1090 
1091  $this->setSubTabs('members');
1092  $this->tabs_gui->setTabActive('members');
1093  $this->tabs_gui->setSubTabActive('grp_edit_members');
1094 
1095  $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.grp_edit_members.html','Modules/Group');
1096  $this->tpl->setVariable('FORMACTION',$this->ctrl->getFormAction($this));
1097 
1098  // add members
1099  include_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
1101  $this,
1102  $ilToolbar,
1103  array(
1104  'auto_complete_name' => $lng->txt('user'),
1105  'user_type' => array(
1106  ilObjGroup::GRP_MEMBER => $lng->txt("member"),
1107  ilObjGroup::GRP_ADMIN => $lng->txt("administrator")
1108  ),
1109  'submit_name' => $lng->txt('add')
1110  )
1111  );
1112 
1113  // spacer
1114  $ilToolbar->addSeparator();
1115 
1116  // search button
1117  $ilToolbar->addButton($this->lng->txt("grp_search_users"),
1118  $this->ctrl->getLinkTargetByClass('ilRepositorySearchGUI','start'));
1119 
1120  $ilToolbar->addSeparator();
1121 
1122  // print button
1123  $ilToolbar->addButton($this->lng->txt("grp_print_list"),
1124  $this->ctrl->getLinkTarget($this, 'printMembers'));
1125 
1126  $this->setShowHidePrefs();
1127 
1128 
1129  // Waiting list table
1130  include_once('./Modules/Group/classes/class.ilGroupWaitingList.php');
1131  $waiting_list = new ilGroupWaitingList($this->object->getId());
1132  if(count($wait = $waiting_list->getAllUsers()))
1133  {
1134  include_once('./Services/Membership/classes/class.ilWaitingListTableGUI.php');
1135  if($ilUser->getPref('grp_wait_hide'))
1136  {
1137  $table_gui = new ilWaitingListTableGUI($this,$waiting_list,false);
1138  $this->ctrl->setParameter($this,'wait_hide',0);
1139  $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,'members'),
1140  $this->lng->txt('show'),
1141  '',
1142  ilUtil::getImagePath('edit_add.png'));
1143  $this->ctrl->clearParameters($this);
1144  }
1145  else
1146  {
1147  $table_gui = new ilWaitingListTableGUI($this,$waiting_list,true);
1148  $this->ctrl->setParameter($this,'wait_hide',1);
1149  $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,'members'),
1150  $this->lng->txt('hide'),
1151  '',
1152  ilUtil::getImagePath('edit_remove.png'));
1153  $this->ctrl->clearParameters($this);
1154  }
1155  $table_gui->setUsers($wait);
1156  $table_gui->setTitle($this->lng->txt('grp_header_waiting_list'),'icon_usr.png',$this->lng->txt('group_new_registrations'));
1157  $this->tpl->setVariable('TABLE_SUB',$table_gui->getHTML());
1158  }
1159 
1160 
1161  // Subscriber table
1162  if($part->getSubscribers())
1163  {
1164  include_once('./Services/Membership/classes/class.ilSubscriberTableGUI.php');
1165  if($ilUser->getPref('grp_subscriber_hide'))
1166  {
1167  $table_gui = new ilSubscriberTableGUI($this,false);
1168  $this->ctrl->setParameter($this,'subscriber_hide',0);
1169  $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,'members'),
1170  $this->lng->txt('show'),
1171  '',
1172  ilUtil::getImagePath('edit_add.png'));
1173  $this->ctrl->clearParameters($this);
1174  }
1175  else
1176  {
1177  $table_gui = new ilSubscriberTableGUI($this,true);
1178  $this->ctrl->setParameter($this,'subscriber_hide',1);
1179  $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,'members'),
1180  $this->lng->txt('hide'),
1181  '',
1182  ilUtil::getImagePath('edit_remove.png'));
1183  $this->ctrl->clearParameters($this);
1184  }
1185  $table_gui->readSubscriberData();
1186  $table_gui->setTitle($this->lng->txt('group_new_registrations'),'icon_usr.png',$this->lng->txt('group_new_registrations'));
1187  $this->tpl->setVariable('TABLE_SUB',$table_gui->getHTML());
1188  }
1189 
1190  if(count($part->getAdmins()))
1191  {
1192  if($ilUser->getPref('grp_admin_hide'))
1193  {
1194  $table_gui = new ilGroupParticipantsTableGUI($this,'admin',false,false);
1195  $this->ctrl->setParameter($this,'admin_hide',0);
1196  $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,'members'),
1197  $this->lng->txt('show'),
1198  '',
1199  ilUtil::getImagePath('edit_add.png'));
1200  $this->ctrl->clearParameters($this);
1201  }
1202  else
1203  {
1204  $table_gui = new ilGroupParticipantsTableGUI($this,'admin',true,false);
1205  $this->ctrl->setParameter($this,'admin_hide',1);
1206  $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,'members'),
1207  $this->lng->txt('hide'),
1208  '',
1209  ilUtil::getImagePath('edit_remove.png'));
1210  $this->ctrl->clearParameters($this);
1211  }
1212  $table_gui->setTitle($this->lng->txt('grp_admins'),'icon_usr.png',$this->lng->txt('grp_admins'));
1213  $table_gui->parse($this->readMemberData($part->getAdmins()));
1214  $this->tpl->setVariable('ADMINS',$table_gui->getHTML());
1215  }
1216 
1217  if($GLOBALS['rbacreview']->getNumberOfAssignedUsers(array($this->object->getDefaultMemberRole())))
1218  {
1219  if($ilUser->getPref('grp_member_hide'))
1220  {
1221  $table_gui = new ilGroupParticipantsTableGUI($this,'member',false,$this->show_tracking,$this->object->getDEfaultMemberRole());
1222  $this->ctrl->setParameter($this,'member_hide',0);
1223  $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,'members'),
1224  $this->lng->txt('show'),
1225  '',
1226  ilUtil::getImagePath('edit_add.png'));
1227  $this->ctrl->clearParameters($this);
1228  }
1229  else
1230  {
1231  $table_gui = new ilGroupParticipantsTableGUI($this,'member',true,$this->show_tracking,$this->object->getDefaultMemberRole());
1232  $this->ctrl->setParameter($this,'member_hide',1);
1233  $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,'members'),
1234  $this->lng->txt('hide'),
1235  '',
1236  ilUtil::getImagePath('edit_remove.png'));
1237  $this->ctrl->clearParameters($this);
1238  }
1239 
1240  $table_gui->setTitle($this->lng->txt('grp_members'),'icon_usr.png',$this->lng->txt('grp_members'));
1241  $table_gui->parse($this->readMemberData($GLOBALS['rbacreview']->assignedUsers($this->object->getDefaultMemberRole()),
1242  null, $table_gui->getSelectedColumns()));
1243  $this->tpl->setCurrentBlock('member_block');
1244  $this->tpl->setVariable('MEMBERS',$table_gui->getHTML());
1245  $this->tpl->parseCurrentBlock();
1246  }
1247 
1248  foreach(ilGroupParticipants::getMemberRoles($this->object->getRefId()) as $role_id)
1249  {
1250  // Do not show table if no user is assigned
1251  if(!($GLOBALS['rbacreview']->getNumberOfAssignedUsers(array($role_id))))
1252  {
1253  continue;
1254  }
1255  if($ilUser->getPref('grp_role_hide'.$role_id))
1256  {
1257  $table_gui = new ilGroupParticipantsTableGUI($this,'role',false,$this->show_tracking,$role_id);
1258  $this->ctrl->setParameter($this,'role_hide_'.$role_id,0);
1259  $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,'members'),
1260  $this->lng->txt('show'),
1261  '',
1262  ilUtil::getImagePath('edit_add.png'));
1263  $this->ctrl->clearParameters($this);
1264  }
1265  else
1266  {
1267  $table_gui = new ilGroupParticipantsTableGUI($this,'role',true,$this->show_tracking,$role_id);
1268  $this->ctrl->setParameter($this,'role_hide_'.$role_id,1);
1269  $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,'members'),
1270  $this->lng->txt('hide'),
1271  '',
1272  ilUtil::getImagePath('edit_remove.png'));
1273  $this->ctrl->clearParameters($this);
1274  }
1275 
1276  $table_gui->setTitle(ilObject::_lookupTitle($role_id),'icon_usr.gif',ilObject::_lookupTitle($role_id));
1277  $table_gui->parse($this->readMemberData($GLOBALS['rbacreview']->assignedUsers($role_id)));
1278  $this->tpl->setCurrentBlock('member_block');
1279  $this->tpl->setVariable('MEMBERS',$table_gui->getHTML());
1280  $this->tpl->parseCurrentBlock();
1281  }
1282 
1283  $this->tpl->setVariable('TXT_SELECTED_USER',$this->lng->txt('grp_selected_users'));
1284  $this->tpl->setVariable('BTN_FOOTER_EDIT',$this->lng->txt('edit'));
1285  $this->tpl->setVariable('BTN_FOOTER_VAL',$this->lng->txt('remove'));
1286  $this->tpl->setVariable('BTN_FOOTER_MAIL',$this->lng->txt('grp_mem_send_mail'));
1287  $this->tpl->setVariable('ARROW_DOWN',ilUtil::getImagePath('arrow_downright.png'));
1288 
1289  }
1290 
1297  public function assignSubscribersObject()
1298  {
1299  global $lng, $ilIliasIniFile,$ilUser;
1300 
1301  $this->checkPermission('write');
1302 
1303  if(!count($_POST['subscribers']))
1304  {
1305  ilUtil::sendFailure($this->lng->txt('no_checkbox'));
1306  $this->membersObject();
1307  return false;
1308  }
1309 
1310  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1311  foreach($_POST['subscribers'] as $usr_id)
1312  {
1313  $this->object->members_obj->sendNotification(
1315  $usr_id
1316  );
1317 
1318  $this->object->members_obj->add($usr_id,IL_GRP_MEMBER);
1319  $this->object->members_obj->deleteSubscriber($usr_id);
1320 
1321  include_once('./Modules/Forum/classes/class.ilForumNotification.php');
1322  ilForumNotification::checkForumsExistsInsert($this->object->getRefId(), $usr_id);
1323  }
1324  ilUtil::sendSuccess($this->lng->txt("grp_msg_applicants_assigned"),true);
1325  $this->ctrl->redirect($this,'members');
1326  return true;
1327  }
1328 
1335  public function refuseSubscribersObject()
1336  {
1337  global $lng;
1338 
1339  $this->checkPermission('write');
1340 
1341  if(!count($_POST['subscribers']))
1342  {
1343  ilUtil::sendFailure($this->lng->txt('no_checkbox'));
1344  $this->membersObject();
1345  return false;
1346  }
1347 
1348  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1349  foreach($_POST['subscribers'] as $usr_id)
1350  {
1351  $this->object->members_obj->sendNotification(
1353  $usr_id
1354  );
1355  $this->object->members_obj->deleteSubscriber($usr_id);
1356  }
1357  ilUtil::sendSuccess($this->lng->txt("grp_msg_applicants_removed"));
1358  $this->membersObject();
1359  return true;
1360 
1361  }
1362 
1371  {
1372  $this->checkPermission('write');
1373 
1374  if(!count($_POST["waiting"]))
1375  {
1376  ilUtil::sendFailure($this->lng->txt("no_checkbox"));
1377  $this->membersObject();
1378  return false;
1379  }
1380 
1381  include_once('./Modules/Group/classes/class.ilGroupWaitingList.php');
1382  $waiting_list = new ilGroupWaitingList($this->object->getId());
1383 
1384  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1385 
1386  $added_users = 0;
1387  foreach($_POST["waiting"] as $user_id)
1388  {
1389  if(!$tmp_obj = ilObjectFactory::getInstanceByObjId($user_id,false))
1390  {
1391  continue;
1392  }
1393  if($this->object->members_obj->isAssigned($user_id))
1394  {
1395  continue;
1396  }
1397  $this->object->members_obj->add($user_id,IL_GRP_MEMBER);
1398  $this->object->members_obj->sendNotification(
1400  $user_id
1401  );
1402  $waiting_list->removeFromList($user_id);
1403 
1404  include_once('./Modules/Forum/classes/class.ilForumNotification.php');
1405  ilForumNotification::checkForumsExistsInsert($this->object->getRefId(), $user_id);
1406 
1407  ++$added_users;
1408  }
1409  if($added_users)
1410  {
1411  ilUtil::sendSuccess($this->lng->txt("grp_users_added"));
1412  $this->membersObject();
1413 
1414  return true;
1415  }
1416  else
1417  {
1418  ilUtil::sendFailure($this->lng->txt("grp_users_already_assigned"));
1419  $this->searchObject();
1420 
1421  return false;
1422  }
1423  }
1424 
1431  public function refuseFromListObject()
1432  {
1433  $this->checkPermission('write');
1434 
1435  if(!count($_POST['waiting']))
1436  {
1437  ilUtil::sendFailure($this->lng->txt('no_checkbox'));
1438  $this->membersObject();
1439  return false;
1440  }
1441 
1442  include_once('./Modules/Group/classes/class.ilGroupWaitingList.php');
1443  $waiting_list = new ilGroupWaitingList($this->object->getId());
1444 
1445  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1446  foreach($_POST["waiting"] as $user_id)
1447  {
1448  $waiting_list->removeFromList($user_id);
1449  $this->object->members_obj->sendNotification(
1451  $user_id
1452  );
1453  }
1454 
1455  ilUtil::sendSuccess($this->lng->txt('grp_users_removed_from_list'));
1456  $this->membersObject();
1457  return true;
1458  }
1459 
1465  public function confirmDeleteMembersObject()
1466  {
1467  $this->checkPermission('write');
1468 
1469  $participants_to_delete = (array) array_unique(array_merge((array) $_POST['admins'],(array) $_POST['members'], (array) $_POST['roles']));
1470 
1471  if(!count($participants_to_delete))
1472  {
1473  ilUtil::sendFailure($this->lng->txt('no_checkbox'));
1474  $this->membersObject();
1475  return false;
1476  }
1477 
1478  // Check last admin
1479  $admins = (array) ilGroupParticipants::_getInstanceByObjId($this->object->getId())->getAdmins();
1480 
1481  $admins_after = (array) array_diff($admins, $participants_to_delete);
1482  if(!count($admins_after) and count($admins))
1483  {
1484  ilUtil::sendFailure($this->lng->txt('grp_err_administrator_required'));
1485  $this->membersObject();
1486  return false;
1487  }
1488 
1489  $this->setSubTabs('members');
1490  $this->tabs_gui->setTabActive('members');
1491  $this->tabs_gui->setSubTabActive('grp_edit_members');
1492 
1493  include_once('./Services/Utilities/classes/class.ilConfirmationGUI.php');
1494  $confirm = new ilConfirmationGUI();
1495  $confirm->setFormAction($this->ctrl->getFormAction($this,'deleteMembers'));
1496  $confirm->setHeaderText($this->lng->txt('grp_dismiss_member'));
1497  $confirm->setConfirm($this->lng->txt('confirm'),'deleteMembers');
1498  $confirm->setCancel($this->lng->txt('cancel'),'members');
1499 
1500  foreach($this->readMemberData(array_merge((array) $_POST['admins'],(array) $_POST['members'], (array) $_POST['roles'])) as $participants)
1501  {
1502  $confirm->addItem('participants[]',
1503  $participants['usr_id'],
1504  $participants['lastname'].', '.$participants['firstname'].' ['.$participants['login'].']',
1505  ilUtil::getImagePath('icon_usr.png'));
1506  }
1507 
1508  $this->tpl->setContent($confirm->getHTML());
1509  }
1510 
1518  public function deleteMembersObject()
1519  {
1520  $this->checkPermission('write');
1521 
1522  if(!count($_POST['participants']))
1523  {
1524  ilUtil::sendFailure($this->lng->txt('no_checkbox'));
1525  $this->membersObject();
1526  return true;
1527  }
1528 
1529  $this->object->members_obj->deleteParticipants($_POST['participants']);
1530 
1531  // Send notification
1532  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1533  include_once './Modules/Forum/classes/class.ilForumNotification.php';
1534  foreach($_POST['participants'] as $part)
1535  {
1536  $this->object->members_obj->sendNotification(
1538  $part
1539  );
1540  ilForumNotification::checkForumsExistsDelete($this->object->getRefId(), $part);
1541  }
1542 
1543 
1544  ilUtil::sendSuccess($this->lng->txt("grp_msg_membership_annulled"));
1545  $this->membersObject();
1546  return true;
1547  }
1548 
1557  {
1558  if(isset($_GET['member_id']))
1559  {
1560  $_POST['participants'] = array($_GET['member_id']);
1561  }
1562  else
1563  {
1564  $_POST['participants'] = array_unique(array_merge((array) $_POST['admins'],
1565  (array) $_POST['members'],
1566  (array) $_POST['roles'],
1567  (array) $_POST['waiting'],
1568  (array) $_POST['subscribers']));
1569  }
1570  if (!count($_POST['participants']))
1571  {
1572  ilUtil::sendFailure($this->lng->txt("no_checkbox"));
1573  $this->membersObject();
1574  return false;
1575  }
1576  foreach($_POST['participants'] as $usr_id)
1577  {
1578  $rcps[] = ilObjUser::_lookupLogin($usr_id);
1579  }
1580 
1581  require_once 'Services/Mail/classes/class.ilMailFormCall.php';
1584  $this,
1585  'members',
1586  array(),
1587  array('type' => 'new', 'sig' => $this->createMailSignature())));
1588  return true;
1589  }
1590 
1597  public function setShowHidePrefs()
1598  {
1599  global $ilUser;
1600 
1601  if(isset($_GET['admin_hide']))
1602  {
1603  $ilUser->writePref('grp_admin_hide',(int) $_GET['admin_hide']);
1604  }
1605  if(isset($_GET['member_hide']))
1606  {
1607  $ilUser->writePref('grp_member_hide',(int) $_GET['member_hide']);
1608  }
1609  if(isset($_GET['subscriber_hide']))
1610  {
1611  $ilUser->writePref('grp_subscriber_hide',(int) $_GET['subscriber_hide']);
1612  }
1613  if(isset($_GET['wait_hide']))
1614  {
1615  $ilUser->writePref('grp_wait_hide',(int) $_GET['wait_hide']);
1616  }
1617  }
1618 
1624  public function editMemberObject()
1625  {
1626  $_POST['members'] = array((int) $_GET['member_id']);
1627  $this->editMembersObject();
1628  }
1629 
1636  public function editMembersObject()
1637  {
1638  $this->checkPermission('write');
1639 
1640  $post_participants = array_unique(array_merge((array) $_POST['admins'],(array) $_POST['members'], (array) $_POST['roles']));
1641  $real_participants = ilGroupParticipants::_getInstanceByObjId($this->object->getId())->getParticipants();
1642  $participants = array_intersect((array) $post_participants, (array) $real_participants);
1643 
1644  if(!count($participants))
1645  {
1646  ilUtil::sendFailure($this->lng->txt('no_checkbox'));
1647  $this->membersObject();
1648  return false;
1649  }
1650 
1651  $this->setSubTabs('members');
1652  $this->tabs_gui->setTabActive('members');
1653  $this->tabs_gui->setSubTabActive('grp_edit_members');
1654 
1655  include_once('./Modules/Group/classes/class.ilGroupEditParticipantsTableGUI.php');
1656  $table_gui = new ilGroupEditParticipantsTableGUI($this);
1657  $table_gui->setTitle($this->lng->txt('grp_mem_change_status'),'icon_usr.png',$this->lng->txt('grp_mem_change_status'));
1658  $table_gui->setData($this->readMemberData($participants));
1659 
1660  $this->tpl->setContent($table_gui->getHTML());
1661  return true;
1662  }
1663 
1671  public function updateMembersObject()
1672  {
1673  $this->checkPermission('write');
1674 
1675  if(!count($_POST['participants']))
1676  {
1677  ilUtil::sendFailure($this->lng->txt('no_checkbox'));
1678  $this->membersObject();
1679  return false;
1680  }
1681 
1682  // Check minimum one admin
1683  $has_admin = false;
1684  $admin_role = $this->object->getDefaultAdminRole();
1685  foreach(ilGroupParticipants::_getInstanceByObjId($this->object->getId())->getAdmins() as $admin_id)
1686  {
1687  if(!isset($_POST['roles'][$admin_id]))
1688  {
1689  $has_admin = true;
1690  break;
1691  }
1692  if(in_array($admin_role,$_POST['roles'][$admin_id]))
1693  {
1694  $has_admin = true;
1695  break;
1696  }
1697  }
1698 
1699  if(!$has_admin and ilGroupParticipants::_getInstanceByObjId($this->object->getId())->getCountAdmins())
1700  {
1701  ilUtil::sendFailure($this->lng->txt('grp_min_one_admin'));
1702  $_POST['members'] = $_POST['participants'];
1703  $this->editMembersObject();
1704  return false;
1705  }
1706 
1707  $admin_role = $this->object->getDefaultAdminRole();
1708 
1709  $notifications = $_POST['notification'] ? $_POST['notification'] : array();
1710  foreach($_POST['participants'] as $usr_id)
1711  {
1712  // Check if a status changed mail is required
1713  $notification = false;
1714  if($this->object->members_obj->isAdmin($usr_id) and !in_array($admin_role,(array) $_POST['roles'][$usr_id]))
1715  {
1716  $notification = true;
1717  }
1718  if(!$this->object->members_obj->isAdmin($usr_id) and in_array($admin_role,(array) $_POST['roles'][$usr_id]))
1719  {
1720  $notification = true;
1721  }
1722 
1723  // TODO: check no role, owner
1724  $this->object->members_obj->updateRoleAssignments($usr_id,(array) $_POST['roles'][$usr_id]);
1725 
1726  // Disable notification for all of them
1727  $this->object->members_obj->updateNotification($usr_id,0);
1728 
1729  if($this->object->members_obj->isAdmin($usr_id) and in_array($usr_id,$notifications))
1730  {
1731  $this->object->members_obj->updateNotification($usr_id,1);
1732  }
1733 
1734  if($notification)
1735  {
1736  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1737  $this->object->members_obj->sendNotification(
1739  $usr_id
1740  );
1741  }
1742  }
1743  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"));
1744  $this->membersObject();
1745  return true;
1746  }
1747 
1755  public function updateStatusObject()
1756  {
1757  $this->checkPermission('write');
1758 
1759  $notification = $_POST['notification'] ? $_POST['notification'] : array();
1760  foreach($this->object->members_obj->getAdmins() as $admin_id)
1761  {
1762  $this->object->members_obj->updateNotification($admin_id,(int) in_array($admin_id,$notification));
1763  }
1764  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
1765  $this->membersObject();
1766  }
1767 
1768 
1769 
1770 
1771 
1776  function canceledObject()
1777  {
1778  $return_location = $_GET["cmd_return_location"];
1779  if (strcmp($return_location, "") == 0)
1780  {
1781  $return_location = "";
1782  }
1783 
1784  $this->ctrl->redirect($this, $return_location);
1785  }
1786 
1787 
1788 
1793  public function leaveObject()
1794  {
1795  global $ilUser;
1796 
1797  $this->checkPermission('leave');
1798 
1799  $part = ilGroupParticipants::_getInstanceByObjId($this->object->getId());
1800  if($part->isLastAdmin($ilUser->getId()))
1801  {
1802  ilUtil::sendFailure($this->lng->txt('grp_err_administrator_required'));
1803  $this->viewObject();
1804  return false;
1805  }
1806 
1807  $this->tabs_gui->setTabActive('grp_btn_unsubscribe');
1808 
1809  include_once "Services/Utilities/classes/class.ilConfirmationGUI.php";
1810  $cgui = new ilConfirmationGUI();
1811  $cgui->setHeaderText($this->lng->txt('grp_dismiss_myself'));
1812  $cgui->setFormAction($this->ctrl->getFormAction($this));
1813  $cgui->setCancel($this->lng->txt("cancel"), "cancel");
1814  $cgui->setConfirm($this->lng->txt("grp_btn_unsubscribe"), "unsubscribe");
1815  $this->tpl->setContent($cgui->getHTML());
1816  }
1817 
1824  public function unsubscribeObject()
1825  {
1826  global $ilUser,$tree, $ilCtrl;
1827 
1828  $this->checkPermission('leave');
1829 
1830  $this->object->members_obj->delete($ilUser->getId());
1831 
1832  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1833  $this->object->members_obj->sendNotification(
1835  $ilUser->getId()
1836  );
1837  $this->object->members_obj->sendNotification(
1839  $ilUser->getId()
1840  );
1841 
1842  include_once './Modules/Forum/classes/class.ilForumNotification.php';
1843  ilForumNotification::checkForumsExistsDelete($this->object->getRefId(), $ilUser->getId());
1844 
1845  ilUtil::sendSuccess($this->lng->txt('grp_msg_membership_annulled'),true);
1846  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id",
1847  $tree->getParentId($this->object->getRefId()));
1848  $ilCtrl->redirectByClass("ilrepositorygui", "");
1849  }
1850 
1851 
1857  {
1858  $user_ids = $_POST["id"];
1859 
1860  if (empty($user_ids[0]))
1861  {
1862  // TODO: jumps back to grp content. go back to last search result
1863  $this->ilErr->raiseError($this->lng->txt("no_checkbox"),$this->ilErr->MESSAGE);
1864  }
1865 
1866  foreach ($user_ids as $new_member)
1867  {
1868  if (!$this->object->addMember($new_member,$this->object->getDefaultMemberRole()))
1869  {
1870  $this->ilErr->raiseError("An Error occured while assigning user to group !",$this->ilErr->MESSAGE);
1871  }
1872  }
1873 
1874  unset($_SESSION["saved_post"]);
1875 
1876  ilUtil::sendSuccess($this->lng->txt("grp_msg_member_assigned"),true);
1877  $this->ctrl->redirect($this,'members');
1878  }
1879 
1884  public function addUserObject($user_ids, $a_type)
1885  {
1886  if (empty($user_ids[0]))
1887  {
1888  $GLOBALS['lng']->loadLanguageModule('search');
1889  ilUtil::sendFailure($this->lng->txt('search_err_user_not_exist'),true);
1890  return false;
1891  }
1892 
1893  foreach ($user_ids as $new_member)
1894  {
1895  switch($a_type)
1896  {
1898  if (!$this->object->addMember($new_member,$this->object->getDefaultMemberRole()))
1899  {
1900  $this->ilErr->raiseError("An Error occured while assigning user to group !",$this->ilErr->MESSAGE);
1901  }
1902  break;
1903 
1904  case ilObjGroup::GRP_ADMIN:
1905  if (!$this->object->addMember($new_member,$this->object->getDefaultAdminRole()))
1906  {
1907  $this->ilErr->raiseError("An Error occured while assigning user to group !",$this->ilErr->MESSAGE);
1908  }
1909  break;
1910  }
1911 
1912  ilObjUser::_addDesktopItem($new_member, $this->object->getRefId(), 'grp');
1913 
1914  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1915  $this->object->members_obj->sendNotification(
1917  $new_member
1918  );
1919 
1920  include_once './Modules/Forum/classes/class.ilForumNotification.php';
1921  ilForumNotification::checkForumsExistsInsert($this->object->getRefId(), $new_member);
1922  }
1923 
1924  unset($_SESSION["saved_post"]);
1925  unset($_SESSION['grp_usr_search_result']);
1926 
1927  ilUtil::sendSuccess($this->lng->txt("grp_msg_member_assigned"),true);
1928  $this->ctrl->redirect($this,'members');
1929  }
1930 
1935  {
1936  global $rbacreview, $ilObjDataCache, $ilias;
1937  include_once('./Services/AccessControl/classes/class.ilObjRole.php');
1938 
1939  $this->lng->loadLanguageModule('mail');
1940  if(!isset($_GET['returned_from_mail']))
1941  {
1942  ilUtil::sendInfo($this->lng->txt('mail_select_recipients'));
1943  }
1944 
1945  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.mail_members.html','Services/Contact');
1946 
1947 
1948  $this->setSubTabs('members');
1949  $this->tabs_gui->setTabActive('members');
1950 
1951  require_once 'Services/Mail/classes/class.ilMailFormCall.php';
1952  $this->tpl->setVariable("MAILACTION", ilMailFormCall::getLinkTarget($this, 'mailMembers', array(), array('type' => 'role','sig' => $this->createMailSignature())));
1953  $this->tpl->setVariable("IMG_ARROW",ilUtil::getImagePath('arrow_downright.png'));
1954  $this->tpl->setVariable("TXT_MARKED_ENTRIES",$this->lng->txt('marked_entries'));
1955  $this->tpl->setVariable("OK",$this->lng->txt('next'));
1956 
1957  // Get role mailbox addresses
1958  $role_folder = $rbacreview->getRoleFolderOfObject($this->object->getRefId());
1959  $role_ids = $rbacreview->getRolesOfRoleFolder($role_folder['ref_id'], false);
1960  $role_addrs = array();
1961 
1962  // Sort by relevance
1963  $sorted_role_ids = array();
1964  $counter = 2;
1965  foreach($role_ids as $role_id)
1966  {
1967  switch(substr(ilObject::_lookupTitle($role_id),0,8))
1968  {
1969  case 'il_grp_a':
1970  $sorted_role_ids[1] = $role_id;
1971  break;
1972 
1973  case 'il_grp_m':
1974  $sorted_role_ids[0] = $role_id;
1975  break;
1976 
1977  default:
1978  $sorted_role_ids[$counter++] = $role_id;
1979  break;
1980  }
1981  }
1982  ksort($sorted_role_ids,SORT_NUMERIC);
1983  foreach ((array) $sorted_role_ids as $role_id)
1984  {
1985  $this->tpl->setCurrentBlock("mailbox_row");
1986  $role_addr = $rbacreview->getRoleMailboxAddress($role_id);
1987 
1988  // check if role title is unique. if not force use pear mail for roles
1989  $ids_for_role_title = ilObject::_getIdsForTitle(ilObject::_lookupTitle($role_id), 'role');
1990  if(count($ids_for_role_title) >= 2)
1991  {
1992  $ilias->setSetting('pear_mail_enable', 1);
1993  }
1994 
1995  $this->tpl->setVariable("CHECK_MAILBOX",ilUtil::formCheckbox(1,'roles[]',
1996  htmlspecialchars($role_addr)
1997  ));
1998 
1999  if (ilMail::_usePearMail() && substr($role_addr, 0, 4) != '#il_')
2000  {
2001  // if pear mail is enabled, mailbox addresses are already localized in the language of the user
2002  $this->tpl->setVariable("MAILBOX",$role_addr);
2003  }
2004  else
2005  {
2006  // if pear mail is not enabled, we need to localize mailbox addresses in the language of the user
2007  $this->tpl->setVariable("MAILBOX",ilObjRole::_getTranslation($ilObjDataCache->lookupTitle($role_id)) . " (".$role_addr.")");
2008  }
2009  $this->tpl->parseCurrentBlock();
2010  }
2011  }
2012 
2018  {
2019  $user_ids = $_POST["user_id"];
2020 
2021  if (empty($user_ids[0]))
2022  {
2023  $this->ilErr->raiseError($this->lng->txt("no_checkbox"),$this->ilErr->MESSAGE);
2024  }
2025  include_once 'Services/Mail/classes/class.ilMail.php';
2026  $mail = new ilMail($_SESSION["AccountId"]);
2027 
2028  foreach ($user_ids as $new_member)
2029  {
2030  $user =& $this->ilias->obj_factory->getInstanceByObjId($new_member);
2031 
2032  $this->object->deleteApplicationListEntry($new_member);
2033  $mail->sendMail($user->getLogin(),"","","Membership application refused: Group ".$this->object->getTitle(),"Your application has been refused.",array(),array('system'));
2034  }
2035 
2036  ilUtil::sendSuccess($this->lng->txt("grp_msg_applicants_removed"),true);
2037  $this->ctrl->redirect($this,'members');
2038  }
2039 
2040  // get tabs
2041  function getTabs(&$tabs_gui)
2042  {
2043  global $rbacsystem, $ilUser, $ilAccess, $lng, $ilHelp;
2044 
2045  $ilHelp->setScreenIdComponent("grp");
2046 
2047  if ($rbacsystem->checkAccess('read',$this->ref_id))
2048  {
2049  $tabs_gui->addTab("view_content", $lng->txt("content"),
2050  $this->ctrl->getLinkTarget($this, ""));
2051  }
2052  if ($rbacsystem->checkAccess('visible',$this->ref_id))
2053  {
2054  $tabs_gui->addTarget("info_short",
2055  $this->ctrl->getLinkTargetByClass(
2056  array("ilobjgroupgui", "ilinfoscreengui"), "showSummary"),
2057  "infoScreen",
2058  "", "",false);
2059  }
2060 
2061 
2062  if ($ilAccess->checkAccess('write','',$this->object->getRefId()))
2063  {
2064  $tabs_gui->addTarget("settings",
2065  $this->ctrl->getLinkTarget($this, "edit"), array("edit", "editMapSettings"), get_class($this),
2066  "");
2067  }
2068 
2069 
2070  $is_participant = ilGroupParticipants::_isParticipant($this->ref_id, $ilUser->getId());
2071 
2072  // Members
2073  $mem_cmd = $ilAccess->checkAccess('write','',$this->ref_id) ? "members" : "membersGallery";
2074  if($mem_cmd != "membersGallery" || $is_participant)
2075  {
2076  $tabs_gui->addTarget("members",
2077  $this->ctrl->getLinkTarget($this, $mem_cmd),
2078  array(),
2079  get_class($this));
2080  }
2081 
2082  // learning progress
2083  include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
2084  if(ilLearningProgressAccess::checkAccess($this->object->getRefId(), $is_participant))
2085  {
2086  $tabs_gui->addTarget('learning_progress',
2087  $this->ctrl->getLinkTargetByClass(array('ilobjgroupgui','illearningprogressgui'),''),
2088  '',
2089  array('illplistofobjectsgui','illplistofsettingsgui','illearningprogressgui','illplistofprogressgui'));
2090  }
2091 
2092 
2093  if($ilAccess->checkAccess('write','',$this->object->getRefId()))
2094  {
2095  $tabs_gui->addTarget(
2096  'export',
2097  $this->ctrl->getLinkTargetByClass('ilexportgui',''),
2098  'export',
2099  'ilexportgui'
2100  );
2101  }
2102 
2103  /*
2104  if ($rbacsystem->checkAccess('write',$this->object->getRefId()))
2105  {
2106 
2107 
2108  $tabs_gui->addTarget('export',
2109  $this->ctrl->getLinkTarget($this,'listExportFiles'),
2110  array('listExportFiles','exportXML','confirmDeleteExportFile','downloadExportFile'),
2111  get_class($this));
2112  }
2113  */
2114  // parent tabs (all container: edit_permission, clipboard, trash
2115  parent::getTabs($tabs_gui);
2116 
2117  if($ilAccess->checkAccess('join','',$this->object->getRefId()) and
2118  !$this->object->members_obj->isAssigned($ilUser->getId()))
2119  {
2120  include_once './Modules/Group/classes/class.ilGroupWaitingList.php';
2121  if(ilGroupWaitingList::_isOnList($ilUser->getId(), $this->object->getId()))
2122  {
2123  $tabs_gui->addTab(
2124  'leave',
2125  $this->lng->txt('membership_leave'),
2126  $this->ctrl->getLinkTargetByClass('ilgroupregistrationgui','show','')
2127  );
2128 
2129  }
2130  else
2131  {
2132 
2133  $tabs_gui->addTarget("join",
2134  $this->ctrl->getLinkTargetByClass('ilgroupregistrationgui', "show"),
2135  'show',
2136  "");
2137  }
2138  }
2139  if($ilAccess->checkAccess('leave','',$this->object->getRefId()) and
2140  $this->object->members_obj->isMember($ilUser->getId()))
2141  {
2142  $tabs_gui->addTarget("grp_btn_unsubscribe",
2143  $this->ctrl->getLinkTarget($this, "leave"),
2144  '',
2145  "");
2146  }
2147  }
2148 
2149  // IMPORT FUNCTIONS
2150 
2152  {
2153  if(!is_array($_FILES['xmldoc']))
2154  {
2155  ilUtil::sendFailure($this->lng->txt("import_file_not_valid"));
2156  $this->createObject();
2157  return false;
2158  }
2159 
2160  include_once './Modules/Group/classes/class.ilObjGroup.php';
2161 
2162  if($ref_id = ilObjGroup::_importFromFile($_FILES['xmldoc'],(int) $_GET['ref_id']))
2163  {
2164  $this->ctrl->setParameter($this, "ref_id", $ref_id);
2165  ilUtil::sendSuccess($this->lng->txt("import_grp_finished"),true);
2166  ilUtil::redirect($this->ctrl->getLinkTarget($this,'edit','',false,false));
2167  }
2168 
2169  ilUtil::sendFailure($this->lng->txt("import_file_not_valid"));
2170  $this->createObject();
2171  }
2172 
2179  function exportObject()
2180  {
2181  $this->tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.grp_members_export.html",
2182  "Modules/Group");
2183  $this->tpl->setCurrentBlock("adm_content");
2184  $this->tpl->setVariable("FORMACTION", $this->getFormAction("export",$this->ctrl->getFormAction($this)));
2185  $this->tpl->setVariable("BUTTON_EXPORT", $this->lng->txt("export_group_members"));
2186  $this->tpl->parseCurrentBlock();
2187  }
2188 
2196  {
2197  $title = preg_replace("/\s/", "_", $this->object->getTitle());
2198  include_once "./Services/Excel/classes/class.ilExcelWriterAdapter.php";
2199  $adapter = new ilExcelWriterAdapter("export_" . $title . ".xls");
2200  $workbook = $adapter->getWorkbook();
2201  // Creating a worksheet
2202  $format_bold =& $workbook->addFormat();
2203  $format_bold->setBold();
2204  $format_percent =& $workbook->addFormat();
2205  $format_percent->setNumFormat("0.00%");
2206  $format_datetime =& $workbook->addFormat();
2207  $format_datetime->setNumFormat("DD/MM/YYYY hh:mm:ss");
2208  $format_title =& $workbook->addFormat();
2209  $format_title->setBold();
2210  $format_title->setColor('black');
2211  $format_title->setPattern(1);
2212  $format_title->setFgColor('silver');
2213  $worksheet =& $workbook->addWorksheet();
2214  $column = 0;
2215  $profile_data = array("email", "gender", "firstname", "lastname", "person_title", "institution",
2216  "department", "street", "zipcode","city", "country", "phone_office", "phone_home", "phone_mobile",
2217  "fax", "matriculation");
2218  foreach ($profile_data as $data)
2219  {
2220  $worksheet->writeString(0, $column++, $this->cleanString($this->lng->txt($data)), $format_title);
2221  }
2222  $member_ids = $this->object->getGroupMemberIds();
2223  $row = 1;
2224  foreach ($member_ids as $member_id)
2225  {
2226  $column = 0;
2227  $member =& $this->ilias->obj_factory->getInstanceByObjId($member_id);
2228  if ($member->getPref("public_email")=="y")
2229  {
2230  $worksheet->writeString($row, $column++, $this->cleanString($member->getEmail()));
2231  }
2232  else
2233  {
2234  $column++;
2235  }
2236  $worksheet->writeString($row, $column++, $this->cleanString($this->lng->txt("gender_" . $member->getGender())));
2237  $worksheet->writeString($row, $column++, $this->cleanString($member->getFirstname()));
2238  $worksheet->writeString($row, $column++, $this->cleanString($member->getLastname()));
2239  $worksheet->writeString($row, $column++, $this->cleanString($member->getUTitle()));
2240  if ($member->getPref("public_institution")=="y")
2241  {
2242  $worksheet->writeString($row, $column++, $this->cleanString($member->getInstitution()));
2243  }
2244  else
2245  {
2246  $column++;
2247  }
2248  if ($member->getPref("public_department")=="y")
2249  {
2250  $worksheet->writeString($row, $column++, $this->cleanString($member->getDepartment()));
2251  }
2252  else
2253  {
2254  $column++;
2255  }
2256  if ($member->getPref("public_street")=="y")
2257  {
2258  $worksheet->writeString($row, $column++, $this->cleanString($member->getStreet()));
2259  }
2260  else
2261  {
2262  $column++;
2263  }
2264  if ($member->getPref("public_zip")=="y")
2265  {
2266  $worksheet->writeString($row, $column++, $this->cleanString($member->getZipcode()));
2267  }
2268  else
2269  {
2270  $column++;
2271  }
2272  if ($member->getPref("public_city")=="y")
2273  {
2274  $worksheet->writeString($row, $column++, $this->cleanString($member->getCity()));
2275  }
2276  else
2277  {
2278  $column++;
2279  }
2280  if ($member->getPref("public_country")=="y")
2281  {
2282  $worksheet->writeString($row, $column++, $this->cleanString($member->getCountry()));
2283  }
2284  else
2285  {
2286  $column++;
2287  }
2288  if ($member->getPref("public_phone_office")=="y")
2289  {
2290  $worksheet->writeString($row, $column++, $this->cleanString($member->getPhoneOffice()));
2291  }
2292  else
2293  {
2294  $column++;
2295  }
2296  if ($member->getPref("public_phone_home")=="y")
2297  {
2298  $worksheet->writeString($row, $column++, $this->cleanString($member->getPhoneHome()));
2299  }
2300  else
2301  {
2302  $column++;
2303  }
2304  if ($member->getPref("public_phone_mobile")=="y")
2305  {
2306  $worksheet->writeString($row, $column++, $this->cleanString($member->getPhoneMobile()));
2307  }
2308  else
2309  {
2310  $column++;
2311  }
2312  if ($member->getPref("public_fax")=="y")
2313  {
2314  $worksheet->writeString($row, $column++, $this->cleanString($member->getFax()));
2315  }
2316  else
2317  {
2318  $column++;
2319  }
2320  if ($member->getPref("public_matriculation")=="y")
2321  {
2322  $worksheet->writeString($row, $column++, $this->cleanString($member->getMatriculation()));
2323  }
2324  else
2325  {
2326  $column++;
2327  }
2328  $row++;
2329  }
2330  $workbook->close();
2331  }
2332 
2341  function cleanString($str)
2342  {
2343  return str_replace(array("��","��","��","��","��","��","��"), array("ae","oe","ue","ss","Ae","Oe","Ue"), $str);
2344  }
2345 
2356  function infoScreenObject()
2357  {
2358  $this->ctrl->setCmd("showSummary");
2359  $this->ctrl->setCmdClass("ilinfoscreengui");
2360  $this->infoScreen();
2361  }
2362 
2366  function infoScreen()
2367  {
2368  global $rbacsystem, $ilUser, $ilSetting;
2369 
2370  $this->tabs_gui->setTabActive('info_short');
2371 
2372  if(!$rbacsystem->checkAccess("visible", $this->ref_id))
2373  {
2374  $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
2375  }
2376 
2377  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
2378  $info = new ilInfoScreenGUI($this);
2379 
2380  if(strlen($this->object->getInformation()))
2381  {
2382  $info->addSection($this->lng->txt('grp_general_informations'));
2383  $info->addProperty($this->lng->txt('grp_information'), nl2br(
2384  ilUtil::makeClickable ($this->object->getInformation(), true)));
2385  }
2386 
2387  $info->enablePrivateNotes();
2388  $info->enableLearningProgress(true);
2389 
2390  $info->addSection($this->lng->txt('group_registration'));
2391  $info->showLDAPRoleGroupMappingInfo();
2392 
2393  if(!$this->object->isRegistrationEnabled())
2394  {
2395  $info->addProperty($this->lng->txt('group_registration_mode'),
2396  $this->lng->txt('grp_reg_deac_info_screen'));
2397 
2398  }
2399  else
2400  {
2401  switch($this->object->getRegistrationType())
2402  {
2404  $info->addProperty($this->lng->txt('group_registration_mode'),
2405  $this->lng->txt('grp_reg_direct_info_screen'));
2406  break;
2407 
2409  $info->addProperty($this->lng->txt('group_registration_mode'),
2410  $this->lng->txt('grp_reg_req_info_screen'));
2411  break;
2412 
2414  $info->addProperty($this->lng->txt('group_registration_mode'),
2415  $this->lng->txt('grp_reg_passwd_info_screen'));
2416  break;
2417 
2418  }
2419  /*
2420  $info->addProperty($this->lng->txt('group_registration_time'),
2421  ilDatePresentation::formatPeriod(
2422  $this->object->getRegistrationStart(),
2423  $this->object->getRegistrationEnd()));
2424  */
2425  if($this->object->isRegistrationUnlimited())
2426  {
2427  $info->addProperty($this->lng->txt('group_registration_time'),
2428  $this->lng->txt('grp_registration_unlimited'));
2429  }
2430  elseif($this->object->getRegistrationStart()->getUnixTime() < time())
2431  {
2432  $info->addProperty($this->lng->txt("group_registration_time"),
2433  $this->lng->txt('cal_until').' '.
2434  ilDatePresentation::formatDate($this->object->getRegistrationEnd()));
2435  }
2436  elseif($this->object->getRegistrationStart()->getUnixTime() >= time())
2437  {
2438  $info->addProperty($this->lng->txt("group_registration_time"),
2439  $this->lng->txt('cal_from').' '.
2440  ilDatePresentation::formatDate($this->object->getRegistrationStart()));
2441  }
2442  if ($this->object->isMembershipLimited())
2443  {
2444  $info->addProperty($this->lng->txt("mem_free_places"),
2445  max(0,$this->object->getMaxMembers() - $this->object->members_obj->getCountMembers()));
2446 
2447  }
2448 
2449  }
2450 
2451  // Confirmation
2452  include_once('Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
2453  $privacy = ilPrivacySettings::_getInstance();
2454 
2455  include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
2456  if($privacy->groupConfirmationRequired() or ilCourseDefinedFieldDefinition::_getFields($this->object->getId()) or $privacy->enabledGroupExport())
2457  {
2458  include_once('Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php');
2459 
2460  $field_info = ilExportFieldsInfo::_getInstanceByType($this->object->getType());
2461 
2462  $this->lng->loadLanguageModule('ps');
2463  $info->addSection($this->lng->txt('grp_user_agreement_info'));
2464  $info->addProperty($this->lng->txt('ps_export_data'),$field_info->exportableFieldsToInfoString());
2465 
2466  if($fields = ilCourseDefinedFieldDefinition::_fieldsToInfoString($this->object->getId()))
2467  {
2468  $info->addProperty($this->lng->txt('ps_grp_user_fields'),$fields);
2469  }
2470  }
2471 
2472 
2473  // forward the command
2474  $this->ctrl->forwardCommand($info);
2475  }
2476 
2481  {
2482  global $ilUser;
2483 
2484  $ilUser->setPref("grpcrs_ntf_".$this->ref_id, (bool)$_REQUEST["grp_ntf"]);
2485  $ilUser->writePrefs();
2486 
2487  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
2488  $this->ctrl->redirect($this, "infoScreen");
2489  }
2490 
2494  function _goto($a_target, $a_add = "")
2495  {
2496  global $ilAccess, $ilErr, $lng,$ilUser;
2497 
2498  include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
2499  if(substr($a_add,0,5) == 'rcode')
2500  {
2501  if($ilUser->getId() == ANONYMOUS_USER_ID)
2502  {
2503  // Redirect to login for anonymous
2505  "login.php?target=".$_GET["target"]."&cmd=force_login&lang=".
2506  $ilUser->getCurrentLanguage()
2507  );
2508  }
2509 
2510  // Redirects to target location after assigning user to course
2512  $a_target,
2514  substr($a_add,5)
2515  );
2516  }
2517 
2518  if ($a_add == "mem" && $ilAccess->checkAccess("write", "", $a_target))
2519  {
2520  ilObjectGUI::_gotoRepositoryNode($a_target, "members");
2521  }
2522 
2523  if ($ilAccess->checkAccess("read", "", $a_target))
2524  {
2526  }
2527  else
2528  {
2529  // to do: force flat view
2530  if ($ilAccess->checkAccess("visible", "", $a_target))
2531  {
2532  ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreenGoto");
2533  }
2534  else
2535  {
2536  if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
2537  {
2538  ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
2539  ilObject::_lookupTitle(ilObject::_lookupObjId($a_target))), true);
2541  }
2542  }
2543  }
2544  $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
2545  }
2546 
2547 
2555  protected function initForm($a_mode = 'edit')
2556  {
2557  global $ilUser,$tpl,$tree;
2558 
2559  if(is_object($this->form))
2560  {
2561  return true;
2562  }
2563 
2564  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
2565 
2566  $this->form = new ilPropertyFormGUI();
2567  switch($a_mode)
2568  {
2569  case 'edit':
2570  $this->form->setFormAction($this->ctrl->getFormAction($this,'update'));
2571  break;
2572 
2573  default:
2574  $this->form->setTableWidth('600px');
2575  $this->form->setFormAction($this->ctrl->getFormAction($this,'save'));
2576  break;
2577  }
2578 
2579  // title
2580  $title = new ilTextInputGUI($this->lng->txt('title'),'title');
2581  $title->setSubmitFormOnEnter(true);
2582  $title->setValue($this->object->getTitle());
2583  $title->setSize(min(40, ilObject::TITLE_LENGTH));
2584  $title->setMaxLength(ilObject::TITLE_LENGTH);
2585  $title->setRequired(true);
2586  $this->form->addItem($title);
2587 
2588  // desc
2589  $desc = new ilTextAreaInputGUI($this->lng->txt('description'),'desc');
2590  $desc->setValue($this->object->getLongDescription());
2591  $desc->setRows(2);
2592  $desc->setCols(40);
2593  $this->form->addItem($desc);
2594 
2595  // Group type
2596  $grp_type = new ilRadioGroupInputGUI($this->lng->txt('grp_typ'),'grp_type');
2597 
2598  if($a_mode == 'edit')
2599  {
2600  $type = ($this->object->getGroupType() ? $this->object->getGroupType() : $this->object->readGroupStatus());
2601  }
2602  else
2603  {
2604  $type = ($this->object->getGroupType() ? $this->object->getGroupType() : GRP_TYPE_PUBLIC);
2605  }
2606 
2607  $grp_type->setValue($type);
2608  $grp_type->setRequired(true);
2609 
2610 
2611  // PUBLIC GROUP
2612  $opt_public = new ilRadioOption($this->lng->txt('grp_public'),GRP_TYPE_PUBLIC,$this->lng->txt('grp_public_info'));
2613  $grp_type->addOption($opt_public);
2614 
2615 
2616  // CLOSED GROUP
2617  $opt_closed = new ilRadioOption($this->lng->txt('grp_closed'),GRP_TYPE_CLOSED,$this->lng->txt('grp_closed_info'));
2618  $grp_type->addOption($opt_closed);
2619  if($a_mode == 'update_group_type')
2620  {
2621  $grp_type->setAlert($this->lng->txt('grp_type_changed_info'));
2622  }
2623  $this->form->addItem($grp_type);
2624 
2625  if($a_mode == 'edit')
2626  {
2627  // Group registration ############################################################
2628  $pres = new ilFormSectionHeaderGUI();
2629  $pres->setTitle($this->lng->txt('grp_setting_header_registration'));
2630  $this->form->addItem($pres);
2631 
2632  // Registration type
2633  $reg_type = new ilRadioGroupInputGUI($this->lng->txt('group_registration_mode'),'registration_type');
2634  $reg_type->setValue($this->object->getRegistrationType());
2635 
2636  $opt_dir = new ilRadioOption($this->lng->txt('grp_reg_direct'),GRP_REGISTRATION_DIRECT);#$this->lng->txt('grp_reg_direct_info'));
2637  $reg_type->addOption($opt_dir);
2638 
2639  $opt_pass = new ilRadioOption($this->lng->txt('grp_pass_request'),GRP_REGISTRATION_PASSWORD);
2640  $pass = new ilTextInputGUI($this->lng->txt("password"),'password');
2641  $pass->setInfo($this->lng->txt('grp_reg_password_info'));
2642  $pass->setValue($this->object->getPassword());
2643  $pass->setSize(10);
2644  $pass->setMaxLength(32);
2645  $opt_pass->addSubItem($pass);
2646  $reg_type->addOption($opt_pass);
2647 
2648  $opt_req = new ilRadioOption($this->lng->txt('grp_reg_request'),GRP_REGISTRATION_REQUEST,$this->lng->txt('grp_reg_request_info'));
2649  $reg_type->addOption($opt_req);
2650 
2651  $opt_deact = new ilRadioOption($this->lng->txt('grp_reg_no_selfreg'),GRP_REGISTRATION_DEACTIVATED,$this->lng->txt('grp_reg_disabled_info'));
2652  $reg_type->addOption($opt_deact);
2653 
2654  // Registration codes
2655  $reg_code = new ilCheckboxInputGUI($this->lng->txt('grp_reg_code'),'reg_code_enabled');
2656  $reg_code->setChecked($this->object->isRegistrationAccessCodeEnabled());
2657  $reg_code->setValue(1);
2658  $reg_code->setInfo($this->lng->txt('grp_reg_code_enabled_info'));
2659  $this->form->addItem($reg_type);
2660 
2661  // Registration codes
2662  if(!$this->object->getRegistrationAccessCode())
2663  {
2664  include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
2665  $this->object->setRegistrationAccessCode(ilMembershipRegistrationCodeUtils::generateCode());
2666  }
2667  $reg_link = new ilHiddenInputGUI('reg_code');
2668  $reg_link->setValue($this->object->getRegistrationAccessCode());
2669  $this->form->addItem($reg_link);
2670 
2671  $link = new ilCustomInputGUI($this->lng->txt('grp_reg_code_link'));
2672  include_once './Services/Link/classes/class.ilLink.php';
2673  $val = ilLink::_getLink($this->object->getRefId(),$this->object->getType(),array(),'_rcode'.$this->object->getRegistrationAccessCode());
2674  $link->setHTML('<font class="small">'.$val.'</font>');
2675  $reg_code->addSubItem($link);
2676  $this->form->addItem($reg_code);
2677 
2678 
2679  // time limit
2680  $time_limit = new ilCheckboxInputGUI($this->lng->txt('grp_reg_limited'),'reg_limit_time');
2681 // $time_limit->setOptionTitle($this->lng->txt('grp_reg_limit_time'));
2682  $time_limit->setChecked($this->object->isRegistrationUnlimited() ? false : true);
2683 
2684  $this->lng->loadLanguageModule('dateplaner');
2685  include_once './Services/Form/classes/class.ilDateDurationInputGUI.php';
2686  $tpl->addJavaScript('./Services/Form/js/date_duration.js');
2687  $dur = new ilDateDurationInputGUI($this->lng->txt('grp_reg_period'),'reg');
2688  $dur->setStartText($this->lng->txt('cal_start'));
2689  $dur->setEndText($this->lng->txt('cal_end'));
2690  $dur->setMinuteStepSize(5);
2691  $dur->setShowDate(true);
2692  $dur->setShowTime(true);
2693  $dur->setStart($this->object->getRegistrationStart());
2694  $dur->setEnd($this->object->getRegistrationEnd());
2695 
2696  $time_limit->addSubItem($dur);
2697  $this->form->addItem($time_limit);
2698 
2699  // max member
2700  $lim = new ilCheckboxInputGUI($this->lng->txt('reg_grp_max_members_short'),'registration_membership_limited');
2701  $lim->setValue(1);
2702 // $lim->setOptionTitle($this->lng->txt('reg_grp_max_members'));
2703  $lim->setChecked($this->object->isMembershipLimited());
2704 
2705 
2706  $max = new ilTextInputGUI($this->lng->txt('reg_grp_max_members'),'registration_max_members');
2707  $max->setValue($this->object->getMaxMembers() ? $this->object->getMaxMembers() : '');
2708  //$max->setTitle($this->lng->txt('members'));
2709  $max->setSize(3);
2710  $max->setMaxLength(4);
2711  $max->setInfo($this->lng->txt('grp_reg_max_members_info'));
2712  $lim->addSubItem($max);
2713 
2714  $wait = new ilCheckboxInputGUI($this->lng->txt('grp_waiting_list'),'waiting_list');
2715  $wait->setValue(1);
2716  //$wait->setOptionTitle($this->lng->txt('grp_waiting_list'));
2717  $wait->setInfo($this->lng->txt('grp_waiting_list_info'));
2718  $wait->setChecked($this->object->isWaitingListEnabled() ? true : false);
2719  $lim->addSubItem($wait);
2720  $this->form->addItem($lim);
2721 
2722 
2723 
2724  // Group presentation
2725  $hasParentCourse = $tree->checkForParentType($this->object->getRefId(),'crs');
2726  $pres = new ilFormSectionHeaderGUI();
2727  $pres->setTitle($this->lng->txt('grp_setting_header_presentation'));
2728  $this->form->addItem($pres);
2729 
2730  // presentation type
2731  $view_type = new ilRadioGroupInputGUI($this->lng->txt('grp_presentation_type'),'view_mode');
2732  if($hasParentCourse)
2733  {
2734  switch($this->object->getViewMode())
2735  {
2737  $course_view_mode = ': '.$this->lng->txt('cntr_view_sessions');
2738  break;
2739 
2741  $course_view_mode = ': '.$this->lng->txt('cntr_view_simple');
2742  break;
2743 
2745  $course_view_mode = ': '.$this->lng->txt('cntr_view_by_type');
2746  break;
2747  }
2748 
2749  $opt = new ilRadioOption($this->lng->txt('grp_view_inherit').$course_view_mode,ilContainer::VIEW_INHERIT);
2750  $opt->setInfo($this->lng->txt('grp_view_inherit_info'));
2751  $view_type->addOption($opt);
2752  }
2753 
2754  if($hasParentCourse &&
2755  $this->object->getViewMode(false) == ilContainer::VIEW_INHERIT)
2756  {
2757  $view_type->setValue(ilContainer::VIEW_INHERIT);
2758  }
2759  else
2760  {
2761  $view_type->setValue($this->object->getViewMode(true));
2762  }
2763 
2764  $opt = new ilRadioOption($this->lng->txt('cntr_view_simple'),ilContainer::VIEW_SIMPLE);
2765  $opt->setInfo($this->lng->txt('grp_view_info_simple'));
2766  $view_type->addOption($opt);
2767 
2768  $opt = new ilRadioOption($this->lng->txt('cntr_view_by_type'), ilContainer::VIEW_BY_TYPE);
2769  $opt->setInfo($this->lng->txt('grp_view_info_by_type'));
2770  $view_type->addOption($opt);
2771  $this->form->addItem($view_type);
2772 
2773 
2774  $sog = new ilRadioGroupInputGUI($this->lng->txt('sorting_header'),'sor');
2775 
2776  include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
2777  $sort = new ilContainerSortingSettings($this->object->getId());
2778  $sog->setValue($sort->getSortMode());
2779  $sog->setRequired(true);
2780 
2781  if($hasParentCourse)
2782  {
2783  $sde = new ilRadioOption();
2784  $sde->setValue(ilContainer::SORT_INHERIT);
2785 
2786  $title = $this->lng->txt('sort_inherit_prefix');
2787  $title .= ' ('.ilContainerSortingSettings::sortModeToString(
2789  $sde->setTitle($title);
2790  $sde->setInfo($this->lng->txt('sorting_info_inherit'));
2791  $sog->addOption($sde);
2792  }
2793 
2794  $sma = new ilRadioOption();
2795  $sma->setValue(ilContainer::SORT_TITLE);
2796  $sma->setTitle($this->lng->txt('sorting_title_header'));
2797  $sma->setInfo($this->lng->txt('sorting_info_title'));
2798  $sog->addOption($sma);
2799 
2800  $sti = new ilRadioOption();
2801  $sti->setValue(ilContainer::SORT_MANUAL);
2802  $sti->setTitle($this->lng->txt('sorting_manual_header'));
2803  $sti->setInfo($this->lng->txt('sorting_info_manual'));
2804  $sog->addOption($sti);
2805 
2806  $this->form->addItem($sog);
2807 
2808  // additional features
2809  $feat = new ilFormSectionHeaderGUI();
2810  $feat->setTitle($this->lng->txt('obj_features'));
2811  $this->form->addItem($feat);
2812 
2813  include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
2815  $this->object->getId(),
2816  $this->form,
2817  array(
2821  )
2822  );
2823 
2824  // Notification Settings
2825  /*$notification = new ilFormSectionHeaderGUI();
2826  $notification->setTitle($this->lng->txt('grp_notification'));
2827  $this->form->addItem($notification);*/
2828 
2829  // Show members type
2830  $mail_type = new ilRadioGroupInputGUI($this->lng->txt('grp_mail_type'), 'mail_type');
2831  $mail_type->setValue($this->object->getMailToMembersType());
2832 
2833  $mail_tutors = new ilRadioOption($this->lng->txt('grp_mail_tutors_only'), ilObjGroup::MAIL_ALLOWED_TUTORS,
2834  $this->lng->txt('grp_mail_tutors_only_info'));
2835  $mail_type->addOption($mail_tutors);
2836 
2837  $mail_all = new ilRadioOption($this->lng->txt('grp_mail_all'), ilObjGroup::MAIL_ALLOWED_ALL,
2838  $this->lng->txt('grp_mail_all_info'));
2839  $mail_type->addOption($mail_all);
2840  $this->form->addItem($mail_type);
2841  }
2842 
2843  switch($a_mode)
2844  {
2845  case 'create':
2846  $this->form->setTitle($this->lng->txt('grp_new'));
2847  $this->form->setTitleIcon(ilUtil::getImagePath('icon_grp.png'));
2848 
2849  $this->form->addCommandButton('save',$this->lng->txt('grp_new'));
2850  $this->form->addCommandButton('cancel',$this->lng->txt('cancel'));
2851  return true;
2852 
2853  case 'edit':
2854  $this->form->setTitle($this->lng->txt('grp_edit'));
2855  $this->form->setTitleIcon(ilUtil::getImagePath('icon_grp.png'));
2856 
2857  // Edit ecs export settings
2858  include_once 'Modules/Group/classes/class.ilECSGroupSettings.php';
2859  $ecs = new ilECSGroupSettings($this->object);
2860  $ecs->addSettingsToForm($this->form, 'grp');
2861 
2862  $this->form->addCommandButton('update',$this->lng->txt('save'));
2863  $this->form->addCommandButton('cancel',$this->lng->txt('cancel'));
2864  return true;
2865 
2866  case 'update_group_type':
2867  $grp_type->setValue(
2868  $type == GRP_TYPE_PUBLIC ?
2869  GRP_TYPE_CLOSED :
2871  );
2872 
2873  $this->form->setTitle($this->lng->txt('grp_edit'));
2874  $this->form->setTitleIcon(ilUtil::getImagePath('icon_grp.png'));
2875  return true;
2876  }
2877  return true;
2878  }
2879 
2886  public function load()
2887  {
2888  $this->object->setTitle(ilUtil::stripSlashes($_POST['title']));
2889  $this->object->setDescription(ilUtil::stripSlashes($_POST['desc']));
2890  $this->object->setGroupType(ilUtil::stripSlashes($_POST['grp_type']));
2891  $this->object->setRegistrationType(ilUtil::stripSlashes($_POST['registration_type']));
2892  $this->object->setPassword(ilUtil::stripSlashes($_POST['password']));
2893  $this->object->enableUnlimitedRegistration((bool) !$_POST['reg_limit_time']);
2894  $this->object->setRegistrationStart($this->loadDate('start'));
2895  $this->object->setRegistrationEnd($this->loadDate('end'));
2896  $this->object->enableMembershipLimitation((bool) $_POST['registration_membership_limited']);
2897  $this->object->setMaxMembers((int) $_POST['registration_max_members']);
2898  $this->object->enableWaitingList((bool) $_POST['waiting_list']);
2899  $this->object->enableRegistrationAccessCode((bool) $_POST['reg_code_enabled']);
2900  $this->object->setRegistrationAccessCode(ilUtil::stripSlashes($_POST['reg_code']));
2901  $this->object->setViewMode(ilUtil::stripSlashes($_POST['view_mode']));
2902  $this->object->setMailToMembersType((int) $_POST['mail_type']);
2903 
2904  return true;
2905  }
2906 
2914  protected function loadDate($a_field)
2915  {
2916  global $ilUser;
2917 
2918  include_once('./Services/Calendar/classes/class.ilDateTime.php');
2919 
2920  $dt['year'] = (int) $_POST['reg'][$a_field]['date']['y'];
2921  $dt['mon'] = (int) $_POST['reg'][$a_field]['date']['m'];
2922  $dt['mday'] = (int) $_POST['reg'][$a_field]['date']['d'];
2923  $dt['hours'] = (int) $_POST['reg'][$a_field]['time']['h'];
2924  $dt['minutes'] = (int) $_POST['reg'][$a_field]['time']['m'];
2925  $dt['seconds'] = (int) $_POST['reg'][$a_field]['time']['s'];
2926 
2927  $date = new ilDateTime($dt,IL_CAL_FKT_GETDATE,$ilUser->getTimeZone());
2928  return $date;
2929  }
2930 
2938  protected function setSubTabs($a_tab)
2939  {
2940  global $rbacsystem,$ilUser,$ilAccess;
2941 
2942  switch($a_tab)
2943  {
2944  case 'members':
2945  // for admins
2946  if($ilAccess->checkAccess('write','',$this->object->getRefId()))
2947  {
2948  $this->tabs_gui->addSubTabTarget("grp_edit_members",
2949  $this->ctrl->getLinkTarget($this,'members'),
2950  "members",
2951  get_class($this));
2952  }
2953  // for all
2954  $this->tabs_gui->addSubTabTarget("grp_members_gallery",
2955  $this->ctrl->getLinkTarget($this,'membersGallery'),
2956  "membersGallery", get_class($this));
2957 
2958  // members map
2959  include_once("./Services/GoogleMaps/classes/class.ilGoogleMapUtil.php");
2961  $this->object->getEnableGroupMap())
2962  {
2963  $this->tabs_gui->addSubTabTarget("grp_members_map",
2964  $this->ctrl->getLinkTarget($this,'membersMap'),
2965  "membersMap", get_class($this));
2966  }
2967 
2968  if(
2969  $ilAccess->checkAccess('write','',$this->object->getRefId()) or
2970  $this->object->getMailToMembersType() == ilObjGroup::MAIL_ALLOWED_ALL
2971  )
2972  {
2973  $this->tabs_gui->addSubTabTarget("mail_members",
2974  $this->ctrl->getLinkTarget($this,'mailMembers'),
2975  "mailMembers", get_class($this));
2976  }
2977 
2978  if($ilAccess->checkAccess('write','',$this->object->getRefId()))
2979  {
2980  $this->tabs_gui->addSubTabTarget("events",
2981  $this->ctrl->getLinkTargetByClass('ilsessionoverviewgui','listSessions'),
2982  "", 'ilsessionoverviewgui');
2983  }
2984 
2985  include_once 'Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
2986  if(ilPrivacySettings::_getInstance()->checkExportAccess($this->object->getRefId()))
2987  {
2988  $this->tabs_gui->addSubTabTarget('grp_export_members',
2989  $this->ctrl->getLinkTargetByClass('ilmemberexportgui','show'),
2990  "", 'ilmemberexportgui');
2991  }
2992 
2993  break;
2994 
2995  case 'settings':
2996  $this->tabs_gui->addSubTabTarget("grp_settings",
2997  $this->ctrl->getLinkTarget($this,'edit'),
2998  "edit", get_class($this));
2999 
3000  $this->tabs_gui->addSubTabTarget("grp_info_settings",
3001  $this->ctrl->getLinkTarget($this,'editInfo'),
3002  "editInfo", get_class($this));
3003 
3004  // custom icon
3005  if ($this->ilias->getSetting("custom_icons"))
3006  {
3007  $this->tabs_gui->addSubTabTarget("grp_icon_settings",
3008  $this->ctrl->getLinkTarget($this,'editGroupIcons'),
3009  "editGroupIcons", get_class($this));
3010  }
3011 
3012  include_once("./Services/GoogleMaps/classes/class.ilGoogleMapUtil.php");
3014  {
3015  $this->tabs_gui->addSubTabTarget("grp_map_settings",
3016  $this->ctrl->getLinkTarget($this,'editMapSettings'),
3017  "editMapSettings", get_class($this));
3018  }
3019 
3020  $this->tabs_gui->addSubTabTarget('groupings',
3021  $this->ctrl->getLinkTargetByClass('ilobjcoursegroupinggui','listGroupings'),
3022  'listGroupings',
3023  get_class($this));
3024 
3025  include_once('Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
3026  include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
3027  // only show if export permission is granted
3028  if(ilPrivacySettings::_getInstance()->checkExportAccess($this->object->getRefId()) or ilCourseDefinedFieldDefinition::_hasFields($this->object->getId()))
3029  {
3030  $this->tabs_gui->addSubTabTarget('grp_custom_user_fields',
3031  $this->ctrl->getLinkTargetByClass('ilobjectcustomuserfieldsgui'),
3032  '',
3033  'ilobjectcustomuserfieldsgui');
3034  }
3035 
3036 
3037 
3038  break;
3039 
3040 
3041  }
3042  }
3043 
3050  private function checkAgreement()
3051  {
3052  global $ilUser,$ilAccess;
3053 
3054  if($ilAccess->checkAccess('write','',$this->object->getRefId()))
3055  {
3056  return true;
3057  }
3058 
3059  // Disable aggrement if is not member of group
3060  if(!$this->object->members_obj->isAssigned($ilUser->getId()))
3061  {
3062  return true;
3063  }
3064 
3065  include_once './Services/Container/classes/class.ilMemberViewSettings.php';
3066  if(ilMemberViewSettings::getInstance()->isActive())
3067  {
3068  return true;
3069  }
3070 
3071  include_once('Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
3072  include_once('Services/Membership/classes/class.ilMemberAgreement.php');
3073  $privacy = ilPrivacySettings::_getInstance();
3074 
3075  // Check agreement
3076  if(($privacy->groupConfirmationRequired() or ilCourseDefinedFieldDefinition::_hasFields($this->object->getId()))
3077  and !ilMemberAgreement::_hasAccepted($ilUser->getId(),$this->object->getId()))
3078  {
3079  return false;
3080  }
3081  // Check required fields
3082  include_once('Modules/Course/classes/Export/class.ilCourseUserData.php');
3083  if(!ilCourseUserData::_checkRequired($ilUser->getId(),$this->object->getId()))
3084  {
3085  return false;
3086  }
3087  return true;
3088  }
3089 
3090 
3095  public function prepareOutput()
3096  {
3097  global $rbacsystem;
3098  if(!$this->getCreationMode())
3099  {
3100  /*
3101  include_once './Services/Container/classes/class.ilMemberViewSettings.php';
3102  $settings = ilMemberViewSettings::getInstance();
3103  if($settings->isActive() and $settings->getContainer() != $this->object->getRefId())
3104  {
3105  $settings->setContainer($this->object->getRefId());
3106  $rbacsystem->initMemberView();
3107  }
3108  */
3109  }
3110  parent::prepareOutput();
3111  }
3112 
3117  protected function createMailSignature()
3118  {
3119  $link = chr(13).chr(10).chr(13).chr(10);
3120  $link .= $this->lng->txt('grp_mail_permanent_link');
3121  $link .= chr(13).chr(10).chr(13).chr(10);
3122  include_once 'Services/Link/classes/class.ilLink.php';
3123  $link .= ilLink::_getLink($this->object->getRefId());
3124  return rawurlencode(base64_encode($link));
3125  }
3126 
3127  protected function initHeaderAction($a_sub_type = null, $a_sub_id = null)
3128  {
3129  global $ilSetting, $ilUser;
3130 
3131  $lg = parent::initHeaderAction($a_sub_type, $a_sub_id);
3132 
3133  include_once('./Modules/Group/classes/class.ilGroupParticipants.php');
3134  if($ilSetting->get("crsgrp_ntf") &&
3135  ilGroupParticipants::_isParticipant($this->ref_id, $ilUser->getId()))
3136  {
3137  if(!$ilUser->getPref("grpcrs_ntf_".$this->ref_id))
3138  {
3139  $lg->addHeaderIcon("not_icon",
3140  ilUtil::getImagePath("notification_off.png"),
3141  $this->lng->txt("grp_notification_deactivated"));
3142 
3143  $this->ctrl->setParameter($this, "grp_ntf", 1);
3144  $caption = "grp_activate_notification";
3145  }
3146  else
3147  {
3148  $lg->addHeaderIcon("not_icon",
3149  ilUtil::getImagePath("notification_on.png"),
3150  $this->lng->txt("grp_notification_activated"));
3151 
3152  $this->ctrl->setParameter($this, "grp_ntf", 0);
3153  $caption = "grp_deactivate_notification";
3154  }
3155 
3156  $lg->addCustomCommand($this->ctrl->getLinkTarget($this, "saveNotification"),
3157  $caption);
3158 
3159 
3160  $this->ctrl->setParameter($this, "grp_ntf", "");
3161  }
3162 
3163  return $lg;
3164  }
3165 
3167  {
3168  global $ilTabs;
3169 
3170  $this->checkPermission('write');
3171 
3172  $ilTabs->clearTargets();
3173  $ilTabs->setBackTarget($this->lng->txt('back'),
3174  $this->ctrl->getLinkTarget($this, 'members'));
3175 
3176  $list = $this->initAttendanceList();
3177  $form = $list->initForm('printMembersOutput');
3178  $this->tpl->setContent($form->getHTML());
3179  }
3180 
3186  protected function initAttendanceList()
3187  {
3188  include_once('./Modules/Group/classes/class.ilGroupParticipants.php');
3189  $members_obj = ilGroupParticipants::_getInstanceByObjId($this->object->getId());
3190 
3191  include_once('./Modules/Group/classes/class.ilGroupWaitingList.php');
3192  $waiting_list = new ilGroupWaitingList($this->object->getId());
3193 
3194  include_once 'Services/Membership/classes/class.ilAttendanceList.php';
3195  $list = new ilAttendanceList($this, $members_obj, $waiting_list);
3196  $list->setId('grpmemlst');
3197 
3198  $list->setTitle($this->lng->txt('grp_members_print_title'),
3199  $this->lng->txt('obj_grp').': '.$this->object->getTitle());
3200 
3201  include_once './Services/Tracking/classes/class.ilObjUserTracking.php';
3202  $this->show_tracking = (ilObjUserTracking::_enabledLearningProgress() and
3204  if($this->show_tracking)
3205  {
3206  include_once('./Services/Object/classes/class.ilObjectLP.php');
3207  $olp = ilObjectLP::getInstance($this->object->getId());
3208  $this->show_tracking = $olp->isActive();
3209  }
3210  if($this->show_tracking)
3211  {
3212  $this->lng->loadLanguageModule('trac');
3213  $list->addPreset('progress', $this->lng->txt('learning_progress'), true);
3214  }
3215 
3216  include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
3217  $privacy = ilPrivacySettings::_getInstance();
3218  if($privacy->enabledGroupAccessTimes())
3219  {
3220  $list->addPreset('access', $this->lng->txt('last_access'), true);
3221  }
3222 
3223  return $list;
3224  }
3225 
3226  public function getAttendanceListUserData($a_user_id)
3227  {
3228  $data = $this->members_data[$a_user_id];
3229  $data['access'] = $data['access_time'];
3230  $data['progress'] = $this->lng->txt($data['progress']);
3231 
3232  return $data;
3233  }
3234 
3236  {
3237  $list = $this->initAttendanceList();
3238  $list->initFromForm();
3239  $list->setCallback(array($this, 'getAttendanceListUserData'));
3240 
3241  $part = ilGroupParticipants::_getInstanceByObjId($this->object->getId());
3242  $this->members_data = $this->readMemberData($part->getParticipants());
3243  $list->getNonMemberUserData($this->members_data);
3244 
3245  echo $list->getFullscreenHTML();
3246  exit();
3247  }
3248 
3249 } // END class.ilObjGroupGUI
3250 ?>
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
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.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
setSubmitFormOnEnter($a_val)
Set submit form on enter.
static _lookupName($a_user_id)
lookup user name
exportMembersObject()
Exports group members to Microsoft Excel file.
setLatitude($a_latitude)
Set Latitude.
This class represents an option in a radio group.
setTitle($a_title)
Set Title.
print $file
static getRedirectTarget($gui, $cmd, Array $gui_params=array(), Array $mail_params=array())
renderObject()
Render group.
assignMemberObject()
displays confirmation formular with users that shall be assigned to group public ...
exit
Definition: login.php:54
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()
set sub tabs
$_POST['username']
Definition: cron.php:12
static getLinkTarget($gui, $cmd, Array $gui_params=array(), Array $mail_params=array())
load()
load settings
static _fieldsToInfoString($a_obj_id)
Fields to info string.
editInfoObject()
edit info
refuseFromListObject()
refuse from waiting list
const GRP_REGISTRATION_DEACTIVATED
removeFromList($a_usr_id)
remove usr from list
This class represents a property form user interface.
GUI class for the workflow of copying objects.
static getDefaultSettings()
Get default longitude, latitude and zoom.
const TITLE_LENGTH
max length of object title
const IL_GRP_ADMIN
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
initInfoEditor()
init info editor
This class represents a section header in a property form.
const LP_STATUS_NOT_ATTEMPTED
static isActivated()
Checks whether Google Map feature is activated.
editGroupIconsObject($a_form=null)
edit container icons
unsubscribeObject()
unsubscribe from group
editObject()
Edit object.
_getTranslation($a_role_title)
updateInfoObject()
update info
$cmd
Definition: sahs_server.php:35
membersGalleryObject()
Builds a group members gallery as a layer of left-floating images.
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.
This class represents a checkbox property in a property form.
static _lookupTitle($a_id)
lookup object title
editMapSettingsObject()
Edit Map Settings.
createObject()
create new object form
__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.
static getMemberRoles($a_ref_id)
Get member roles (not auto generated)
const IL_CAL_UNIX
_goto($a_target, $a_add="")
goto target group
const IL_GRP_MEMBER
const GRP_REGISTRATION_PASSWORD
setInfo($a_info)
Set Info.
initForm($a_mode='edit')
init create/edit form
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
updateGroupTypeObject()
change group type
const GRP_REGISTRATION_REQUEST
static _hasAccepted($a_usr_id, $a_obj_id)
Check if user has accepted agreement.
const GRP_TYPE_PUBLIC
setSubTabs($a_tab)
set sub tabs
const LP_STATUS_IN_PROGRESS
Base class for attendance lists.
addHeaderCommand($a_href, $a_text, $a_target="", $a_img="")
Add Header Command (Link) (Image needed for now)
Class ilExcelWriterAdapter.
global $ilCtrl
Definition: ilias.php:18
setInfo($a_info)
Set Information Text.
prepareOutput()
Handle member view.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
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
loadDate($a_field)
load date
This class represents a hidden form property in a property form.
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
sendMailToSelectedUsersObject()
show send mail
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
$GLOBALS['ct_recipient']
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.
Class Mail this class handles base functions for mail handling.
const GRP_TYPE_CLOSED
static _lookupObjId($a_id)
static makeClickable($a_text, $detectGotoLinks=false)
makeClickable In Texten enthaltene URLs und Mail-Adressen klickbar machen
setValue($a_value)
Set Value.
initCreateForm($a_new_type)
User interface class for google maps.
This class represents a location property in a property form.
getAttendanceListUserData($a_user_id)
This class represents a text property in a property form.
static formatDate(ilDateTime $date)
Format a date public.
static lookupSortModeFromParentContainer($a_obj_id)
Lookup sort mode from parent container.
Waiting list for groups.
Date and time handling
GUI class for course/group subscriptions.
forwardToStyleSheet()
Forward to style object.
& forwardToPageObject()
forward command to page object
redirection script todo: (a better solution should control the processing via a xml file) ...
_lookupLogin($a_user_id)
lookup login
updateStatusObject()
update status
global $ilIliasIniFile
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
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 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:86
deleteMembersObject()
delete members
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static _lookupType($a_id, $a_reference=false)
lookup object type
confirmDeleteMembersObject()
delete selected members
refuseApplicantsObject()
adds applicant to group as member public
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.
static checkForumsExistsDelete($ref_id, $user_id=0)
modifyItemGUI($a_item_list_gui, $a_item_data, $a_show_path)
Modify Item ListGUI for presentation in container.
setStartText($a_txt)
Set text, which will be shown before the start date.
static _lookupInProgressForObject($a_obj_id, $a_user_ids=null)
Get in progress users for object.
const IL_CAL_FKT_GETDATE
createMailSignature()
Create a course mail signature.
updateObject()
update GroupObject
_tracProgress($a_user_id, $a_obj_id, $a_ref_id, $a_obj_type='')
initAttendanceList()
Init attendance list object.
assignSubscribersObject()
assign subscribers
This class represents a custom property in a property form.
static _addDesktopItem($a_usr_id, $a_item_id, $a_type, $a_par="")
add an item to user&#39;s personal desktop
checkAgreement()
Check agreement and redirect if it is not accepted.
static generateCode()
Generate new registration key.
refuseSubscribersObject()
refuse subscribers
mailMembersObject()
Form for mail to group members.
initHeaderAction($a_sub_type=null, $a_sub_id=null)
global $ilUser
Definition: imgupload.php:15
static fillAutoCompleteToolbar($parent_object, ilToolbarGUI $toolbar=null, $a_options=array())
fill toolbar with
editMembersObject()
edit member(s)
membersMapObject()
Members map.
getContentStylePath($a_style_id)
get content style path
global $ilSetting
Definition: privfeed.php:40
static getInstance()
Get instance.
exportObject()
Creates the output form for group member export.
const MAIL_ALLOWED_ALL
This class represents a text area property in a property form.
readMemberData($ids, $role='admin', $selected_columns=null)
ilContainerGUI($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
Constructor public.
Class ilCourseContentGUI.
static initServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Init service settings form.
GUI class for course/group waiting list.
getCreationMode()
get creation mode
static _getIdsForTitle($title, $type='', $partialmatch=false)
updateMembersObject()
update members
Class ilContainerGUI.
putObjectInTree(ilObject $a_obj, $a_parent_node_id=null)
Add object to tree at given position.
Class ilObjGroup.
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 setRecipients(array $recipients)
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
static _getInstance()
Get instance of ilPrivacySettings.
assignFromWaitingListObject()
add from waiting list
GUI class for service settings (calendar, notes, comments)
setShowHidePrefs()
set preferences (show/hide tabel content)
static _lookupCompletedForObject($a_obj_id, $a_user_ids=null)
Get completed users for object.
static checkForumsExistsInsert($ref_id, $user_id=0)
saveObject()
save object
setValue($a_value)
Set Value.
_catchupWriteEvents($obj_id, $usr_id, $timestamp=null)
Catches up with all write events which occured before the specified timestamp.
static redirect($a_script)
http redirect to other script
const LP_STATUS_COMPLETED
getFormAction($a_cmd, $a_formaction="")
get form action for command (command is method name without "Object", e.g.
const GRP_REGISTRATION_DIRECT
editMemberObject()
edit one member
static getInstance($a_obj_id)
canceledObject()
canceledObject is called when operation is canceled, method links back public
addHeaderAction()
Add header action menu.
leaveObject()
leave Group public
_importFromFile($file, $parent_id)
Static used for importing an group from xml zip file.
Class ilObjUserTrackingGUI.
addUserObject($user_ids, $a_type)
displays confirmation formular with users that shall be assigned to group public ...
_recordWriteEvent($obj_id, $usr_id, $action, $parent_obj_id=null)
Records a write event.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
static formCheckbox($checked, $varname, $value, $disabled=false)
??? public
membersObject()
edit members
showRepTree($a_initial_call=false)
Show tree.
Confirmation screen class.
cleanString($str)
Clean output string from german umlauts.
static _getFields($a_container_id, $a_sort=IL_CDF_SORT_NAME)
Get all fields of a container.
saveNotificationObject()
:TEMP: Save notification setting (from infoscreen)