ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilObjGroupGUI.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
24 include_once "./Services/Container/classes/class.ilContainerGUI.php";
25 include_once('./Modules/Group/classes/class.ilObjGroup.php');
26 
42 {
47  public function __construct($a_data,$a_id,$a_call_by_reference,$a_prepare_output = false)
48  {
49  $this->type = "grp";
50  $this->ilContainerGUI($a_data,$a_id,$a_call_by_reference,$a_prepare_output);
51 
52  $this->lng->loadLanguageModule('grp');
53  }
54 
55  function &executeCommand()
56  {
57  global $ilUser,$rbacsystem,$ilAccess, $ilNavigationHistory,$ilErr, $ilCtrl;
58 
59  $next_class = $this->ctrl->getNextClass($this);
60  $cmd = $this->ctrl->getCmd();
61  $this->prepareOutput();
62 
63  // add entry to navigation history
64  if (!$this->getCreationMode() &&
65  $ilAccess->checkAccess("read", "", $_GET["ref_id"]))
66  {
67  $ilNavigationHistory->addItem($_GET["ref_id"],
68  "repository.php?cmd=frameset&ref_id=".$_GET["ref_id"], "grp");
69  }
70 
71  switch($next_class)
72  {
73  case "ilconditionhandlerinterface":
74  include_once './classes/class.ilConditionHandlerInterface.php';
75 
76  if($_GET['item_id'])
77  {
78  $this->ctrl->saveParameter($this,'item_id',$_GET['item_id']);
79  $this->setSubTabs('activation');
80  $this->tabs_gui->setTabActive('view_content');
81 
82  $new_gui =& new ilConditionHandlerInterface($this,(int) $_GET['item_id']);
83  $this->ctrl->forwardCommand($new_gui);
84  }
85  else
86  {
87  $new_gui =& new ilConditionHandlerInterface($this);
88  $this->ctrl->forwardCommand($new_gui);
89  }
90  break;
91 
92  case 'ilgroupregistrationgui':
93  $this->ctrl->setReturn($this,'');
94  $this->tabs_gui->setTabActive('join');
95  include_once('./Modules/Group/classes/class.ilGroupRegistrationGUI.php');
96  $registration = new ilGroupRegistrationGUI($this->object);
97  $this->ctrl->forwardCommand($registration);
98  break;
99 
100  case 'ilpermissiongui':
101  $this->tabs_gui->setTabActive('perm_settings');
102  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
103  $perm_gui =& new ilPermissionGUI($this);
104  $ret =& $this->ctrl->forwardCommand($perm_gui);
105  break;
106 
107  case 'ilrepositorysearchgui':
108  include_once('./Services/Search/classes/class.ilRepositorySearchGUI.php');
109  $rep_search =& new ilRepositorySearchGUI();
110  $rep_search->setCallback($this,
111  'addUserObject',
112  array(
113  ilObjGroup::GRP_MEMBER => $this->lng->txt('il_grp_member'),
114  ilObjGroup::GRP_ADMIN => $this->lng->txt('il_grp_admin')
115  ));
116 
117  // Set tabs
118  $this->tabs_gui->setTabActive('members');
119  $this->ctrl->setReturn($this,'members');
120  $ret =& $this->ctrl->forwardCommand($rep_search);
121  $this->setSubTabs('members');
122  $this->tabs_gui->setSubTabActive('members');
123  break;
124 
125  case 'ilcourseitemadministrationgui':
126  include_once 'Modules/Course/classes/class.ilCourseItemAdministrationGUI.php';
127  $this->tabs_gui->clearSubTabs();
128  $this->ctrl->setReturn($this,'view');
129  $item_adm_gui = new ilCourseItemAdministrationGUI($this->object,(int) $_REQUEST['item_id']);
130  $this->ctrl->forwardCommand($item_adm_gui);
131  break;
132 
133  case "ilinfoscreengui":
134  $ret =& $this->infoScreen();
135  break;
136 
137  case "illearningprogressgui":
138  include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
139 
141  $this->object->getRefId(),
142  $_GET['user_id'] ? $_GET['user_id'] : $ilUser->getId());
143  $this->ctrl->forwardCommand($new_gui);
144  $this->tabs_gui->setTabActive('learning_progress');
145  break;
146 
147  case 'ilobjcoursegroupinggui':
148  include_once './Modules/Course/classes/class.ilObjCourseGroupingGUI.php';
149 
150  $this->ctrl->setReturn($this,'edit');
151  $crs_grp_gui =& new ilObjCourseGroupingGUI($this->object,(int) $_GET['obj_id']);
152  $this->ctrl->forwardCommand($crs_grp_gui);
153  $this->setSubTabs('settings');
154  $this->tabs_gui->setTabActive('settings');
155  $this->tabs_gui->setSubTabActive('groupings');
156  break;
157 
158  case 'ilcoursecontentgui':
159 
160  include_once './Modules/Course/classes/class.ilCourseContentGUI.php';
161  $course_content_obj = new ilCourseContentGUI($this);
162  $this->ctrl->forwardCommand($course_content_obj);
163  break;
164 
165  case 'ilcourseitemadministrationgui':
166 
167  include_once 'Modules/Course/classes/class.ilCourseItemAdministrationGUI.php';
168 
169  $this->ctrl->setReturn($this,'');
170  $item_adm_gui = new ilCourseItemAdministrationGUI($this->object,(int) $_GET['item_id']);
171  $this->ctrl->forwardCommand($item_adm_gui);
172 
173  // (Sub)tabs
174  $this->setSubTabs('activation');
175  $this->tabs_gui->setTabActive('view_content');
176  $this->tabs_gui->setSubTabActive('activation');
177  break;
178 
179  case 'ilpublicuserprofilegui':
180  require_once './Services/User/classes/class.ilPublicUserProfileGUI.php';
181  $profile_gui = new ilPublicUserProfileGUI($_GET["user"]);
182  $html = $this->ctrl->forwardCommand($profile_gui);
183  $this->setSubTabs('members');
184  $this->tabs_gui->setTabActive('group_members');
185  $this->tabs_gui->setSubTabActive('grp_members_gallery');
186  $this->tpl->setVariable("ADM_CONTENT", $html);
187  break;
188 
189  case "ilcolumngui":
190  $this->tabs_gui->setTabActive('none');
191  $this->checkPermission("read");
192  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
193  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
194  ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId()));
195  $this->renderObject();
196  break;
197 
198  // container page editing
199  case "ilpageobjectgui":
200  $ret = $this->forwardToPageObject();
201  if ($ret != "")
202  {
203  $this->tpl->setContent($ret);
204  }
205  break;
206 
207  case 'ilobjectcopygui':
208  include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
209  $cp = new ilObjectCopyGUI($this);
210  $cp->setType('grp');
211  $this->ctrl->forwardCommand($cp);
212  break;
213 
214  case "ilobjstylesheetgui":
215  $this->forwardToStyleSheet();
216  break;
217 
218  default:
219 
220  // check visible permission
221  if (!$this->getCreationMode() and !$ilAccess->checkAccess('visible','',$this->object->getRefId(),'grp'))
222  {
223  $ilErr->raiseError($this->lng->txt("msg_no_perm_read"),$ilErr->MESSAGE);
224  }
225 
226  // check read permission
227  if ((!$this->getCreationMode()
228  && !$rbacsystem->checkAccess('read',$this->object->getRefId()) && $cmd != 'infoScreen')
229  || $cmd == 'join')
230  {
231  // no join permission -> redirect to info screen
232  if (!$rbacsystem->checkAccess('join',$this->object->getRefId()))
233  {
234  $this->ctrl->redirect($this, "infoScreen");
235  }
236  else // no read -> show registration
237  {
238  include_once('./Modules/Group/classes/class.ilGroupRegistrationGUI.php');
239  $this->ctrl->redirectByClass("ilGroupRegistrationGUI", "show");
240  }
241  }
242  if(!$cmd)
243  {
244  $cmd = 'view';
245  }
246  $cmd .= 'Object';
247  $this->$cmd();
248  break;
249  }
250  }
251 
252  function viewObject()
253  {
254  global $tree,$rbacsystem,$ilUser;
255 
256  include_once 'Services/Tracking/classes/class.ilLearningProgress.php';
257  ilLearningProgress::_tracProgress($ilUser->getId(),$this->object->getId(),'grp');
258 
259  if (strtolower($_GET["baseClass"]) == "iladministrationgui")
260  {
262  return true;
263  }
264  $this->tabs_gui->setTabActive('view_content');
265  $this->renderObject();
266  }
267 
271  function renderObject()
272  {
273  global $ilTabs;
274 
275  $ilTabs->activateTab("view_content");
277  return $ret;
278 
279  }
280 
281 
285  function modifyItemGUI($a_item_list_gui, $a_item_data, $a_show_path)
286  {
287  global $tree;
288 
289  // if folder is in a course, modify item list gui according to course requirements
290  if ($course_ref_id = $tree->checkForParentType($this->object->getRefId(),'crs'))
291  {
292  include_once("./Modules/Course/classes/class.ilObjCourse.php");
293  include_once("./Modules/Course/classes/class.ilObjCourseGUI.php");
294  $course_obj_id = ilObject::_lookupObjId($course_ref_id);
295  ilObjCourseGUI::_modifyItemGUI($a_item_list_gui,'ilcoursecontentgui',$a_item_data, $a_show_path,
296  ilObjCourse::_lookupAboStatus($course_obj_id), $course_ref_id, $course_obj_id,
297  $this->object->getRefId());
298  }
299  }
300 
301 
311  public function createObject()
312  {
313  if(!is_object($this->object))
314  {
315  $this->object = new ilObjGroup();
316  }
317 
318  $this->ctrl->setParameter($this,'new_type','grp');
319  $this->initForm('create');
320  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.grp_create.html','Modules/Group');
321  $this->tpl->setVariable('CREATE_FORM',$this->form->getHTML());
322 
323  // IMPORT
324  $this->tpl->setVariable('IMP_FORMACTION',$this->ctrl->getFormAction($this));
325  $this->tpl->setVariable("TYPE_IMG",
326  ilUtil::getImagePath("icon_grp.gif"));
327  $this->tpl->setVariable("ALT_IMG", $this->lng->txt("obj_grp"));
328 
329  $this->tpl->setVariable("TXT_REQUIRED_FLD", $this->lng->txt("required_field"));
330  $this->tpl->setVariable("TXT_IMPORT_CRS", $this->lng->txt("import_grp"));
331  $this->tpl->setVariable("TXT_CRS_FILE", $this->lng->txt("file"));
332  $this->tpl->setVariable("TXT_IMPORT", $this->lng->txt("import"));
333  $this->tpl->setVariable('TXT_CANCEL',$this->lng->txt('cancel'));
334 
335  // get the value for the maximal uploadable filesize from the php.ini (if available)
336  $umf=get_cfg_var("upload_max_filesize");
337  // get the value for the maximal post data from the php.ini (if available)
338  $pms=get_cfg_var("post_max_size");
339 
340  // use the smaller one as limit
341  $max_filesize=min($umf, $pms);
342  if (!$max_filesize)
343  $max_filesize=max($umf, $pms);
344 
345  // gives out the limit as a littel notice :)
346  $this->tpl->setVariable("TXT_FILE_INFO", $this->lng->txt("file_notice").$max_filesize);
347 
348 
349  $this->fillCloneTemplate('DUPLICATE','grp');
350  }
351 
358  public function saveObject()
359  {
360  global $ilErr,$ilUser;
361 
362  $this->object = new ilObjGroup();
363 
364  $this->load();
365  $ilErr->setMessage('');
366 
367  if(!$this->object->validate())
368  {
369  $err = $this->lng->txt('err_check_input');
371  $err = $ilErr->getMessage();
373  $this->createObject();
374  return true;
375  }
376 
377  $this->object->create();
378  $this->object->createReference();
379  $this->object->putInTree($_GET["ref_id"]);
380  $this->object->setPermissions($_GET["ref_id"]);
381  $this->object->initDefaultRoles();
382  $this->object->initGroupStatus($this->object->getGroupType());
383 
384 
385  // Add user as admin and enable notification
386  include_once('./Modules/Group/classes/class.ilGroupParticipants.php');
387  $members_obj = ilGroupParticipants::_getInstanceByObjId($this->object->getId());
388  $members_obj->add($ilUser->getId(),IL_GRP_ADMIN);
389  $members_obj->updateNotification($ilUser->getId(),1);
390 
391 
392  // BEGIN ChangeEvent: Record save object.
393  require_once('Services/Tracking/classes/class.ilChangeEvent.php');
395  {
396  ilChangeEvent::_recordWriteEvent($this->object->getId(), $ilUser->getId(), 'create');
397  }
398  // END ChangeEvent: Record save object.
399 
400 
401  ilUtil::sendSuccess($this->lng->txt("grp_added"),true);
402  $this->redirectToRefId($_GET["ref_id"]);
403  }
404 
412  public function editObject()
413  {
414  $this->checkPermission("write");
415 
416  $this->setSubTabs('settings');
417  $this->tabs_gui->setTabActive('settings');
418  $this->tabs_gui->setSubTabActive('grp_settings');
419 
420  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.grp_edit.html','Modules/Group');
421  if($_GET['group_type_changed'])
422  {
423  $this->ctrl->clearParameters($this);
424  $this->tpl->setVariable('GRP_FORMACTION',$this->ctrl->getFormAction($this));
425  $this->tpl->setVariable('TXT_SW_GRP_TYPE_S',$this->lng->txt('grp_change_type'));
426  $this->tpl->setVariable('TXT_SW_GRP_TYPE_C',$this->lng->txt('cancel'));
427  $this->initForm('update_group_type');
428  }
429  else
430  {
431  $this->initForm('edit');
432  }
433  $this->tpl->setVariable('EDIT_FORM',$this->form->getHTML());
434  }
435 
443  public function updateGroupTypeObject()
444  {
445  $type = $this->object->getGroupType() ?
446  $this->object->getGroupType() :
447  $this->object->readGroupStatus();
448 
449  if($type == GRP_TYPE_PUBLIC)
450  {
451  $this->object->setGroupType(GRP_TYPE_CLOSED);
452  }
453  else
454  {
455  $this->object->setGroupType(GRP_TYPE_PUBLIC);
456  }
457  $this->object->updateGroupType();
458  $this->object->update();
459  ilUtil::sendSuccess($this->lng->txt('grp_type_changed_info'),true);
460  $this->ctrl->redirect($this,'edit');
461  }
462 
463 
469  public function updateObject()
470  {
471  global $ilErr;
472 
473  $this->checkPermission('write');
474 
475  $old_type = $this->object->getGroupType();
476 
477  $this->load();
478  $ilErr->setMessage('');
479 
480  if(!$this->object->validate())
481  {
482  $err = $this->lng->txt('err_check_input');
484  $err = $ilErr->getMessage();
486  $this->editObject();
487  return true;
488  }
489 
490  $modified = false;
491  if($this->object->isGroupTypeModified($old_type) and !$update_group_type)
492  {
493  $modified = true;
494  $this->object->setGroupType($old_type);
495  }
496 
497  $this->object->update();
498 
499  // BEGIN ChangeEvents: Record update Object.
500  require_once('Services/Tracking/classes/class.ilChangeEvent.php');
502  {
503  global $ilUser;
504  ilChangeEvent::_recordWriteEvent($this->object->getId(), $ilUser->getId(), 'update');
505  ilChangeEvent::_catchupWriteEvents($this->object->getId(), $ilUser->getId());
506  }
507  // END PATCH ChangeEvents: Record update Object.
508 
509  if($modified)
510  {
511  ilUtil::sendQuestion($this->lng->txt('grp_warn_grp_type_changed'),true);
512  $this->ctrl->setParameter($this,'group_type_changed',1);
513  $this->ctrl->redirect($this,'edit');
514  return false;
515  }
516  else
517  {
518  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"),true);
519  $this->ctrl->redirect($this,'edit');
520  return true;
521  }
522  }
523 
527  public function editGroupIconsObject()
528  {
529  global $rbacsystem;
530 
531  $this->checkPermission('write');
532 
533  $this->setSubTabs("settings");
534  $this->tabs_gui->setTabActive('settings');
535  $this->tabs_gui->setSubTabActive('grp_icon_settings');
536 
537  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.grp_edit_icons.html",'Modules/Group');
538  $this->showCustomIconsEditing();
539  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this,'updateGroupIcons'));
540  $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
541  $this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt("save"));
542  $this->tpl->setVariable("CMD_CANCEL", "cancel");
543  $this->tpl->setVariable("CMD_SUBMIT", "updateGroupIcons");
544  $this->tpl->parseCurrentBlock();
545  }
546 
553  public function updateGroupIconsObject()
554  {
555  $this->checkPermission('write');
556 
557  //save custom icons
558  if ($this->ilias->getSetting("custom_icons"))
559  {
560  $this->object->saveIcons($_FILES["cont_big_icon"]['tmp_name'],
561  $_FILES["cont_small_icon"]['tmp_name'], $_FILES["cont_tiny_icon"]['tmp_name']);
562  }
563 
564  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"),true);
565  $this->ctrl->redirect($this,"editGroupIcons");
566  }
567 
573  public function removeSmallIconObject()
574  {
575  $this->object->removeSmallIcon();
576  ilUtil::redirect($this->ctrl->getLinkTarget($this, "editGroupIcons"));
577  }
578 
584  public function removeBigIconObject()
585  {
586  $this->object->removeBigIcon();
587  ilUtil::redirect($this->ctrl->getLinkTarget($this, "editGroupIcons"));
588  }
589 
595  public function removeTinyIconObject()
596  {
597  $this->object->removeTinyIcon();
598  ilUtil::redirect($this->ctrl->getLinkTarget($this, "editGroupIcons"));
599  }
600 
604  public function editMapSettingsObject()
605  {
606  global $ilUser, $ilCtrl, $ilUser, $ilAccess;
607 
608  $this->setSubTabs("settings");
609  $this->tabs_gui->setTabActive('settings');
610  $this->tabs_gui->setSubTabActive('grp_map_settings');
611 
612  include_once('./Services/GoogleMaps/classes/class.ilGoogleMapUtil.php');
614  !$ilAccess->checkAccess("write", "", $this->object->getRefId()))
615  {
616  return;
617  }
618 
619  $latitude = $this->object->getLatitude();
620  $longitude = $this->object->getLongitude();
621  $zoom = $this->object->getLocationZoom();
622 
623  // Get Default settings, when nothing is set
624  if ($latitude == 0 && $longitude == 0 && $zoom == 0)
625  {
627  $latitude = $def["latitude"];
628  $longitude = $def["longitude"];
629  $zoom = $def["zoom"];
630  }
631 
632 
633  //$this->tpl->setTitleIcon(ilUtil::getImagePath("icon_pd_b.gif"), $this->lng->txt("personal_desktop"));
634  //$this->tpl->setVariable("HEADER", $this->lng->txt("personal_desktop"));
635 
636  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
637  $form = new ilPropertyFormGUI();
638  $form->setFormAction($ilCtrl->getFormAction($this));
639 
640  $form->setTitle($this->lng->txt("grp_map_settings"));
641 
642  // enable map
643  $public = new ilCheckboxInputGUI($this->lng->txt("grp_enable_map"),
644  "enable_map");
645  $public->setValue("1");
646  $public->setChecked($this->object->getEnableGroupMap());
647  $form->addItem($public);
648 
649  // map location
650  $loc_prop = new ilLocationInputGUI($this->lng->txt("grp_map_location"),
651  "location");
652  $loc_prop->setLatitude($latitude);
653  $loc_prop->setLongitude($longitude);
654  $loc_prop->setZoom($zoom);
655  $form->addItem($loc_prop);
656 
657  $form->addCommandButton("saveMapSettings", $this->lng->txt("save"));
658 
659  $this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
660  }
661 
662  public function saveMapSettingsObject()
663  {
664  global $ilCtrl, $ilUser;
665 
666  $this->object->setLatitude(ilUtil::stripSlashes($_POST["location"]["latitude"]));
667  $this->object->setLongitude(ilUtil::stripSlashes($_POST["location"]["longitude"]));
668  $this->object->setLocationZoom(ilUtil::stripSlashes($_POST["location"]["zoom"]));
669  $this->object->setEnableGroupMap(ilUtil::stripSlashes($_POST["enable_map"]));
670  $this->object->update();
671 
672  $ilCtrl->redirect($this, "editMapSettings");
673  }
674 
678  public function membersMapObject()
679  {
680  global $tpl;
681 
682  $this->setSubTabs('members');
683  $this->tabs_gui->setTabActive('members');
684 
685  include_once("./Services/GoogleMaps/classes/class.ilGoogleMapUtil.php");
686  if (!ilGoogleMapUtil::isActivated() || !$this->object->getEnableGroupMap())
687  {
688  return;
689  }
690 
691  include_once("./Services/GoogleMaps/classes/class.ilGoogleMapGUI.php");
692  $map = new ilGoogleMapGUI();
693  $map->setMapId("group_map");
694  $map->setWidth("700px");
695  $map->setHeight("500px");
696  $map->setLatitude($this->object->getLatitude());
697  $map->setLongitude($this->object->getLongitude());
698  $map->setZoom($this->object->getLocationZoom());
699  $map->setEnableTypeControl(true);
700  $map->setEnableNavigationControl(true);
701  $map->setEnableCentralMarker(true);
702 
703 
704  $member_ids = $this->object->getGroupMemberIds();
705  $admin_ids = $this->object->getGroupAdminIds();
706 
707  // fetch all users data in one shot to improve performance
708  $members = $this->object->getGroupMemberData($member_ids);
709  foreach($member_ids as $user_id)
710  {
711  $map->addUserMarker($user_id);
712  }
713  $tpl->setContent($map->getHTML());
714  $tpl->setLeftContent($map->getUserListHTML());
715  }
716 
717 
724  public function editInfoObject()
725  {
726  global $ilErr,$ilAccess;
727 
728  $this->checkPermission('write');
729 
730  $this->setSubTabs('settings');
731  $this->tabs_gui->setTabActive('settings');
732  $this->tabs_gui->setSubTabActive('grp_info_settings');
733 
734  $this->initInfoEditor();
735  $this->tpl->setContent($this->form->getHTML());
736  }
737 
744  protected function initInfoEditor()
745  {
746  if(is_object($this->form))
747  {
748  return true;
749  }
750 
751  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
752  $this->form = new ilPropertyFormGUI();
753  $this->form->setFormAction($this->ctrl->getFormAction($this,'updateInfo'));
754  $this->form->setTitle($this->lng->txt('grp_general_informations'));
755  $this->form->addCommandButton('updateInfo',$this->lng->txt('save'));
756  $this->form->addCommandButton('cancel',$this->lng->txt('cancel'));
757 
758  $area = new ilTextAreaInputGUI($this->lng->txt('grp_information'),'important');
759  $area->setInfo($this->lng->txt('grp_information_info'));
760  $area->setValue($this->object->getInformation());
761  $area->setRows(8);
762  $area->setCols(80);
763  $this->form->addItem($area);
764  }
765 
772  public function updateInfoObject()
773  {
774  $this->checkPermission('write');
775 
776  $this->object->setInformation(ilUtil::stripSlashes($_POST['important']));
777  $this->object->update();
778 
779  ilUtil::sendSuccess($this->lng->txt("settings_saved"));
780  $this->editInfoObject();
781  return true;
782  }
783 
785 
790  public function membersGalleryObject()
791  {
792  global $rbacsystem, $ilAccess, $ilUser;
793 
794  $is_admin = (bool) $rbacsystem->checkAccess("write", $this->object->getRefId());
795 
796  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.crs_members_gallery.html','Modules/Course');
797 
798  $this->setSubTabs('members');
799  $this->tabs_gui->setTabActive('members');
800 
801  $member_ids = $this->object->getGroupMemberIds();
802  $admin_ids = $this->object->getGroupAdminIds();
803 
804  // fetch all users data in one shot to improve performance
805  $members = $this->object->getGroupMemberData($member_ids);
806 
807  // MEMBERS
808  if(count($members))
809  {
810  $ordered_members = array();
811 
812  foreach($members as $member)
813  {
814  // get user object
815  if(!($usr_obj = ilObjectFactory::getInstanceByObjId($member["id"],false)))
816  {
817  continue;
818  }
819 
820  // please do not use strtoupper on first/last name for output
821  // this messes up with some unicode characters, i guess
822  // depending on php verion, alex
823  array_push($ordered_members,array("id" => $member["id"],
824  "login" => $usr_obj->getLogin(),
825  "lastname" => $usr_obj->getLastName(),
826  "firstname" => $usr_obj->getFirstName(),
827  "sortlastname" => strtoupper($usr_obj->getLastName()).strtoupper($usr_obj->getFirstName()),
828  "usr_obj" => $usr_obj));
829  }
830 
831  $ordered_members=ilUtil::sortArray($ordered_members,"sortlastname","asc");
832 
833  foreach($ordered_members as $member) {
834 
835  $usr_obj = $member["usr_obj"];
836 
837  $public_profile = $usr_obj->getPref("public_profile");
838  if ($public_profile == "g")
839  {
840  $public_profile = "y";
841  }
842 
843  // SET LINK TARGET FOR USER PROFILE
844  $this->ctrl->setParameterByClass("ilpublicuserprofilegui", "user", $member["id"]);
845  $profile_target = $this->ctrl->getLinkTargetByClass("ilpublicuserprofilegui","getHTML");
846 
847  // GET USER IMAGE
848  $file = $usr_obj->getPersonalPicturePath("xsmall");
849 
850  switch(in_array($member["id"],$admin_ids))
851  {
852  //admins
853  case 1:
854  if ($public_profile == "y")
855  {
856  $this->tpl->setCurrentBlock("tutor_linked");
857  $this->tpl->setVariable("LINK_PROFILE", $profile_target);
858  $this->tpl->setVariable("SRC_USR_IMAGE", $file);
859  $this->tpl->parseCurrentBlock();
860  }
861  else
862  {
863  $this->tpl->setCurrentBlock("tutor_not_linked");
864  $this->tpl->setVariable("SRC_USR_IMAGE", $file);
865  $this->tpl->parseCurrentBlock();
866  }
867  $this->tpl->setCurrentBlock("tutor");
868  break;
869 
870  case 0:
871  if ($public_profile == "y")
872  {
873  $this->tpl->setCurrentBlock("member_linked");
874  $this->tpl->setVariable("LINK_PROFILE", $profile_target);
875  $this->tpl->setVariable("SRC_USR_IMAGE", $file);
876  $this->tpl->parseCurrentBlock();
877  }
878  else
879  {
880  $this->tpl->setCurrentBlock("member_not_linked");
881  $this->tpl->setVariable("SRC_USR_IMAGE", $file);
882  $this->tpl->parseCurrentBlock();
883  }
884  $this->tpl->setCurrentBlock("member");
885  break;
886  }
887 
888  // do not show name, if public profile is not activated
889  if ($public_profile == "y")
890  {
891  $this->tpl->setVariable("FIRSTNAME", $member["firstname"]);
892  $this->tpl->setVariable("LASTNAME", $member["lastname"]);
893  }
894  $this->tpl->setVariable("LOGIN", $usr_obj->getLogin());
895  $this->tpl->parseCurrentBlock();
896  }
897  $this->tpl->setCurrentBlock("members");
898  //$this->tpl->setVariable("MEMBERS_TABLE_HEADER",$this->lng->txt('crs_members_title'));
899  $this->tpl->parseCurrentBlock();
900  }
901 
902  $this->tpl->setVariable("TITLE",$this->lng->txt('crs_members_print_title'));
903  $this->tpl->setVariable("CSS_PATH",ilUtil::getStyleSheetLocation());
904  }
905 
906 
907  protected function readMemberData($ids,$role = 'admin')
908  {
909  include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
910  $privacy = ilPrivacySettings::_getInstance();
911 
912  if($this->show_tracking)
913  {
914  include_once 'Services/Tracking/classes/class.ilLPStatusWrapper.php';
915  $completed = ilLPStatusWrapper::_getCompleted($this->object->getId());
916  $in_progress = ilLPStatusWrapper::_getInProgress($this->object->getId());
917  $not_attempted = ilLPStatusWrapper::_getNotAttempted($this->object->getId());
918  $failed = ilLPStatusWrapper::_getFailed($this->object->getId());
919  }
920 
921  if($privacy->enabledGroupAccessTimes())
922  {
923  include_once('./Services/Tracking/classes/class.ilLearningProgress.php');
924  $progress = ilLearningProgress::_lookupProgressByObjId($this->object->getId());
925  }
926 
927  foreach($ids as $usr_id)
928  {
929  $name = ilObjUser::_lookupName($usr_id);
930  $tmp_data['firstname'] = $name['firstname'];
931  $tmp_data['lastname'] = $name['lastname'];
932  $tmp_data['login'] = ilObjUser::_lookupLogin($usr_id);
933  $tmp_data['notification'] = $this->object->members_obj->isNotificationEnabled($usr_id) ? 1 : 0;
934  $tmp_data['usr_id'] = $usr_id;
935  $tmp_data['login'] = ilObjUser::_lookupLogin($usr_id);
936 
937  if($this->show_tracking)
938  {
939  if(in_array($usr_id,$completed))
940  {
941  $tmp_data['progress'] = LP_STATUS_COMPLETED;
942  }
943  elseif(in_array($usr_id,$in_progress))
944  {
945  $tmp_data['progress'] = LP_STATUS_IN_PROGRESS;
946  }
947  elseif(in_array($usr_id,$failed))
948  {
949  $tmp_data['progress'] = LP_STATUS_FAILED;
950  }
951  else
952  {
953  $tmp_data['progress'] = LP_STATUS_NOT_ATTEMPTED;
954  }
955  }
956 
957  if($privacy->enabledGroupAccessTimes())
958  {
959  if(isset($progress[$usr_id]['ts']) and $progress[$usr_id]['ts'])
960  {
961  $tmp_data['access_time'] = ilDatePresentation::formatDate(
962  $tmp_date = new ilDateTime($progress[$usr_id]['ts'],IL_CAL_UNIX));
963  $tmp_data['access_time_unix'] = $tmp_date->get(IL_CAL_UNIX);
964  }
965  else
966  {
967  $tmp_data['access_time'] = $this->lng->txt('no_date');
968  $tmp_data['access_time_unix'] = 0;
969  }
970  }
971 
972  $members[] = $tmp_data;
973  }
974  return $members ? $members : array();
975  }
976 
983  public function membersObject()
984  {
985  global $ilUser, $ilToolbar, $lng, $ilCtrl;
986 
987  include_once('./Modules/Group/classes/class.ilGroupParticipants.php');
988  include_once('./Modules/Group/classes/class.ilGroupParticipantsTableGUI.php');
989 
990  $this->checkPermission('write');
991 
992  include_once './Services/Tracking/classes/class.ilObjUserTracking.php';
993  include_once('./Services/Tracking/classes/class.ilLPObjSettings.php');
994  $this->show_tracking = (ilObjUserTracking::_enabledLearningProgress() and
996  ilLPObjSettings::_lookupMode($this->object->getId()) != LP_MODE_DEACTIVATED);
997 
998 
999  $part = ilGroupParticipants::_getInstanceByObjId($this->object->getId());
1000 
1001  $this->setSubTabs('members');
1002  $this->tabs_gui->setTabActive('members');
1003  $this->tabs_gui->setSubTabActive('grp_edit_members');
1004 
1005  $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.grp_edit_members.html','Modules/Group');
1006  $this->tpl->setVariable('FORMACTION',$this->ctrl->getFormAction($this));
1007 
1008  // add members
1009 
1010  // user input
1011  include_once("./Services/Form/classes/class.ilUserLoginAutoCompleteInputGUI.php");
1012  $ul = new ilUserLoginAutoCompleteInputGUI($lng->txt("user"), "user_login", $this, "addMemberAutoComplete");
1013  $ul->setSize(15);
1014  $ilToolbar->addInputItem($ul, true);
1015 
1016  // member type
1017  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
1018  $options = array(
1019  ilObjGroup::GRP_MEMBER => $lng->txt("member"),
1020  ilObjGroup::GRP_ADMIN => $lng->txt("administrator")
1021  );
1022  $si = new ilSelectInputGUI("", "member_type");
1023  $si->setOptions($options);
1024  $ilToolbar->addInputItem($si);
1025 
1026  // add button
1027  $ilToolbar->addFormButton($lng->txt("add"), "addAsMember");
1028  $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1029 
1030  // spacer
1031  $ilToolbar->addSeparator();
1032 
1033  // search button
1034  $ilToolbar->addButton($this->lng->txt("grp_search_users"),
1035  $this->ctrl->getLinkTargetByClass('ilRepositorySearchGUI','start'));
1036 
1037  $this->setShowHidePrefs();
1038 
1039 
1040  // Waiting list table
1041  include_once('./Modules/Group/classes/class.ilGroupWaitingList.php');
1042  $waiting_list = new ilGroupWaitingList($this->object->getId());
1043  if(count($wait = $waiting_list->getAllUsers()))
1044  {
1045  include_once('./Services/Membership/classes/class.ilWaitingListTableGUI.php');
1046  if($ilUser->getPref('grp_wait_hide'))
1047  {
1048  $table_gui = new ilWaitingListTableGUI($this,$waiting_list,false);
1049  $this->ctrl->setParameter($this,'wait_hide',0);
1050  $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,'members'),
1051  $this->lng->txt('show'),
1052  '',
1053  ilUtil::getImagePath('edit_add.png'));
1054  $this->ctrl->clearParameters($this);
1055  }
1056  else
1057  {
1058  $table_gui = new ilWaitingListTableGUI($this,$waiting_list,true);
1059  $this->ctrl->setParameter($this,'wait_hide',1);
1060  $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,'members'),
1061  $this->lng->txt('hide'),
1062  '',
1063  ilUtil::getImagePath('edit_remove.png'));
1064  $this->ctrl->clearParameters($this);
1065  }
1066  $table_gui->setUsers($wait);
1067  $table_gui->setTitle($this->lng->txt('grp_header_waiting_list'),'icon_usr.gif',$this->lng->txt('group_new_registrations'));
1068  $this->tpl->setVariable('TABLE_SUB',$table_gui->getHTML());
1069  }
1070 
1071 
1072  // Subscriber table
1073  if(count($subscribers = $part->getSubscribers()))
1074  {
1075  include_once('./Services/Membership/classes/class.ilSubscriberTableGUI.php');
1076  if($ilUser->getPref('grp_subscriber_hide'))
1077  {
1078  $table_gui = new ilSubscriberTableGUI($this,$part,false);
1079  $this->ctrl->setParameter($this,'subscriber_hide',0);
1080  $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,'members'),
1081  $this->lng->txt('show'),
1082  '',
1083  ilUtil::getImagePath('edit_add.png'));
1084  $this->ctrl->clearParameters($this);
1085  }
1086  else
1087  {
1088  $table_gui = new ilSubscriberTableGUI($this,$part,true);
1089  $this->ctrl->setParameter($this,'subscriber_hide',1);
1090  $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,'members'),
1091  $this->lng->txt('hide'),
1092  '',
1093  ilUtil::getImagePath('edit_remove.png'));
1094  $this->ctrl->clearParameters($this);
1095  }
1096  $table_gui->setSubscribers($subscribers);
1097  $table_gui->setTitle($this->lng->txt('group_new_registrations'),'icon_usr.gif',$this->lng->txt('group_new_registrations'));
1098  $this->tpl->setVariable('TABLE_SUB',$table_gui->getHTML());
1099  }
1100 
1101  if(count($part->getAdmins()))
1102  {
1103  if($ilUser->getPref('grp_admin_hide'))
1104  {
1105  $table_gui = new ilGroupParticipantsTableGUI($this,'admin',false,$this->show_tracking);
1106  $this->ctrl->setParameter($this,'admin_hide',0);
1107  $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,'members'),
1108  $this->lng->txt('show'),
1109  '',
1110  ilUtil::getImagePath('edit_add.png'));
1111  $this->ctrl->clearParameters($this);
1112  }
1113  else
1114  {
1115  $table_gui = new ilGroupParticipantsTableGUI($this,'admin',true,$this->show_tracking);
1116  $this->ctrl->setParameter($this,'admin_hide',1);
1117  $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,'members'),
1118  $this->lng->txt('hide'),
1119  '',
1120  ilUtil::getImagePath('edit_remove.png'));
1121  $this->ctrl->clearParameters($this);
1122  }
1123  $table_gui->setTitle($this->lng->txt('grp_admins'),'icon_usr.gif',$this->lng->txt('grp_admins'));
1124  $table_gui->setData($this->readMemberData($part->getAdmins()));
1125  $this->tpl->setVariable('ADMINS',$table_gui->getHTML());
1126  }
1127 
1128  if(count($part->getMembers()))
1129  {
1130  if($ilUser->getPref('grp_member_hide'))
1131  {
1132  $table_gui = new ilGroupParticipantsTableGUI($this,'member',false,$this->show_tracking);
1133  $this->ctrl->setParameter($this,'member_hide',0);
1134  $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,'members'),
1135  $this->lng->txt('show'),
1136  '',
1137  ilUtil::getImagePath('edit_add.png'));
1138  $this->ctrl->clearParameters($this);
1139  }
1140  else
1141  {
1142  $table_gui = new ilGroupParticipantsTableGUI($this,'member',true,$this->show_tracking);
1143  $this->ctrl->setParameter($this,'member_hide',1);
1144  $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this,'members'),
1145  $this->lng->txt('hide'),
1146  '',
1147  ilUtil::getImagePath('edit_remove.png'));
1148  $this->ctrl->clearParameters($this);
1149  }
1150 
1151  $table_gui->setTitle($this->lng->txt('grp_members'),'icon_usr.gif',$this->lng->txt('grp_members'));
1152  $table_gui->setData($this->readMemberData($part->getMembers()));
1153  $this->tpl->setVariable('MEMBERS',$table_gui->getHTML());
1154 
1155  }
1156 
1157  $this->tpl->setVariable('TXT_SELECTED_USER',$this->lng->txt('grp_selected_users'));
1158  $this->tpl->setVariable('BTN_FOOTER_EDIT',$this->lng->txt('edit'));
1159  $this->tpl->setVariable('BTN_FOOTER_VAL',$this->lng->txt('remove'));
1160  $this->tpl->setVariable('BTN_FOOTER_MAIL',$this->lng->txt('grp_mem_send_mail'));
1161  $this->tpl->setVariable('ARROW_DOWN',ilUtil::getImagePath('arrow_downright.gif'));
1162 
1163  }
1164 
1169  {
1170  include_once("./Services/Form/classes/class.ilUserLoginAutoCompleteInputGUI.php");
1172  }
1173 
1180  public function assignSubscribersObject()
1181  {
1182  global $lng, $ilIliasIniFile,$ilUser;
1183 
1184  $this->checkPermission('write');
1185 
1186  if(!count($_POST['subscribers']))
1187  {
1188  ilUtil::sendFailure($this->lng->txt('no_checkbox'));
1189  $this->membersObject();
1190  return false;
1191  }
1192 
1193  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1194  foreach($_POST['subscribers'] as $usr_id)
1195  {
1196  $this->object->members_obj->sendNotification(
1198  $usr_id
1199  );
1200 
1201  $this->object->members_obj->add($usr_id,IL_GRP_MEMBER);
1202  $this->object->members_obj->deleteSubscriber($usr_id);
1203  }
1204  ilUtil::sendSuccess($this->lng->txt("grp_msg_applicants_assigned"));
1205  $this->membersObject();
1206  return true;
1207  }
1208 
1215  public function refuseSubscribersObject()
1216  {
1217  global $lng;
1218 
1219  $this->checkPermission('write');
1220 
1221  if(!count($_POST['subscribers']))
1222  {
1223  ilUtil::sendFailure($this->lng->txt('no_checkbox'));
1224  $this->membersObject();
1225  return false;
1226  }
1227 
1228  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1229  foreach($_POST['subscribers'] as $usr_id)
1230  {
1231  $this->object->members_obj->sendNotification(
1233  $usr_id
1234  );
1235  $this->object->members_obj->deleteSubscriber($usr_id);
1236  }
1237  ilUtil::sendSuccess($this->lng->txt("grp_msg_applicants_removed"));
1238  $this->membersObject();
1239  return true;
1240 
1241  }
1242 
1251  {
1252  $this->checkPermission('write');
1253 
1254  if(!count($_POST["waiting"]))
1255  {
1256  ilUtil::sendFailure($this->lng->txt("no_checkbox"));
1257  $this->membersObject();
1258  return false;
1259  }
1260 
1261  include_once('./Modules/Group/classes/class.ilGroupWaitingList.php');
1262  $waiting_list = new ilGroupWaitingList($this->object->getId());
1263 
1264  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1265 
1266  $added_users = 0;
1267  foreach($_POST["waiting"] as $user_id)
1268  {
1269  if(!$tmp_obj = ilObjectFactory::getInstanceByObjId($user_id,false))
1270  {
1271  continue;
1272  }
1273  if($this->object->members_obj->isAssigned($user_id))
1274  {
1275  continue;
1276  }
1277  $this->object->members_obj->add($user_id,IL_GRP_MEMBER);
1278  $this->object->members_obj->sendNotification(
1280  $user_id
1281  );
1282  $waiting_list->removeFromList($user_id);
1283 
1284  ++$added_users;
1285  }
1286  if($added_users)
1287  {
1288  ilUtil::sendSuccess($this->lng->txt("grp_users_added"));
1289  $this->membersObject();
1290 
1291  return true;
1292  }
1293  else
1294  {
1295  ilUtil::sendFailure($this->lng->txt("grp_users_already_assigned"));
1296  $this->searchObject();
1297 
1298  return false;
1299  }
1300  }
1301 
1308  public function refuseFromListObject()
1309  {
1310  $this->checkPermission('write');
1311 
1312  if(!count($_POST['waiting']))
1313  {
1314  ilUtil::sendFailure($this->lng->txt('no_checkbox'));
1315  $this->membersObject();
1316  return false;
1317  }
1318 
1319  include_once('./Modules/Group/classes/class.ilGroupWaitingList.php');
1320  $waiting_list = new ilGroupWaitingList($this->object->getId());
1321 
1322  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1323  foreach($_POST["waiting"] as $user_id)
1324  {
1325  $waiting_list->removeFromList($user_id);
1326  $this->object->members_obj->sendNotification(
1328  $user_id
1329  );
1330  }
1331 
1332  ilUtil::sendSuccess($this->lng->txt('grp_users_removed_from_list'));
1333  $this->membersObject();
1334  return true;
1335  }
1336 
1342  public function confirmDeleteMembersObject()
1343  {
1344  $this->checkPermission('write');
1345 
1346  $this->setSubTabs('members');
1347  $this->tabs_gui->setTabActive('members');
1348  $this->tabs_gui->setSubTabActive('grp_edit_members');
1349 
1350  if(!count($_POST['admins']) and !count($_POST['members']))
1351  {
1352  ilUtil::sendFailure($this->lng->txt('no_checkbox'));
1353  $this->membersObject();
1354  return false;
1355  }
1356 
1357  if(count($_POST['admins']) ==
1358  count(ilGroupParticipants::_getInstanceByObjId($this->object->getId())->getAdmins()))
1359  {
1360  ilUtil::sendFailure($this->lng->txt('grp_err_administrator_required'));
1361  $this->membersObject();
1362  return false;
1363  }
1364 
1365  include_once('./Services/Utilities/classes/class.ilConfirmationGUI.php');
1366  $confirm = new ilConfirmationGUI();
1367  $confirm->setFormAction($this->ctrl->getFormAction($this,'deleteMembers'));
1368  $confirm->setHeaderText($this->lng->txt('grp_dismiss_member'));
1369  $confirm->setConfirm($this->lng->txt('confirm'),'deleteMembers');
1370  $confirm->setCancel($this->lng->txt('cancel'),'members');
1371 
1372  foreach($this->readMemberData(array_merge((array) $_POST['admins'],(array) $_POST['members'])) as $participants)
1373  {
1374  $confirm->addItem('participants[]',
1375  $participants['usr_id'],
1376  $participants['lastname'].', '.$participants['firstname'].' ['.$participants['login'].']',
1377  ilUtil::getImagePath('icon_usr.gif'));
1378  }
1379 
1380  $this->tpl->setContent($confirm->getHTML());
1381  }
1382 
1390  public function deleteMembersObject()
1391  {
1392  $this->checkPermission('write');
1393 
1394  if(!count($_POST['participants']))
1395  {
1396  ilUtil::sendFailure($this->lng->txt('no_checkbox'));
1397  $this->membersObject();
1398  return true;
1399  }
1400 
1401  $this->object->members_obj->deleteParticipants($_POST['participants']);
1402 
1403  // Send notification
1404  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1405  foreach($_POST['participants'] as $part)
1406  {
1407  $this->object->members_obj->sendNotification(
1409  $part
1410  );
1411  }
1412 
1413 
1414  ilUtil::sendSuccess($this->lng->txt("grp_msg_membership_annulled"));
1415  $this->membersObject();
1416  return true;
1417  }
1418 
1427  {
1428  if(isset($_GET['member_id']))
1429  {
1430  $_POST['participants'] = array($_GET['member_id']);
1431  }
1432  else
1433  {
1434  $_POST['participants'] = array_unique(array_merge((array) $_POST['admins'],
1435  (array) $_POST['members'],
1436  (array) $_POST['waiting'],
1437  (array) $_POST['subscribers']));
1438  }
1439  if (!count($_POST['participants']))
1440  {
1441  ilUtil::sendFailure($this->lng->txt("no_checkbox"));
1442  $this->membersObject();
1443  return false;
1444  }
1445  foreach($_POST['participants'] as $usr_id)
1446  {
1447  $rcps[] = ilObjUser::_lookupLogin($usr_id);
1448  }
1449  ilUtil::redirect("ilias.php?baseClass=ilmailgui&type=new&rcp_to=".implode(',',$rcps));
1450  return true;
1451  }
1452 
1459  public function setShowHidePrefs()
1460  {
1461  global $ilUser;
1462 
1463  if(isset($_GET['admin_hide']))
1464  {
1465  $ilUser->writePref('grp_admin_hide',(int) $_GET['admin_hide']);
1466  }
1467  if(isset($_GET['member_hide']))
1468  {
1469  $ilUser->writePref('grp_member_hide',(int) $_GET['member_hide']);
1470  }
1471  if(isset($_GET['subscriber_hide']))
1472  {
1473  $ilUser->writePref('grp_subscriber_hide',(int) $_GET['subscriber_hide']);
1474  }
1475  if(isset($_GET['wait_hide']))
1476  {
1477  $ilUser->writePref('grp_wait_hide',(int) $_GET['wait_hide']);
1478  }
1479  }
1480 
1486  public function editMemberObject()
1487  {
1488  $_POST['members'] = array((int) $_GET['member_id']);
1489  $this->editMembersObject();
1490  }
1491 
1498  public function editMembersObject()
1499  {
1500  $this->checkPermission('write');
1501 
1502  $participants = array_unique(array_merge((array) $_POST['admins'],(array) $_POST['members']));
1503 
1504  if(!count($participants))
1505  {
1506  ilUtil::sendFailure($this->lng->txt('no_checkbox'));
1507  $this->membersObject();
1508  return false;
1509  }
1510 
1511  $this->setSubTabs('members');
1512  $this->tabs_gui->setTabActive('members');
1513  $this->tabs_gui->setSubTabActive('grp_edit_members');
1514 
1515  include_once('./Modules/Group/classes/class.ilGroupEditParticipantsTableGUI.php');
1516  $table_gui = new ilGroupEditParticipantsTableGUI($this);
1517  $table_gui->setTitle($this->lng->txt('grp_mem_change_status'),'icon_usr.gif',$this->lng->txt('grp_mem_change_status'));
1518  $table_gui->setData($this->readMemberData($participants));
1519 
1520  $this->tpl->setContent($table_gui->getHTML());
1521  return true;
1522  }
1523 
1531  public function updateMembersObject()
1532  {
1533  $this->checkPermission('write');
1534 
1535  if(!count($_POST['participants']))
1536  {
1537  ilUtil::sendFailure($this->lng->txt('no_checkbox'));
1538  $this->membersObject();
1539  return false;
1540  }
1541 
1542  // Check minimum one admin
1543  $has_admin = false;
1544  $admin_role = $this->object->getDefaultAdminRole();
1545  foreach(ilGroupParticipants::_getInstanceByObjId($this->object->getId())->getAdmins() as $admin_id)
1546  {
1547  if(!isset($_POST['roles'][$admin_id]))
1548  {
1549  $has_admin = true;
1550  break;
1551  }
1552  if(in_array($admin_role,$_POST['roles'][$admin_id]))
1553  {
1554  $has_admin = true;
1555  break;
1556  }
1557  }
1558 
1559  if(!$has_admin)
1560  {
1561  ilUtil::sendFailure($this->lng->txt('grp_min_one_admin'));
1562  $_POST['members'] = $_POST['participants'];
1563  $this->editMembersObject();
1564  return false;
1565  }
1566 
1567  $admin_role = $this->object->getDefaultAdminRole();
1568 
1569  $notifications = $_POST['notification'] ? $_POST['notification'] : array();
1570  foreach($_POST['participants'] as $usr_id)
1571  {
1572  // Check if a status changed mail is required
1573  $notification = false;
1574  if($this->object->members_obj->isAdmin($usr_id) and !in_array($admin_role,(array) $_POST['roles'][$usr_id]))
1575  {
1576  $notification = true;
1577  }
1578  if(!$this->object->members_obj->isAdmin($usr_id) and in_array($admin_role,(array) $_POST['roles'][$usr_id]))
1579  {
1580  $notification = true;
1581  }
1582 
1583  // TODO: check no role, owner
1584  $this->object->members_obj->updateRoleAssignments($usr_id,(array) $_POST['roles'][$usr_id]);
1585 
1586  // Disable notification for all of them
1587  $this->object->members_obj->updateNotification($usr_id,0);
1588 
1589  if($this->object->members_obj->isAdmin($usr_id) and in_array($usr_id,$notifications))
1590  {
1591  $this->object->members_obj->updateNotification($usr_id,1);
1592  }
1593 
1594  if($notification)
1595  {
1596  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1597  $this->object->members_obj->sendNotification(
1599  $usr_id
1600  );
1601  }
1602  }
1603  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"));
1604  $this->membersObject();
1605  return true;
1606  }
1607 
1615  public function updateStatusObject()
1616  {
1617  $this->checkPermission('write');
1618 
1619  $notification = $_POST['notification'] ? $_POST['notification'] : array();
1620  foreach($this->object->members_obj->getAdmins() as $admin_id)
1621  {
1622  $this->object->members_obj->updateNotification($admin_id,(int) in_array($admin_id,$notification));
1623  }
1624  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
1625  $this->membersObject();
1626  }
1627 
1628 
1629 
1631  {
1632  global $rbacsystem;
1633 
1634  $this->tabs_gui->setTabActive('export');
1635 
1636  $this->lng->loadLanguageModule('content');
1637 
1638  if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
1639  {
1640  $this->ilErr->raiseError($this->lng->txt("permission_denied"),$this->ilErr->MESSAGE);
1641  }
1642 
1643  $this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
1644  $this->__exportMenu();
1645 
1646  $this->object->__initFileObject();
1647  $export_files = $this->object->file_obj->getExportFiles();
1648 
1649  require_once("./Services/Table/classes/class.ilTableGUI.php");
1650  $tbl = new ilTableGUI();
1651 
1652  $this->tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.table.html");
1653  $this->tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.grp_export_file_row.html");
1654 
1655  $num = 0;
1656 
1657  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
1658 
1659  $tbl->setTitle($this->lng->txt("cont_export_files"));
1660  $tbl->setHeaderNames(array("", $this->lng->txt("type"),
1661  $this->lng->txt("cont_file"),
1662  $this->lng->txt("cont_size"), $this->lng->txt("date") ));
1663 
1664  $cols = array("", "type", "file", "size", "date");
1665  $header_params = array("ref_id" => $_GET["ref_id"],
1666  "cmd" => "listExportFiles", "cmdClass" => strtolower(get_class($this)));
1667  $tbl->setHeaderVars($cols, $header_params);
1668  $tbl->setColumnWidth(array("1%", "9%", "40%", "25%", "25%"));
1669 
1670  // control
1671  $tbl->setOrderColumn($_GET["sort_by"]);
1672  $tbl->setOrderDirection($_GET["sort_order"]);
1673  $tbl->setLimit($_GET["limit"]);
1674  $tbl->setOffset($_GET["offset"]);
1675  $tbl->setMaxCount($this->maxcount); // ???
1676  $tbl->disable("sort");
1677 
1678  $this->tpl->setVariable("COLUMN_COUNTS", 5);
1679 
1680  // delete button
1681  $this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.gif"));
1682  $this->tpl->setCurrentBlock("tbl_action_btn");
1683  $this->tpl->setVariable("BTN_NAME", "confirmDeleteExportFile");
1684  $this->tpl->setVariable("BTN_VALUE", $this->lng->txt("delete"));
1685  $this->tpl->parseCurrentBlock();
1686 
1687  $this->tpl->setCurrentBlock("tbl_action_btn");
1688  $this->tpl->setVariable("BTN_NAME", "downloadExportFile");
1689  $this->tpl->setVariable("BTN_VALUE", $this->lng->txt("download"));
1690  $this->tpl->parseCurrentBlock();
1691 
1692  // footer
1693  $tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
1694 
1695  $tbl->setMaxCount(count($export_files));
1696  $export_files = array_slice($export_files, $_GET["offset"], $_GET["limit"]);
1697  $tbl->render();
1698  foreach($export_files as $exp_file)
1699  {
1700  $this->tpl->setCurrentBlock("tbl_content");
1701  $this->tpl->setVariable("TXT_FILENAME", $exp_file["file"]);
1702 
1703  $css_row = ilUtil::switchColor($i++, "tblrow1", "tblrow2");
1704  $this->tpl->setVariable("CSS_ROW", $css_row);
1705 
1706  $this->tpl->setVariable("TXT_SIZE", $exp_file["size"]);
1707  $this->tpl->setVariable("TXT_TYPE", $exp_file["type"]);
1708  $this->tpl->setVariable("CHECKBOX_ID",$exp_file["file"]);
1709 
1710  $file_arr = explode("__", $exp_file["file"]);
1711  $this->tpl->setVariable('TXT_DATE',ilDatePresentation::formatDate(new ilDateTime($file_arr[0],IL_CAL_UNIX)));
1712 
1713 
1714  $this->tpl->parseCurrentBlock();
1715  }
1716  if(!count($export_files))
1717  {
1718  $tbl->disable('footer');
1719  $this->tpl->setCurrentBlock("notfound");
1720  $this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
1721  $this->tpl->setVariable("NUM_COLS", 4);
1722  $this->tpl->parseCurrentBlock();
1723  }
1724 
1725  $this->tpl->parseCurrentBlock();
1726  }
1727 
1728  function __exportMenu()
1729  {
1730  // create xml export file button
1731  $this->tpl->setCurrentBlock("btn_cell");
1732  $this->tpl->setVariable("BTN_LINK", $this->ctrl->getLinkTarget($this, "exportXML"));
1733  $this->tpl->setVariable("BTN_TXT", $this->lng->txt("cont_create_export_file_xml"));
1734  $this->tpl->parseCurrentBlock();
1735  }
1736 
1737  function exportXMLObject()
1738  {
1739  global $rbacsystem;
1740 
1741  if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
1742  {
1743  $this->ilErr->raiseError($this->lng->txt("permission_denied"),$this->ilErr->MESSAGE);
1744  }
1745 
1746  $this->object->exportXML();
1747 
1748  $this->listExportFilesObject();
1749 
1750  return true;
1751  }
1752 
1754  {
1755  global $rbacsystem;
1756 
1757  if (!$rbacsystem->checkAccess("write",$this->object->getRefId()))
1758  {
1759  $this->ilErr->raiseError($this->lng->txt("permission_denied"),$this->ilErr->MESSAGE);
1760  }
1761 
1762  if(!count($_POST['file']))
1763  {
1764  ilUtil::sendFailure($this->lng->txt('grp_select_one_file'));
1765  }
1766  else
1767  {
1768  $this->object->deleteExportFiles($_POST['file']);
1769  ilUtil::sendSuccess($this->lng->txt('grp_deleted_export_files'));
1770  }
1771 
1772  $this->listExportFilesObject();
1773 
1774  return true;
1775  }
1776 
1778  {
1779  if(!count($_POST['file']))
1780  {
1781  ilUtil::sendFailure($this->lng->txt('grp_select_one_file'));
1782  $this->listExportFilesObject();
1783  return false;
1784  }
1785  if(count($_POST['file']) > 1)
1786  {
1787  ilUtil::sendFailure($this->lng->txt('grp_select_one_file_only'));
1788  $this->listExportFilesObject();
1789  return false;
1790  }
1791 
1792  $this->object->downloadExportFile(ilUtil::stripSlashes($_POST['file'][0]));
1793 
1794  // If file wasn't sent
1795  ilUtil::sendFailure($this->lng->txt('grp_error_sending_file'));
1796 
1797  return true;
1798  }
1799 
1800 
1801 
1802 
1807  function canceledObject()
1808  {
1809  $return_location = $_GET["cmd_return_location"];
1810  if (strcmp($return_location, "") == 0)
1811  {
1812  $return_location = "";
1813  }
1814 
1815  $this->ctrl->redirect($this, $return_location);
1816  }
1817 
1818 
1819 
1824  public function leaveObject()
1825  {
1826  $this->checkPermission('leave');
1827 
1828  $this->tabs_gui->setTabActive('grp_btn_unsubscribe');
1829 
1830  $tpl = new ilTemplate('tpl.unsubscribe.html',true,true,'Modules/Group');
1831  $tpl->setVariable('UNSUB_FORMACTION',$this->ctrl->getFormAction($this));
1832  $tpl->setVariable('TXT_SUBMIT',$this->lng->txt('grp_btn_unsubscribe'));
1833  $tpl->setVariable('TXT_CANCEL',$this->lng->txt('cancel'));
1834 
1835  ilUtil::sendQuestion($this->lng->txt('grp_dismiss_myself'));
1836  $this->tpl->setContent($tpl->get());
1837  }
1838 
1845  public function unsubscribeObject()
1846  {
1847  global $ilUser,$tree;
1848 
1849  $this->checkPermission('leave');
1850 
1851  $this->object->members_obj->delete($ilUser->getId());
1852 
1853  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1854  $this->object->members_obj->sendNotification(
1856  $ilUser->getId()
1857  );
1858  $this->object->members_obj->sendNotification(
1860  $ilUser->getId()
1861  );
1862 
1863  ilUtil::sendSuccess($this->lng->txt('grp_msg_membership_annulled'),true);
1864  ilUtil::redirect('repository.php?ref_id='.$tree->getParentId($this->object->getRefId()));
1865  }
1866 
1867 
1873  {
1874  $user_ids = $_POST["id"];
1875 
1876  if (empty($user_ids[0]))
1877  {
1878  // TODO: jumps back to grp content. go back to last search result
1879  $this->ilErr->raiseError($this->lng->txt("no_checkbox"),$this->ilErr->MESSAGE);
1880  }
1881 
1882  foreach ($user_ids as $new_member)
1883  {
1884  if (!$this->object->addMember($new_member,$this->object->getDefaultMemberRole()))
1885  {
1886  $this->ilErr->raiseError("An Error occured while assigning user to group !",$this->ilErr->MESSAGE);
1887  }
1888  }
1889 
1890  unset($_SESSION["saved_post"]);
1891 
1892  ilUtil::sendSuccess($this->lng->txt("grp_msg_member_assigned"),true);
1893  ilUtil::redirect($this->ctrl->getLinkTarget($this,"members"));
1894  }
1895 
1900  {
1901  $users = explode(',', $_POST['user_login']);
1902  foreach($users as $user)
1903  {
1904  $_POST['user'][] = ilObjUser::_lookupId($user);
1905  }
1906 
1907  if(!$this->addUserObject())
1908  {
1909  $this->membersObject();
1910  }
1911  }
1912 
1917  function addUserObject()
1918  {
1919  $user_ids = $_POST["user"];
1920 
1921  $mail = new ilMail($_SESSION["AccountId"]);
1922 
1923  if (empty($user_ids[0]))
1924  {
1925  // TODO: jumps back to grp content. go back to last search result
1926  #$this->ilErr->raiseError($this->lng->txt("no_checkbox"),$this->ilErr->MESSAGE);
1927  ilUtil::sendFailure($this->lng->txt("no_checkbox"));
1928  return false;
1929  }
1930 
1931  foreach ($user_ids as $new_member)
1932  {
1933  switch($_POST['member_type'])
1934  {
1936  if (!$this->object->addMember($new_member,$this->object->getDefaultMemberRole()))
1937  {
1938  $this->ilErr->raiseError("An Error occured while assigning user to group !",$this->ilErr->MESSAGE);
1939  }
1940  break;
1941 
1942  case ilObjGroup::GRP_ADMIN:
1943  if (!$this->object->addMember($new_member,$this->object->getDefaultAdminRole()))
1944  {
1945  $this->ilErr->raiseError("An Error occured while assigning user to group !",$this->ilErr->MESSAGE);
1946  }
1947  break;
1948  }
1949 
1950  ilObjUser::_addDesktopItem($new_member, $this->object->getRefId(), 'grp');
1951 
1952  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1953  $this->object->members_obj->sendNotification(
1955  $new_member
1956  );
1957  }
1958 
1959  unset($_SESSION["saved_post"]);
1960  unset($_SESSION['grp_usr_search_result']);
1961 
1962  ilUtil::sendSuccess($this->lng->txt("grp_msg_member_assigned"),true);
1963  ilUtil::redirect($this->ctrl->getLinkTarget($this,"members"));
1964  }
1965 
1970  {
1971  global $rbacreview, $ilObjDataCache;
1972  include_once('./Services/AccessControl/classes/class.ilObjRole.php');
1973 
1974  //$this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.mail_members.html',"Services/Mail");
1975  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.mail_members.html','Services/Contact');
1976 
1977 
1978  $this->setSubTabs('members');
1979  $this->tabs_gui->setTabActive('members');
1980 
1981  $this->tpl->setVariable("MAILACTION",'ilias.php?baseClass=ilMailGUI&type=role');
1982  $this->tpl->setVariable("IMG_ARROW",ilUtil::getImagePath('arrow_downright.gif'));
1983  $this->tpl->setVariable("TXT_MARKED_ENTRIES",$this->lng->txt('marked_entries'));
1984  $this->tpl->setVariable("OK",$this->lng->txt('ok'));
1985 
1986  // Get role mailbox addresses
1987  $role_folder = $rbacreview->getRoleFolderOfObject($this->object->getRefId());
1988  $role_ids = $rbacreview->getRolesOfRoleFolder($role_folder['ref_id'], false);
1989  $role_addrs = array();
1990 
1991  // Sort by relevance
1992  $sorted_role_ids = array();
1993  $counter = 2;
1994  foreach($role_ids as $role_id)
1995  {
1996  switch(substr(ilObject::_lookupTitle($role_id),0,8))
1997  {
1998  case 'il_grp_a':
1999  $sorted_role_ids[1] = $role_id;
2000  break;
2001 
2002  case 'il_grp_m':
2003  $sorted_role_ids[0] = $role_id;
2004  break;
2005 
2006  default:
2007  $sorted_role_ids[$counter++] = $role_id;
2008  break;
2009  }
2010  }
2011  ksort($sorted_role_ids,SORT_NUMERIC);
2012  foreach ((array) $sorted_role_ids as $role_id)
2013  {
2014  $this->tpl->setCurrentBlock("mailbox_row");
2015  $role_addr = $rbacreview->getRoleMailboxAddress($role_id);
2016  $this->tpl->setVariable("CHECK_MAILBOX",ilUtil::formCheckbox(1,'roles[]',
2017  htmlspecialchars($role_addr)
2018  ));
2019 
2020  if (ilMail::_usePearMail())
2021  {
2022  // if pear mail is enabled, mailbox addresses are already localized in the language of the user
2023  $this->tpl->setVariable("MAILBOX",$role_addr);
2024  }
2025  else
2026  {
2027  // if pear mail is not enabled, we need to localize mailbox addresses in the language of the user
2028  $this->tpl->setVariable("MAILBOX",ilObjRole::_getTranslation($ilObjDataCache->lookupTitle($role_id)) . " (".$role_addr.")");
2029  }
2030  $this->tpl->parseCurrentBlock();
2031  }
2032  }
2033 
2039  {
2040  $user_ids = $_POST["user_id"];
2041 
2042  if (empty($user_ids[0]))
2043  {
2044  $this->ilErr->raiseError($this->lng->txt("no_checkbox"),$this->ilErr->MESSAGE);
2045  }
2046 
2047  $mail = new ilMail($_SESSION["AccountId"]);
2048 
2049  foreach ($user_ids as $new_member)
2050  {
2051  $user =& $this->ilias->obj_factory->getInstanceByObjId($new_member);
2052 
2053  $this->object->deleteApplicationListEntry($new_member);
2054  $mail->sendMail($user->getLogin(),"","","Membership application refused: Group ".$this->object->getTitle(),"Your application has been refused.",array(),array('system'));
2055  }
2056 
2057  ilUtil::sendSuccess($this->lng->txt("grp_msg_applicants_removed"),true);
2058  ilUtil::redirect($this->ctrl->getLinkTarget($this,"members"));
2059  }
2060 
2061  // get tabs
2062  function getTabs(&$tabs_gui)
2063  {
2064  global $rbacsystem, $ilUser, $ilAccess, $lng;
2065 
2066  if ($rbacsystem->checkAccess('read',$this->ref_id))
2067  {
2068  $tabs_gui->addTab("view_content", $lng->txt("content"),
2069  $this->ctrl->getLinkTarget($this, ""));
2070  }
2071  if ($rbacsystem->checkAccess('visible',$this->ref_id))
2072  {
2073  $tabs_gui->addTarget("info_short",
2074  $this->ctrl->getLinkTargetByClass(
2075  array("ilobjgroupgui", "ilinfoscreengui"), "showSummary"),
2076  "infoScreen",
2077  "", "",false);
2078  }
2079 
2080 
2081  if ($ilAccess->checkAccess('write','',$this->object->getRefId()))
2082  {
2083  $tabs_gui->addTarget("settings",
2084  $this->ctrl->getLinkTarget($this, "edit"), array("edit", "editMapSettings"), get_class($this),
2085  "");
2086  }
2087 
2088  // Members
2089  if($ilAccess->checkAccess('read','',$this->object->getRefId()))
2090  {
2091  $mem_cmd = $ilAccess->checkAccess('write','',$this->ref_id) ? "members" : "membersGallery";
2092  $tabs_gui->addTarget("members",$this->ctrl->getLinkTarget($this, $mem_cmd), array(),get_class($this));
2093  }
2094 
2095 
2096  // learning progress
2097  include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
2098  if(ilLearningProgressAccess::checkAccess($this->object->getRefId()))
2099  {
2100  $tabs_gui->addTarget('learning_progress',
2101  $this->ctrl->getLinkTargetByClass(array('ilobjgroupgui','illearningprogressgui'),''),
2102  '',
2103  array('illplistofobjectsgui','illplistofsettingsgui','illearningprogressgui','illplistofprogressgui'));
2104  }
2105 
2106  if ($rbacsystem->checkAccess('write',$this->object->getRefId()))
2107  {
2108  $tabs_gui->addTarget('export',
2109  $this->ctrl->getLinkTarget($this,'listExportFiles'),
2110  array('listExportFiles','exportXML','confirmDeleteExportFile','downloadExportFile'),
2111  get_class($this));
2112  }
2113 
2114  // parent tabs (all container: edit_permission, clipboard, trash
2115  parent::getTabs($tabs_gui);
2116 
2117  if($ilAccess->checkAccess('join','',$this->object->getRefId()) and
2118  !$this->object->members_obj->isAssigned($ilUser->getId()))
2119  {
2120  include_once './Modules/Group/classes/class.ilGroupWaitingList.php';
2121  if(ilGroupWaitingList::_isOnList($ilUser->getId(), $this->object->getId()))
2122  {
2123  $tabs_gui->addTab(
2124  'leave',
2125  $this->lng->txt('membership_leave'),
2126  $this->ctrl->getLinkTargetByClass('ilgroupregistrationgui','show','')
2127  );
2128 
2129  }
2130  else
2131  {
2132 
2133  $tabs_gui->addTarget("join",
2134  $this->ctrl->getLinkTargetByClass('ilgroupregistrationgui', "show"),
2135  'show',
2136  "");
2137  }
2138  }
2139  if($ilAccess->checkAccess('leave','',$this->object->getRefId()) and
2140  $this->object->members_obj->isMember($ilUser->getId()))
2141  {
2142  $tabs_gui->addTarget("grp_btn_unsubscribe",
2143  $this->ctrl->getLinkTarget($this, "leave"),
2144  '',
2145  "");
2146  }
2147  }
2148 
2149 
2150  // IMPORT FUNCTIONS
2151 
2152  function importFileObject()
2153  {
2154  if(!is_array($_FILES['xmldoc']))
2155  {
2156  ilUtil::sendFailure($this->lng->txt("import_file_not_valid"));
2157  $this->createObject();
2158  return false;
2159  }
2160 
2161  include_once './Modules/Group/classes/class.ilObjGroup.php';
2162 
2163  if($ref_id = ilObjGroup::_importFromFile($_FILES['xmldoc'],(int) $_GET['ref_id']))
2164  {
2165  $this->ctrl->setParameter($this, "ref_id", $ref_id);
2166  ilUtil::sendSuccess($this->lng->txt("import_grp_finished"),true);
2167  ilUtil::redirect($this->ctrl->getLinkTarget($this,'edit'));
2168  }
2169 
2170  ilUtil::sendFailure($this->lng->txt("import_file_not_valid"));
2171  $this->createObject();
2172  }
2173 
2174  // Methods for ConditionHandlerInterface
2175  function initConditionHandlerGUI($item_id)
2176  {
2177  include_once './classes/class.ilConditionHandlerInterface.php';
2178 
2179  if(!is_object($this->chi_obj))
2180  {
2181  if($_GET['item_id'])
2182  {
2183  $this->chi_obj =& new ilConditionHandlerInterface($this,$item_id);
2184  $this->ctrl->saveParameter($this,'item_id',$_GET['item_id']);
2185  }
2186  else
2187  {
2188  $this->chi_obj =& new ilConditionHandlerInterface($this);
2189  }
2190  }
2191  return true;
2192  }
2193 
2194 
2201  function exportObject()
2202  {
2203  $this->tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.grp_members_export.html");
2204  $this->tpl->setCurrentBlock("adm_content");
2205  $this->tpl->setVariable("FORMACTION", $this->getFormAction("export",$this->ctrl->getFormAction($this)));
2206  $this->tpl->setVariable("BUTTON_EXPORT", $this->lng->txt("export_group_members"));
2207  $this->tpl->parseCurrentBlock();
2208  }
2209 
2217  {
2218  $title = preg_replace("/\s/", "_", $this->object->getTitle());
2219  include_once "./Services/Excel/classes/class.ilExcelWriterAdapter.php";
2220  $adapter = new ilExcelWriterAdapter("export_" . $title . ".xls");
2221  $workbook = $adapter->getWorkbook();
2222  // Creating a worksheet
2223  $format_bold =& $workbook->addFormat();
2224  $format_bold->setBold();
2225  $format_percent =& $workbook->addFormat();
2226  $format_percent->setNumFormat("0.00%");
2227  $format_datetime =& $workbook->addFormat();
2228  $format_datetime->setNumFormat("DD/MM/YYYY hh:mm:ss");
2229  $format_title =& $workbook->addFormat();
2230  $format_title->setBold();
2231  $format_title->setColor('black');
2232  $format_title->setPattern(1);
2233  $format_title->setFgColor('silver');
2234  $worksheet =& $workbook->addWorksheet();
2235  $column = 0;
2236  $profile_data = array("email", "gender", "firstname", "lastname", "person_title", "institution",
2237  "department", "street", "zipcode","city", "country", "phone_office", "phone_home", "phone_mobile",
2238  "fax", "matriculation");
2239  foreach ($profile_data as $data)
2240  {
2241  $worksheet->writeString(0, $column++, $this->cleanString($this->lng->txt($data)), $format_title);
2242  }
2243  $member_ids = $this->object->getGroupMemberIds();
2244  $row = 1;
2245  foreach ($member_ids as $member_id)
2246  {
2247  $column = 0;
2248  $member =& $this->ilias->obj_factory->getInstanceByObjId($member_id);
2249  if ($member->getPref("public_email")=="y")
2250  {
2251  $worksheet->writeString($row, $column++, $this->cleanString($member->getEmail()));
2252  }
2253  else
2254  {
2255  $column++;
2256  }
2257  $worksheet->writeString($row, $column++, $this->cleanString($this->lng->txt("gender_" . $member->getGender())));
2258  $worksheet->writeString($row, $column++, $this->cleanString($member->getFirstname()));
2259  $worksheet->writeString($row, $column++, $this->cleanString($member->getLastname()));
2260  $worksheet->writeString($row, $column++, $this->cleanString($member->getUTitle()));
2261  if ($member->getPref("public_institution")=="y")
2262  {
2263  $worksheet->writeString($row, $column++, $this->cleanString($member->getInstitution()));
2264  }
2265  else
2266  {
2267  $column++;
2268  }
2269  if ($member->getPref("public_department")=="y")
2270  {
2271  $worksheet->writeString($row, $column++, $this->cleanString($member->getDepartment()));
2272  }
2273  else
2274  {
2275  $column++;
2276  }
2277  if ($member->getPref("public_street")=="y")
2278  {
2279  $worksheet->writeString($row, $column++, $this->cleanString($member->getStreet()));
2280  }
2281  else
2282  {
2283  $column++;
2284  }
2285  if ($member->getPref("public_zip")=="y")
2286  {
2287  $worksheet->writeString($row, $column++, $this->cleanString($member->getZipcode()));
2288  }
2289  else
2290  {
2291  $column++;
2292  }
2293  if ($member->getPref("public_city")=="y")
2294  {
2295  $worksheet->writeString($row, $column++, $this->cleanString($member->getCity()));
2296  }
2297  else
2298  {
2299  $column++;
2300  }
2301  if ($member->getPref("public_country")=="y")
2302  {
2303  $worksheet->writeString($row, $column++, $this->cleanString($member->getCountry()));
2304  }
2305  else
2306  {
2307  $column++;
2308  }
2309  if ($member->getPref("public_phone_office")=="y")
2310  {
2311  $worksheet->writeString($row, $column++, $this->cleanString($member->getPhoneOffice()));
2312  }
2313  else
2314  {
2315  $column++;
2316  }
2317  if ($member->getPref("public_phone_home")=="y")
2318  {
2319  $worksheet->writeString($row, $column++, $this->cleanString($member->getPhoneHome()));
2320  }
2321  else
2322  {
2323  $column++;
2324  }
2325  if ($member->getPref("public_phone_mobile")=="y")
2326  {
2327  $worksheet->writeString($row, $column++, $this->cleanString($member->getPhoneMobile()));
2328  }
2329  else
2330  {
2331  $column++;
2332  }
2333  if ($member->getPref("public_fax")=="y")
2334  {
2335  $worksheet->writeString($row, $column++, $this->cleanString($member->getFax()));
2336  }
2337  else
2338  {
2339  $column++;
2340  }
2341  if ($member->getPref("public_matriculation")=="y")
2342  {
2343  $worksheet->writeString($row, $column++, $this->cleanString($member->getMatriculation()));
2344  }
2345  else
2346  {
2347  $column++;
2348  }
2349  $row++;
2350  }
2351  $workbook->close();
2352  }
2353 
2362  function cleanString($str)
2363  {
2364  return str_replace(array("��","��","��","��","��","��","��"), array("ae","oe","ue","ss","Ae","Oe","Ue"), $str);
2365  }
2366 
2377  function infoScreenObject()
2378  {
2379  $this->ctrl->setCmd("showSummary");
2380  $this->ctrl->setCmdClass("ilinfoscreengui");
2381  $this->infoScreen();
2382  }
2383 
2387  function infoScreen()
2388  {
2389  global $rbacsystem;
2390 
2391  $this->tabs_gui->setTabActive('info_short');
2392 
2393  if(!$rbacsystem->checkAccess("visible", $this->ref_id))
2394  {
2395  $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
2396  }
2397 
2398  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
2399  $info = new ilInfoScreenGUI($this);
2400 
2401  if(strlen($this->object->getInformation()))
2402  {
2403  $info->addSection($this->lng->txt('grp_general_informations'));
2404  $info->addProperty($this->lng->txt('grp_information'), nl2br(
2405  ilUtil::makeClickable ($this->object->getInformation(), true)));
2406  }
2407 
2408  $info->enablePrivateNotes();
2409  $info->enableLearningProgress(true);
2410 
2411  $info->addSection($this->lng->txt('group_registration'));
2412  $info->showLDAPRoleGroupMappingInfo();
2413 
2414  if(!$this->object->isRegistrationEnabled())
2415  {
2416  $info->addProperty($this->lng->txt('group_registration_mode'),
2417  $this->lng->txt('grp_reg_deac_info_screen'));
2418 
2419  }
2420  else
2421  {
2422  switch($this->object->getRegistrationType())
2423  {
2425  $info->addProperty($this->lng->txt('group_registration_mode'),
2426  $this->lng->txt('grp_reg_direct_info_screen'));
2427  break;
2428 
2430  $info->addProperty($this->lng->txt('group_registration_mode'),
2431  $this->lng->txt('grp_reg_req_info_screen'));
2432  break;
2433 
2435  $info->addProperty($this->lng->txt('group_registration_mode'),
2436  $this->lng->txt('grp_reg_passwd_info_screen'));
2437  break;
2438 
2439  }
2440  /*
2441  $info->addProperty($this->lng->txt('group_registration_time'),
2442  ilDatePresentation::formatPeriod(
2443  $this->object->getRegistrationStart(),
2444  $this->object->getRegistrationEnd()));
2445  */
2446  if($this->object->isRegistrationUnlimited())
2447  {
2448  $info->addProperty($this->lng->txt('group_registration_time'),
2449  $this->lng->txt('grp_registration_unlimited'));
2450  }
2451  elseif($this->object->getRegistrationStart()->getUnixTime() < time())
2452  {
2453  $info->addProperty($this->lng->txt("group_registration_time"),
2454  $this->lng->txt('cal_until').' '.
2455  ilDatePresentation::formatDate($this->object->getRegistrationEnd()));
2456  }
2457  elseif($this->object->getRegistrationStart()->getUnixTime() >= time())
2458  {
2459  $info->addProperty($this->lng->txt("group_registration_time"),
2460  $this->lng->txt('cal_from').' '.
2461  ilDatePresentation::formatDate($this->object->getRegistrationStart()));
2462  }
2463  if ($this->object->isMembershipLimited())
2464  {
2465  $info->addProperty($this->lng->txt("mem_free_places"),
2466  max(0,$this->object->getMaxMembers() - $this->object->members_obj->getCountMembers()));
2467 
2468  }
2469 
2470  }
2471 
2472  // forward the command
2473  $this->ctrl->forwardCommand($info);
2474  }
2475 
2479  function _goto($a_target)
2480  {
2481  global $ilAccess, $ilErr, $lng;
2482 
2483  if ($ilAccess->checkAccess("read", "", $a_target))
2484  {
2485  $_GET["cmd"] = "frameset";
2486  $_GET["ref_id"] = $a_target;
2487  include("repository.php");
2488  exit;
2489  }
2490  else
2491  {
2492  // to do: force flat view
2493  if ($ilAccess->checkAccess("visible", "", $a_target))
2494  {
2495  $_GET["cmd"] = "infoScreen";
2496  $_GET["ref_id"] = $a_target;
2497  include("repository.php");
2498  exit;
2499  }
2500  else
2501  {
2502  if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
2503  {
2504  $_GET["cmd"] = "frameset";
2505  $_GET["target"] = "";
2506  $_GET["ref_id"] = ROOT_FOLDER_ID;
2507  ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
2508  ilObject::_lookupTitle(ilObject::_lookupObjId($a_target))), true);
2509  include("repository.php");
2510  exit;
2511  }
2512  }
2513  }
2514  $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
2515  }
2516 
2517 
2525  protected function initForm($a_mode = 'edit')
2526  {
2527  global $ilUser,$tpl;
2528 
2529  if(is_object($this->form))
2530  {
2531  return true;
2532  }
2533 
2534  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
2535 
2536  $this->form = new ilPropertyFormGUI();
2537  $this->form->setTableWidth('60%');
2538 
2539  switch($a_mode)
2540  {
2541  case 'edit':
2542  $this->form->setFormAction($this->ctrl->getFormAction($this,'update'));
2543  break;
2544 
2545  default:
2546  $this->form->setFormAction($this->ctrl->getFormAction($this,'save'));
2547  break;
2548  }
2549 
2550  // title
2551  $title = new ilTextInputGUI($this->lng->txt('title'),'title');
2552  $title->setSubmitFormOnEnter(true);
2553  $title->setValue($this->object->getTitle());
2554  $title->setSize(40);
2555  $title->setMaxLength(128);
2556  $title->setRequired(true);
2557  $this->form->addItem($title);
2558 
2559  // desc
2560  $desc = new ilTextAreaInputGUI($this->lng->txt('description'),'desc');
2561  $desc->setValue($this->object->getLongDescription());
2562  $desc->setRows(2);
2563  $desc->setCols(40);
2564  $this->form->addItem($desc);
2565 
2566  // Group type
2567  $grp_type = new ilRadioGroupInputGUI($this->lng->txt('grp_typ'),'grp_type');
2568 
2569  if($a_mode == 'edit')
2570  {
2571  $type = ($this->object->getGroupType() ? $this->object->getGroupType() : $this->object->readGroupStatus());
2572  }
2573  else
2574  {
2575  $type = ($this->object->getGroupType() ? $this->object->getGroupType() : GRP_TYPE_PUBLIC);
2576  }
2577 
2578  $grp_type->setValue($type);
2579  $grp_type->setRequired(true);
2580 
2581  // OPEN GROUP
2582  #$opt_open = new ilRadioOption($this->lng->txt('grp_open'),GRP_TYPE_OPEN,$this->lng->txt('grp_open_info'));
2583  #$grp_type->addOption($opt_open);
2584 
2585 
2586  // PUBLIC GROUP
2587  $opt_public = new ilRadioOption($this->lng->txt('grp_public'),GRP_TYPE_PUBLIC,$this->lng->txt('grp_public_info'));
2588  $grp_type->addOption($opt_public);
2589 
2590  // Registration type
2591  $reg_type = new ilRadioGroupInputGUI('','registration_type');
2592  $reg_type->setValue($this->object->getRegistrationType());
2593 
2594  $opt_dir = new ilRadioOption($this->lng->txt('grp_reg_direct'),GRP_REGISTRATION_DIRECT);#$this->lng->txt('grp_reg_direct_info'));
2595  $reg_type->addOption($opt_dir);
2596 
2597  $opt_pass = new ilRadioOption($this->lng->txt('grp_pass_request'),GRP_REGISTRATION_PASSWORD);
2598  $pass = new ilTextInputGUI('','password');
2599  $pass->setInfo($this->lng->txt('grp_reg_password_info'));
2600  $pass->setValue($this->object->getPassword());
2601  $pass->setSize(10);
2602  $pass->setMaxLength(32);
2603  $opt_pass->addSubItem($pass);
2604  $reg_type->addOption($opt_pass);
2605  $opt_public->addSubItem($reg_type);
2606 
2607  $opt_req = new ilRadioOption($this->lng->txt('grp_reg_request'),GRP_REGISTRATION_REQUEST,$this->lng->txt('grp_reg_request_info'));
2608  $reg_type->addOption($opt_req);
2609 
2610  $opt_deact = new ilRadioOption($this->lng->txt('grp_reg_disabled'),GRP_REGISTRATION_DEACTIVATED,$this->lng->txt('grp_reg_disabled_info'));
2611  $reg_type->addOption($opt_deact);
2612 
2613  // CLOSED GROUP
2614  $opt_closed = new ilRadioOption($this->lng->txt('grp_closed'),GRP_TYPE_CLOSED,$this->lng->txt('grp_closed_info'));
2615  $grp_type->addOption($opt_closed);
2616  if($a_mode == 'update_group_type')
2617  {
2618  $grp_type->setAlert($this->lng->txt('grp_type_changed_info'));
2619  }
2620  $this->form->addItem($grp_type);
2621 
2622  // time limit
2623  $time_limit = new ilCheckboxInputGUI($this->lng->txt('grp_reg_limited'),'reg_limit_time');
2624  $time_limit->setOptionTitle($this->lng->txt('grp_reg_limit_time'));
2625  $time_limit->setChecked($this->object->isRegistrationUnlimited() ? false : true);
2626 
2627  $this->lng->loadLanguageModule('dateplaner');
2628  include_once './Services/Form/classes/class.ilDateDurationInputGUI.php';
2629  $tpl->addJavaScript('./Services/Form/js/date_duration.js');
2630  $dur = new ilDateDurationInputGUI($this->lng->txt('grp_reg_period'),'reg');
2631  $dur->setStartText($this->lng->txt('cal_start'));
2632  $dur->setEndText($this->lng->txt('cal_end'));
2633  $dur->setMinuteStepSize(5);
2634  $dur->setShowDate(true);
2635  $dur->setShowTime(true);
2636  $dur->setStart($this->object->getRegistrationStart());
2637  $dur->setEnd($this->object->getRegistrationEnd());
2638 
2639  $time_limit->addSubItem($dur);
2640 
2641  /*
2642  $start = new ilDateTimeInputGUI($this->lng->txt('grp_reg_start'),'registration_start');
2643  $start->setShowTime(true);
2644  $start->setDate($this->object->getRegistrationStart());
2645  $time_limit->addSubItem($start);
2646 
2647  $end = new ilDateTimeInputGUI($this->lng->txt('grp_reg_end'),'registration_end');
2648  $end->setShowTime(true);
2649  $end->setDate($this->object->getRegistrationEnd());
2650 
2651  $time_limit->addSubItem($end);
2652  */
2653 
2654  $this->form->addItem($time_limit);
2655 
2656  // max member
2657  $lim = new ilCheckboxInputGUI($this->lng->txt('reg_grp_max_members_short'),'registration_membership_limited');
2658  $lim->setValue(1);
2659  $lim->setOptionTitle($this->lng->txt('reg_grp_max_members'));
2660  $lim->setChecked($this->object->isMembershipLimited());
2661 
2662 
2663  $max = new ilTextInputGUI('','registration_max_members');
2664  $max->setValue($this->object->getMaxMembers() ? $this->object->getMaxMembers() : '');
2665  $max->setTitle($this->lng->txt('members').':');
2666  $max->setSize(3);
2667  $max->setMaxLength(4);
2668  $max->setInfo($this->lng->txt('grp_reg_max_members_info'));
2669  $lim->addSubItem($max);
2670 
2671  $wait = new ilCheckboxInputGUI('','waiting_list');
2672  $wait->setValue(1);
2673  $wait->setOptionTitle($this->lng->txt('grp_waiting_list'));
2674  $wait->setInfo($this->lng->txt('grp_waiting_list_info'));
2675  $wait->setChecked($this->object->isWaitingListEnabled() ? true : false);
2676  $lim->addSubItem($wait);
2677  $this->form->addItem($lim);
2678 
2679  switch($a_mode)
2680  {
2681  case 'create':
2682  $this->form->setTitle($this->lng->txt('grp_new'));
2683  $this->form->setTitleIcon(ilUtil::getImagePath('icon_grp.gif'));
2684 
2685  $this->form->addCommandButton('save',$this->lng->txt('grp_new'));
2686  $this->form->addCommandButton('cancel',$this->lng->txt('cancel'));
2687  return true;
2688 
2689  case 'edit':
2690  $this->form->setTitle($this->lng->txt('grp_edit'));
2691  $this->form->setTitleIcon(ilUtil::getImagePath('icon_grp.gif'));
2692 
2693  $this->form->addCommandButton('update',$this->lng->txt('save'));
2694  $this->form->addCommandButton('cancel',$this->lng->txt('cancel'));
2695  return true;
2696 
2697  case 'update_group_type':
2698  $grp_type->setValue(
2699  $type == GRP_TYPE_PUBLIC ?
2700  GRP_TYPE_CLOSED :
2702  );
2703 
2704  $this->form->setTitle($this->lng->txt('grp_edit'));
2705  $this->form->setTitleIcon(ilUtil::getImagePath('icon_grp.gif'));
2706  return true;
2707  }
2708  return true;
2709  }
2710 
2717  public function load()
2718  {
2719  $this->object->setTitle(ilUtil::stripSlashes($_POST['title']));
2720  $this->object->setDescription(ilUtil::stripSlashes($_POST['desc']));
2721  $this->object->setGroupType(ilUtil::stripSlashes($_POST['grp_type']));
2722  $this->object->setRegistrationType(ilUtil::stripSlashes($_POST['registration_type']));
2723  $this->object->setPassword(ilUtil::stripSlashes($_POST['password']));
2724  $this->object->enableUnlimitedRegistration((bool) !$_POST['reg_limit_time']);
2725  $this->object->setRegistrationStart($this->loadDate('start'));
2726  $this->object->setRegistrationEnd($this->loadDate('end'));
2727  $this->object->enableMembershipLimitation((bool) $_POST['registration_membership_limited']);
2728  $this->object->setMaxMembers((int) $_POST['registration_max_members']);
2729  $this->object->enableWaitingList((bool) $_POST['waiting_list']);
2730 
2731  return true;
2732  }
2733 
2741  protected function loadDate($a_field)
2742  {
2743  global $ilUser;
2744 
2745  include_once('./Services/Calendar/classes/class.ilDateTime.php');
2746 
2747  $dt['year'] = (int) $_POST['reg'][$a_field]['date']['y'];
2748  $dt['mon'] = (int) $_POST['reg'][$a_field]['date']['m'];
2749  $dt['mday'] = (int) $_POST['reg'][$a_field]['date']['d'];
2750  $dt['hours'] = (int) $_POST['reg'][$a_field]['time']['h'];
2751  $dt['minutes'] = (int) $_POST['reg'][$a_field]['time']['m'];
2752  $dt['seconds'] = (int) $_POST['reg'][$a_field]['time']['s'];
2753 
2754  $date = new ilDateTime($dt,IL_CAL_FKT_GETDATE,$ilUser->getTimeZone());
2755  return $date;
2756  }
2757 
2765  protected function setSubTabs($a_tab)
2766  {
2767  global $rbacsystem,$ilUser,$ilAccess;
2768 
2769  switch($a_tab)
2770  {
2771  case 'members':
2772  // for admins
2773  if($ilAccess->checkAccess('write','',$this->object->getRefId()))
2774  {
2775  $this->tabs_gui->addSubTabTarget("grp_edit_members",
2776  $this->ctrl->getLinkTarget($this,'members'),
2777  "members",
2778  get_class($this));
2779  }
2780  // for all
2781  $this->tabs_gui->addSubTabTarget("grp_members_gallery",
2782  $this->ctrl->getLinkTarget($this,'membersGallery'),
2783  "membersGallery", get_class($this));
2784 
2785  // members map
2786  include_once("./Services/GoogleMaps/classes/class.ilGoogleMapUtil.php");
2788  $this->object->getEnableGroupMap())
2789  {
2790  $this->tabs_gui->addSubTabTarget("grp_members_map",
2791  $this->ctrl->getLinkTarget($this,'membersMap'),
2792  "membersMap", get_class($this));
2793  }
2794 
2795  $this->tabs_gui->addSubTabTarget("mail_members",
2796  $this->ctrl->getLinkTarget($this,'mailMembers'),
2797  "mailMembers", get_class($this));
2798 
2799  break;
2800 
2801  case "activation":
2802  $this->tabs_gui->addSubTabTarget("activation",
2803  $this->ctrl->getLinkTargetByClass('ilCourseItemAdministrationGUI','edit'),
2804  "edit", get_class($this));
2805  $this->ctrl->setParameterByClass('ilconditionhandlerinterface','item_id',(int) $_GET['item_id']);
2806  $this->tabs_gui->addSubTabTarget("preconditions",
2807  $this->ctrl->getLinkTargetByClass('ilConditionHandlerInterface','listConditions'),
2808  "", "ilConditionHandlerInterface");
2809  break;
2810 
2811  case 'settings':
2812  $this->tabs_gui->addSubTabTarget("grp_settings",
2813  $this->ctrl->getLinkTarget($this,'edit'),
2814  "edit", get_class($this));
2815 
2816  $this->tabs_gui->addSubTabTarget("grp_info_settings",
2817  $this->ctrl->getLinkTarget($this,'editInfo'),
2818  "editInfo", get_class($this));
2819 
2820  // custom icon
2821  if ($this->ilias->getSetting("custom_icons"))
2822  {
2823  $this->tabs_gui->addSubTabTarget("grp_icon_settings",
2824  $this->ctrl->getLinkTarget($this,'editGroupIcons'),
2825  "editGroupIcons", get_class($this));
2826  }
2827 
2828 
2829  include_once("./Services/GoogleMaps/classes/class.ilGoogleMapUtil.php");
2831  {
2832  $this->tabs_gui->addSubTabTarget("grp_map_settings",
2833  $this->ctrl->getLinkTarget($this,'editMapSettings'),
2834  "editMapSettings", get_class($this));
2835  }
2836 
2837  $this->tabs_gui->addSubTabTarget('groupings',
2838  $this->ctrl->getLinkTargetByClass('ilobjcoursegroupinggui','listGroupings'),
2839  'listGroupings',
2840  get_class($this));
2841 
2842  break;
2843  }
2844  }
2845 
2850  public function prepareOutput()
2851  {
2852  global $rbacsystem;
2853  if(!$this->getCreationMode())
2854  {
2855  /*
2856  include_once './Services/Container/classes/class.ilMemberViewSettings.php';
2857  $settings = ilMemberViewSettings::getInstance();
2858  if($settings->isActive() and $settings->getContainer() != $this->object->getRefId())
2859  {
2860  $settings->setContainer($this->object->getRefId());
2861  $rbacsystem->initMemberView();
2862  }
2863  */
2864  }
2866  }
2867 
2868 } // END class.ilObjGroupGUI
2869 ?>