ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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  include_once("./Services/Link/classes/class.ilLink.php");
55  $ilNavigationHistory->addItem($_GET["ref_id"],
56  ilLink::_getLink($_GET["ref_id"], "grp"), "grp");
57  }
58 
59  switch($next_class)
60  {
61  case 'ilgroupregistrationgui':
62  $this->ctrl->setReturn($this,'');
63  $this->tabs_gui->setTabActive('join');
64  include_once('./Modules/Group/classes/class.ilGroupRegistrationGUI.php');
65  $registration = new ilGroupRegistrationGUI($this->object);
66  $this->ctrl->forwardCommand($registration);
67  break;
68 
69  case 'ilpermissiongui':
70  $this->tabs_gui->setTabActive('perm_settings');
71  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
72  $perm_gui =& new ilPermissionGUI($this);
73  $ret =& $this->ctrl->forwardCommand($perm_gui);
74  break;
75 
76  case 'ilrepositorysearchgui':
77 
78  if(!$this->checkPermissionBool('write'))
79  {
80  $GLOBALS['ilErr']->raiseError($GLOBALS['lng']->txt('permission_denied'), $GLOBALS['ilErr']->WARNING);
81  }
82  include_once('./Services/Search/classes/class.ilRepositorySearchGUI.php');
83  $rep_search =& new ilRepositorySearchGUI();
84  $rep_search->setCallback($this,
85  'addUserObject',
86  $this->getLocalRoles()
87  );
88 
89  // Set tabs
90  $this->tabs_gui->setTabActive('members');
91  $this->ctrl->setReturn($this,'members');
92  $ret =& $this->ctrl->forwardCommand($rep_search);
93  $this->setSubTabs('members');
94  $this->tabs_gui->setSubTabActive('members');
95  break;
96 
97  case "ilinfoscreengui":
98  $ret =& $this->infoScreen();
99  break;
100 
101  case "illearningprogressgui":
102  include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
103 
105  $this->object->getRefId(),
106  $_GET['user_id'] ? $_GET['user_id'] : $ilUser->getId());
107  $this->ctrl->forwardCommand($new_gui);
108  $this->tabs_gui->setTabActive('learning_progress');
109  break;
110 
111  case 'ilobjcoursegroupinggui':
112  $this->setSubTabs('settings');
113 
114  include_once './Modules/Course/classes/class.ilObjCourseGroupingGUI.php';
115  $this->ctrl->setReturn($this,'edit');
116  $crs_grp_gui =& new ilObjCourseGroupingGUI($this->object,(int) $_GET['obj_id']);
117  $this->ctrl->forwardCommand($crs_grp_gui);
118 
119  $this->tabs_gui->setTabActive('settings');
120  $this->tabs_gui->setSubTabActive('groupings');
121  break;
122 
123  case 'ilcoursecontentgui':
124 
125  include_once './Modules/Course/classes/class.ilCourseContentGUI.php';
126  $course_content_obj = new ilCourseContentGUI($this);
127  $this->ctrl->forwardCommand($course_content_obj);
128  break;
129 
130  case 'ilpublicuserprofilegui':
131  require_once './Services/User/classes/class.ilPublicUserProfileGUI.php';
132  $this->setSubTabs('members');
133  $this->tabs_gui->setTabActive('group_members');
134  $this->tabs_gui->setSubTabActive('grp_members_gallery');
135  $profile_gui = new ilPublicUserProfileGUI($_GET["user"]);
136  $profile_gui->setBackUrl($ilCtrl->getLinkTarget($this, "membersGallery"));
137  $html = $this->ctrl->forwardCommand($profile_gui);
138  $this->tpl->setVariable("ADM_CONTENT", $html);
139  break;
140 
141  case "ilcolumngui":
142  $this->tabs_gui->setTabActive('none');
143  $this->checkPermission("read");
144  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
145  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
146  ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId()));
147  $this->renderObject();
148  break;
149 
150  // container page editing
151  case "ilcontainerpagegui":
152  $ret = $this->forwardToPageObject();
153  if ($ret != "")
154  {
155  $this->tpl->setContent($ret);
156  }
157  break;
158 
159  case 'ilobjectcopygui':
160  include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
161  $cp = new ilObjectCopyGUI($this);
162  $cp->setType('grp');
163  $this->ctrl->forwardCommand($cp);
164  break;
165 
166  case "ilobjstylesheetgui":
167  $this->forwardToStyleSheet();
168  break;
169 
170  case 'ilobjectcustomuserfieldsgui':
171  if(isset($_REQUEST['member_id']))
172  {
173  $this->ctrl->setReturn($this,'members');
174  }
175  include_once './Services/Membership/classes/class.ilObjectCustomUserFieldsGUI.php';
176  $cdf_gui = new ilObjectCustomUserFieldsGUI($this->object->getId());
177  $this->setSubTabs('settings');
178  $this->tabs_gui->setTabActive('settings');
179  $this->ctrl->forwardCommand($cdf_gui);
180  break;
181 
182  case 'ilmemberagreementgui':
183  include_once('Services/Membership/classes/class.ilMemberAgreementGUI.php');
184  $this->ctrl->setReturn($this,'');
185  $this->tabs_gui->setTabActive('view_content');
186  $agreement = new ilMemberAgreementGUI($this->object->getRefId());
187  $this->ctrl->forwardCommand($agreement);
188  break;
189 
190  case 'ilexportgui':
191  $this->tabs_gui->setTabActive('export');
192  include_once './Services/Export/classes/class.ilExportGUI.php';
193  $exp = new ilExportGUI($this);
194  $exp->addFormat('xml');
195  $this->ctrl->forwardCommand($exp);
196  break;
197 
198  case 'ilmemberexportgui':
199  include_once('./Services/Membership/classes/Export/class.ilMemberExportGUI.php');
200 
201  $this->setSubTabs('members');
202  $this->tabs_gui->setTabActive('members');
203  $this->tabs_gui->setSubTabActive('export_members');
204  $export = new ilMemberExportGUI($this->object->getRefId());
205  $this->ctrl->forwardCommand($export);
206  break;
207 
208  case "ilcommonactiondispatchergui":
209  include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
211  $this->ctrl->forwardCommand($gui);
212  break;
213 
214  case 'ilobjectservicesettingsgui':
215  $this->ctrl->setReturn($this,'edit');
216  $this->setSubTabs("settings");
217  $this->tabs_gui->activateTab('settings');
218  $this->tabs_gui->activateSubTab('tool_settings');
219 
220  include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
221  $service = new ilObjectServiceSettingsGUI(
222  $this,
223  $this->object->getId(),
224  array(
226  ));
227  $this->ctrl->forwardCommand($service);
228  break;
229 
230  case 'ilsessionoverviewgui':
231  $this->setSubTabs('members');
232  $this->tabs_gui->setTabActive('members');
233  $this->tabs_gui->setSubTabActive('events');
234 
235  include_once './Modules/Group/classes/class.ilGroupParticipants.php';
236  $prt = ilGroupParticipants::_getInstanceByObjId($this->object->getId());
237 
238  include_once('./Modules/Session/classes/class.ilSessionOverviewGUI.php');
239  $overview = new ilSessionOverviewGUI($this->object->getRefId(), $prt);
240  $this->ctrl->forwardCommand($overview);
241  break;
242 
243  default:
244 
245  // check visible permission
246  if (!$this->getCreationMode() and
247  !$ilAccess->checkAccess('visible','',$this->object->getRefId(),'grp') and
248  !$ilAccess->checkAccess('read','',$this->object->getRefId(),'grp') )
249  {
250  $ilErr->raiseError($this->lng->txt("msg_no_perm_read"),$ilErr->MESSAGE);
251  }
252 
253  // #9401 - see also ilStartupGUI::_checkGoto()
254  if($cmd == 'infoScreenGoto')
255  {
256  if($this->object->isRegistrationEnabled())
257  {
258  $cmd = 'join';
259  }
260  else
261  {
262  $cmd = 'infoScreen';
263  }
264  }
265 
266  // check read permission
267  if ((!$this->getCreationMode()
268  && !$rbacsystem->checkAccess('read',$this->object->getRefId()) && $cmd != 'infoScreen')
269  || $cmd == 'join')
270  {
271  // no join permission -> redirect to info screen
272  if (!$rbacsystem->checkAccess('join',$this->object->getRefId()))
273  {
274  $this->ctrl->redirect($this, "infoScreen");
275  }
276  else // no read -> show registration
277  {
278  include_once('./Modules/Group/classes/class.ilGroupRegistrationGUI.php');
279  $this->ctrl->redirectByClass("ilGroupRegistrationGUI", "show");
280  }
281  }
282  if(!$cmd)
283  {
284  $cmd = 'view';
285  }
286  $cmd .= 'Object';
287  $this->$cmd();
288  break;
289  }
290 
291  $this->addHeaderAction();
292  }
293 
294  function viewObject()
295  {
296  global $tree,$rbacsystem,$ilUser;
297 
298  include_once 'Services/Tracking/classes/class.ilLearningProgress.php';
299  ilLearningProgress::_tracProgress($ilUser->getId(),$this->object->getId(),
300  $this->object->getRefId(),'grp');
301 
302  if (strtolower($_GET["baseClass"]) == "iladministrationgui")
303  {
304  parent::viewObject();
305  return true;
306  }
307 
308  if(!$this->checkAgreement())
309  {
310  include_once('Services/Membership/classes/class.ilMemberAgreementGUI.php');
311  $this->tabs_gui->setTabActive('view_content');
312  $this->ctrl->setReturn($this,'view');
313  $agreement = new ilMemberAgreementGUI($this->object->getRefId());
314  $this->ctrl->setCmdClass(get_class($agreement));
315  $this->ctrl->forwardCommand($agreement);
316  return true;
317  }
318 
319  $this->tabs_gui->setTabActive('view_content');
320  $this->renderObject();
321  }
322 
326  function renderObject()
327  {
328  global $ilTabs;
329 
330  $ilTabs->activateTab("view_content");
331  $ret = parent::renderObject();
332  return $ret;
333 
334  }
335 
339  function modifyItemGUI($a_item_list_gui, $a_item_data, $a_show_path)
340  {
341  global $tree;
342 
343  // if folder is in a course, modify item list gui according to course requirements
344  if ($course_ref_id = $tree->checkForParentType($this->object->getRefId(),'crs'))
345  {
346  include_once("./Modules/Course/classes/class.ilObjCourse.php");
347  include_once("./Modules/Course/classes/class.ilObjCourseGUI.php");
348  $course_obj_id = ilObject::_lookupObjId($course_ref_id);
349  ilObjCourseGUI::_modifyItemGUI($a_item_list_gui,'ilcoursecontentgui',$a_item_data, $a_show_path,
350  ilObjCourse::_lookupAboStatus($course_obj_id), $course_ref_id, $course_obj_id,
351  $this->object->getRefId());
352  }
353  }
354 
355  protected function initCreateForm($a_new_type)
356  {
357  if(!is_object($this->object))
358  {
359  $this->object = new ilObjGroup();
360  }
361 
362  $this->initForm('create');
363  return $this->form;
364  }
365 
373  public function saveObject()
374  {
375  global $ilErr,$ilUser,$tree;
376 
377  $this->object = new ilObjGroup();
378 
379  // we reduced the form, only 3 values left
380  // $this->load();
381 
382  $grp_type = ilUtil::stripSlashes($_POST['grp_type']);
383  switch($grp_type)
384  {
385  case GRP_TYPE_PUBLIC:
386  $this->object->setRegistrationType(GRP_REGISTRATION_DIRECT);
387  break;
388 
389  default:
390  $this->object->setRegistrationType(GRP_REGISTRATION_DEACTIVATED);
391  break;
392  }
393  $this->object->setTitle(ilUtil::stripSlashes($_POST['title']));
394  $this->object->setDescription(ilUtil::stripSlashes($_POST['desc']));
395  $this->object->setGroupType(ilUtil::stripSlashes($_POST['grp_type']));
396  $this->object->setViewMode(ilContainer::VIEW_INHERIT);
397 
398  $ilErr->setMessage('');
399 
400  if(!$this->object->validate())
401  {
402  $err = $this->lng->txt('err_check_input');
403  ilUtil::sendFailure($err);
404  $err = $ilErr->getMessage();
405  ilUtil::sendInfo($err);
406  $this->createObject();
407  return true;
408  }
409 
410  $this->object->create();
411  $this->putObjectInTree($this->object, $_GET["ref_id"]);
412  $this->object->initGroupStatus($this->object->getGroupType());
413 
414  // check for parent group or course => SORT_INHERIT
415  $sort_mode = ilContainer::SORT_TITLE;
416  if(
417  $GLOBALS['tree']->checkForParentType($this->object->getRefId(),'crs') ||
418  $GLOBALS['tree']->checkForParentType($this->object->getRefId(),'grp')
419  )
420  {
421  $sort_mode = ilContainer::SORT_INHERIT;
422  }
423  // Save sorting
424  include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
425  $sort = new ilContainerSortingSettings($this->object->getId());
426  $sort->setSortMode($sort_mode);
427  $sort->update();
428 
429 
430  // Add user as admin and enable notification
431  include_once('./Modules/Group/classes/class.ilGroupParticipants.php');
432  $members_obj = ilGroupParticipants::_getInstanceByObjId($this->object->getId());
433  $members_obj->add($ilUser->getId(),IL_GRP_ADMIN);
434  $members_obj->updateNotification($ilUser->getId(),1);
435 
436 
437  ilUtil::sendSuccess($this->lng->txt("grp_added"),true);
438  $this->ctrl->setParameter($this,'ref_id',$this->object->getRefId());
439  $this->ctrl->redirect($this, "edit");
440  }
441 
449  public function editObject()
450  {
451  $this->checkPermission("write");
452 
453  $this->setSubTabs('settings');
454  $this->tabs_gui->setTabActive('settings');
455  $this->tabs_gui->setSubTabActive('grp_settings');
456 
457  $this->initForm('edit');
458 
459  $this->tpl->setVariable('ADM_CONTENT',$this->form->getHTML());
460  }
461 
469  public function updateGroupTypeObject()
470  {
471  $type = $this->object->getGroupType() ?
472  $this->object->getGroupType() :
473  $this->object->readGroupStatus();
474 
475  if($type == GRP_TYPE_PUBLIC)
476  {
477  $this->object->setGroupType(GRP_TYPE_CLOSED);
478  }
479  else
480  {
481  $this->object->setGroupType(GRP_TYPE_PUBLIC);
482  }
483  $this->object->updateGroupType();
484  $this->object->update();
485  ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
486  $this->ctrl->redirect($this,'edit');
487  }
488 
489 
495  public function updateObject()
496  {
497  global $ilErr;
498 
499  $this->checkPermission('write');
500 
501 
502  $this->initForm();
503  $this->form->checkInput();
504 
505  $old_type = $this->object->getGroupType();
506 
507  $this->load();
508  $ilErr->setMessage('');
509 
510  if(!$this->object->validate())
511  {
512  $err = $this->lng->txt('err_check_input');
513  ilUtil::sendFailure($err);
514  $err = $ilErr->getMessage();
515  ilUtil::sendInfo($err);
516  $this->editObject();
517  return true;
518  }
519 
520  $modified = false;
521  if($this->object->isGroupTypeModified($old_type))
522  {
523  $modified = true;
524  $this->object->setGroupType($old_type);
525  }
526 
527  $this->object->update();
528 
529 
530  include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
532  $this->object->getId(),
533  $this->form,
534  array(
539  )
540  );
541 
542  // Save sorting
543  $this->saveSortingSettings($this->form);
544 
545  // BEGIN ChangeEvents: Record update Object.
546  require_once('Services/Tracking/classes/class.ilChangeEvent.php');
547  global $ilUser;
548  ilChangeEvent::_recordWriteEvent($this->object->getId(), $ilUser->getId(), 'update');
549  ilChangeEvent::_catchupWriteEvents($this->object->getId(), $ilUser->getId());
550  // END PATCH ChangeEvents: Record update Object.
551 
552  // Update ecs export settings
553  include_once 'Modules/Group/classes/class.ilECSGroupSettings.php';
554  $ecs = new ilECSGroupSettings($this->object);
555  $ecs->handleSettingsUpdate();
556 
557  if($modified)
558  {
559  include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
560  ilUtil::sendQuestion($this->lng->txt('grp_warn_grp_type_changed'));
561  $confirm = new ilConfirmationGUI();
562  $confirm->setFormAction($this->ctrl->getFormAction($this));
563  $confirm->addItem(
564  'grp_type',
565  $this->object->getGroupType(),
566  $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'))
567  );
568  $confirm->addButton($this->lng->txt('grp_change_type'), 'updateGroupType');
569  $confirm->setCancel($this->lng->txt('cancel'), 'edit');
570 
571  $this->tpl->setContent($confirm->getHTML());
572  return true;
573  }
574  else
575  {
576  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"),true);
577  $this->ctrl->redirect($this,'edit');
578  return true;
579  }
580  }
581 
585  public function editGroupIconsObject($a_form = null)
586  {
587  global $tpl;
588 
589  $this->checkPermission('write');
590 
591  $this->setSubTabs("settings");
592  $this->tabs_gui->setTabActive('settings');
593  $this->tabs_gui->setSubTabActive('grp_icon_settings');
594 
595  if(!$a_form)
596  {
597  $a_form = $this->initGroupIconsForm();
598  }
599 
600  $tpl->setContent($a_form->getHTML());
601  }
602 
604  {
605  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
606  $form = new ilPropertyFormGUI();
607  $form->setFormAction($this->ctrl->getFormAction($this));
608 
609  $this->showCustomIconsEditing(1, $form);
610 
611  // $form->setTitle($this->lng->txt('edit_grouping'));
612  $form->addCommandButton('updateGroupIcons', $this->lng->txt('save'));
613 
614  return $form;
615  }
616 
623  public function updateGroupIconsObject()
624  {
625  global $ilSetting;
626 
627  $this->checkPermission('write');
628 
629  $form = $this->initGroupIconsForm();
630  if($form->checkInput())
631  {
632  //save custom icons
633  if ($ilSetting->get("custom_icons"))
634  {
635  if($_POST["cont_icon_delete"])
636  {
637  $this->object->removeCustomIcon();
638  }
639  $this->object->saveIcons($_FILES["cont_icon"]['tmp_name']);
640  }
641  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"),true);
642  $this->ctrl->redirect($this,"editGroupIcons");
643  }
644 
645  $form->setValuesByPost();
646  $this->editGroupIconsObject($form);
647  }
648 
652  public function editMapSettingsObject()
653  {
654  global $ilUser, $ilCtrl, $ilUser, $ilAccess;
655 
656  $this->setSubTabs("settings");
657  $this->tabs_gui->setTabActive('settings');
658  $this->tabs_gui->setSubTabActive('grp_map_settings');
659 
660  include_once('./Services/Maps/classes/class.ilMapUtil.php');
661  if (!ilMapUtil::isActivated() ||
662  !$ilAccess->checkAccess("write", "", $this->object->getRefId()))
663  {
664  return;
665  }
666 
667  $latitude = $this->object->getLatitude();
668  $longitude = $this->object->getLongitude();
669  $zoom = $this->object->getLocationZoom();
670 
671  // Get Default settings, when nothing is set
672  if ($latitude == 0 && $longitude == 0 && $zoom == 0)
673  {
675  $latitude = $def["latitude"];
676  $longitude = $def["longitude"];
677  $zoom = $def["zoom"];
678  }
679 
680 
681  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
682  $form = new ilPropertyFormGUI();
683  $form->setFormAction($ilCtrl->getFormAction($this));
684 
685  $form->setTitle($this->lng->txt("grp_map_settings"));
686 
687  // enable map
688  $public = new ilCheckboxInputGUI($this->lng->txt("grp_enable_map"),
689  "enable_map");
690  $public->setValue("1");
691  $public->setChecked($this->object->getEnableGroupMap());
692  $form->addItem($public);
693 
694  // map location
695  $loc_prop = new ilLocationInputGUI($this->lng->txt("grp_map_location"),
696  "location");
697  $loc_prop->setLatitude($latitude);
698  $loc_prop->setLongitude($longitude);
699  $loc_prop->setZoom($zoom);
700  $form->addItem($loc_prop);
701 
702  $form->addCommandButton("saveMapSettings", $this->lng->txt("save"));
703 
704  $this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
705  }
706 
707  public function saveMapSettingsObject()
708  {
709  global $ilCtrl, $ilUser;
710 
711  $this->object->setLatitude(ilUtil::stripSlashes($_POST["location"]["latitude"]));
712  $this->object->setLongitude(ilUtil::stripSlashes($_POST["location"]["longitude"]));
713  $this->object->setLocationZoom(ilUtil::stripSlashes($_POST["location"]["zoom"]));
714  $this->object->setEnableGroupMap(ilUtil::stripSlashes($_POST["enable_map"]));
715  $this->object->update();
716 
717  $ilCtrl->redirect($this, "editMapSettings");
718  }
719 
723  public function membersMapObject()
724  {
725  global $tpl;
726 
727  $this->setSubTabs('members');
728  $this->tabs_gui->setTabActive('members');
729 
730  include_once("./Services/Maps/classes/class.ilMapUtil.php");
731  if (!ilMapUtil::isActivated() || !$this->object->getEnableGroupMap())
732  {
733  return;
734  }
735 
736  $map = ilMapUtil::getMapGUI();
737  $map->setMapId("group_map")
738  ->setWidth("700px")
739  ->setHeight("500px")
740  ->setLatitude($this->object->getLatitude())
741  ->setLongitude($this->object->getLongitude())
742  ->setZoom($this->object->getLocationZoom())
743  ->setEnableTypeControl(true)
744  ->setEnableNavigationControl(true)
745  ->setEnableCentralMarker(true);
746 
747 
748  $member_ids = $this->object->getGroupMemberIds();
749  $admin_ids = $this->object->getGroupAdminIds();
750 
751  // fetch all users data in one shot to improve performance
752  $members = $this->object->getGroupMemberData($member_ids);
753  foreach($member_ids as $user_id)
754  {
755  $map->addUserMarker($user_id);
756  }
757  $tpl->setContent($map->getHTML());
758  $tpl->setLeftContent($map->getUserListHTML());
759  }
760 
761 
768  public function editInfoObject()
769  {
770  global $ilErr,$ilAccess;
771 
772  $this->checkPermission('write');
773 
774  $this->setSubTabs('settings');
775  $this->tabs_gui->setTabActive('settings');
776  $this->tabs_gui->setSubTabActive('grp_info_settings');
777 
778  $this->initInfoEditor();
779  $this->tpl->setContent($this->form->getHTML());
780  }
781 
788  protected function initInfoEditor()
789  {
790  if(is_object($this->form))
791  {
792  return true;
793  }
794 
795  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
796  $this->form = new ilPropertyFormGUI();
797  $this->form->setFormAction($this->ctrl->getFormAction($this,'updateInfo'));
798  $this->form->setTitle($this->lng->txt('grp_general_informations'));
799  $this->form->addCommandButton('updateInfo',$this->lng->txt('save'));
800  $this->form->addCommandButton('cancel',$this->lng->txt('cancel'));
801 
802  $area = new ilTextAreaInputGUI($this->lng->txt('grp_information'),'important');
803  $area->setInfo($this->lng->txt('grp_information_info'));
804  $area->setValue($this->object->getInformation());
805  $area->setRows(8);
806  $area->setCols(80);
807  $this->form->addItem($area);
808  }
809 
816  public function updateInfoObject()
817  {
818  $this->checkPermission('write');
819 
820  $this->object->setInformation(ilUtil::stripSlashes($_POST['important']));
821  $this->object->update();
822 
823  ilUtil::sendSuccess($this->lng->txt("settings_saved"));
824  $this->editInfoObject();
825  return true;
826  }
827 
829 
834  public function membersGalleryObject()
835  {
836  global $rbacsystem, $ilAccess, $ilUser, $ilToolbar;
837 
838  $is_admin = (bool) $rbacsystem->checkAccess("write", $this->object->getRefId());
839 
840  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.crs_members_gallery.html','Modules/Course');
841 
842  $this->setSubTabs('members');
843  $this->tabs_gui->setTabActive('members');
844 
845  $member_ids = $this->object->getGroupMemberIds();
846  $admin_ids = $this->object->getGroupAdminIds();
847 
848  // fetch all users data in one shot to improve performance
849  $members = $this->object->getGroupMemberData($member_ids);
850 
851  $this->addMailToMemberButton($ilToolbar, "membersGallery");
852 
853  // MEMBERS
854  if(count($members))
855  {
856  $ordered_members = array();
857 
858  foreach($members as $member)
859  {
860  // get user object
861  if(!($usr_obj = ilObjectFactory::getInstanceByObjId($member["id"],false)))
862  {
863  continue;
864  }
865 
866  if(!$usr_obj->getActive())
867  {
868  continue;
869  }
870 
871  // please do not use strtoupper on first/last name for output
872  // this messes up with some unicode characters, i guess
873  // depending on php verion, alex
874  array_push($ordered_members,array("id" => $member["id"],
875  "login" => $usr_obj->getLogin(),
876  "lastname" => $usr_obj->getLastName(),
877  "firstname" => $usr_obj->getFirstName(),
878  "sortlastname" => strtoupper($usr_obj->getLastName()).strtoupper($usr_obj->getFirstName()),
879  "usr_obj" => $usr_obj));
880  }
881 
882  $ordered_members=ilUtil::sortArray($ordered_members,"sortlastname","asc");
883 
884  foreach($ordered_members as $member) {
885 
886  $usr_obj = $member["usr_obj"];
887 
888  $public_profile = $usr_obj->getPref("public_profile");
889  if ($public_profile == "g")
890  {
891  $public_profile = "y";
892  }
893 
894  // SET LINK TARGET FOR USER PROFILE
895  $this->ctrl->setParameterByClass("ilpublicuserprofilegui", "user", $member["id"]);
896  $profile_target = $this->ctrl->getLinkTargetByClass("ilpublicuserprofilegui","getHTML");
897 
898  // GET USER IMAGE
899  $file = $usr_obj->getPersonalPicturePath("xsmall");
900 
901  switch(in_array($member["id"],$admin_ids))
902  {
903  //admins
904  case 1:
905  if ($public_profile == "y")
906  {
907  $this->tpl->setCurrentBlock("member_linked");
908  $this->tpl->setVariable("LINK_PROFILE", $profile_target);
909  $this->tpl->setVariable("SRC_USR_IMAGE", $file);
910  $this->tpl->parseCurrentBlock();
911  }
912  else
913  {
914  $this->tpl->setCurrentBlock("member_not_linked");
915  $this->tpl->setVariable("SRC_USR_IMAGE", $file);
916  $this->tpl->parseCurrentBlock();
917  }
918  $this->tpl->setCurrentBlock("member");
919  break;
920 
921  case 0:
922  if ($public_profile == "y")
923  {
924  $this->tpl->setCurrentBlock("member_linked");
925  $this->tpl->setVariable("LINK_PROFILE", $profile_target);
926  $this->tpl->setVariable("SRC_USR_IMAGE", $file);
927  $this->tpl->parseCurrentBlock();
928  }
929  else
930  {
931  $this->tpl->setCurrentBlock("member_not_linked");
932  $this->tpl->setVariable("SRC_USR_IMAGE", $file);
933  $this->tpl->parseCurrentBlock();
934  }
935  $this->tpl->setCurrentBlock("member");
936  break;
937  }
938 
939  if (in_array($member["id"],$admin_ids)) {
940  $this->tpl->setVariable("MEMBER_CLASS", "il_Admin");
941  }
942  else {
943  $this->tpl->setVariable("MEMBER_CLASS", "il_Member");
944  }
945 
946 
947  // do not show name, if public profile is not activated
948  if ($public_profile == "y")
949  {
950  $this->tpl->setVariable("FIRSTNAME", $member["firstname"]);
951  $this->tpl->setVariable("LASTNAME", $member["lastname"]);
952  }
953  $this->tpl->setVariable("LOGIN", $usr_obj->getLogin());
954  $this->tpl->parseCurrentBlock();
955  }
956  $this->tpl->setCurrentBlock("members");
957  //$this->tpl->setVariable("MEMBERS_TABLE_HEADER",$this->lng->txt('crs_members_title'));
958  $this->tpl->parseCurrentBlock();
959  }
960 
961  $this->tpl->setVariable("TITLE",$this->lng->txt('crs_members_print_title'));
962  $this->tpl->setVariable("CSS_PATH",ilUtil::getStyleSheetLocation());
963  }
964 
965 
966  public function readMemberData($ids,$role = 'admin',$selected_columns = null)
967  {
968  include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
969  $privacy = ilPrivacySettings::_getInstance();
970 
971  if($this->show_tracking)
972  {
973  include_once 'Services/Tracking/classes/class.ilLPStatusWrapper.php';
974  $completed = ilLPStatusWrapper::_lookupCompletedForObject($this->object->getId());
975  $in_progress = ilLPStatusWrapper::_lookupInProgressForObject($this->object->getId());
976  $failed = ilLPStatusWrapper::_lookupFailedForObject($this->object->getId());
977  }
978 
979  if($privacy->enabledGroupAccessTimes())
980  {
981  include_once('./Services/Tracking/classes/class.ilLearningProgress.php');
982  $progress = ilLearningProgress::_lookupProgressByObjId($this->object->getId());
983  }
984 
985  $do_prtf = (is_array($selected_columns) &&
986  in_array('prtf', $selected_columns) &&
987  is_array($ids));
988  if($do_prtf)
989  {
990  include_once "Modules/Portfolio/classes/class.ilObjPortfolio.php";
992  $this->ctrl->getLinkTarget($this, "members"));
993  }
994 
995  foreach($ids as $usr_id)
996  {
997  $name = ilObjUser::_lookupName($usr_id);
998  $tmp_data['firstname'] = $name['firstname'];
999  $tmp_data['lastname'] = $name['lastname'];
1000  $tmp_data['login'] = ilObjUser::_lookupLogin($usr_id);
1001  $tmp_data['notification'] = $this->object->members_obj->isNotificationEnabled($usr_id) ? 1 : 0;
1002  $tmp_data['usr_id'] = $usr_id;
1003  $tmp_data['login'] = ilObjUser::_lookupLogin($usr_id);
1004 
1005  if($this->show_tracking)
1006  {
1007  if(in_array($usr_id,$completed))
1008  {
1009  $tmp_data['progress'] = ilLPStatus::LP_STATUS_COMPLETED;
1010  }
1011  elseif(in_array($usr_id,$in_progress))
1012  {
1013  $tmp_data['progress'] = ilLPStatus::LP_STATUS_IN_PROGRESS;
1014  }
1015  elseif(in_array($usr_id,$failed))
1016  {
1017  $tmp_data['progress'] = ilLPStatus::LP_STATUS_FAILED;
1018  }
1019  else
1020  {
1021  $tmp_data['progress'] = ilLPStatus::LP_STATUS_NOT_ATTEMPTED;
1022  }
1023  }
1024 
1025  if($privacy->enabledGroupAccessTimes())
1026  {
1027  if(isset($progress[$usr_id]['ts']) and $progress[$usr_id]['ts'])
1028  {
1029  $tmp_data['access_time'] = ilDatePresentation::formatDate(
1030  $tmp_date = new ilDateTime($progress[$usr_id]['ts'],IL_CAL_UNIX));
1031  $tmp_data['access_time_unix'] = $tmp_date->get(IL_CAL_UNIX);
1032  }
1033  else
1034  {
1035  $tmp_data['access_time'] = $this->lng->txt('no_date');
1036  $tmp_data['access_time_unix'] = 0;
1037  }
1038  }
1039 
1040  if($do_prtf)
1041  {
1042  $tmp_data['prtf'] = $all_prtf[$usr_id];
1043  }
1044 
1045  $members[$usr_id] = $tmp_data;
1046  }
1047  return $members ? $members : array();
1048  }
1049 
1056  public function membersObject()
1057  {
1058  global $ilUser, $ilToolbar, $lng, $ilCtrl;
1059 
1060  include_once('./Modules/Group/classes/class.ilGroupParticipants.php');
1061  include_once('./Modules/Group/classes/class.ilGroupParticipantsTableGUI.php');
1062 
1063  $this->checkPermission('write');
1064 
1065  include_once './Services/Tracking/classes/class.ilObjUserTracking.php';
1066  $this->show_tracking = (ilObjUserTracking::_enabledLearningProgress() and
1068  if($this->show_tracking)
1069  {
1070  include_once('./Services/Object/classes/class.ilObjectLP.php');
1071  $olp = ilObjectLP::getInstance($this->object->getId());
1072  $this->show_tracking = $olp->isActive();
1073  }
1074 
1075  $part = ilGroupParticipants::_getInstanceByObjId($this->object->getId());
1076 
1077  $this->setSubTabs('members');
1078  $this->tabs_gui->setTabActive('members');
1079  $this->tabs_gui->setSubTabActive('grp_edit_members');
1080 
1081  $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.grp_edit_members.html','Modules/Group');
1082  $this->tpl->setVariable('FORMACTION',$this->ctrl->getFormAction($this));
1083 
1084  // add members
1085  include_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
1087  $this,
1088  $ilToolbar,
1089  array(
1090  'auto_complete_name' => $lng->txt('user'),
1091  'user_type' => $this->getLocalRoles(),
1092  'submit_name' => $lng->txt('add')
1093  )
1094  );
1095 
1096  // spacer
1097  $ilToolbar->addSeparator();
1098 
1099  // search button
1100  $ilToolbar->addButton($this->lng->txt("grp_search_users"),
1101  $this->ctrl->getLinkTargetByClass('ilRepositorySearchGUI','start'));
1102 
1103  $ilToolbar->addSeparator();
1104 
1105  // print button
1106  $ilToolbar->addButton($this->lng->txt("grp_print_list"),
1107  $this->ctrl->getLinkTarget($this, 'printMembers'));
1108 
1109  $this->addMailToMemberButton($ilToolbar, "members", true);
1110 
1111  $this->setShowHidePrefs();
1112 
1113 
1114  // Waiting list table
1115  include_once('./Modules/Group/classes/class.ilGroupWaitingList.php');
1116  $waiting_list = new ilGroupWaitingList($this->object->getId());
1117  if(count($wait = $waiting_list->getAllUsers()))
1118  {
1119  include_once('./Services/Membership/classes/class.ilWaitingListTableGUI.php');
1120  if($ilUser->getPref('grp_wait_hide'))
1121  {
1122  $table_gui = new ilWaitingListTableGUI($this,$waiting_list,false);
1123  $this->ctrl->setParameter($this,'wait_hide',0);
1124  $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,'members'),
1125  $this->lng->txt('show'));
1126  $this->ctrl->clearParameters($this);
1127  }
1128  else
1129  {
1130  $table_gui = new ilWaitingListTableGUI($this,$waiting_list,true);
1131  $this->ctrl->setParameter($this,'wait_hide',1);
1132  $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,'members'),
1133  $this->lng->txt('hide'));
1134  $this->ctrl->clearParameters($this);
1135  }
1136  $table_gui->setUsers($wait);
1137  $table_gui->setTitle($this->lng->txt('grp_header_waiting_list'),'icon_usr.svg',$this->lng->txt('group_new_registrations'));
1138  $this->tpl->setVariable('TABLE_SUB',$table_gui->getHTML());
1139  }
1140 
1141 
1142  // Subscriber table
1143  if($part->getSubscribers())
1144  {
1145  include_once('./Services/Membership/classes/class.ilSubscriberTableGUI.php');
1146  if($ilUser->getPref('grp_subscriber_hide'))
1147  {
1148  $table_gui = new ilSubscriberTableGUI($this,false);
1149  $this->ctrl->setParameter($this,'subscriber_hide',0);
1150  $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,'members'),
1151  $this->lng->txt('show'));
1152  $this->ctrl->clearParameters($this);
1153  }
1154  else
1155  {
1156  $table_gui = new ilSubscriberTableGUI($this,true);
1157  $this->ctrl->setParameter($this,'subscriber_hide',1);
1158  $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,'members'),
1159  $this->lng->txt('hide'));
1160  $this->ctrl->clearParameters($this);
1161  }
1162  $table_gui->readSubscriberData();
1163  $table_gui->setTitle($this->lng->txt('group_new_registrations'),'icon_usr.svg',$this->lng->txt('group_new_registrations'));
1164  $this->tpl->setVariable('TABLE_SUB',$table_gui->getHTML());
1165  }
1166 
1167  if(count($part->getAdmins()))
1168  {
1169  if($ilUser->getPref('grp_admin_hide'))
1170  {
1171  $table_gui = new ilGroupParticipantsTableGUI($this,'admin',false,false);
1172  $this->ctrl->setParameter($this,'admin_hide',0);
1173  $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,'members'),
1174  $this->lng->txt('show'));
1175  $this->ctrl->clearParameters($this);
1176  }
1177  else
1178  {
1179  $table_gui = new ilGroupParticipantsTableGUI($this,'admin',true,false);
1180  $this->ctrl->setParameter($this,'admin_hide',1);
1181  $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,'members'),
1182  $this->lng->txt('hide'));
1183  $this->ctrl->clearParameters($this);
1184  }
1185  $table_gui->setTitle($this->lng->txt('grp_admins'),'icon_usr.svg',$this->lng->txt('grp_admins'));
1186  $table_gui->parse($this->readMemberData($part->getAdmins()));
1187  $this->tpl->setVariable('ADMINS',$table_gui->getHTML());
1188  }
1189 
1190  if($GLOBALS['rbacreview']->getNumberOfAssignedUsers(array($this->object->getDefaultMemberRole())))
1191  {
1192  if($ilUser->getPref('grp_member_hide'))
1193  {
1194  $table_gui = new ilGroupParticipantsTableGUI($this,'member',false,$this->show_tracking,$this->object->getDEfaultMemberRole());
1195  $this->ctrl->setParameter($this,'member_hide',0);
1196  $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,'members'),
1197  $this->lng->txt('show'));
1198  $this->ctrl->clearParameters($this);
1199  }
1200  else
1201  {
1202  $table_gui = new ilGroupParticipantsTableGUI($this,'member',true,$this->show_tracking,$this->object->getDefaultMemberRole());
1203  $this->ctrl->setParameter($this,'member_hide',1);
1204  $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,'members'),
1205  $this->lng->txt('hide'));
1206  $this->ctrl->clearParameters($this);
1207  }
1208 
1209  $table_gui->setTitle($this->lng->txt('grp_members'),'icon_usr.svg',$this->lng->txt('grp_members'));
1210  $table_gui->parse($this->readMemberData($GLOBALS['rbacreview']->assignedUsers($this->object->getDefaultMemberRole()),
1211  null, $table_gui->getSelectedColumns()));
1212  $this->tpl->setCurrentBlock('member_block');
1213  $this->tpl->setVariable('MEMBERS',$table_gui->getHTML());
1214  $this->tpl->parseCurrentBlock();
1215  }
1216 
1217  foreach(ilGroupParticipants::getMemberRoles($this->object->getRefId()) as $role_id)
1218  {
1219  // Do not show table if no user is assigned
1220  if(!($GLOBALS['rbacreview']->getNumberOfAssignedUsers(array($role_id))))
1221  {
1222  continue;
1223  }
1224  if($ilUser->getPref('grp_role_hide'.$role_id))
1225  {
1226  $table_gui = new ilGroupParticipantsTableGUI($this,'role',false,$this->show_tracking,$role_id);
1227  $this->ctrl->setParameter($this,'role_hide_'.$role_id,0);
1228  $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,'members'),
1229  $this->lng->txt('show'));
1230  $this->ctrl->clearParameters($this);
1231  }
1232  else
1233  {
1234  $table_gui = new ilGroupParticipantsTableGUI($this,'role',true,$this->show_tracking,$role_id);
1235  $this->ctrl->setParameter($this,'role_hide_'.$role_id,1);
1236  $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,'members'),
1237  $this->lng->txt('hide'));
1238  $this->ctrl->clearParameters($this);
1239  }
1240 
1241  $table_gui->setTitle(ilObject::_lookupTitle($role_id),'icon_usr.gif',ilObject::_lookupTitle($role_id));
1242  $table_gui->parse($this->readMemberData($GLOBALS['rbacreview']->assignedUsers($role_id)));
1243  $this->tpl->setCurrentBlock('member_block');
1244  $this->tpl->setVariable('MEMBERS',$table_gui->getHTML());
1245  $this->tpl->parseCurrentBlock();
1246  }
1247 
1248  $this->tpl->setVariable('TXT_SELECTED_USER',$this->lng->txt('grp_selected_users'));
1249  $this->tpl->setVariable('BTN_FOOTER_EDIT',$this->lng->txt('edit'));
1250  $this->tpl->setVariable('BTN_FOOTER_VAL',$this->lng->txt('remove'));
1251  $this->tpl->setVariable('BTN_FOOTER_MAIL',$this->lng->txt('grp_mem_send_mail'));
1252  $this->tpl->setVariable('ARROW_DOWN',ilUtil::getImagePath('arrow_downright.svg'));
1253 
1254  }
1255 
1262  public function assignSubscribersObject()
1263  {
1264  global $lng, $ilIliasIniFile,$ilUser;
1265 
1266  $this->checkPermission('write');
1267 
1268  if(!count($_POST['subscribers']))
1269  {
1270  ilUtil::sendFailure($this->lng->txt('no_checkbox'));
1271  $this->membersObject();
1272  return false;
1273  }
1274 
1275  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1276  foreach($_POST['subscribers'] as $usr_id)
1277  {
1278  $this->object->members_obj->sendNotification(
1280  $usr_id
1281  );
1282 
1283  $this->object->members_obj->add($usr_id,IL_GRP_MEMBER);
1284  $this->object->members_obj->deleteSubscriber($usr_id);
1285 
1286  }
1287  ilUtil::sendSuccess($this->lng->txt("grp_msg_applicants_assigned"),true);
1288  $this->ctrl->redirect($this,'members');
1289  return true;
1290  }
1291 
1298  public function refuseSubscribersObject()
1299  {
1300  global $lng;
1301 
1302  $this->checkPermission('write');
1303 
1304  if(!count($_POST['subscribers']))
1305  {
1306  ilUtil::sendFailure($this->lng->txt('no_checkbox'));
1307  $this->membersObject();
1308  return false;
1309  }
1310 
1311  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1312  foreach($_POST['subscribers'] as $usr_id)
1313  {
1314  $this->object->members_obj->sendNotification(
1316  $usr_id
1317  );
1318  $this->object->members_obj->deleteSubscriber($usr_id);
1319  }
1320  ilUtil::sendSuccess($this->lng->txt("grp_msg_applicants_removed"));
1321  $this->membersObject();
1322  return true;
1323 
1324  }
1325 
1334  {
1335  $this->checkPermission('write');
1336 
1337  if(!count($_POST["waiting"]))
1338  {
1339  ilUtil::sendFailure($this->lng->txt("no_checkbox"));
1340  $this->membersObject();
1341  return false;
1342  }
1343 
1344  include_once('./Modules/Group/classes/class.ilGroupWaitingList.php');
1345  $waiting_list = new ilGroupWaitingList($this->object->getId());
1346 
1347  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1348 
1349  $added_users = 0;
1350  foreach($_POST["waiting"] as $user_id)
1351  {
1352  if(!$tmp_obj = ilObjectFactory::getInstanceByObjId($user_id,false))
1353  {
1354  continue;
1355  }
1356  if($this->object->members_obj->isAssigned($user_id))
1357  {
1358  continue;
1359  }
1360  $this->object->members_obj->add($user_id,IL_GRP_MEMBER);
1361  $this->object->members_obj->sendNotification(
1363  $user_id
1364  );
1365  $waiting_list->removeFromList($user_id);
1366 
1367  ++$added_users;
1368  }
1369  if($added_users)
1370  {
1371  ilUtil::sendSuccess($this->lng->txt("grp_users_added"), true);
1372  $this->ctrl->redirect($this, "members");
1373 
1374  return true;
1375  }
1376  else
1377  {
1378  ilUtil::sendFailure($this->lng->txt("grp_users_already_assigned"));
1379  $this->searchObject();
1380 
1381  return false;
1382  }
1383  }
1384 
1391  public function refuseFromListObject()
1392  {
1393  $this->checkPermission('write');
1394 
1395  if(!count($_POST['waiting']))
1396  {
1397  ilUtil::sendFailure($this->lng->txt('no_checkbox'));
1398  $this->membersObject();
1399  return false;
1400  }
1401 
1402  include_once('./Modules/Group/classes/class.ilGroupWaitingList.php');
1403  $waiting_list = new ilGroupWaitingList($this->object->getId());
1404 
1405  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1406  foreach($_POST["waiting"] as $user_id)
1407  {
1408  $waiting_list->removeFromList($user_id);
1409  $this->object->members_obj->sendNotification(
1411  $user_id
1412  );
1413  }
1414 
1415  ilUtil::sendSuccess($this->lng->txt('grp_users_removed_from_list'), true);
1416  $this->ctrl->redirect($this, "members");
1417  return true;
1418  }
1419 
1425  public function confirmDeleteMembersObject()
1426  {
1427  $this->checkPermission('write');
1428 
1429  $participants_to_delete = (array) array_unique(array_merge((array) $_POST['admins'],(array) $_POST['members'], (array) $_POST['roles']));
1430 
1431  if(!count($participants_to_delete))
1432  {
1433  ilUtil::sendFailure($this->lng->txt('no_checkbox'));
1434  $this->membersObject();
1435  return false;
1436  }
1437 
1438  // Check last admin
1439  $admins = (array) ilGroupParticipants::_getInstanceByObjId($this->object->getId())->getAdmins();
1440 
1441  $admins_after = (array) array_diff($admins, $participants_to_delete);
1442  if(!count($admins_after) and count($admins))
1443  {
1444  ilUtil::sendFailure($this->lng->txt('grp_err_administrator_required'));
1445  $this->membersObject();
1446  return false;
1447  }
1448 
1449  $this->setSubTabs('members');
1450  $this->tabs_gui->setTabActive('members');
1451  $this->tabs_gui->setSubTabActive('grp_edit_members');
1452 
1453  include_once('./Services/Utilities/classes/class.ilConfirmationGUI.php');
1454  $confirm = new ilConfirmationGUI();
1455  $confirm->setFormAction($this->ctrl->getFormAction($this,'deleteMembers'));
1456  $confirm->setHeaderText($this->lng->txt('grp_dismiss_member'));
1457  $confirm->setConfirm($this->lng->txt('confirm'),'deleteMembers');
1458  $confirm->setCancel($this->lng->txt('cancel'),'members');
1459 
1460  foreach($this->readMemberData(array_merge((array) $_POST['admins'],(array) $_POST['members'], (array) $_POST['roles'])) as $participants)
1461  {
1462  $confirm->addItem('participants[]',
1463  $participants['usr_id'],
1464  $participants['lastname'].', '.$participants['firstname'].' ['.$participants['login'].']',
1465  ilUtil::getImagePath('icon_usr.svg'));
1466  }
1467 
1468  $this->tpl->setContent($confirm->getHTML());
1469  }
1470 
1478  public function deleteMembersObject()
1479  {
1480  $this->checkPermission('write');
1481 
1482  if(!count($_POST['participants']))
1483  {
1484  ilUtil::sendFailure($this->lng->txt('no_checkbox'));
1485  $this->membersObject();
1486  return true;
1487  }
1488 
1489  $this->object->members_obj->deleteParticipants($_POST['participants']);
1490 
1491  // Send notification
1492  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1493  foreach($_POST['participants'] as $part)
1494  {
1495  $this->object->members_obj->sendNotification(
1497  $part
1498  );
1499  }
1500 
1501 
1502  ilUtil::sendSuccess($this->lng->txt("grp_msg_membership_annulled"), true);
1503  $this->ctrl->redirect($this, "members");
1504  return true;
1505  }
1506 
1515  {
1516  if(isset($_GET['member_id']))
1517  {
1518  $_POST['participants'] = array($_GET['member_id']);
1519  }
1520  else
1521  {
1522  $_POST['participants'] = array_unique(array_merge((array) $_POST['admins'],
1523  (array) $_POST['members'],
1524  (array) $_POST['roles'],
1525  (array) $_POST['waiting'],
1526  (array) $_POST['subscribers']));
1527  }
1528  if (!count($_POST['participants']))
1529  {
1530  ilUtil::sendFailure($this->lng->txt("no_checkbox"));
1531  $this->membersObject();
1532  return false;
1533  }
1534  foreach($_POST['participants'] as $usr_id)
1535  {
1536  $rcps[] = ilObjUser::_lookupLogin($usr_id);
1537  }
1538 
1539  require_once 'Services/Mail/classes/class.ilMailFormCall.php';
1542  $this,
1543  'members',
1544  array(),
1545  array('type' => 'new', 'sig' => $this->createMailSignature())));
1546  return true;
1547  }
1548 
1555  public function setShowHidePrefs()
1556  {
1557  global $ilUser;
1558 
1559  if(isset($_GET['admin_hide']))
1560  {
1561  $ilUser->writePref('grp_admin_hide',(int) $_GET['admin_hide']);
1562  }
1563  if(isset($_GET['member_hide']))
1564  {
1565  $ilUser->writePref('grp_member_hide',(int) $_GET['member_hide']);
1566  }
1567  if(isset($_GET['subscriber_hide']))
1568  {
1569  $ilUser->writePref('grp_subscriber_hide',(int) $_GET['subscriber_hide']);
1570  }
1571  if(isset($_GET['wait_hide']))
1572  {
1573  $ilUser->writePref('grp_wait_hide',(int) $_GET['wait_hide']);
1574  }
1575  }
1576 
1582  public function editMemberObject()
1583  {
1584  $_POST['members'] = array((int) $_GET['member_id']);
1585  $this->editMembersObject();
1586  }
1587 
1594  public function editMembersObject()
1595  {
1596  $this->checkPermission('write');
1597 
1598  $post_participants = array_unique(array_merge((array) $_POST['admins'],(array) $_POST['members'], (array) $_POST['roles']));
1599  $real_participants = ilGroupParticipants::_getInstanceByObjId($this->object->getId())->getParticipants();
1600  $participants = array_intersect((array) $post_participants, (array) $real_participants);
1601 
1602  if(!count($participants))
1603  {
1604  ilUtil::sendFailure($this->lng->txt('no_checkbox'));
1605  $this->membersObject();
1606  return false;
1607  }
1608 
1609  $this->setSubTabs('members');
1610  $this->tabs_gui->setTabActive('members');
1611  $this->tabs_gui->setSubTabActive('grp_edit_members');
1612 
1613  include_once('./Modules/Group/classes/class.ilGroupEditParticipantsTableGUI.php');
1614  $table_gui = new ilGroupEditParticipantsTableGUI($this);
1615  $table_gui->setTitle($this->lng->txt('grp_mem_change_status'),'icon_usr.svg',$this->lng->txt('grp_mem_change_status'));
1616  $table_gui->setData($this->readMemberData($participants));
1617 
1618  $this->tpl->setContent($table_gui->getHTML());
1619  return true;
1620  }
1621 
1629  public function updateMembersObject()
1630  {
1631  $this->checkPermission('write');
1632 
1633  if(!count($_POST['participants']))
1634  {
1635  ilUtil::sendFailure($this->lng->txt('no_checkbox'));
1636  $this->membersObject();
1637  return false;
1638  }
1639 
1640  // Check minimum one admin
1641  $has_admin = false;
1642  $admin_role = $this->object->getDefaultAdminRole();
1643  foreach(ilGroupParticipants::_getInstanceByObjId($this->object->getId())->getAdmins() as $admin_id)
1644  {
1645  if(!isset($_POST['roles'][$admin_id]))
1646  {
1647  $has_admin = true;
1648  break;
1649  }
1650  if(in_array($admin_role,$_POST['roles'][$admin_id]))
1651  {
1652  $has_admin = true;
1653  break;
1654  }
1655  }
1656 
1657  if(!$has_admin and ilGroupParticipants::_getInstanceByObjId($this->object->getId())->getCountAdmins())
1658  {
1659  ilUtil::sendFailure($this->lng->txt('grp_min_one_admin'));
1660  $_POST['members'] = $_POST['participants'];
1661  $this->editMembersObject();
1662  return false;
1663  }
1664 
1665  $admin_role = $this->object->getDefaultAdminRole();
1666 
1667  $notifications = $_POST['notification'] ? $_POST['notification'] : array();
1668  foreach($_POST['participants'] as $usr_id)
1669  {
1670  // Check if a status changed mail is required
1671  $notification = false;
1672  if($this->object->members_obj->isAdmin($usr_id) and !in_array($admin_role,(array) $_POST['roles'][$usr_id]))
1673  {
1674  $notification = true;
1675  }
1676  if(!$this->object->members_obj->isAdmin($usr_id) and in_array($admin_role,(array) $_POST['roles'][$usr_id]))
1677  {
1678  $notification = true;
1679  }
1680 
1681  // TODO: check no role, owner
1682  $this->object->members_obj->updateRoleAssignments($usr_id,(array) $_POST['roles'][$usr_id]);
1683 
1684  // Disable notification for all of them
1685  $this->object->members_obj->updateNotification($usr_id,0);
1686 
1687  if($this->object->members_obj->isAdmin($usr_id) and in_array($usr_id,$notifications))
1688  {
1689  $this->object->members_obj->updateNotification($usr_id,1);
1690  }
1691 
1692  if($notification)
1693  {
1694  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1695  $this->object->members_obj->sendNotification(
1697  $usr_id
1698  );
1699  }
1700  }
1701  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1702  $this->ctrl->redirect($this, "members");
1703  return true;
1704  }
1705 
1713  public function updateStatusObject()
1714  {
1715  $this->checkPermission('write');
1716 
1717  $notification = $_POST['notification'] ? $_POST['notification'] : array();
1718  foreach($this->object->members_obj->getAdmins() as $admin_id)
1719  {
1720  $this->object->members_obj->updateNotification($admin_id,(int) in_array($admin_id,$notification));
1721  }
1722  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
1723  $this->membersObject();
1724  }
1725 
1726 
1727 
1728 
1729 
1734  function canceledObject()
1735  {
1736  $return_location = $_GET["cmd_return_location"];
1737  if (strcmp($return_location, "") == 0)
1738  {
1739  $return_location = "";
1740  }
1741 
1742  $this->ctrl->redirect($this, $return_location);
1743  }
1744 
1745 
1746 
1751  public function leaveObject()
1752  {
1753  global $ilUser;
1754 
1755  $this->checkPermission('leave');
1756 
1757  $part = ilGroupParticipants::_getInstanceByObjId($this->object->getId());
1758  if($part->isLastAdmin($ilUser->getId()))
1759  {
1760  ilUtil::sendFailure($this->lng->txt('grp_err_administrator_required'));
1761  $this->viewObject();
1762  return false;
1763  }
1764 
1765  $this->tabs_gui->setTabActive('grp_btn_unsubscribe');
1766 
1767  include_once "Services/Utilities/classes/class.ilConfirmationGUI.php";
1768  $cgui = new ilConfirmationGUI();
1769  $cgui->setHeaderText($this->lng->txt('grp_dismiss_myself'));
1770  $cgui->setFormAction($this->ctrl->getFormAction($this));
1771  $cgui->setCancel($this->lng->txt("cancel"), "cancel");
1772  $cgui->setConfirm($this->lng->txt("grp_btn_unsubscribe"), "unsubscribe");
1773  $this->tpl->setContent($cgui->getHTML());
1774  }
1775 
1782  public function unsubscribeObject()
1783  {
1784  global $ilUser,$tree, $ilCtrl;
1785 
1786  $this->checkPermission('leave');
1787 
1788  $this->object->members_obj->delete($ilUser->getId());
1789 
1790  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1791  $this->object->members_obj->sendNotification(
1793  $ilUser->getId()
1794  );
1795  $this->object->members_obj->sendNotification(
1797  $ilUser->getId()
1798  );
1799 
1800  ilUtil::sendSuccess($this->lng->txt('grp_msg_membership_annulled'),true);
1801  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id",
1802  $tree->getParentId($this->object->getRefId()));
1803  $ilCtrl->redirectByClass("ilrepositorygui", "");
1804  }
1805 
1806 
1812  {
1813  $user_ids = $_POST["id"];
1814 
1815  if (empty($user_ids[0]))
1816  {
1817  // TODO: jumps back to grp content. go back to last search result
1818  $this->ilErr->raiseError($this->lng->txt("no_checkbox"),$this->ilErr->MESSAGE);
1819  }
1820 
1821  foreach ($user_ids as $new_member)
1822  {
1823  if (!$this->object->addMember($new_member,$this->object->getDefaultMemberRole()))
1824  {
1825  $this->ilErr->raiseError("An Error occured while assigning user to group !",$this->ilErr->MESSAGE);
1826  }
1827  }
1828 
1829  unset($_SESSION["saved_post"]);
1830 
1831  ilUtil::sendSuccess($this->lng->txt("grp_msg_member_assigned"),true);
1832  $this->ctrl->redirect($this,'members');
1833  }
1834 
1839  public function addUserObject($user_ids, $a_type)
1840  {
1841  if (empty($user_ids[0]))
1842  {
1843  $GLOBALS['lng']->loadLanguageModule('search');
1844  ilUtil::sendFailure($this->lng->txt('search_err_user_not_exist'),true);
1845  return false;
1846  }
1847 
1848  $part = ilGroupParticipants::_getInstanceByObjId($this->object->getId());
1849  $assigned = FALSE;
1850  foreach((array) $user_ids as $new_member)
1851  {
1852  if($part->isAssigned($new_member))
1853  {
1854  continue;
1855  }
1856  switch($a_type)
1857  {
1858  case $this->object->getDefaultAdminRole():
1859  $part->add($new_member, IL_GRP_ADMIN);
1860  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1861  $part->sendNotification(
1863  $new_member
1864  );
1865  $assigned = TRUE;
1866  break;
1867 
1868  default:
1869  $part->add($new_member, IL_GRP_MEMBER);
1870  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1871  $part->sendNotification(
1873  $new_member
1874  );
1875  $assigned = TRUE;
1876  break;
1877  }
1878  }
1879 
1880  if($assigned)
1881  {
1882  ilUtil::sendSuccess($this->lng->txt("grp_msg_member_assigned"),true);
1883  }
1884  else
1885  {
1886  ilUtil::sendSuccess($this->lng->txt('grp_users_already_assigned'),TRUE);
1887  }
1888  $this->ctrl->redirect($this,'members');
1889  }
1890 
1895  {
1896  global $rbacreview, $ilObjDataCache, $ilias;
1897  include_once('./Services/AccessControl/classes/class.ilObjRole.php');
1898 
1899  $this->lng->loadLanguageModule('mail');
1900  if(!isset($_GET['returned_from_mail']))
1901  {
1902  ilUtil::sendInfo($this->lng->txt('mail_select_recipients'));
1903  }
1904 
1905  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.mail_members.html','Services/Contact');
1906 
1907 
1908  $this->tabs_gui->setTabActive('members');
1909  $b_cmd = $_GET["back_cmd"] ? $_GET["back_cmd"] : "members";
1910  $this->tabs_gui->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTarget($this,$b_cmd));
1911 
1912 
1913  require_once 'Services/Mail/classes/class.ilMailFormCall.php';
1914  $this->tpl->setVariable("MAILACTION", ilMailFormCall::getLinkTarget($this, $b_cmd, array(), array('type' => 'role','sig' => $this->createMailSignature())));
1915  $this->tpl->setVariable("IMG_ARROW",ilUtil::getImagePath('arrow_downright.svg'));
1916  $this->tpl->setVariable("TXT_MARKED_ENTRIES",$this->lng->txt('marked_entries'));
1917  $this->tpl->setVariable("OK",$this->lng->txt('next'));
1918 
1919  // Get role mailbox addresses
1920  $role_ids = $rbacreview->getRolesOfRoleFolder($this->object->getRefId(), false);
1921  $role_addrs = array();
1922 
1923  // Sort by relevance
1924  $sorted_role_ids = array();
1925  $counter = 2;
1926  foreach($role_ids as $role_id)
1927  {
1928  switch(substr(ilObject::_lookupTitle($role_id),0,8))
1929  {
1930  case 'il_grp_a':
1931  $sorted_role_ids[1] = $role_id;
1932  break;
1933 
1934  case 'il_grp_m':
1935  $sorted_role_ids[0] = $role_id;
1936  break;
1937 
1938  default:
1939  $sorted_role_ids[$counter++] = $role_id;
1940  break;
1941  }
1942  }
1943  ksort($sorted_role_ids,SORT_NUMERIC);
1944  foreach ((array) $sorted_role_ids as $role_id)
1945  {
1946  $this->tpl->setCurrentBlock("mailbox_row");
1947  $role_addr = $rbacreview->getRoleMailboxAddress($role_id);
1948 
1949  // check if role title is unique. if not force use pear mail for roles
1950  $ids_for_role_title = ilObject::_getIdsForTitle(ilObject::_lookupTitle($role_id), 'role');
1951  if(count($ids_for_role_title) >= 2)
1952  {
1953  $ilias->setSetting('pear_mail_enable', 1);
1954  }
1955 
1956  $this->tpl->setVariable("CHECK_MAILBOX",ilUtil::formCheckbox(1,'roles[]',
1957  htmlspecialchars($role_addr)
1958  ));
1959 
1960  if (ilMail::_usePearMail() && substr($role_addr, 0, 4) != '#il_')
1961  {
1962  // if pear mail is enabled, mailbox addresses are already localized in the language of the user
1963  $this->tpl->setVariable("MAILBOX",$role_addr);
1964  }
1965  else
1966  {
1967  // if pear mail is not enabled, we need to localize mailbox addresses in the language of the user
1968  $this->tpl->setVariable("MAILBOX",ilObjRole::_getTranslation($ilObjDataCache->lookupTitle($role_id)) . " (".$role_addr.")");
1969  }
1970  $this->tpl->parseCurrentBlock();
1971  }
1972  }
1973 
1979  {
1980  $user_ids = $_POST["user_id"];
1981 
1982  if (empty($user_ids[0]))
1983  {
1984  $this->ilErr->raiseError($this->lng->txt("no_checkbox"),$this->ilErr->MESSAGE);
1985  }
1986  include_once 'Services/Mail/classes/class.ilMail.php';
1987  $mail = new ilMail($_SESSION["AccountId"]);
1988 
1989  foreach ($user_ids as $new_member)
1990  {
1991  $user =& $this->ilias->obj_factory->getInstanceByObjId($new_member);
1992 
1993  $this->object->deleteApplicationListEntry($new_member);
1994  $mail->sendMail($user->getLogin(),"","","Membership application refused: Group ".$this->object->getTitle(),"Your application has been refused.",array(),array('system'));
1995  }
1996 
1997  ilUtil::sendSuccess($this->lng->txt("grp_msg_applicants_removed"),true);
1998  $this->ctrl->redirect($this,'members');
1999  }
2000 
2001  // get tabs
2002  function getTabs(&$tabs_gui)
2003  {
2004  global $rbacsystem, $ilUser, $ilAccess, $lng, $ilHelp;
2005 
2006  $ilHelp->setScreenIdComponent("grp");
2007 
2008  if ($rbacsystem->checkAccess('read',$this->ref_id))
2009  {
2010  $tabs_gui->addTab("view_content", $lng->txt("content"),
2011  $this->ctrl->getLinkTarget($this, ""));
2012  }
2013  if ($rbacsystem->checkAccess('visible',$this->ref_id))
2014  {
2015  $tabs_gui->addTarget("info_short",
2016  $this->ctrl->getLinkTargetByClass(
2017  array("ilobjgroupgui", "ilinfoscreengui"), "showSummary"),
2018  "infoScreen",
2019  "", "",false);
2020  }
2021 
2022 
2023  if ($ilAccess->checkAccess('write','',$this->object->getRefId()))
2024  {
2025  $tabs_gui->addTarget("settings",
2026  $this->ctrl->getLinkTarget($this, "edit"), array("edit", "editMapSettings"), get_class($this),
2027  "");
2028  }
2029 
2030 
2031  $is_participant = ilGroupParticipants::_isParticipant($this->ref_id, $ilUser->getId());
2032 
2033  // Members
2034  $mem_cmd = $ilAccess->checkAccess('write','',$this->ref_id) ? "members" : "membersGallery";
2035  if($mem_cmd != "membersGallery" || $is_participant)
2036  {
2037  $tabs_gui->addTarget("members",
2038  $this->ctrl->getLinkTarget($this, $mem_cmd),
2039  array(),
2040  get_class($this));
2041  }
2042 
2043  // learning progress
2044  include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
2045  if(ilLearningProgressAccess::checkAccess($this->object->getRefId(), $is_participant))
2046  {
2047  $tabs_gui->addTarget('learning_progress',
2048  $this->ctrl->getLinkTargetByClass(array('ilobjgroupgui','illearningprogressgui'),''),
2049  '',
2050  array('illplistofobjectsgui','illplistofsettingsgui','illearningprogressgui','illplistofprogressgui'));
2051  }
2052 
2053 
2054  if($ilAccess->checkAccess('write','',$this->object->getRefId()))
2055  {
2056  $tabs_gui->addTarget(
2057  'export',
2058  $this->ctrl->getLinkTargetByClass('ilexportgui',''),
2059  'export',
2060  'ilexportgui'
2061  );
2062  }
2063 
2064  /*
2065  if ($rbacsystem->checkAccess('write',$this->object->getRefId()))
2066  {
2067 
2068 
2069  $tabs_gui->addTarget('export',
2070  $this->ctrl->getLinkTarget($this,'listExportFiles'),
2071  array('listExportFiles','exportXML','confirmDeleteExportFile','downloadExportFile'),
2072  get_class($this));
2073  }
2074  */
2075  // parent tabs (all container: edit_permission, clipboard, trash
2076  parent::getTabs($tabs_gui);
2077 
2078  if($ilAccess->checkAccess('join','',$this->object->getRefId()) and
2079  !$this->object->members_obj->isAssigned($ilUser->getId()))
2080  {
2081  include_once './Modules/Group/classes/class.ilGroupWaitingList.php';
2082  if(ilGroupWaitingList::_isOnList($ilUser->getId(), $this->object->getId()))
2083  {
2084  $tabs_gui->addTab(
2085  'leave',
2086  $this->lng->txt('membership_leave'),
2087  $this->ctrl->getLinkTargetByClass('ilgroupregistrationgui','show','')
2088  );
2089 
2090  }
2091  else
2092  {
2093 
2094  $tabs_gui->addTarget("join",
2095  $this->ctrl->getLinkTargetByClass('ilgroupregistrationgui', "show"),
2096  'show',
2097  "");
2098  }
2099  }
2100  if($ilAccess->checkAccess('leave','',$this->object->getRefId()) and
2101  $this->object->members_obj->isMember($ilUser->getId()))
2102  {
2103  $tabs_gui->addTarget("grp_btn_unsubscribe",
2104  $this->ctrl->getLinkTarget($this, "leave"),
2105  '',
2106  "");
2107  }
2108  }
2109 
2110  // IMPORT FUNCTIONS
2111 
2113  {
2114  if(!is_array($_FILES['xmldoc']))
2115  {
2116  ilUtil::sendFailure($this->lng->txt("import_file_not_valid"));
2117  $this->createObject();
2118  return false;
2119  }
2120 
2121  include_once './Modules/Group/classes/class.ilObjGroup.php';
2122 
2123  if($ref_id = ilObjGroup::_importFromFile($_FILES['xmldoc'],(int) $_GET['ref_id']))
2124  {
2125  $this->ctrl->setParameter($this, "ref_id", $ref_id);
2126  ilUtil::sendSuccess($this->lng->txt("import_grp_finished"),true);
2127  ilUtil::redirect($this->ctrl->getLinkTarget($this,'edit','',false,false));
2128  }
2129 
2130  ilUtil::sendFailure($this->lng->txt("import_file_not_valid"));
2131  $this->createObject();
2132  }
2133 
2140  function exportObject()
2141  {
2142  $this->tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.grp_members_export.html",
2143  "Modules/Group");
2144  $this->tpl->setCurrentBlock("adm_content");
2145  $this->tpl->setVariable("FORMACTION", $this->getFormAction("export",$this->ctrl->getFormAction($this)));
2146  $this->tpl->setVariable("BUTTON_EXPORT", $this->lng->txt("export_group_members"));
2147  $this->tpl->parseCurrentBlock();
2148  }
2149 
2157  {
2158  $title = preg_replace("/\s/", "_", $this->object->getTitle());
2159  include_once "./Services/Excel/classes/class.ilExcelWriterAdapter.php";
2160  $adapter = new ilExcelWriterAdapter("export_" . $title . ".xls");
2161  $workbook = $adapter->getWorkbook();
2162  // Creating a worksheet
2163  $format_bold =& $workbook->addFormat();
2164  $format_bold->setBold();
2165  $format_percent =& $workbook->addFormat();
2166  $format_percent->setNumFormat("0.00%");
2167  $format_datetime =& $workbook->addFormat();
2168  $format_datetime->setNumFormat("DD/MM/YYYY hh:mm:ss");
2169  $format_title =& $workbook->addFormat();
2170  $format_title->setBold();
2171  $format_title->setColor('black');
2172  $format_title->setPattern(1);
2173  $format_title->setFgColor('silver');
2174  $worksheet =& $workbook->addWorksheet();
2175  $column = 0;
2176  $profile_data = array("email", "gender", "firstname", "lastname", "person_title", "institution",
2177  "department", "street", "zipcode","city", "country", "phone_office", "phone_home", "phone_mobile",
2178  "fax", "matriculation");
2179  foreach ($profile_data as $data)
2180  {
2181  $worksheet->writeString(0, $column++, $this->cleanString($this->lng->txt($data)), $format_title);
2182  }
2183  $member_ids = $this->object->getGroupMemberIds();
2184  $row = 1;
2185  foreach ($member_ids as $member_id)
2186  {
2187  $column = 0;
2188  $member =& $this->ilias->obj_factory->getInstanceByObjId($member_id);
2189  if ($member->getPref("public_email")=="y")
2190  {
2191  $worksheet->writeString($row, $column++, $this->cleanString($member->getEmail()));
2192  }
2193  else
2194  {
2195  $column++;
2196  }
2197  $worksheet->writeString($row, $column++, $this->cleanString($this->lng->txt("gender_" . $member->getGender())));
2198  $worksheet->writeString($row, $column++, $this->cleanString($member->getFirstname()));
2199  $worksheet->writeString($row, $column++, $this->cleanString($member->getLastname()));
2200  $worksheet->writeString($row, $column++, $this->cleanString($member->getUTitle()));
2201  if ($member->getPref("public_institution")=="y")
2202  {
2203  $worksheet->writeString($row, $column++, $this->cleanString($member->getInstitution()));
2204  }
2205  else
2206  {
2207  $column++;
2208  }
2209  if ($member->getPref("public_department")=="y")
2210  {
2211  $worksheet->writeString($row, $column++, $this->cleanString($member->getDepartment()));
2212  }
2213  else
2214  {
2215  $column++;
2216  }
2217  if ($member->getPref("public_street")=="y")
2218  {
2219  $worksheet->writeString($row, $column++, $this->cleanString($member->getStreet()));
2220  }
2221  else
2222  {
2223  $column++;
2224  }
2225  if ($member->getPref("public_zip")=="y")
2226  {
2227  $worksheet->writeString($row, $column++, $this->cleanString($member->getZipcode()));
2228  }
2229  else
2230  {
2231  $column++;
2232  }
2233  if ($member->getPref("public_city")=="y")
2234  {
2235  $worksheet->writeString($row, $column++, $this->cleanString($member->getCity()));
2236  }
2237  else
2238  {
2239  $column++;
2240  }
2241  if ($member->getPref("public_country")=="y")
2242  {
2243  $worksheet->writeString($row, $column++, $this->cleanString($member->getCountry()));
2244  }
2245  else
2246  {
2247  $column++;
2248  }
2249  if ($member->getPref("public_phone_office")=="y")
2250  {
2251  $worksheet->writeString($row, $column++, $this->cleanString($member->getPhoneOffice()));
2252  }
2253  else
2254  {
2255  $column++;
2256  }
2257  if ($member->getPref("public_phone_home")=="y")
2258  {
2259  $worksheet->writeString($row, $column++, $this->cleanString($member->getPhoneHome()));
2260  }
2261  else
2262  {
2263  $column++;
2264  }
2265  if ($member->getPref("public_phone_mobile")=="y")
2266  {
2267  $worksheet->writeString($row, $column++, $this->cleanString($member->getPhoneMobile()));
2268  }
2269  else
2270  {
2271  $column++;
2272  }
2273  if ($member->getPref("public_fax")=="y")
2274  {
2275  $worksheet->writeString($row, $column++, $this->cleanString($member->getFax()));
2276  }
2277  else
2278  {
2279  $column++;
2280  }
2281  if ($member->getPref("public_matriculation")=="y")
2282  {
2283  $worksheet->writeString($row, $column++, $this->cleanString($member->getMatriculation()));
2284  }
2285  else
2286  {
2287  $column++;
2288  }
2289  $row++;
2290  }
2291  $workbook->close();
2292  }
2293 
2302  function cleanString($str)
2303  {
2304  return str_replace(array("��","��","��","��","��","��","��"), array("ae","oe","ue","ss","Ae","Oe","Ue"), $str);
2305  }
2306 
2317  function infoScreenObject()
2318  {
2319  $this->ctrl->setCmd("showSummary");
2320  $this->ctrl->setCmdClass("ilinfoscreengui");
2321  $this->infoScreen();
2322  }
2323 
2327  function infoScreen()
2328  {
2329  global $rbacsystem, $ilUser, $ilSetting;
2330 
2331  $this->tabs_gui->setTabActive('info_short');
2332 
2333  if(!$rbacsystem->checkAccess("visible", $this->ref_id))
2334  {
2335  $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
2336  }
2337 
2338  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
2339  $info = new ilInfoScreenGUI($this);
2340 
2341  if(strlen($this->object->getInformation()))
2342  {
2343  $info->addSection($this->lng->txt('grp_general_informations'));
2344  $info->addProperty($this->lng->txt('grp_information'), nl2br(
2345  ilUtil::makeClickable ($this->object->getInformation(), true)));
2346  }
2347 
2348  $info->enablePrivateNotes();
2349  $info->enableLearningProgress(true);
2350 
2351  $info->addSection($this->lng->txt('group_registration'));
2352  $info->showLDAPRoleGroupMappingInfo();
2353 
2354  if(!$this->object->isRegistrationEnabled())
2355  {
2356  $info->addProperty($this->lng->txt('group_registration_mode'),
2357  $this->lng->txt('grp_reg_deac_info_screen'));
2358 
2359  }
2360  else
2361  {
2362  switch($this->object->getRegistrationType())
2363  {
2365  $info->addProperty($this->lng->txt('group_registration_mode'),
2366  $this->lng->txt('grp_reg_direct_info_screen'));
2367  break;
2368 
2370  $info->addProperty($this->lng->txt('group_registration_mode'),
2371  $this->lng->txt('grp_reg_req_info_screen'));
2372  break;
2373 
2375  $info->addProperty($this->lng->txt('group_registration_mode'),
2376  $this->lng->txt('grp_reg_passwd_info_screen'));
2377  break;
2378 
2379  }
2380  /*
2381  $info->addProperty($this->lng->txt('group_registration_time'),
2382  ilDatePresentation::formatPeriod(
2383  $this->object->getRegistrationStart(),
2384  $this->object->getRegistrationEnd()));
2385  */
2386  if($this->object->isRegistrationUnlimited())
2387  {
2388  $info->addProperty($this->lng->txt('group_registration_time'),
2389  $this->lng->txt('grp_registration_unlimited'));
2390  }
2391  elseif($this->object->getRegistrationStart()->getUnixTime() < time())
2392  {
2393  $info->addProperty($this->lng->txt("group_registration_time"),
2394  $this->lng->txt('cal_until').' '.
2395  ilDatePresentation::formatDate($this->object->getRegistrationEnd()));
2396  }
2397  elseif($this->object->getRegistrationStart()->getUnixTime() >= time())
2398  {
2399  $info->addProperty($this->lng->txt("group_registration_time"),
2400  $this->lng->txt('cal_from').' '.
2401  ilDatePresentation::formatDate($this->object->getRegistrationStart()));
2402  }
2403  if ($this->object->isMembershipLimited())
2404  {
2405  include_once './Modules/Group/classes/class.ilObjGroupAccess.php';
2406  $reg_info = ilObjGroupAccess::lookupRegistrationInfo($this->object->getId());
2407 
2408  $info->addProperty(
2409  $this->lng->txt('mem_free_places'),
2410  $reg_info['reg_info_free_places']
2411  );
2412  }
2413  }
2414 
2415  // Confirmation
2416  include_once('Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
2417  $privacy = ilPrivacySettings::_getInstance();
2418 
2419  include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
2420  if($privacy->groupConfirmationRequired() or ilCourseDefinedFieldDefinition::_getFields($this->object->getId()) or $privacy->enabledGroupExport())
2421  {
2422  include_once('Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php');
2423 
2424  $field_info = ilExportFieldsInfo::_getInstanceByType($this->object->getType());
2425 
2426  $this->lng->loadLanguageModule('ps');
2427  $info->addSection($this->lng->txt('grp_user_agreement_info'));
2428  $info->addProperty($this->lng->txt('ps_export_data'),$field_info->exportableFieldsToInfoString());
2429 
2430  if($fields = ilCourseDefinedFieldDefinition::_fieldsToInfoString($this->object->getId()))
2431  {
2432  $info->addProperty($this->lng->txt('ps_grp_user_fields'),$fields);
2433  }
2434  }
2435 
2436 
2437  // forward the command
2438  $this->ctrl->forwardCommand($info);
2439  }
2440 
2445  {
2446  global $ilUser;
2447 
2448  $ilUser->setPref("grpcrs_ntf_".$this->ref_id, (bool)$_REQUEST["grp_ntf"]);
2449  $ilUser->writePrefs();
2450 
2451  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
2452  $this->ctrl->redirect($this, "infoScreen");
2453  }
2454 
2458  public static function _goto($a_target, $a_add = "")
2459  {
2460  global $ilAccess, $ilErr, $lng,$ilUser;
2461 
2462  include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
2463  if(substr($a_add,0,5) == 'rcode')
2464  {
2465  if($ilUser->getId() == ANONYMOUS_USER_ID)
2466  {
2467  // Redirect to login for anonymous
2469  "login.php?target=".$_GET["target"]."&cmd=force_login&lang=".
2470  $ilUser->getCurrentLanguage()
2471  );
2472  }
2473 
2474  // Redirects to target location after assigning user to course
2476  $a_target,
2478  substr($a_add,5)
2479  );
2480  }
2481 
2482  if ($a_add == "mem" && $ilAccess->checkAccess("write", "", $a_target))
2483  {
2484  ilObjectGUI::_gotoRepositoryNode($a_target, "members");
2485  }
2486 
2487  if ($ilAccess->checkAccess("read", "", $a_target))
2488  {
2490  }
2491  else
2492  {
2493  // to do: force flat view
2494  if ($ilAccess->checkAccess("visible", "", $a_target))
2495  {
2496  ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreenGoto");
2497  }
2498  else
2499  {
2500  if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
2501  {
2502  ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
2503  ilObject::_lookupTitle(ilObject::_lookupObjId($a_target))), true);
2505  }
2506  }
2507  }
2508  $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
2509  }
2510 
2511 
2519  protected function initForm($a_mode = 'edit')
2520  {
2521  global $ilUser,$tpl,$tree;
2522 
2523  if(is_object($this->form))
2524  {
2525  return true;
2526  }
2527 
2528  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
2529 
2530  $this->form = new ilPropertyFormGUI();
2531  switch($a_mode)
2532  {
2533  case 'edit':
2534  $this->form->setFormAction($this->ctrl->getFormAction($this,'update'));
2535  break;
2536 
2537  default:
2538  $this->form->setTableWidth('600px');
2539  $this->form->setFormAction($this->ctrl->getFormAction($this,'save'));
2540  break;
2541  }
2542 
2543  // title
2544  $title = new ilTextInputGUI($this->lng->txt('title'),'title');
2545  $title->setSubmitFormOnEnter(true);
2546  $title->setValue($this->object->getTitle());
2547  $title->setSize(min(40, ilObject::TITLE_LENGTH));
2548  $title->setMaxLength(ilObject::TITLE_LENGTH);
2549  $title->setRequired(true);
2550  $this->form->addItem($title);
2551 
2552  // desc
2553  $desc = new ilTextAreaInputGUI($this->lng->txt('description'),'desc');
2554  $desc->setValue($this->object->getLongDescription());
2555  $desc->setRows(2);
2556  $desc->setCols(40);
2557  $this->form->addItem($desc);
2558 
2559  // Group type
2560  $grp_type = new ilRadioGroupInputGUI($this->lng->txt('grp_typ'),'grp_type');
2561 
2562  if($a_mode == 'edit')
2563  {
2564  $type = ($this->object->getGroupType() ? $this->object->getGroupType() : $this->object->readGroupStatus());
2565  }
2566  else
2567  {
2568  $type = ($this->object->getGroupType() ? $this->object->getGroupType() : GRP_TYPE_PUBLIC);
2569  }
2570 
2571  $grp_type->setValue($type);
2572  $grp_type->setRequired(true);
2573 
2574 
2575  // PUBLIC GROUP
2576  $opt_public = new ilRadioOption($this->lng->txt('grp_public'),GRP_TYPE_PUBLIC,$this->lng->txt('grp_public_info'));
2577  $grp_type->addOption($opt_public);
2578 
2579 
2580  // CLOSED GROUP
2581  $opt_closed = new ilRadioOption($this->lng->txt('grp_closed'),GRP_TYPE_CLOSED,$this->lng->txt('grp_closed_info'));
2582  $grp_type->addOption($opt_closed);
2583 
2584  $this->form->addItem($grp_type);
2585 
2586  if($a_mode == 'edit')
2587  {
2588  // Group registration ############################################################
2589  $pres = new ilFormSectionHeaderGUI();
2590  $pres->setTitle($this->lng->txt('grp_setting_header_registration'));
2591  $this->form->addItem($pres);
2592 
2593  // Registration type
2594  $reg_type = new ilRadioGroupInputGUI($this->lng->txt('group_registration_mode'),'registration_type');
2595  $reg_type->setValue($this->object->getRegistrationType());
2596 
2597  $opt_dir = new ilRadioOption($this->lng->txt('grp_reg_direct'),GRP_REGISTRATION_DIRECT);#$this->lng->txt('grp_reg_direct_info'));
2598  $reg_type->addOption($opt_dir);
2599 
2600  $opt_pass = new ilRadioOption($this->lng->txt('grp_pass_request'),GRP_REGISTRATION_PASSWORD);
2601  $pass = new ilTextInputGUI($this->lng->txt("password"),'password');
2602  $pass->setInfo($this->lng->txt('grp_reg_password_info'));
2603  $pass->setValue($this->object->getPassword());
2604  $pass->setSize(10);
2605  $pass->setMaxLength(32);
2606  $opt_pass->addSubItem($pass);
2607  $reg_type->addOption($opt_pass);
2608 
2609  $opt_req = new ilRadioOption($this->lng->txt('grp_reg_request'),GRP_REGISTRATION_REQUEST,$this->lng->txt('grp_reg_request_info'));
2610  $reg_type->addOption($opt_req);
2611 
2612  $opt_deact = new ilRadioOption($this->lng->txt('grp_reg_no_selfreg'),GRP_REGISTRATION_DEACTIVATED,$this->lng->txt('grp_reg_disabled_info'));
2613  $reg_type->addOption($opt_deact);
2614 
2615  // Registration codes
2616  $reg_code = new ilCheckboxInputGUI($this->lng->txt('grp_reg_code'),'reg_code_enabled');
2617  $reg_code->setChecked($this->object->isRegistrationAccessCodeEnabled());
2618  $reg_code->setValue(1);
2619  $reg_code->setInfo($this->lng->txt('grp_reg_code_enabled_info'));
2620  $this->form->addItem($reg_type);
2621 
2622  // Registration codes
2623  if(!$this->object->getRegistrationAccessCode())
2624  {
2625  include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
2626  $this->object->setRegistrationAccessCode(ilMembershipRegistrationCodeUtils::generateCode());
2627  }
2628  $reg_link = new ilHiddenInputGUI('reg_code');
2629  $reg_link->setValue($this->object->getRegistrationAccessCode());
2630  $this->form->addItem($reg_link);
2631 
2632  $link = new ilCustomInputGUI($this->lng->txt('grp_reg_code_link'));
2633  include_once './Services/Link/classes/class.ilLink.php';
2634  $val = ilLink::_getLink($this->object->getRefId(),$this->object->getType(),array(),'_rcode'.$this->object->getRegistrationAccessCode());
2635  $link->setHTML('<font class="small">'.$val.'</font>');
2636  $reg_code->addSubItem($link);
2637  $this->form->addItem($reg_code);
2638 
2639 
2640  // time limit
2641  $time_limit = new ilCheckboxInputGUI($this->lng->txt('grp_reg_limited'),'reg_limit_time');
2642 // $time_limit->setOptionTitle($this->lng->txt('grp_reg_limit_time'));
2643  $time_limit->setChecked($this->object->isRegistrationUnlimited() ? false : true);
2644 
2645  $this->lng->loadLanguageModule('dateplaner');
2646  include_once './Services/Form/classes/class.ilDateDurationInputGUI.php';
2647  $tpl->addJavaScript('./Services/Form/js/date_duration.js');
2648  $dur = new ilDateDurationInputGUI($this->lng->txt('grp_reg_period'),'reg');
2649  $dur->setStartText($this->lng->txt('cal_start'));
2650  $dur->setEndText($this->lng->txt('cal_end'));
2651  $dur->setShowTime(true);
2652  $dur->setStart($this->object->getRegistrationStart());
2653  $dur->setEnd($this->object->getRegistrationEnd());
2654 
2655  $time_limit->addSubItem($dur);
2656  $this->form->addItem($time_limit);
2657 
2658  // max member
2659  $lim = new ilCheckboxInputGUI($this->lng->txt('reg_grp_max_members_short'),'registration_membership_limited');
2660  $lim->setValue(1);
2661 // $lim->setOptionTitle($this->lng->txt('reg_grp_max_members'));
2662  $lim->setChecked($this->object->isMembershipLimited());
2663 
2664 
2665  $max = new ilTextInputGUI($this->lng->txt('reg_grp_max_members'),'registration_max_members');
2666  $max->setValue($this->object->getMaxMembers() ? $this->object->getMaxMembers() : '');
2667  //$max->setTitle($this->lng->txt('members'));
2668  $max->setSize(3);
2669  $max->setMaxLength(4);
2670  $max->setInfo($this->lng->txt('grp_reg_max_members_info'));
2671  $lim->addSubItem($max);
2672 
2673  $wait = new ilCheckboxInputGUI($this->lng->txt('grp_waiting_list'),'waiting_list');
2674  $wait->setValue(1);
2675  //$wait->setOptionTitle($this->lng->txt('grp_waiting_list'));
2676  $wait->setInfo($this->lng->txt('grp_waiting_list_info'));
2677  $wait->setChecked($this->object->isWaitingListEnabled() ? true : false);
2678  $lim->addSubItem($wait);
2679  $this->form->addItem($lim);
2680 
2681  // Group presentation
2682  $hasParentMembership =
2683  (
2684  $tree->checkForParentType($this->object->getRefId(),'crs') ||
2685  $tree->checkForParentType($this->object->getRefId(),'grp')
2686  );
2687 
2688  $pres = new ilFormSectionHeaderGUI();
2689  $pres->setTitle($this->lng->txt('grp_setting_header_presentation'));
2690  $this->form->addItem($pres);
2691 
2692  // presentation type
2693  $view_type = new ilRadioGroupInputGUI($this->lng->txt('grp_presentation_type'),'view_mode');
2694  if($hasParentMembership)
2695  {
2696  switch($this->object->getViewMode())
2697  {
2699  $course_view_mode = ': '.$this->lng->txt('cntr_view_sessions');
2700  break;
2701 
2703  $course_view_mode = ': '.$this->lng->txt('cntr_view_simple');
2704  break;
2705 
2707  $course_view_mode = ': '.$this->lng->txt('cntr_view_by_type');
2708  break;
2709  }
2710 
2711  $opt = new ilRadioOption($this->lng->txt('grp_view_inherit').$course_view_mode,ilContainer::VIEW_INHERIT);
2712  $opt->setInfo($this->lng->txt('grp_view_inherit_info'));
2713  $view_type->addOption($opt);
2714  }
2715 
2716  if($hasParentMembership &&
2717  $this->object->getViewMode(false) == ilContainer::VIEW_INHERIT)
2718  {
2719  $view_type->setValue(ilContainer::VIEW_INHERIT);
2720  }
2721  else
2722  {
2723  $view_type->setValue($this->object->getViewMode(true));
2724  }
2725 
2726  $opt = new ilRadioOption($this->lng->txt('cntr_view_simple'),ilContainer::VIEW_SIMPLE);
2727  $opt->setInfo($this->lng->txt('grp_view_info_simple'));
2728  $view_type->addOption($opt);
2729 
2730  $opt = new ilRadioOption($this->lng->txt('cntr_view_by_type'), ilContainer::VIEW_BY_TYPE);
2731  $opt->setInfo($this->lng->txt('grp_view_info_by_type'));
2732  $view_type->addOption($opt);
2733  $this->form->addItem($view_type);
2734 
2735 
2736  // Sorting
2737  $sorting_settings = array();
2738  if($hasParentMembership)
2739  {
2740  $sorting_settings[] = ilContainer::SORT_INHERIT;
2741  }
2742  $sorting_settings[] = ilContainer::SORT_TITLE;
2743  $sorting_settings[] = ilContainer::SORT_CREATION;
2744  $sorting_settings[] = ilContainer::SORT_MANUAL;
2745  $this->initSortingForm($this->form, $sorting_settings);
2746 
2747  // additional features
2748  $feat = new ilFormSectionHeaderGUI();
2749  $feat->setTitle($this->lng->txt('obj_features'));
2750  $this->form->addItem($feat);
2751 
2752  include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
2754  $this->object->getId(),
2755  $this->form,
2756  array(
2761  )
2762  );
2763 
2764  // Notification Settings
2765  /*$notification = new ilFormSectionHeaderGUI();
2766  $notification->setTitle($this->lng->txt('grp_notification'));
2767  $this->form->addItem($notification);*/
2768 
2769  // Show members type
2770  $mail_type = new ilRadioGroupInputGUI($this->lng->txt('grp_mail_type'), 'mail_type');
2771  $mail_type->setValue($this->object->getMailToMembersType());
2772 
2773  $mail_tutors = new ilRadioOption($this->lng->txt('grp_mail_tutors_only'), ilObjGroup::MAIL_ALLOWED_TUTORS,
2774  $this->lng->txt('grp_mail_tutors_only_info'));
2775  $mail_type->addOption($mail_tutors);
2776 
2777  $mail_all = new ilRadioOption($this->lng->txt('grp_mail_all'), ilObjGroup::MAIL_ALLOWED_ALL,
2778  $this->lng->txt('grp_mail_all_info'));
2779  $mail_type->addOption($mail_all);
2780  $this->form->addItem($mail_type);
2781  }
2782 
2783  switch($a_mode)
2784  {
2785  case 'create':
2786  $this->form->setTitle($this->lng->txt('grp_new'));
2787  $this->form->setTitleIcon(ilUtil::getImagePath('icon_grp.svg'));
2788 
2789  $this->form->addCommandButton('save',$this->lng->txt('grp_new'));
2790  $this->form->addCommandButton('cancel',$this->lng->txt('cancel'));
2791  return true;
2792 
2793  case 'edit':
2794  $this->form->setTitle($this->lng->txt('grp_edit'));
2795  $this->form->setTitleIcon(ilUtil::getImagePath('icon_grp.svg'));
2796 
2797  // Edit ecs export settings
2798  include_once 'Modules/Group/classes/class.ilECSGroupSettings.php';
2799  $ecs = new ilECSGroupSettings($this->object);
2800  $ecs->addSettingsToForm($this->form, 'grp');
2801 
2802  $this->form->addCommandButton('update',$this->lng->txt('save'));
2803  $this->form->addCommandButton('cancel',$this->lng->txt('cancel'));
2804  return true;
2805 
2806  }
2807  return true;
2808  }
2809 
2816  public function load()
2817  {
2818  $this->object->setTitle(ilUtil::stripSlashes($_POST['title']));
2819  $this->object->setDescription(ilUtil::stripSlashes($_POST['desc']));
2820  $this->object->setGroupType(ilUtil::stripSlashes($_POST['grp_type']));
2821  $this->object->setRegistrationType(ilUtil::stripSlashes($_POST['registration_type']));
2822  $this->object->setPassword(ilUtil::stripSlashes($_POST['password']));
2823  $this->object->enableUnlimitedRegistration((bool) !$_POST['reg_limit_time']);
2824  $this->object->setRegistrationStart($this->loadDate('start'));
2825  $this->object->setRegistrationEnd($this->loadDate('end'));
2826  $this->object->enableMembershipLimitation((bool) $_POST['registration_membership_limited']);
2827  $this->object->setMaxMembers((int) $_POST['registration_max_members']);
2828  $this->object->enableWaitingList((bool) $_POST['waiting_list']);
2829  $this->object->enableRegistrationAccessCode((bool) $_POST['reg_code_enabled']);
2830  $this->object->setRegistrationAccessCode(ilUtil::stripSlashes($_POST['reg_code']));
2831  $this->object->setViewMode(ilUtil::stripSlashes($_POST['view_mode']));
2832  $this->object->setMailToMembersType((int) $_POST['mail_type']);
2833 
2834  return true;
2835  }
2836 
2844  protected function loadDate($a_field)
2845  {
2846  global $ilUser;
2847 
2848  include_once('./Services/Calendar/classes/class.ilDateTime.php');
2849 
2850  $dt['year'] = (int) $_POST['reg'][$a_field]['date']['y'];
2851  $dt['mon'] = (int) $_POST['reg'][$a_field]['date']['m'];
2852  $dt['mday'] = (int) $_POST['reg'][$a_field]['date']['d'];
2853  $dt['hours'] = (int) $_POST['reg'][$a_field]['time']['h'];
2854  $dt['minutes'] = (int) $_POST['reg'][$a_field]['time']['m'];
2855  $dt['seconds'] = (int) $_POST['reg'][$a_field]['time']['s'];
2856 
2857  $date = new ilDateTime($dt,IL_CAL_FKT_GETDATE,$ilUser->getTimeZone());
2858  return $date;
2859  }
2860 
2868  protected function setSubTabs($a_tab)
2869  {
2870  global $rbacsystem,$ilUser,$ilAccess;
2871 
2872  switch($a_tab)
2873  {
2874  case 'members':
2875  // for admins
2876  if($ilAccess->checkAccess('write','',$this->object->getRefId()))
2877  {
2878  $this->tabs_gui->addSubTabTarget("grp_edit_members",
2879  $this->ctrl->getLinkTarget($this,'members'),
2880  "members",
2881  get_class($this));
2882  }
2883  // for all
2884  $this->tabs_gui->addSubTabTarget("grp_members_gallery",
2885  $this->ctrl->getLinkTarget($this,'membersGallery'),
2886  "membersGallery", get_class($this));
2887 
2888  // members map
2889  include_once("./Services/Maps/classes/class.ilMapUtil.php");
2890  if (ilMapUtil::isActivated() &&
2891  $this->object->getEnableGroupMap())
2892  {
2893  $this->tabs_gui->addSubTabTarget("grp_members_map",
2894  $this->ctrl->getLinkTarget($this,'membersMap'),
2895  "membersMap", get_class($this));
2896  }
2897 
2898  if($ilAccess->checkAccess('write','',$this->object->getRefId()))
2899  {
2900  $this->tabs_gui->addSubTabTarget("events",
2901  $this->ctrl->getLinkTargetByClass('ilsessionoverviewgui','listSessions'),
2902  "", 'ilsessionoverviewgui');
2903  }
2904 
2905  include_once 'Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
2906  if(ilPrivacySettings::_getInstance()->checkExportAccess($this->object->getRefId()))
2907  {
2908  $this->tabs_gui->addSubTabTarget('grp_export_members',
2909  $this->ctrl->getLinkTargetByClass('ilmemberexportgui','show'),
2910  "", 'ilmemberexportgui');
2911  }
2912 
2913  break;
2914 
2915  case 'settings':
2916  $this->tabs_gui->addSubTabTarget("grp_settings",
2917  $this->ctrl->getLinkTarget($this,'edit'),
2918  "edit", get_class($this));
2919 
2920  $this->tabs_gui->addSubTabTarget("grp_info_settings",
2921  $this->ctrl->getLinkTarget($this,'editInfo'),
2922  "editInfo", get_class($this));
2923 
2924  // custom icon
2925  if ($this->ilias->getSetting("custom_icons"))
2926  {
2927  $this->tabs_gui->addSubTabTarget("grp_icon_settings",
2928  $this->ctrl->getLinkTarget($this,'editGroupIcons'),
2929  "editGroupIcons", get_class($this));
2930  }
2931 
2932  include_once("./Services/Maps/classes/class.ilMapUtil.php");
2933  if (ilMapUtil::isActivated())
2934  {
2935  $this->tabs_gui->addSubTabTarget("grp_map_settings",
2936  $this->ctrl->getLinkTarget($this,'editMapSettings'),
2937  "editMapSettings", get_class($this));
2938  }
2939 
2940  $this->tabs_gui->addSubTabTarget('groupings',
2941  $this->ctrl->getLinkTargetByClass('ilobjcoursegroupinggui','listGroupings'),
2942  'listGroupings',
2943  get_class($this));
2944 
2945  include_once('Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
2946  include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
2947  // only show if export permission is granted
2948  if(ilPrivacySettings::_getInstance()->checkExportAccess($this->object->getRefId()) or ilCourseDefinedFieldDefinition::_hasFields($this->object->getId()))
2949  {
2950  $this->tabs_gui->addSubTabTarget('grp_custom_user_fields',
2951  $this->ctrl->getLinkTargetByClass('ilobjectcustomuserfieldsgui'),
2952  '',
2953  'ilobjectcustomuserfieldsgui');
2954  }
2955 
2956 
2957 
2958  break;
2959 
2960 
2961  }
2962  }
2963 
2970  private function checkAgreement()
2971  {
2972  global $ilUser,$ilAccess;
2973 
2974  if($ilAccess->checkAccess('write','',$this->object->getRefId()))
2975  {
2976  return true;
2977  }
2978 
2979  // Disable aggrement if is not member of group
2980  if(!$this->object->members_obj->isAssigned($ilUser->getId()))
2981  {
2982  return true;
2983  }
2984 
2985  include_once './Services/Container/classes/class.ilMemberViewSettings.php';
2986  if(ilMemberViewSettings::getInstance()->isActive())
2987  {
2988  return true;
2989  }
2990 
2991  include_once('Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
2992  include_once('Services/Membership/classes/class.ilMemberAgreement.php');
2993  $privacy = ilPrivacySettings::_getInstance();
2994 
2995  // Check agreement
2996  if(($privacy->groupConfirmationRequired() or ilCourseDefinedFieldDefinition::_hasFields($this->object->getId()))
2997  and !ilMemberAgreement::_hasAccepted($ilUser->getId(),$this->object->getId()))
2998  {
2999  return false;
3000  }
3001  // Check required fields
3002  include_once('Modules/Course/classes/Export/class.ilCourseUserData.php');
3003  if(!ilCourseUserData::_checkRequired($ilUser->getId(),$this->object->getId()))
3004  {
3005  return false;
3006  }
3007  return true;
3008  }
3009 
3010 
3015  public function prepareOutput()
3016  {
3017  global $rbacsystem;
3018  if(!$this->getCreationMode())
3019  {
3020  /*
3021  include_once './Services/Container/classes/class.ilMemberViewSettings.php';
3022  $settings = ilMemberViewSettings::getInstance();
3023  if($settings->isActive() and $settings->getContainer() != $this->object->getRefId())
3024  {
3025  $settings->setContainer($this->object->getRefId());
3026  $rbacsystem->initMemberView();
3027  }
3028  */
3029  }
3030  parent::prepareOutput();
3031  }
3032 
3037  protected function createMailSignature()
3038  {
3039  $link = chr(13).chr(10).chr(13).chr(10);
3040  $link .= $this->lng->txt('grp_mail_permanent_link');
3041  $link .= chr(13).chr(10).chr(13).chr(10);
3042  include_once 'Services/Link/classes/class.ilLink.php';
3043  $link .= ilLink::_getLink($this->object->getRefId());
3044  return rawurlencode(base64_encode($link));
3045  }
3046 
3047  protected function initHeaderAction($a_sub_type = null, $a_sub_id = null)
3048  {
3049  global $ilSetting, $ilUser;
3050 
3051  $lg = parent::initHeaderAction($a_sub_type, $a_sub_id);
3052 
3053  include_once('./Modules/Group/classes/class.ilGroupParticipants.php');
3054  if($ilSetting->get("crsgrp_ntf") &&
3055  ilGroupParticipants::_isParticipant($this->ref_id, $ilUser->getId()))
3056  {
3057  if(!$ilUser->getPref("grpcrs_ntf_".$this->ref_id))
3058  {
3059  $lg->addHeaderIcon("not_icon",
3060  ilUtil::getImagePath("notification_off.svg"),
3061  $this->lng->txt("grp_notification_deactivated"));
3062 
3063  $this->ctrl->setParameter($this, "grp_ntf", 1);
3064  $caption = "grp_activate_notification";
3065  }
3066  else
3067  {
3068  $lg->addHeaderIcon("not_icon",
3069  ilUtil::getImagePath("notification_on.svg"),
3070  $this->lng->txt("grp_notification_activated"));
3071 
3072  $this->ctrl->setParameter($this, "grp_ntf", 0);
3073  $caption = "grp_deactivate_notification";
3074  }
3075 
3076  $lg->addCustomCommand($this->ctrl->getLinkTarget($this, "saveNotification"),
3077  $caption);
3078 
3079 
3080  $this->ctrl->setParameter($this, "grp_ntf", "");
3081  }
3082 
3083  return $lg;
3084  }
3085 
3087  {
3088  global $ilTabs;
3089 
3090  $this->checkPermission('write');
3091 
3092  $ilTabs->clearTargets();
3093  $ilTabs->setBackTarget($this->lng->txt('back'),
3094  $this->ctrl->getLinkTarget($this, 'members'));
3095 
3096  $list = $this->initAttendanceList();
3097  $form = $list->initForm('printMembersOutput');
3098  $this->tpl->setContent($form->getHTML());
3099  }
3100 
3106  protected function initAttendanceList()
3107  {
3108  include_once('./Modules/Group/classes/class.ilGroupParticipants.php');
3109  $members_obj = ilGroupParticipants::_getInstanceByObjId($this->object->getId());
3110 
3111  include_once('./Modules/Group/classes/class.ilGroupWaitingList.php');
3112  $waiting_list = new ilGroupWaitingList($this->object->getId());
3113 
3114  include_once 'Services/Membership/classes/class.ilAttendanceList.php';
3115  $list = new ilAttendanceList($this, $members_obj, $waiting_list);
3116  $list->setId('grpmemlst');
3117 
3118  $list->setTitle($this->lng->txt('grp_members_print_title'),
3119  $this->lng->txt('obj_grp').': '.$this->object->getTitle());
3120 
3121  include_once './Services/Tracking/classes/class.ilObjUserTracking.php';
3122  $this->show_tracking = (ilObjUserTracking::_enabledLearningProgress() and
3124  if($this->show_tracking)
3125  {
3126  include_once('./Services/Object/classes/class.ilObjectLP.php');
3127  $olp = ilObjectLP::getInstance($this->object->getId());
3128  $this->show_tracking = $olp->isActive();
3129  }
3130  if($this->show_tracking)
3131  {
3132  $this->lng->loadLanguageModule('trac');
3133  $list->addPreset('progress', $this->lng->txt('learning_progress'), true);
3134  }
3135 
3136  include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
3137  $privacy = ilPrivacySettings::_getInstance();
3138  if($privacy->enabledGroupAccessTimes())
3139  {
3140  $list->addPreset('access', $this->lng->txt('last_access'), true);
3141  }
3142 
3143  return $list;
3144  }
3145 
3146  public function getAttendanceListUserData($a_user_id)
3147  {
3148  $data = $this->members_data[$a_user_id];
3149  $data['access'] = $data['access_time'];
3150  $data['progress'] = $this->lng->txt($data['progress']);
3151 
3152  return $data;
3153  }
3154 
3156  {
3157  $list = $this->initAttendanceList();
3158  $list->initFromForm();
3159  $list->setCallback(array($this, 'getAttendanceListUserData'));
3160 
3161  $part = ilGroupParticipants::_getInstanceByObjId($this->object->getId());
3162  $this->members_data = $this->readMemberData($part->getParticipants());
3163  $list->getNonMemberUserData($this->members_data);
3164 
3165  echo $list->getFullscreenHTML();
3166  exit();
3167  }
3168 
3173  protected function getLocalRoles()
3174  {
3175  $local_roles = $this->object->getLocalGroupRoles(false);
3176  $grp_member = $this->object->getDefaultMemberRole();
3177  $grp_roles = array();
3178 
3179  //put the group member role to the top of the crs_roles array
3180  if(in_array($grp_member, $local_roles))
3181  {
3182  $grp_roles[$grp_member] = ilObjRole::_getTranslation(array_search ($grp_member, $local_roles));
3183  unset($local_roles[$grp_roles[$grp_member]]);
3184  }
3185 
3186  foreach($local_roles as $title => $role_id)
3187  {
3188  $grp_roles[$role_id] = ilObjRole::_getTranslation($title);
3189  }
3190  return $grp_roles;
3191  }
3192 
3193 
3201  protected function addMailToMemberButton($ilToolbar, $back_cmd = null, $a_separator = false)
3202  {
3203  global $ilAccess, $ilUser, $rbacsystem;
3204  include_once 'Services/Mail/classes/class.ilMail.php';
3205  $mail = new ilMail($ilUser->getId());
3206 
3207  if(
3208  ($ilAccess->checkAccess('write','',$this->object->getRefId()) or
3209  $this->object->getMailToMembersType() == ilObjGroup::MAIL_ALLOWED_ALL) and
3210  $rbacsystem->checkAccess('internal_mail',$mail->getMailObjectReferenceId()))
3211  {
3212 
3213  if($a_separator)
3214  {
3215  $ilToolbar->addSeparator();
3216  }
3217 
3218  if($back_cmd)
3219  {
3220  $this->ctrl->setParameter($this, "back_cmd", $back_cmd);
3221  }
3222 
3223  $ilToolbar->addButton($this->lng->txt("mail_members"),
3224  $this->ctrl->getLinkTarget($this,'mailMembers'));
3225  }
3226  }
3227 
3229  {
3230  if(!is_array($_POST["subscribers"]))
3231  {
3232  ilUtil::sendFailure($this->lng->txt("no_checkbox"));
3233  $this->membersObject();
3234 
3235  return false;
3236  }
3237 
3238  $this->lng->loadLanguageModule('mmbr');
3239 
3240  $this->checkPermission('write');
3241  $this->setSubTabs('members');
3242  $this->tabs_gui->setTabActive('members');
3243  $this->tabs_gui->setSubTabActive('grp_edit_members');
3244 
3245  include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
3246  $c_gui = new ilConfirmationGUI();
3247 
3248  // set confirm/cancel commands
3249  $c_gui->setFormAction($this->ctrl->getFormAction($this, "refuseSubscribers"));
3250  $c_gui->setHeaderText($this->lng->txt("info_refuse_sure"));
3251  $c_gui->setCancel($this->lng->txt("cancel"), "members");
3252  $c_gui->setConfirm($this->lng->txt("confirm"), "refuseSubscribers");
3253 
3254  foreach($_POST["subscribers"] as $subscribers)
3255  {
3256  $name = ilObjUser::_lookupName($subscribers);
3257 
3258  $c_gui->addItem('subscribers[]',
3259  $name['user_id'],
3260  $name['lastname'].', '.$name['firstname'].' ['.$name['login'].']',
3261  ilUtil::getImagePath('icon_usr.svg'));
3262  }
3263 
3264  $this->tpl->setContent($c_gui->getHTML());
3265  }
3266 
3268  {
3269  if(!is_array($_POST["subscribers"]))
3270  {
3271  ilUtil::sendFailure($this->lng->txt("no_checkbox"));
3272  $this->membersObject();
3273 
3274  return false;
3275  }
3276  $this->checkPermission('write');
3277  $this->setSubTabs('members');
3278  $this->tabs_gui->setTabActive('members');
3279  $this->tabs_gui->setSubTabActive('grp_edit_members');
3280 
3281  include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
3282  $c_gui = new ilConfirmationGUI();
3283 
3284  // set confirm/cancel commands
3285  $c_gui->setFormAction($this->ctrl->getFormAction($this, "assignSubscribers"));
3286  $c_gui->setHeaderText($this->lng->txt("info_assign_sure"));
3287  $c_gui->setCancel($this->lng->txt("cancel"), "members");
3288  $c_gui->setConfirm($this->lng->txt("confirm"), "assignSubscribers");
3289 
3290  foreach($_POST["subscribers"] as $subscribers)
3291  {
3292  $name = ilObjUser::_lookupName($subscribers);
3293 
3294  $c_gui->addItem('subscribers[]',
3295  $name['user_id'],
3296  $name['lastname'].', '.$name['firstname'].' ['.$name['login'].']',
3297  ilUtil::getImagePath('icon_usr.svg'));
3298  }
3299 
3300  $this->tpl->setContent($c_gui->getHTML());
3301  return true;
3302  }
3303 
3305  {
3306  if(!is_array($_POST["waiting"]))
3307  {
3308  ilUtil::sendFailure($this->lng->txt("no_checkbox"));
3309  $this->membersObject();
3310 
3311  return false;
3312  }
3313 
3314  $this->lng->loadLanguageModule('mmbr');
3315 
3316  $this->checkPermission('write');
3317  $this->setSubTabs('members');
3318  $this->tabs_gui->setTabActive('members');
3319  $this->tabs_gui->setSubTabActive('grp_edit_members');
3320 
3321  include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
3322  $c_gui = new ilConfirmationGUI();
3323 
3324  // set confirm/cancel commands
3325  $c_gui->setFormAction($this->ctrl->getFormAction($this, "refuseFromList"));
3326  $c_gui->setHeaderText($this->lng->txt("info_refuse_sure"));
3327  $c_gui->setCancel($this->lng->txt("cancel"), "members");
3328  $c_gui->setConfirm($this->lng->txt("confirm"), "refuseFromList");
3329 
3330  foreach($_POST["waiting"] as $waiting)
3331  {
3332  $name = ilObjUser::_lookupName($waiting);
3333 
3334  $c_gui->addItem('waiting[]',
3335  $name['user_id'],
3336  $name['lastname'].', '.$name['firstname'].' ['.$name['login'].']',
3337  ilUtil::getImagePath('icon_usr.svg'));
3338  }
3339 
3340  $this->tpl->setContent($c_gui->getHTML());
3341  return true;
3342  }
3343 
3345  {
3346  if(!is_array($_POST["waiting"]))
3347  {
3348  ilUtil::sendFailure($this->lng->txt("no_checkbox"));
3349  $this->membersObject();
3350 
3351  return false;
3352  }
3353  $this->checkPermission('write');
3354  $this->setSubTabs('members');
3355  $this->tabs_gui->setTabActive('members');
3356  $this->tabs_gui->setSubTabActive('grp_edit_members');
3357 
3358  include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
3359  $c_gui = new ilConfirmationGUI();
3360 
3361  // set confirm/cancel commands
3362  $c_gui->setFormAction($this->ctrl->getFormAction($this, "assignFromWaitingList"));
3363  $c_gui->setHeaderText($this->lng->txt("info_assign_sure"));
3364  $c_gui->setCancel($this->lng->txt("cancel"), "members");
3365  $c_gui->setConfirm($this->lng->txt("confirm"), "assignFromWaitingList");
3366 
3367  foreach($_POST["waiting"] as $waiting)
3368  {
3369  $name = ilObjUser::_lookupName($waiting);
3370 
3371  $c_gui->addItem('waiting[]',
3372  $name['user_id'],
3373  $name['lastname'].', '.$name['firstname'].' ['.$name['login'].']',
3374  ilUtil::getImagePath('icon_usr.svg'));
3375  }
3376 
3377  $this->tpl->setContent($c_gui->getHTML());
3378  return true;
3379  }
3380 
3381 } // END class.ilObjGroupGUI
3382 ?>
< 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
saveSortingSettings(ilPropertyFormGUI $form)
Save sorting settings.
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.
getLocalRoles()
returns all local roles [role_id] => title
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
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.
static _tracProgress($a_user_id, $a_obj_id, $a_ref_id, $a_obj_type='')
This class represents a checkbox property in a property form.
static _lookupTitle($a_id)
lookup object title
editMapSettingsObject()
Edit Map Settings.
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
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
static lookupRegistrationInfo($a_obj_id)
Lookup registration info ilDB $ilDB ilObjUser $ilUser ilLanguage $lng.
sendMailToSelectedUsersObject()
show send mail
static getMapGUI()
Get an instance of the GUI class.
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.
static getDefaultSettings()
Get default longitude, latitude and zoom.
initCreateForm($a_new_type)
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.
Waiting list for groups.
global $ilIliasIniFile
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
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.
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
static isActivated()
Checks whether Map feature is activated.
initAttendanceList()
Init attendance list object.
addMailToMemberButton($ilToolbar, $back_cmd=null, $a_separator=false)
add Mail to Member button to toolbar
assignSubscribersObject()
assign subscribers
This class represents a custom property in a property form.
checkAgreement()
Check agreement and redirect if it is not accepted.
static generateCode()
Generate new registration key.
refuseSubscribersObject()
refuse subscribers
mailMembersObject()
Form for mail to group members.
initHeaderAction($a_sub_type=null, $a_sub_id=null)
static fillAutoCompleteToolbar($parent_object, ilToolbarGUI $toolbar=null, $a_options=array())
fill toolbar with
global $ilUser
Definition: imgupload.php:15
initSortingForm(ilPropertyFormGUI $form, array $a_sorting_settings)
Append sorting settings to property form.
editMembersObject()
edit member(s)
membersMapObject()
Members map.
static _goto($a_target, $a_add="")
goto target group
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.
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
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
_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)