18 include_once
"./Services/Container/classes/class.ilContainerGUI.php";
31 $this->
ilContainerGUI($a_data,$a_id,$a_call_by_reference,$a_prepare_output);
33 $this->ctrl->saveParameter($this,
'ref_id');
35 $this->lng->loadLanguageModule(
'ilinc');
49 if(!$rbacsystem->checkAccess(
'create',
$_GET[
'ref_id'], $new_type))
51 $this->ilias->raiseError($this->lng->txt(
'permission_denied'), $this->ilias->error_obj->MESSAGE);
55 return $this->tpl->setVariable(
'ADM_CONTENT', $this->form_gui->getHtml());
62 if(!$ilAccess->checkAccess(
'write',
'', (
int)
$_GET[
'ref_id']))
64 $this->ilErr->raiseError($this->lng->txt(
'permission_denied'), $this->ilErr->MESSAGE);
68 if($this->form_gui->checkInput())
70 $_POST[
'Fobject'][
'title'] = $this->form_gui->getInput(
'title');
71 $_POST[
'Fobject'][
'desc'] = $this->form_gui->getInput(
'desc');
72 $_POST[
'Fobject'][
'activated'] = $this->form_gui->getInput(
'activated');
73 $_POST[
'Fobject'][
'akclassvalue1'] = $this->form_gui->getInput(
'akclassvalue1');
74 $_POST[
'Fobject'][
'akclassvalue2'] = $this->form_gui->getInput(
'akclassvalue2');
81 if($this->ilias->getSetting(
'ilinc_akclassvalues_active'))
83 if($this->object->getAKClassValue1() !=
$_POST[
'Fobject'][
'akclassvalue1'])
88 if($this->object->getAKClassValue2() !=
$_POST[
'Fobject'][
'akclassvalue2'])
98 $this->ilErr->raiseError($this->object->getErrorMsg(), $this->ilErr->MESSAGE);
102 if(array_key_exists(
'akclassvalue1',
$_POST[
'Fobject']) or
103 array_key_exists(
'akclassvalue2',
$_POST[
'Fobject']))
105 if(!$this->object->updateClassrooms())
108 $this->form_gui->setValuesByPost();
109 return $this->tpl->setVariable(
'ADM_CONTENT', $this->form_gui->getHtml());
114 $this->form_gui->setValuesByPost();
115 return $this->tpl->setVariable(
'ADM_CONTENT', $this->form_gui->getHtml());
119 $this->form_gui->setValuesByPost();
120 return $this->tpl->setVariable(
'ADM_CONTENT', $this->form_gui->getHtml());
131 if($this->form_gui->checkInput())
133 $_POST[
'Fobject'][
'title'] = $this->form_gui->getInput(
'title');
134 $_POST[
'Fobject'][
'desc'] = $this->form_gui->getInput(
'desc');
135 $_POST[
'Fobject'][
'activated'] = $this->form_gui->getInput(
'activated');
136 $_POST[
'Fobject'][
'akclassvalue1'] = $this->form_gui->getInput(
'akclassvalue1');
137 $_POST[
'Fobject'][
'akclassvalue2'] = $this->form_gui->getInput(
'akclassvalue2');
140 include_once
'Modules/ILinc/classes/class.ilnetucateXMLAPI.php';
142 $ilinc->addCourse(
$_POST[
'Fobject']);
144 $response = $ilinc->sendRequest();
145 if($response->isError())
147 $this->ilErr->raiseError($response->getErrorMsg(), $this->ilErr->MESSAGE);
154 $icrsObj->storeiLincId($response->getFirstID());
155 $icrsObj->saveActivationStatus(
ilUtil::tf2yn((
bool)$this->form_gui->getInput(
'activated')));
156 $icrsObj->saveAKClassValues(
157 $this->form_gui->getInput(
'akclassvalue1'),
158 $this->form_gui->getInput(
'akclassvalue2')
162 $roles = $icrsObj->initDefaultRoles();
165 $success = $icrsObj->addMember($this->ilias->account, $icrsObj->getDefaultAdminRole(),
true);
169 $this->ilErr->raiseError($icrsObj->getErrorMsg(), $this->ilErr->MESSAGE);
176 $this->ilias->account->addDesktopItem($icrsObj->getRefId(),
'icrs');
184 $this->form_gui->setValuesByPost();
185 return $this->tpl->setVariable(
'ADM_CONTENT', $this->form_gui->getHtml());
196 global $rbacsystem,$ilAccess;
198 $this->ctrl->setParameter($this,
'ref_id',$this->ref_id);
200 if($rbacsystem->checkAccess(
'read',$this->ref_id))
202 $tabs_gui->addTarget(
'ilinc_classrooms',
203 $this->ctrl->getLinkTarget($this,
''),
204 array(
'',
'view',
'editClassroom',
'updateClassroom',
'removeClassroom')
208 if($this->ilias->getSetting(
'ilinc_active'))
210 if($ilAccess->checkAccess(
'write',
'', $this->ref_id))
212 $tabs_gui->addTarget(
'edit_properties',
213 $this->ctrl->getLinkTarget($this,
'edit'), array(
'edit',
'update',
'save'), get_class($this));
223 if($ilAccess->checkAccess(
'write',
'',$this->ref_id))
225 $tabs_gui->addTarget(
"ilinc_involved_users",
226 $this->ctrl->getLinkTarget($this,
"members"),
227 array(
"members",
"mailMembers",
"membersGallery",
"showProfile",
'changeMember',
'RemoveMember'),
230 elseif ($ilAccess->checkAccess(
'read',
'',$this->ref_id))
232 $tabs_gui->addTarget(
"ilinc_involved_users",
233 $this->ctrl->getLinkTarget($this,
"membersGallery"),
234 array(
"members",
"mailMembers",
"membersGallery",
"showProfile"),
238 if ($rbacsystem->checkAccess(
'write',$this->ref_id) and $this->
object->isDocent($this->ilias->account))
241 $tabs_gui->addTarget(
"ilinc_manage_course_documents",
242 $url = $this->object->userLogin($this->ilias->account),
"agenda",
"",
"_blank");
257 if ($rbacsystem->checkAccess(
'edit_permission',$this->ref_id))
259 $tabs_gui->addTarget(
"perm_settings",
260 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
264 if ($this->ctrl->getTargetScript() ==
"repository.php" and !empty(
$_SESSION[
'il_rep_clipboard']))
266 $tabs_gui->addTarget(
"clipboard",
267 $this->ctrl->getLinkTarget($this,
"clipboard"),
"clipboard", get_class($this));
270 if ($this->ctrl->getTargetScript() ==
"adm_object.php")
272 if ($this->tree->getSavedNodeData($this->ref_id))
274 $tabs_gui->addTarget(
"trash",
275 $this->ctrl->getLinkTarget($this,
"trash"),
"trash", get_class($this));
282 unset(
$_SESSION[
"grp_delete_member_ids"]);
283 unset(
$_SESSION[
"grp_delete_subscriber_ids"]);
291 public function __search($a_search_string,$a_search_for)
293 include_once(
"./classes/class.ilSearch.php");
295 $this->lng->loadLanguageModule(
"content");
297 $search->setPerformUpdate(
false);
299 $search->setCombination(
"and");
300 $search->setSearchFor(array(0 => $a_search_for));
301 $search->setSearchType(
'new');
303 if($search->validate($message))
305 $search->performSearch();
310 $this->ctrl->redirect($this,
"searchUserForm");
313 return $search->getResultByType($a_search_for);
318 $return_to =
"searchUserForm";
320 if ($a_cmd ==
"listUsersRole" or $a_cmd ==
"listUsersGroup")
322 $return_to =
"search";
326 $tpl =& $tbl->getTemplateObject();
329 $tpl->setCurrentBlock(
"tbl_form_header");
330 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
331 $tpl->parseCurrentBlock();
333 $tpl->setCurrentBlock(
"tbl_action_btn");
334 $tpl->setVariable(
"BTN_NAME",$return_to);
335 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"back"));
336 $tpl->parseCurrentBlock();
338 $tpl->setCurrentBlock(
"tbl_action_btn");
339 $tpl->setVariable(
"BTN_NAME",
"addUser");
340 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"add"));
341 $tpl->parseCurrentBlock();
343 if (!empty($a_user_ids))
346 $tpl->setCurrentBlock(
"tbl_action_toggle_checkboxes");
347 $tpl->setVariable(
"JS_VARNAME",
"user");
349 $tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
350 $tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
351 $tpl->parseCurrentBlock();
354 $tpl->setCurrentBlock(
"tbl_action_row");
355 $tpl->setVariable(
"COLUMN_COUNTS",5);
357 $tpl->parseCurrentBlock();
359 $tbl->setTitle($this->lng->txt(
"ilinc_header_edit_users"),
"icon_usr_b.gif",$this->lng->txt(
"ilinc_header_edit_users"));
360 $tbl->setHeaderNames(array(
"",
361 $this->lng->txt(
"username"),
362 $this->lng->txt(
"firstname"),
363 $this->lng->txt(
"lastname"),
364 $this->lng->txt(
"last_visit")));
365 $tbl->setHeaderVars(array(
"",
370 array(
"ref_id" => $this->object->getRefId(),
372 "cmdClass" =>
"ilobjilinccoursegui",
373 "cmdNode" =>
$_GET[
"cmdNode"]));
375 $tbl->setColumnWidth(array(
"",
"33%",
"33%",
"33%"));
380 $this->tpl->setVariable(
"SEARCH_RESULT_TABLE",$tbl->tpl->get());
388 $tpl =& $tbl->getTemplateObject();
390 $tpl->setCurrentBlock(
"tbl_form_header");
391 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
392 $tpl->parseCurrentBlock();
394 $tpl->setCurrentBlock(
"tbl_action_btn");
395 $tpl->setVariable(
"BTN_NAME",
"searchUserForm");
396 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"back"));
397 $tpl->parseCurrentBlock();
399 $tpl->setCurrentBlock(
"tbl_action_btn");
400 $tpl->setVariable(
"BTN_NAME",
"listUsersRole");
401 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"grp_list_users"));
402 $tpl->parseCurrentBlock();
404 if (!empty($a_role_ids))
407 $tpl->setCurrentBlock(
"tbl_action_toggle_checkboxes");
408 $tpl->setVariable(
"JS_VARNAME",
"role");
410 $tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
411 $tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
412 $tpl->parseCurrentBlock();
415 $tpl->setCurrentBlock(
"tbl_action_row");
416 $tpl->setVariable(
"COLUMN_COUNTS",5);
418 $tpl->parseCurrentBlock();
420 $tbl->setTitle($this->lng->txt(
"ilinc_header_edit_users"),
"icon_usr_b.gif",$this->lng->txt(
"ilinc_header_edit_users"));
421 $tbl->setHeaderNames(array(
"",
422 $this->lng->txt(
"obj_role"),
423 $this->lng->txt(
"grp_count_members")));
424 $tbl->setHeaderVars(array(
"",
427 array(
"ref_id" => $this->object->getRefId(),
429 "cmdClass" =>
"ilobjilincoursegui",
430 "cmdNode" =>
$_GET[
"cmdNode"]));
432 $tbl->setColumnWidth(array(
"",
"80%",
"19%"));
438 $this->tpl->setVariable(
"SEARCH_RESULT_TABLE",$tbl->tpl->get());
446 $tpl =& $tbl->getTemplateObject();
448 $tpl->setCurrentBlock(
"tbl_form_header");
449 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
450 $tpl->parseCurrentBlock();
452 $tpl->setCurrentBlock(
"tbl_action_btn");
453 $tpl->setVariable(
"BTN_NAME",
"searchUserForm");
454 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"back"));
455 $tpl->parseCurrentBlock();
457 $tpl->setCurrentBlock(
"tbl_action_btn");
458 $tpl->setVariable(
"BTN_NAME",
"listUsersGroup");
459 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"grp_list_users"));
460 $tpl->parseCurrentBlock();
462 if (!empty($a_grp_ids))
465 $tpl->setCurrentBlock(
"tbl_action_toggle_checkboxes");
466 $tpl->setVariable(
"JS_VARNAME",
"group");
468 $tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
469 $tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
470 $tpl->parseCurrentBlock();
473 $tpl->setCurrentBlock(
"tbl_action_row");
474 $tpl->setVariable(
"COLUMN_COUNTS",5);
476 $tpl->parseCurrentBlock();
478 $tbl->setTitle($this->lng->txt(
"ilinc_header_edit_users"),
"icon_usr_b.gif",$this->lng->txt(
"ilinc_header_edit_users"));
479 $tbl->setHeaderNames(array(
"",
480 $this->lng->txt(
"obj_grp"),
481 $this->lng->txt(
"grp_count_members")));
482 $tbl->setHeaderVars(array(
"",
485 array(
"ref_id" => $this->object->getRefId(),
487 "cmdClass" =>
"ilobjilinccoursegui",
488 "cmdNode" =>
$_GET[
"cmdNode"]));
490 $tbl->setColumnWidth(array(
"",
"80%",
"19%"));
496 $this->tpl->setVariable(
"SEARCH_RESULT_TABLE",$tbl->tpl->get());
503 include_once
"./Services/Table/classes/class.ilTableGUI.php";
513 $offset =
$_GET[
"update_subscribers"] ?
$_GET[
"offset"] : 0;
514 $order =
$_GET[
"update_subscribers"] ?
$_GET[
"sort_by"] :
'login';
515 $direction =
$_GET[
"update_subscribers"] ?
$_GET[
"sort_order"] :
'';
519 $offset =
$_GET[
"offset"];
520 $order =
$_GET[
"sort_by"] ?
$_GET[
"sort_by"] :
"title";
521 $direction =
$_GET[
"sort_order"];
525 $offset =
$_GET[
"offset"];
526 $order =
$_GET[
"sort_by"] ?
$_GET[
"sort_by"] :
"title";
527 $direction =
$_GET[
"sort_order"];
531 $offset =
$_GET[
"offset"];
533 if (
$_GET[
"sort_by"] ==
"title" or empty(
$_GET[
"sort_by"]))
535 $_GET[
"sort_by"] =
"login";
537 $order =
$_GET[
"sort_by"];
538 $direction =
$_GET[
"sort_order"];
542 $tbl->setOrderColumn($order);
543 $tbl->setOrderDirection($direction);
544 $tbl->setOffset($offset);
545 $tbl->setLimit(
$_GET[
"limit"]);
547 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
548 $tbl->setData($result_set);
553 global $rbacsystem,$rbacreview;
558 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
560 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
563 if(!is_array(
$_POST[
"role"]))
571 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.grp_usr_selection.html");
572 $this->
__showButton(
"searchUserForm",$this->lng->txt(
"grp_new_search"));
576 foreach(
$_POST[
"role"] as $role_id)
578 $members = array_merge($rbacreview->assignedUsers($role_id),$members);
581 $members = array_unique($members);
586 foreach($members as
$user)
593 $user_ids[$counter] =
$user;
596 $f_result[$counter][] = $tmp_obj->getLogin();
597 $f_result[$counter][] = $tmp_obj->getLastname();
598 $f_result[$counter][] = $tmp_obj->getFirstname();
611 global $rbacsystem,$rbacreview,
$tree;
616 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
618 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
621 if(!is_array(
$_POST[
"group"]))
629 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.grp_usr_selection.html");
630 $this->
__showButton(
"searchUserForm",$this->lng->txt(
"grp_new_search"));
634 foreach(
$_POST[
"group"] as $group_id)
636 if (!$tree->isInTree($group_id))
645 $members = array_merge($tmp_obj->getGroupMemberIds(),$members);
650 $members = array_unique($members);
655 foreach($members as
$user)
662 $user_ids[$counter] =
$user;
665 $f_result[$counter][] = $tmp_obj->getLogin();
666 $f_result[$counter][] = $tmp_obj->getLastname();
667 $f_result[$counter][] = $tmp_obj->getFirstname();
713 if(!$this->ilias->getSetting(
'ilinc_active'))
715 $this->ilias->raiseError($lng->txt(
'ilinc_server_not_active'), $this->ilias->error_obj->MESSAGE);
718 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.icrs_members.html',
'Modules/ILinc');
721 $this->lng->loadLanguageModule(
'ilinc');
724 $is_admin = (bool)$ilAccess->checkAccess(
'write',
'', $this->object->getRefId());
727 $ilToolbar->addButton($this->lng->txt(
'ilinc_add_user'), $this->ctrl->getLinkTargetByClass(
'ilRepositorySearchGUI',
'start'));
731 $val_contact =
"<img src=\"".ilUtil::getImagePath(
"icon_pencil_b.gif").
"\" alt=\"".$this->lng->txt(
"ilinc_mem_send_mail").
"\" title=\"".$this->lng->txt(
"ilinc_mem_send_mail").
"\" border=\"0\" vspace=\"0\"/>";
732 $val_change =
"<img src=\"".ilUtil::getImagePath(
"icon_change_b.gif").
"\" alt=\"".$this->lng->txt(
"ilinc_mem_change_status").
"\" title=\"".$this->lng->txt(
"ilinc_mem_change_status").
"\" border=\"0\" vspace=\"0\"/>";
733 $val_leave =
"<img src=\"".ilUtil::getImagePath(
"icon_group_out_b.gif").
"\" alt=\"".$this->lng->txt(
"ilinc_mem_leave").
"\" title=\"".$this->lng->txt(
"ilinc_mem_leave").
"\" border=\"0\" vspace=\"0\"/>";
736 $access_leave = $ilAccess->checkAccess(
'leave',
'', $this->object->getRefId());
737 $access_write = $ilAccess->checkAccess(
'write',
'', $this->object->getRefId());
739 $member_ids = $this->
object->getMemberIds();
742 $members = $this->
object->getMemberData($member_ids);
745 $docent_ids = $this->
object->getiLincMemberIds(
true);
746 $student_ids = $this->
object->getiLincMemberIds(
false);
749 $result_set = array();
750 foreach($members as $mem)
752 $link_contact =
'ilias.php?baseClass=ilMailGUI&type=new&rcp_to='.$mem[
'login'];
753 $link_change = $this->ctrl->getLinkTarget($this,
'changeMember').
'&mem_id='.$mem[
'id'];
754 if(($mem[
'id'] == $ilUser->getId() && $access_leave) || $access_delete)
756 $link_leave = $this->ctrl->getLinkTarget($this,
'removeMember').
'&mem_id='.$mem[
'id'];
760 $member_functions =
'';
763 $member_functions =
"<a href=\"$link_change\">$val_change</a>";
765 if(($mem[
'id'] == $ilUser->getId() && $access_leave) || $access_write)
767 $link_leave = $this->ctrl->getLinkTarget($this,
'removeMember').
'&mem_id='.$mem[
'id'];
768 $member_functions .=
"<a href=\"$link_leave\">$val_leave</a>";
772 $str_member_roles = $this->
object->getMemberRolesTitle($mem[
'id']);
776 $result_set[$counter][
'checkbox'] = ilUtil::formCheckBox(0,
'user_id[]', $mem[
'id']);
779 $status = $this->
object->checkiLincMemberStatus($mem[
'ilinc_id'], $docent_ids, $student_ids);
780 if($status == ILINC_MEMBER_NOTSET)
782 $status =
"<span class='warning'>".$this->lng->txt($status).
"</span>";
786 $status = $this->lng->txt($status);
789 $result_set[$counter][
'login'] = $mem[
'login'];
790 $result_set[$counter][
'firstname'] = $mem[
'firstname'];
791 $result_set[$counter][
'lastname'] = $mem[
'lastname'];
792 $result_set[$counter][
'attending_as'] = $status;
793 $result_set[$counter][
'role'] = $str_member_roles;
794 $result_set[$counter][
'options'] =
"<a href=\"$link_contact\">".$val_contact.
"</a>".$member_functions;
798 unset($member_functions);
801 include_once
'Modules/ILinc/classes/class.iliLinkMembersTableGUI.php';
803 $oTable->setTitle($this->lng->txt(
'ilinc_involved_users'),
'icon_usr_b.gif', $this->lng->txt(
'ilinc_involved_users'));
805 return $this->tpl->setVariable(
'MEMBER_TABLE', $oTable->getHTML());
810 global $ilUser,$rbacsystem,$ilAccess,
$ilErr;
812 $next_class = $this->ctrl->getNextClass($this);
813 $cmd = $this->ctrl->getCmd();
818 case "ilconditionhandlerinterface":
819 include_once
'./classes/class.ilConditionHandlerInterface.php';
824 $this->ctrl->saveParameter($this,
'item_id',$_GET[
'item_id']);
825 $this->ctrl->forwardCommand($new_gui);
830 $this->ctrl->forwardCommand($new_gui);
834 case 'ilrepositorysearchgui':
835 include_once(
'./Services/Search/classes/class.ilRepositorySearchGUI.php');
837 $rep_search->setCallback($this,
'addUserObject');
840 $this->tabs_gui->setTabActive(
'members');
841 $this->ctrl->setReturn($this,
'members');
842 $ret =& $this->ctrl->forwardCommand($rep_search);
844 $this->tabs_gui->setSubTabActive(
'members');
847 case "ilobjilincclassroomgui":
848 include_once (
'./Modules/ILinc/classes/class.ilObjiLincClassroomGUI.php');
850 $ret =& $this->ctrl->forwardCommand($icla_gui);
853 case 'ilpermissiongui':
854 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
856 $ret =& $this->ctrl->forwardCommand($perm_gui);
859 case 'ilpublicuserprofilegui':
860 require_once
'./Services/User/classes/class.ilPublicUserProfileGUI.php';
862 $html = $this->ctrl->forwardCommand($profile_gui);
864 $this->tabs_gui->setTabActive(
'group_members');
865 $this->tabs_gui->setSubTabActive(
'grp_members_gallery');
866 $this->tpl->setVariable(
"ADM_CONTENT", $html);
870 if (!$this->
getCreationMode() and !$ilAccess->checkAccess(
'visible',
'',$this->object->getRefId(),
'icrs'))
872 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"),$ilErr->MESSAGE);
888 global
$ilCtrl, $ilNavigationHistory, $ilAccess;
890 if(!$ilAccess->checkAccess(
'read',
'', $this->object->getRefId()))
892 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'), $this->ilias->error_obj->MESSAGE);
897 $ilAccess->checkAccess(
'read',
'', $this->object->getRefId()))
899 $ilNavigationHistory->addItem($this->object->getRefId(),
900 'repository.php?cmd=view&ref_id='.$this->object->getRefId(),
'icrs');
903 if(strtolower(
$_GET[
'baseClass']) ==
'iladministrationgui')
915 $url = $this->
object->userLogin($this->ilias->account);
919 $this->ilias->raiseError($this->object->getErrorMsg(),$this->ilias->error_obj->FATAL);
929 $this->lng->loadLanguageModule(
'search');
932 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
934 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
937 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.grp_members_search.html");
939 $this->tpl->setVariable(
"F_ACTION",$this->ctrl->getFormAction($this));
940 $this->tpl->setVariable(
"SEARCH_ASSIGN_USR",$this->lng->txt(
"grp_search_members"));
941 $this->tpl->setVariable(
"SEARCH_SEARCH_TERM",$this->lng->txt(
"search_search_term"));
942 $this->tpl->setVariable(
"SEARCH_VALUE",
$_SESSION[
"grp_search_str"] ?
$_SESSION[
"grp_search_str"] :
"");
943 $this->tpl->setVariable(
"SEARCH_FOR",$this->lng->txt(
"exc_search_for"));
944 $this->tpl->setVariable(
"SEARCH_ROW_TXT_USER",$this->lng->txt(
"exc_users"));
945 $this->tpl->setVariable(
"SEARCH_ROW_TXT_ROLE",$this->lng->txt(
"exc_roles"));
946 $this->tpl->setVariable(
"SEARCH_ROW_TXT_GROUP",$this->lng->txt(
"exc_groups"));
947 $this->tpl->setVariable(
"BTN2_VALUE",$this->lng->txt(
"cancel"));
948 $this->tpl->setVariable(
"BTN1_VALUE",$this->lng->txt(
"search"));
950 $usr = (
$_POST[
"search_for"] ==
"usr" ||
$_POST[
"search_for"] ==
"") ? 1 : 0;
951 $grp = (
$_POST[
"search_for"] ==
"grp") ? 1 : 0;
952 $role = (
$_POST[
"search_for"] ==
"role") ? 1 : 0;
963 global $rbacsystem,
$tree;
969 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
971 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
974 if(!isset(
$_POST[
"search_for"]) or !isset(
$_POST[
"search_str"]))
990 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.grp_usr_selection.html");
991 $this->
__showButton(
"searchUserForm",$this->lng->txt(
"grp_new_search"));
996 switch(
$_POST[
"search_for"])
1006 $user_ids[$counter] = $user[
"id"];
1009 $f_result[$counter][] = $tmp_obj->getLogin();
1010 $f_result[$counter][] = $tmp_obj->getFirstname();
1011 $f_result[$counter][] = $tmp_obj->getLastname();
1025 if ($role[
"id"] == ANONYMOUS_ROLE_ID)
1036 if ($tmp_obj->getCountMembers() == 0)
1041 $role_ids[$counter] = $role[
"id"];
1044 $f_result[$counter][] = array($tmp_obj->getTitle(),$tmp_obj->getDescription());
1045 $f_result[$counter][] = $tmp_obj->getCountMembers();
1058 if(!$tree->isInTree($group[
"id"]))
1069 if ($tmp_obj->getId() == $this->
object->getId())
1074 $grp_ids[$counter] = $group[
"id"];
1077 $f_result[$counter][] = array($tmp_obj->getTitle(),$tmp_obj->getDescription());
1078 $f_result[$counter][] = $tmp_obj->getCountMembers();
1084 if(!count($f_result))
1104 $user_ids =
$_POST[
"user"];
1108 if (empty($user_ids[0]))
1111 $this->ilErr->raiseError($this->lng->txt(
"no_checkbox"),$this->ilErr->MESSAGE);
1114 foreach ($user_ids as $new_member)
1116 $user_obj = $this->ilias->obj_factory->getInstanceByObjId($new_member);
1118 if (!$this->object->addMember($user_obj,$this->object->getDefaultMemberRole(),
false))
1121 $this->ilErr->raiseError($this->object->getErrorMsg(),$this->ilErr->MESSAGE);
1124 $user_obj->addDesktopItem($this->object->getRefId(),
"icrs");
1125 $mail->sendMail($user_obj->getLogin(),
"",
"",$this->lng->txtlng(
"common",
"ilinc_mail_subj_new_subscription",$user_obj->getLanguage()).
": ".$this->object->getTitle(),$this->lng->txtlng(
"common",
"ilinc_mail_body_new_subscription",$user_obj->getLanguage()),array(),array(
'normal'));
1144 global $ilUser, $rbacreview;
1148 $user_ids = array();
1150 if(isset(
$_POST[
'user_id']))
1152 $user_ids =
$_POST[
'user_id'];
1154 else if(isset(
$_GET[
'mem_id']))
1156 $user_ids[] =
$_GET[
'mem_id'];
1158 else if(isset(
$_GET[
'mem_id_arr']))
1160 $user_ids = explode(
',',
$_GET[
'mem_id_arr']);
1163 if(empty($user_ids[0]))
1165 $this->ilErr->raiseError($this->lng->txt(
"no_checkbox"), $this->ilErr->MESSAGE);
1168 if(count($user_ids) == 1 && $ilUser->getId() != $user_ids[0])
1170 if(!$rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID) &&
1171 !in_array($ilUser->getId(), $this->
object->getAdminIds()))
1173 $this->ilErr->raiseError($this->lng->txt(
"ilinc_err_no_permission"), $this->ilErr->MESSAGE);
1178 $is_dismiss_me = array_search($this->ilias->account->getId(), $user_ids);
1180 $confirm =
"confirmedRemoveMember";
1181 $cancel =
"canceled";
1182 $info = ($is_dismiss_me !==
false) ?
"ilinc_dismiss_myself" :
"ilinc_dismiss_member";
1184 $return =
"members";
1189 if(is_array($user_ids))
1191 foreach($user_ids as $id)
1196 'title' => $obj_data->getTitle(),
1197 'desc' => $obj_data->getDescription(),
1198 'last_update' => $obj_data->getLastUpdateDate()
1205 $data[$user_ids] = array(
1207 'title' => $obj_data->getTitle(),
1208 'desc' => $obj_data->getDescription(),
1209 'last_update' => $obj_data->getLastUpdateDate(),
1214 if(is_array($user_ids))
1216 $_SESSION[
'saved_post'][
'user_id'] = $user_ids;
1220 $_SESSION[
'saved_post'][
'user_id'][0] = $user_ids;
1225 $_SESSION[
'saved_post'][
'status'] = $status;
1228 include_once
'Modules/ILinc/classes/class.iliLinkConfirmationTableGUI.php';
1229 $this->ctrl->setParameter($this,
'cmd_return_location', $a_cmd_return_location);
1230 $this->ctrl->setParameter($this,
'mem_id_arr', implode(
',', $user_ids));
1232 $oTable->addCommandButton($cancel, $this->lng->txt(
'cancel'));
1233 $oTable->addCommandButton($confirm, $this->lng->txt(
'confirm'));
1235 return $this->tpl->setContent($oTable->getHTML());
1242 function confirmationObject($user_id =
'', $confirm =
'', $cancel =
'', $info =
'', $status =
'', $a_cmd_return_location =
'', $invokeMethod =
'')
1255 $removed_self =
false;
1260 foreach(
$_SESSION[
"saved_post"][
"user_id"] as $member_id)
1264 if (!$this->object->removeMember($user_obj))
1270 $user_obj->dropDesktopItem($this->object->getRefId(),
"icrs");
1272 if (!$removed_self and $user_obj->getId() == $this->ilias->account->getId())
1274 $removed_self =
true;
1278 $mail->sendMail($user_obj->getLogin(),
"",
"",$this->lng->txtlng(
"common",
"ilinc_mail_subj_subscription_cancelled",$user_obj->getLanguage()).
": ".$this->object->getTitle(),$this->lng->txtlng(
"common",
"ilinc_mail_body_subscription_cancelled",$user_obj->getLanguage()),array(),array(
'normal'));
1288 ilUtil::redirect(
"repository.php?ref_id=".$this->tree->getParentId($this->ref_id));
1300 global $rbacreview, $ilUser;
1304 $member_ids = array();
1306 if(isset(
$_POST[
'user_id']))
1308 $member_ids =
$_POST[
'user_id'];
1310 else if(isset(
$_GET[
'mem_id']))
1312 $member_ids[0] =
$_GET[
'mem_id'];
1314 else if(isset(
$_GET[
'mem_id_arr']))
1316 $member_ids = explode(
',',
$_GET[
'mem_id_arr']);
1319 if(empty($member_ids[0]))
1321 $this->ilErr->raiseError($this->lng->txt(
'no_checkbox'), $this->ilErr->MESSAGE);
1324 if(!$rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID) &&
1325 !in_array($ilUser->getId(), $this->
object->getAdminIds()))
1327 $this->ilErr->raiseError($this->lng->txt(
'grp_err_no_permission'), $this->ilErr->MESSAGE);
1330 $stati = array_flip($this->object->getLocalRoles(
true));
1333 $docent_ids = $this->
object->getiLincMemberIds(
true);
1334 $student_ids = $this->
object->getiLincMemberIds(
false);
1339 foreach($member_ids as $member_id)
1342 $mem_status = $this->
object->getMemberRoles($member_id);
1344 include_once
'Modules/ILinc/classes/class.ilObjiLincUser.php';
1347 $ilinc_status = $this->
object->checkiLincMemberStatus($ilinc_user->id, $docent_ids, $student_ids);
1349 $docent = 0; $student = 0;
1351 if($ilinc_status == ILINC_MEMBER_DOCENT)
1355 else if($ilinc_status == ILINC_MEMBER_STUDENT)
1360 $radio1 =
ilUtil::formRadioButton($docent,
'ilinc_member_status_select['.$member->getId().
']['.$ilinc_user->id.
']', ILINC_MEMBER_DOCENT);
1361 $radio2 =
ilUtil::formRadioButton($student,
'ilinc_member_status_select['.$member->getId().
']['.$ilinc_user->id.
']', ILINC_MEMBER_STUDENT);
1363 $data[$member->getId()] = array(
1364 'login' => $member->getLogin(),
1365 'firstname' => $member->getFirstname(),
1366 'lastname' => $member->getLastname(),
1367 'attending_as' => $radio1.
' '.$this->lng->txt(
'ilinc_docent').
'<br />'.$radio2.
' '.$this->lng->txt(
'ilinc_student'),
1368 'grp_role' =>
ilUtil::formSelect($mem_status,
'member_status_select['.$member->getId().
'][]', $stati,
true,
true, 3)
1375 include_once
'Modules/ILinc/classes/class.iliLinkMembersTableGUI.php';
1376 $this->ctrl->setParameter($this,
'mem_id_arr', implode(
',', $member_ids));
1378 $oTable->setTitle($this->lng->txt(
'grp_mem_change_status'),
'icon_usr_b.gif', $this->lng->txt(
'grp_mem_change_status'));
1380 return $this->tpl->setContent($oTable->getHTML());
1391 if(!$ilAccess->checkAccess(
'write',
'', $this->object->getRefId()))
1393 $this->ilErr->raiseError(
'permission_denied',$this->ilErr->MESSAGE);
1396 if(isset(
$_POST[
'member_status_select']))
1398 foreach(
$_POST[
'member_status_select'] as
$key => $value)
1400 $this->
object->leave(
$key);
1401 $this->
object->join(
$key,$value);
1405 if(isset(
$_POST[
'ilinc_member_status_select']))
1407 $users_to_add = array();
1408 $users_to_register = array();
1409 $users_to_unregister = array();
1411 foreach(
$_POST[
'ilinc_member_status_select'] as $user_id => $ilinc_arr)
1413 $ilinc_user_id = key($ilinc_arr);
1414 $ilinc_user_status = current($ilinc_arr);
1421 if($ilinc_user_id == 0)
1428 include_once
'Modules/ILinc/classes/class.ilObjiLincUser.php';
1431 if(!$ilinc_user->id)
1434 $users_to_add[] =& $user_obj;
1438 $users_to_register[$ilinc_user->id] = ILINC_MEMBER_STUDENT;
1445 $users_to_unregister[] = $ilinc_user_id;
1446 $users_to_register[$ilinc_user_id] = $ilinc_user_status;
1450 if(!$this->object->unregisterUsers($users_to_unregister))
1454 $this->ilErr->raiseError($this->object->getErrorMsg(),$this->ilErr->MESSAGE);
1457 if(count($users_to_add) > 0)
1460 foreach ($users_to_add as
$user)
1462 if (!$this->object->addUser($user))
1466 $this->ilErr->raiseError($this->object->getErrorMsg(),$this->ilErr->MESSAGE);
1471 include_once
'Modules/ILinc/classes/class.ilObjiLincUser.php';
1473 $users_to_register[$ilinc_user->id] = ILINC_MEMBER_STUDENT;
1478 if(!$this->object->registerUsers($users_to_register))
1482 $this->ilErr->raiseError($this->object->getErrorMsg(),$this->ilErr->MESSAGE);
1492 if(!$this->ilias->getSetting(
'ilinc_active'))
1494 $this->ilias->raiseError($this->lng->txt(
'ilinc_server_not_active'), $this->ilias->error_obj->MESSAGE);
1499 return $this->tpl->setVariable(
'ADM_CONTENT', $this->form_gui->getHtml());
1504 $this->form_gui->setValuesByArray(array(
1505 'title' => $this->object->getTitle(),
1506 'desc' => $this->
object->getDescription(),
1507 'activated' => (int)$this->object->activated,
1508 'akclassvalue1' => $this->object->getAKClassValue1(),
1509 'akclassvalue2' => $this->
object->getAKClassValue2(),
1515 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
1518 $this->form_gui->setTableWidth(
'600');
1519 if($a_mode ==
'create')
1521 $this->form_gui->setTitle($this->lng->txt(
'icrs_new'));
1525 $this->form_gui->setTitle($this->lng->txt(
'icrs_edit'));
1530 $text_input =
new ilTextInputGUI($this->lng->txt(
'title'),
'title');
1532 $this->form_gui->addItem($text_input);
1536 $this->form_gui->addItem($text_area);
1540 $this->form_gui->addItem($text_area);
1543 if($this->ilias->getSetting(
'ilinc_akclassvalues_active'))
1546 $section_header->setTitle($this->lng->txt(
'akclassvalues'));
1547 $this->form_gui->addItem($section_header);
1549 $text_input =
new ilTextInputGUI($this->lng->txt(
'akclassvalue1'),
'akclassvalue1');
1550 if($this->ilias->getSetting(
'ilinc_akclassvalues_required'))
1554 $this->form_gui->addItem($text_input);
1556 $text_input =
new ilTextInputGUI($this->lng->txt(
'akclassvalue2'),
'akclassvalue2');
1557 $this->form_gui->addItem($text_input);
1560 if($this->call_by_reference)
1562 $this->ctrl->setParameter($this,
'obj_id', $this->obj_id);
1566 if($a_mode ==
'create')
1568 $this->ctrl->setParameter($this,
'mode',
'create');
1569 $this->ctrl->setParameter($this,
'new_type',
'icrs');
1571 $this->form_gui->addCommandButton(
'save', $this->lng->txt(
'icrs_add'));
1572 $this->form_gui->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
1573 $this->form_gui->setFormAction($this->ctrl->getFormAction($this,
'save'));
1577 $this->form_gui->addCommandButton(
'update', $this->lng->txt(
'save'));
1578 $this->form_gui->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
1579 $this->form_gui->setFormAction($this->ctrl->getFormAction($this,
'update'));
1587 if(!$ilAccess->checkAccess(
'join',
'', (
int)
$_GET[
'ref_id']))
1589 $this->ilias->raiseError($this->lng->txt(
'permission_denied'), $this->ilias->error_obj->MESSAGE);
1592 if(!$this->object->addMember($this->ilias->account, $this->object->getDefaultMemberRole(),
false))
1594 $this->ilErr->raiseError($this->object->getErrorMsg(), $this->ilErr->MESSAGE);
1597 $this->ilias->account->addDesktopItem($this->object->getRefId(),
"icrs");
1610 global $rbacsystem, $ilUser;
1616 $this->tabs_gui->addSubTabTarget(
'members', $this->ctrl->getLinkTarget($this,
'members'), array(
'members',
'changeMember',
'removeMember'), get_class($this));
1617 $this->tabs_gui->addSubTabTarget(
'icrs_members_gallery', $this->ctrl->getLinkTarget($this,
'membersGallery'),
'membersGallery', get_class($this));
1618 $this->tabs_gui->addSubTabTarget(
'mail_members', $this->ctrl->getLinkTarget($this,
'mailMembers'),
'mailMembers', get_class($this));
1625 global $rbacreview, $ilObjDataCache;
1627 include_once
'Services/AccessControl/classes/class.ilObjRole.php';
1630 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.mail_members.html',
'Services/Contact');
1634 $link_data = $this->
object->_getLinkToObject( $this->object->getRefId() );
1635 $link_to_seminar = ILIAS_HTTP_PATH.
'/'.$link_data[0];
1637 $this->tpl->setVariable(
'MAILACTION',
'ilias.php?baseClass=ilMailGUI&type=role');
1638 $this->tpl->setVariable(
'ADDITIONAL_MESSAGE_TEXT', $link_to_seminar);
1640 $this->tpl->setVariable(
'OK', $this->lng->txt(
'ok'));
1642 $role_folder = $rbacreview->getRoleFolderOfObject( $this->object->getRefId() );
1643 $role_ids = $rbacreview->getRolesOfRoleFolder($role_folder[
'ref_id'],
false);
1644 foreach($role_ids as $role_id)
1646 $this->tpl->setCurrentBlock(
'mailbox_row');
1647 $role_addr = $rbacreview->getRoleMailboxAddress( $role_id );
1648 $this->tpl->setVariable(
'CHECK_MAILBOX',
ilUtil::formCheckbox(1,
'roles[]', htmlspecialchars($role_addr)));
1652 $this->tpl->setVariable(
'MAILBOX', $role_addr);
1657 $this->tpl->setVariable(
'MAILBOX',
ilObjRole::_getTranslation( $ilObjDataCache->lookupTitle( $role_id ) ).
' (' . $role_addr .
')');
1660 $this->tpl->parseCurrentBlock();
1673 $is_admin = (bool) $rbacsystem->checkAccess(
'write', $this->object->getRefId());
1675 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.icrs_members_gallery.html',
'Modules/ILinc');
1679 $this->lng->loadLanguageModule(
'ilinc');
1681 $member_ids = $this->
object->getMemberIds();
1684 $members = $this->
object->getMemberData($member_ids);
1687 $admin_ids = $this->
object->getiLincMemberIds(
true);
1692 foreach($members as $member)
1700 $public_profile = $usr_obj->getPref(
'public_profile');
1703 $this->ctrl->setParameterByClass(
'ilpublicuserprofilegui',
'user', $member[
'id']);
1704 $profile_target = $this->ctrl->getLinkTargetByClass(
'ilpublicuserprofilegui',
'getHTML');
1707 $file = $usr_obj->getPersonalPicturePath(
'xsmall');
1709 switch(in_array($member[
'ilinc_id'],$admin_ids))
1713 if($public_profile ==
'y' || $public_profile ==
'g')
1715 $this->tpl->setCurrentBlock(
'tutor_linked');
1716 $this->tpl->setVariable(
'LINK_PROFILE', $profile_target);
1717 $this->tpl->setVariable(
'SRC_USR_IMAGE',
$file);
1718 $this->tpl->parseCurrentBlock();
1722 $this->tpl->setCurrentBlock(
'tutor_not_linked');
1723 $this->tpl->setVariable(
'SRC_USR_IMAGE',
$file);
1724 $this->tpl->parseCurrentBlock();
1726 $this->tpl->setCurrentBlock(
'tutor');
1730 if($public_profile ==
'y' || $public_profile ==
'g')
1732 $this->tpl->setCurrentBlock(
'member_linked');
1733 $this->tpl->setVariable(
'LINK_PROFILE', $profile_target);
1734 $this->tpl->setVariable(
'SRC_USR_IMAGE',
$file);
1735 $this->tpl->parseCurrentBlock();
1739 $this->tpl->setCurrentBlock(
'member_not_linked');
1740 $this->tpl->setVariable(
'SRC_USR_IMAGE',
$file);
1741 $this->tpl->parseCurrentBlock();
1743 $this->tpl->setCurrentBlock(
'member');
1748 if($public_profile ==
'y' || $public_profile ==
'g')
1750 $this->tpl->setVariable(
'FIRSTNAME', $member[
'firstname']);
1751 $this->tpl->setVariable(
'LASTNAME', $member[
'lastname']);
1754 $this->tpl->setVariable(
'LOGIN', $usr_obj->getLogin());
1755 $this->tpl->parseCurrentBlock();
1758 $this->tpl->setCurrentBlock(
'members');
1759 $this->tpl->setVariable(
'MEMBERS_TABLE_HEADER',$this->lng->txt(
'ilinc_involved_users'));
1760 $this->tpl->parseCurrentBlock();
1763 $this->tpl->setVariable(
'TITLE', $this->lng->txt(
'icrs_members_print_title'));
1766 $headline = $this->
object->getTitle().
'<br />'.$this->
object->getDescription();
1767 $this->tpl->setVariable(
'HEADLINE', $headline);
1786 if ($ilAccess->checkAccess(
'read',
'', $a_target))
1788 $_GET[
'cmd'] =
'frameset';
1789 $_GET[
'ref_id'] = $a_target;
1793 $ilErr->raiseError($lng->txt(
'msg_no_perm_read'), $ilErr->FATAL);
1796 include
'repository.php';