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 $this->iLincAddCourseResponse = $ilinc->sendRequest();
145 if($this->iLincAddCourseResponse->isError())
147 $this->ilErr->raiseError($this->iLincAddCourseResponse->getErrorMsg(), $this->ilErr->MESSAGE);
155 $this->form_gui->setValuesByPost();
156 return $this->tpl->setVariable(
'ADM_CONTENT', $this->form_gui->getHtml());
166 $a_new_object->storeiLincId($this->iLincAddCourseResponse->getFirstID());
167 $a_new_object->saveActivationStatus(
ilUtil::tf2yn((
bool)$this->form_gui->getInput(
'activated')));
168 $a_new_object->saveAKClassValues(
169 $this->form_gui->getInput(
'akclassvalue1'),
170 $this->form_gui->getInput(
'akclassvalue2')
174 $success = $a_new_object->addMember($this->ilias->account, $a_new_object->getDefaultAdminRole(),
true);
179 $this->ctrl->returnToParent($this);
186 $this->ilias->account->addDesktopItem($a_new_object->
getRefId(),
'icrs');
200 global $rbacsystem,$ilAccess;
202 $this->ctrl->setParameter($this,
'ref_id',$this->ref_id);
204 if($rbacsystem->checkAccess(
'read',$this->ref_id))
206 $tabs_gui->addTarget(
'ilinc_classrooms',
207 $this->ctrl->getLinkTarget($this,
''),
208 array(
'',
'view',
'editClassroom',
'updateClassroom',
'removeClassroom')
212 if($this->ilias->getSetting(
'ilinc_active'))
214 if($ilAccess->checkAccess(
'write',
'', $this->ref_id))
216 $tabs_gui->addTarget(
'edit_properties',
217 $this->ctrl->getLinkTarget($this,
'edit'), array(
'edit',
'update',
'save'), get_class($this));
227 if($ilAccess->checkAccess(
'write',
'',$this->ref_id))
229 $tabs_gui->addTarget(
"ilinc_involved_users",
230 $this->ctrl->getLinkTarget($this,
"members"),
231 array(
"members",
"mailMembers",
"membersGallery",
"showProfile",
'changeMember',
'RemoveMember'),
234 elseif ($ilAccess->checkAccess(
'read',
'',$this->ref_id))
236 $tabs_gui->addTarget(
"ilinc_involved_users",
237 $this->ctrl->getLinkTarget($this,
"membersGallery"),
238 array(
"members",
"mailMembers",
"membersGallery",
"showProfile"),
242 if ($rbacsystem->checkAccess(
'write',$this->ref_id) and $this->
object->isDocent($this->ilias->account))
245 $tabs_gui->addTarget(
"ilinc_manage_course_documents",
246 $url = $this->object->userLogin($this->ilias->account),
"agenda",
"",
"_blank");
261 if ($rbacsystem->checkAccess(
'edit_permission',$this->ref_id))
263 $tabs_gui->addTarget(
"perm_settings",
264 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
268 if ($this->ctrl->getTargetScript() ==
"repository.php" and !empty(
$_SESSION[
'il_rep_clipboard']))
270 $tabs_gui->addTarget(
"clipboard",
271 $this->ctrl->getLinkTarget($this,
"clipboard"),
"clipboard", get_class($this));
274 if ($this->ctrl->getTargetScript() ==
"adm_object.php")
276 if ($this->tree->getSavedNodeData($this->ref_id))
278 $tabs_gui->addTarget(
"trash",
279 $this->ctrl->getLinkTarget($this,
"trash"),
"trash", get_class($this));
286 unset(
$_SESSION[
"grp_delete_member_ids"]);
287 unset(
$_SESSION[
"grp_delete_subscriber_ids"]);
295 public function __search($a_search_string,$a_search_for)
297 include_once(
"./classes/class.ilSearch.php");
299 $this->lng->loadLanguageModule(
"content");
301 $search->setPerformUpdate(
false);
303 $search->setCombination(
"and");
304 $search->setSearchFor(array(0 => $a_search_for));
305 $search->setSearchType(
'new');
307 if($search->validate($message))
309 $search->performSearch();
314 $this->ctrl->redirect($this,
"searchUserForm");
317 return $search->getResultByType($a_search_for);
322 $return_to =
"searchUserForm";
324 if ($a_cmd ==
"listUsersRole" or $a_cmd ==
"listUsersGroup")
326 $return_to =
"search";
330 $tpl =& $tbl->getTemplateObject();
333 $tpl->setCurrentBlock(
"tbl_form_header");
334 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
335 $tpl->parseCurrentBlock();
337 $tpl->setCurrentBlock(
"tbl_action_btn");
338 $tpl->setVariable(
"BTN_NAME",$return_to);
339 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"back"));
340 $tpl->parseCurrentBlock();
342 $tpl->setCurrentBlock(
"tbl_action_btn");
343 $tpl->setVariable(
"BTN_NAME",
"addUser");
344 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"add"));
345 $tpl->parseCurrentBlock();
347 if (!empty($a_user_ids))
350 $tpl->setCurrentBlock(
"tbl_action_toggle_checkboxes");
351 $tpl->setVariable(
"JS_VARNAME",
"user");
353 $tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
354 $tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
355 $tpl->parseCurrentBlock();
358 $tpl->setCurrentBlock(
"tbl_action_row");
359 $tpl->setVariable(
"COLUMN_COUNTS",5);
361 $tpl->parseCurrentBlock();
363 $tbl->setTitle($this->lng->txt(
"ilinc_header_edit_users"),
"icon_usr_b.gif",$this->lng->txt(
"ilinc_header_edit_users"));
364 $tbl->setHeaderNames(array(
"",
365 $this->lng->txt(
"username"),
366 $this->lng->txt(
"firstname"),
367 $this->lng->txt(
"lastname"),
368 $this->lng->txt(
"last_visit")));
369 $tbl->setHeaderVars(array(
"",
374 array(
"ref_id" => $this->object->getRefId(),
376 "cmdClass" =>
"ilobjilinccoursegui",
377 "cmdNode" =>
$_GET[
"cmdNode"]));
379 $tbl->setColumnWidth(array(
"",
"33%",
"33%",
"33%"));
384 $this->tpl->setVariable(
"SEARCH_RESULT_TABLE",$tbl->tpl->get());
392 $tpl =& $tbl->getTemplateObject();
394 $tpl->setCurrentBlock(
"tbl_form_header");
395 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
396 $tpl->parseCurrentBlock();
398 $tpl->setCurrentBlock(
"tbl_action_btn");
399 $tpl->setVariable(
"BTN_NAME",
"searchUserForm");
400 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"back"));
401 $tpl->parseCurrentBlock();
403 $tpl->setCurrentBlock(
"tbl_action_btn");
404 $tpl->setVariable(
"BTN_NAME",
"listUsersRole");
405 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"grp_list_users"));
406 $tpl->parseCurrentBlock();
408 if (!empty($a_role_ids))
411 $tpl->setCurrentBlock(
"tbl_action_toggle_checkboxes");
412 $tpl->setVariable(
"JS_VARNAME",
"role");
414 $tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
415 $tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
416 $tpl->parseCurrentBlock();
419 $tpl->setCurrentBlock(
"tbl_action_row");
420 $tpl->setVariable(
"COLUMN_COUNTS",5);
422 $tpl->parseCurrentBlock();
424 $tbl->setTitle($this->lng->txt(
"ilinc_header_edit_users"),
"icon_usr_b.gif",$this->lng->txt(
"ilinc_header_edit_users"));
425 $tbl->setHeaderNames(array(
"",
426 $this->lng->txt(
"obj_role"),
427 $this->lng->txt(
"grp_count_members")));
428 $tbl->setHeaderVars(array(
"",
431 array(
"ref_id" => $this->object->getRefId(),
433 "cmdClass" =>
"ilobjilincoursegui",
434 "cmdNode" =>
$_GET[
"cmdNode"]));
436 $tbl->setColumnWidth(array(
"",
"80%",
"19%"));
442 $this->tpl->setVariable(
"SEARCH_RESULT_TABLE",$tbl->tpl->get());
450 $tpl =& $tbl->getTemplateObject();
452 $tpl->setCurrentBlock(
"tbl_form_header");
453 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
454 $tpl->parseCurrentBlock();
456 $tpl->setCurrentBlock(
"tbl_action_btn");
457 $tpl->setVariable(
"BTN_NAME",
"searchUserForm");
458 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"back"));
459 $tpl->parseCurrentBlock();
461 $tpl->setCurrentBlock(
"tbl_action_btn");
462 $tpl->setVariable(
"BTN_NAME",
"listUsersGroup");
463 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"grp_list_users"));
464 $tpl->parseCurrentBlock();
466 if (!empty($a_grp_ids))
469 $tpl->setCurrentBlock(
"tbl_action_toggle_checkboxes");
470 $tpl->setVariable(
"JS_VARNAME",
"group");
472 $tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
473 $tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
474 $tpl->parseCurrentBlock();
477 $tpl->setCurrentBlock(
"tbl_action_row");
478 $tpl->setVariable(
"COLUMN_COUNTS",5);
480 $tpl->parseCurrentBlock();
482 $tbl->setTitle($this->lng->txt(
"ilinc_header_edit_users"),
"icon_usr_b.gif",$this->lng->txt(
"ilinc_header_edit_users"));
483 $tbl->setHeaderNames(array(
"",
484 $this->lng->txt(
"obj_grp"),
485 $this->lng->txt(
"grp_count_members")));
486 $tbl->setHeaderVars(array(
"",
489 array(
"ref_id" => $this->object->getRefId(),
491 "cmdClass" =>
"ilobjilinccoursegui",
492 "cmdNode" =>
$_GET[
"cmdNode"]));
494 $tbl->setColumnWidth(array(
"",
"80%",
"19%"));
500 $this->tpl->setVariable(
"SEARCH_RESULT_TABLE",$tbl->tpl->get());
507 include_once
"./Services/Table/classes/class.ilTableGUI.php";
517 $offset =
$_GET[
"update_subscribers"] ?
$_GET[
"offset"] : 0;
518 $order =
$_GET[
"update_subscribers"] ?
$_GET[
"sort_by"] :
'login';
519 $direction =
$_GET[
"update_subscribers"] ?
$_GET[
"sort_order"] :
'';
523 $offset =
$_GET[
"offset"];
524 $order =
$_GET[
"sort_by"] ?
$_GET[
"sort_by"] :
"title";
525 $direction =
$_GET[
"sort_order"];
529 $offset =
$_GET[
"offset"];
530 $order =
$_GET[
"sort_by"] ?
$_GET[
"sort_by"] :
"title";
531 $direction =
$_GET[
"sort_order"];
535 $offset =
$_GET[
"offset"];
537 if (
$_GET[
"sort_by"] ==
"title" or empty(
$_GET[
"sort_by"]))
539 $_GET[
"sort_by"] =
"login";
541 $order =
$_GET[
"sort_by"];
542 $direction =
$_GET[
"sort_order"];
546 $tbl->setOrderColumn($order);
547 $tbl->setOrderDirection($direction);
548 $tbl->setOffset($offset);
549 $tbl->setLimit(
$_GET[
"limit"]);
551 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
552 $tbl->setData($result_set);
557 global $rbacsystem,$rbacreview;
562 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
564 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
567 if(!is_array(
$_POST[
"role"]))
575 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.grp_usr_selection.html");
576 $this->
__showButton(
"searchUserForm",$this->lng->txt(
"grp_new_search"));
580 foreach(
$_POST[
"role"] as $role_id)
582 $members = array_merge($rbacreview->assignedUsers($role_id),$members);
585 $members = array_unique($members);
590 foreach($members as $user)
597 $user_ids[$counter] = $user;
600 $f_result[$counter][] = $tmp_obj->getLogin();
601 $f_result[$counter][] = $tmp_obj->getLastname();
602 $f_result[$counter][] = $tmp_obj->getFirstname();
615 global $rbacsystem,$rbacreview,
$tree;
620 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
622 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
625 if(!is_array(
$_POST[
"group"]))
633 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.grp_usr_selection.html");
634 $this->
__showButton(
"searchUserForm",$this->lng->txt(
"grp_new_search"));
638 foreach(
$_POST[
"group"] as $group_id)
640 if (!$tree->isInTree($group_id))
649 $members = array_merge($tmp_obj->getGroupMemberIds(),$members);
654 $members = array_unique($members);
659 foreach($members as $user)
666 $user_ids[$counter] = $user;
669 $f_result[$counter][] = $tmp_obj->getLogin();
670 $f_result[$counter][] = $tmp_obj->getLastname();
671 $f_result[$counter][] = $tmp_obj->getFirstname();
717 if(!$this->ilias->getSetting(
'ilinc_active'))
719 $this->ilias->raiseError($lng->txt(
'ilinc_server_not_active'), $this->ilias->error_obj->MESSAGE);
722 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.icrs_members.html',
'Modules/ILinc');
725 $this->lng->loadLanguageModule(
'ilinc');
728 $is_admin = (bool)$ilAccess->checkAccess(
'write',
'', $this->object->getRefId());
731 $ilToolbar->addButton($this->lng->txt(
'ilinc_add_user'), $this->ctrl->getLinkTargetByClass(
'ilRepositorySearchGUI',
'start'));
735 $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\"/>";
736 $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\"/>";
737 $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\"/>";
740 $access_leave = $ilAccess->checkAccess(
'leave',
'', $this->object->getRefId());
741 $access_write = $ilAccess->checkAccess(
'write',
'', $this->object->getRefId());
743 $member_ids = $this->
object->getMemberIds();
746 $members = $this->
object->getMemberData($member_ids);
749 $docent_ids = $this->
object->getiLincMemberIds(
true);
750 $student_ids = $this->
object->getiLincMemberIds(
false);
753 $result_set = array();
754 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
755 foreach($members as $mem)
758 $link_change = $this->ctrl->getLinkTarget($this,
'changeMember').
'&mem_id='.$mem[
'id'];
759 if(($mem[
'id'] == $ilUser->getId() && $access_leave) || $access_delete)
761 $link_leave = $this->ctrl->getLinkTarget($this,
'removeMember').
'&mem_id='.$mem[
'id'];
765 $member_functions =
'';
768 $member_functions =
"<a href=\"$link_change\">$val_change</a>";
770 if(($mem[
'id'] == $ilUser->getId() && $access_leave) || $access_write)
772 $link_leave = $this->ctrl->getLinkTarget($this,
'removeMember').
'&mem_id='.$mem[
'id'];
773 $member_functions .=
"<a href=\"$link_leave\">$val_leave</a>";
777 $str_member_roles = $this->
object->getMemberRolesTitle($mem[
'id']);
781 $result_set[$counter][
'checkbox'] = ilUtil::formCheckBox(0,
'user_id[]', $mem[
'id']);
784 $status = $this->
object->checkiLincMemberStatus($mem[
'ilinc_id'], $docent_ids, $student_ids);
785 if($status == ILINC_MEMBER_NOTSET)
787 $status =
"<span class='warning'>".$this->lng->txt($status).
"</span>";
791 $status = $this->lng->txt($status);
794 $result_set[$counter][
'login'] = $mem[
'login'];
795 $result_set[$counter][
'firstname'] = $mem[
'firstname'];
796 $result_set[$counter][
'lastname'] = $mem[
'lastname'];
797 $result_set[$counter][
'attending_as'] = $status;
798 $result_set[$counter][
'role'] = $str_member_roles;
799 $result_set[$counter][
'options'] =
"<a href=\"$link_contact\">".$val_contact.
"</a>".$member_functions;
803 unset($member_functions);
806 include_once
'Modules/ILinc/classes/class.iliLinkMembersTableGUI.php';
808 $oTable->setTitle($this->lng->txt(
'ilinc_involved_users'),
'icon_usr_b.gif', $this->lng->txt(
'ilinc_involved_users'));
810 return $this->tpl->setVariable(
'MEMBER_TABLE', $oTable->getHTML());
815 global $ilUser,$rbacsystem,$ilAccess,
$ilErr;
817 $next_class = $this->ctrl->getNextClass($this);
818 $cmd = $this->ctrl->getCmd();
823 case "ilconditionhandlerinterface":
824 include_once
'./Services/AccessControl/classes/class.ilConditionHandlerInterface.php';
829 $this->ctrl->saveParameter($this,
'item_id',$_GET[
'item_id']);
830 $this->ctrl->forwardCommand($new_gui);
835 $this->ctrl->forwardCommand($new_gui);
839 case 'ilrepositorysearchgui':
840 include_once(
'./Services/Search/classes/class.ilRepositorySearchGUI.php');
842 $rep_search->setCallback($this,
'addUserObject');
845 $this->tabs_gui->setTabActive(
'members');
846 $this->ctrl->setReturn($this,
'members');
847 $ret =& $this->ctrl->forwardCommand($rep_search);
849 $this->tabs_gui->setSubTabActive(
'members');
852 case "ilobjilincclassroomgui":
853 include_once (
'./Modules/ILinc/classes/class.ilObjiLincClassroomGUI.php');
855 $ret =& $this->ctrl->forwardCommand($icla_gui);
858 case 'ilpermissiongui':
859 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
861 $ret =& $this->ctrl->forwardCommand($perm_gui);
864 case 'ilpublicuserprofilegui':
865 require_once
'./Services/User/classes/class.ilPublicUserProfileGUI.php';
867 $html = $this->ctrl->forwardCommand($profile_gui);
869 $this->tabs_gui->setTabActive(
'group_members');
870 $this->tabs_gui->setSubTabActive(
'grp_members_gallery');
871 $this->tpl->setVariable(
"ADM_CONTENT", $html);
875 if (!$this->
getCreationMode() and !$ilAccess->checkAccess(
'visible',
'',$this->object->getRefId(),
'icrs'))
877 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"),$ilErr->MESSAGE);
893 global
$ilCtrl, $ilNavigationHistory, $ilAccess;
895 if(!$ilAccess->checkAccess(
'read',
'', $this->object->getRefId()))
897 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'), $this->ilias->error_obj->MESSAGE);
902 $ilAccess->checkAccess(
'read',
'', $this->object->getRefId()))
904 $ilNavigationHistory->addItem($this->object->getRefId(),
905 'repository.php?cmd=view&ref_id='.$this->object->getRefId(),
'icrs');
908 if(strtolower(
$_GET[
'baseClass']) ==
'iladministrationgui')
920 $url = $this->
object->userLogin($this->ilias->account);
924 $this->ilias->raiseError($this->object->getErrorMsg(),$this->ilias->error_obj->FATAL);
934 $this->lng->loadLanguageModule(
'search');
937 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
939 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
942 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.grp_members_search.html");
944 $this->tpl->setVariable(
"F_ACTION",$this->ctrl->getFormAction($this));
945 $this->tpl->setVariable(
"SEARCH_ASSIGN_USR",$this->lng->txt(
"grp_search_members"));
946 $this->tpl->setVariable(
"SEARCH_SEARCH_TERM",$this->lng->txt(
"search_search_term"));
947 $this->tpl->setVariable(
"SEARCH_VALUE",
$_SESSION[
"grp_search_str"] ?
$_SESSION[
"grp_search_str"] :
"");
948 $this->tpl->setVariable(
"SEARCH_FOR",$this->lng->txt(
"exc_search_for"));
949 $this->tpl->setVariable(
"SEARCH_ROW_TXT_USER",$this->lng->txt(
"exc_users"));
950 $this->tpl->setVariable(
"SEARCH_ROW_TXT_ROLE",$this->lng->txt(
"exc_roles"));
951 $this->tpl->setVariable(
"SEARCH_ROW_TXT_GROUP",$this->lng->txt(
"exc_groups"));
952 $this->tpl->setVariable(
"BTN2_VALUE",$this->lng->txt(
"cancel"));
953 $this->tpl->setVariable(
"BTN1_VALUE",$this->lng->txt(
"search"));
955 $usr = (
$_POST[
"search_for"] ==
"usr" ||
$_POST[
"search_for"] ==
"") ? 1 : 0;
956 $grp = (
$_POST[
"search_for"] ==
"grp") ? 1 : 0;
957 $role = (
$_POST[
"search_for"] ==
"role") ? 1 : 0;
968 global $rbacsystem,
$tree;
974 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
976 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
979 if(!isset(
$_POST[
"search_for"]) or !isset(
$_POST[
"search_str"]))
995 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.grp_usr_selection.html");
996 $this->
__showButton(
"searchUserForm",$this->lng->txt(
"grp_new_search"));
1001 switch(
$_POST[
"search_for"])
1011 $user_ids[$counter] = $user[
"id"];
1014 $f_result[$counter][] = $tmp_obj->getLogin();
1015 $f_result[$counter][] = $tmp_obj->getFirstname();
1016 $f_result[$counter][] = $tmp_obj->getLastname();
1030 if ($role[
"id"] == ANONYMOUS_ROLE_ID)
1041 if ($tmp_obj->getCountMembers() == 0)
1046 $role_ids[$counter] = $role[
"id"];
1049 $f_result[$counter][] = array($tmp_obj->getTitle(),$tmp_obj->getDescription());
1050 $f_result[$counter][] = $tmp_obj->getCountMembers();
1063 if(!$tree->isInTree($group[
"id"]))
1074 if ($tmp_obj->getId() == $this->
object->getId())
1079 $grp_ids[$counter] = $group[
"id"];
1082 $f_result[$counter][] = array($tmp_obj->getTitle(),$tmp_obj->getDescription());
1083 $f_result[$counter][] = $tmp_obj->getCountMembers();
1089 if(!count($f_result))
1109 $user_ids =
$_POST[
"user"];
1110 include_once
'Services/Mail/classes/class.ilMail.php';
1113 if (empty($user_ids[0]))
1116 $this->ilErr->raiseError($this->lng->txt(
"no_checkbox"),$this->ilErr->MESSAGE);
1119 foreach ($user_ids as $new_member)
1121 $user_obj = $this->ilias->obj_factory->getInstanceByObjId($new_member);
1123 if (!$this->object->addMember($user_obj,$this->object->getDefaultMemberRole(),
false))
1126 $this->ilErr->raiseError($this->object->getErrorMsg(),$this->ilErr->MESSAGE);
1129 $user_obj->addDesktopItem($this->object->getRefId(),
"icrs");
1130 $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'));
1140 ilUtil::redirect($this->ctrl->getLinkTarget($this,
"members",
"",
false,
false));
1149 global $ilUser, $rbacreview;
1153 $user_ids = array();
1155 if(isset(
$_POST[
'user_id']))
1157 $user_ids =
$_POST[
'user_id'];
1159 else if(isset(
$_GET[
'mem_id']))
1161 $user_ids[] =
$_GET[
'mem_id'];
1163 else if(isset(
$_GET[
'mem_id_arr']))
1165 $user_ids = explode(
',',
$_GET[
'mem_id_arr']);
1168 if(empty($user_ids[0]))
1170 $this->ilErr->raiseError($this->lng->txt(
"no_checkbox"), $this->ilErr->MESSAGE);
1173 if(count($user_ids) == 1 && $ilUser->getId() != $user_ids[0])
1175 if(!$rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID) &&
1176 !in_array($ilUser->getId(), $this->
object->getAdminIds()))
1178 $this->ilErr->raiseError($this->lng->txt(
"ilinc_err_no_permission"), $this->ilErr->MESSAGE);
1183 $is_dismiss_me = array_search($this->ilias->account->getId(), $user_ids);
1185 $confirm =
"confirmedRemoveMember";
1186 $cancel =
"canceled";
1187 $info = ($is_dismiss_me !==
false) ?
"ilinc_dismiss_myself" :
"ilinc_dismiss_member";
1189 $return =
"members";
1194 if(is_array($user_ids))
1196 foreach($user_ids as $id)
1201 'title' => $obj_data->getTitle(),
1202 'desc' => $obj_data->getDescription(),
1203 'last_update' => $obj_data->getLastUpdateDate()
1210 $data[$user_ids] = array(
1212 'title' => $obj_data->getTitle(),
1213 'desc' => $obj_data->getDescription(),
1214 'last_update' => $obj_data->getLastUpdateDate(),
1219 if(is_array($user_ids))
1221 $_SESSION[
'saved_post'][
'user_id'] = $user_ids;
1225 $_SESSION[
'saved_post'][
'user_id'][0] = $user_ids;
1230 $_SESSION[
'saved_post'][
'status'] = $status;
1233 include_once
'Modules/ILinc/classes/class.iliLinkConfirmationTableGUI.php';
1234 $this->ctrl->setParameter($this,
'cmd_return_location', $a_cmd_return_location);
1235 $this->ctrl->setParameter($this,
'mem_id_arr', implode(
',', $user_ids));
1237 $oTable->addCommandButton($cancel, $this->lng->txt(
'cancel'));
1238 $oTable->addCommandButton($confirm, $this->lng->txt(
'confirm'));
1240 return $this->tpl->setContent($oTable->getHTML());
1247 function confirmationObject($user_id =
'', $confirm =
'', $cancel =
'', $info =
'', $status =
'', $a_cmd_return_location =
'', $invokeMethod =
'')
1260 $removed_self =
false;
1261 include_once
'Services/Mail/classes/class.ilMail.php';
1265 foreach(
$_SESSION[
"saved_post"][
"user_id"] as $member_id)
1269 if (!$this->object->removeMember($user_obj))
1272 ilUtil::redirect($this->ctrl->getLinkTarget($this,
"members",
"",
false,
false));
1275 $user_obj->dropDesktopItem($this->object->getRefId(),
"icrs");
1277 if (!$removed_self and $user_obj->getId() == $this->ilias->account->getId())
1279 $removed_self =
true;
1283 $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'));
1293 ilUtil::redirect(
"repository.php?ref_id=".$this->tree->getParentId($this->ref_id));
1296 ilUtil::redirect($this->ctrl->getLinkTarget($this,
"members",
"",
false,
false));
1305 global $rbacreview, $ilUser;
1309 $member_ids = array();
1311 if(isset(
$_POST[
'user_id']))
1313 $member_ids =
$_POST[
'user_id'];
1315 else if(isset(
$_GET[
'mem_id']))
1317 $member_ids[0] =
$_GET[
'mem_id'];
1319 else if(isset(
$_GET[
'mem_id_arr']))
1321 $member_ids = explode(
',',
$_GET[
'mem_id_arr']);
1324 if(empty($member_ids[0]))
1326 $this->ilErr->raiseError($this->lng->txt(
'no_checkbox'), $this->ilErr->MESSAGE);
1329 if(!$rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID) &&
1330 !in_array($ilUser->getId(), $this->
object->getAdminIds()))
1332 $this->ilErr->raiseError($this->lng->txt(
'grp_err_no_permission'), $this->ilErr->MESSAGE);
1335 $stati = array_flip($this->object->getLocalRoles(
true));
1338 $docent_ids = $this->
object->getiLincMemberIds(
true);
1339 $student_ids = $this->
object->getiLincMemberIds(
false);
1344 foreach($member_ids as $member_id)
1347 $mem_status = $this->
object->getMemberRoles($member_id);
1349 include_once
'Modules/ILinc/classes/class.ilObjiLincUser.php';
1352 $ilinc_status = $this->
object->checkiLincMemberStatus($ilinc_user->id, $docent_ids, $student_ids);
1354 $docent = 0; $student = 0;
1356 if($ilinc_status == ILINC_MEMBER_DOCENT)
1360 else if($ilinc_status == ILINC_MEMBER_STUDENT)
1365 $radio1 =
ilUtil::formRadioButton($docent,
'ilinc_member_status_select['.$member->getId().
']['.$ilinc_user->id.
']', ILINC_MEMBER_DOCENT);
1366 $radio2 =
ilUtil::formRadioButton($student,
'ilinc_member_status_select['.$member->getId().
']['.$ilinc_user->id.
']', ILINC_MEMBER_STUDENT);
1368 $data[$member->getId()] = array(
1369 'login' => $member->getLogin(),
1370 'firstname' => $member->getFirstname(),
1371 'lastname' => $member->getLastname(),
1372 'attending_as' => $radio1.
' '.$this->lng->txt(
'ilinc_docent').
'<br />'.$radio2.
' '.$this->lng->txt(
'ilinc_student'),
1373 'grp_role' =>
ilUtil::formSelect($mem_status,
'member_status_select['.$member->getId().
'][]', $stati,
true,
true, 3)
1380 include_once
'Modules/ILinc/classes/class.iliLinkMembersTableGUI.php';
1381 $this->ctrl->setParameter($this,
'mem_id_arr', implode(
',', $member_ids));
1383 $oTable->setTitle($this->lng->txt(
'grp_mem_change_status'),
'icon_usr_b.gif', $this->lng->txt(
'grp_mem_change_status'));
1385 return $this->tpl->setContent($oTable->getHTML());
1396 if(!$ilAccess->checkAccess(
'write',
'', $this->object->getRefId()))
1398 $this->ilErr->raiseError(
'permission_denied',$this->ilErr->MESSAGE);
1401 if(isset(
$_POST[
'member_status_select']))
1403 foreach(
$_POST[
'member_status_select'] as $key => $value)
1405 $this->
object->leave($key);
1406 $this->
object->join($key,$value);
1410 if(isset(
$_POST[
'ilinc_member_status_select']))
1412 $users_to_add = array();
1413 $users_to_register = array();
1414 $users_to_unregister = array();
1416 foreach(
$_POST[
'ilinc_member_status_select'] as $user_id => $ilinc_arr)
1418 $ilinc_user_id = key($ilinc_arr);
1419 $ilinc_user_status = current($ilinc_arr);
1426 if($ilinc_user_id == 0)
1433 include_once
'Modules/ILinc/classes/class.ilObjiLincUser.php';
1436 if(!$ilinc_user->id)
1439 $users_to_add[] =& $user_obj;
1443 $users_to_register[$ilinc_user->id] = ILINC_MEMBER_STUDENT;
1450 $users_to_unregister[] = $ilinc_user_id;
1451 $users_to_register[$ilinc_user_id] = $ilinc_user_status;
1455 if(!$this->object->unregisterUsers($users_to_unregister))
1459 $this->ilErr->raiseError($this->object->getErrorMsg(),$this->ilErr->MESSAGE);
1462 if(count($users_to_add) > 0)
1465 foreach ($users_to_add as $user)
1467 if (!$this->object->addUser($user))
1471 $this->ilErr->raiseError($this->object->getErrorMsg(),$this->ilErr->MESSAGE);
1476 include_once
'Modules/ILinc/classes/class.ilObjiLincUser.php';
1478 $users_to_register[$ilinc_user->id] = ILINC_MEMBER_STUDENT;
1483 if(!$this->object->registerUsers($users_to_register))
1487 $this->ilErr->raiseError($this->object->getErrorMsg(),$this->ilErr->MESSAGE);
1492 ilUtil::redirect($this->ctrl->getLinkTarget($this,
'members',
'',
false,
false));
1497 if(!$this->ilias->getSetting(
'ilinc_active'))
1499 $this->ilias->raiseError($this->lng->txt(
'ilinc_server_not_active'), $this->ilias->error_obj->MESSAGE);
1504 return $this->tpl->setVariable(
'ADM_CONTENT', $this->form_gui->getHtml());
1509 $this->form_gui->setValuesByArray(array(
1510 'title' => $this->object->getTitle(),
1511 'desc' => $this->
object->getDescription(),
1512 'activated' => (int)$this->object->activated,
1513 'akclassvalue1' => $this->object->getAKClassValue1(),
1514 'akclassvalue2' => $this->
object->getAKClassValue2(),
1520 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
1523 $this->form_gui->setTableWidth(
'600');
1524 if($a_mode ==
'create')
1526 $this->form_gui->setTitle($this->lng->txt(
'icrs_new'));
1530 $this->form_gui->setTitle($this->lng->txt(
'icrs_edit'));
1535 $text_input =
new ilTextInputGUI($this->lng->txt(
'title'),
'title');
1537 $this->form_gui->addItem($text_input);
1541 $this->form_gui->addItem($text_area);
1545 $this->form_gui->addItem($text_area);
1548 if($this->ilias->getSetting(
'ilinc_akclassvalues_active'))
1551 $section_header->setTitle($this->lng->txt(
'akclassvalues'));
1552 $this->form_gui->addItem($section_header);
1554 $text_input =
new ilTextInputGUI($this->lng->txt(
'akclassvalue1'),
'akclassvalue1');
1555 if($this->ilias->getSetting(
'ilinc_akclassvalues_required'))
1559 $this->form_gui->addItem($text_input);
1561 $text_input =
new ilTextInputGUI($this->lng->txt(
'akclassvalue2'),
'akclassvalue2');
1562 $this->form_gui->addItem($text_input);
1565 if($this->call_by_reference)
1567 $this->ctrl->setParameter($this,
'obj_id', $this->obj_id);
1571 if($a_mode ==
'create')
1573 $this->ctrl->setParameter($this,
'mode',
'create');
1574 $this->ctrl->setParameter($this,
'new_type',
'icrs');
1576 $this->form_gui->addCommandButton(
'save', $this->lng->txt(
'icrs_add'));
1577 $this->form_gui->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
1578 $this->form_gui->setFormAction($this->ctrl->getFormAction($this,
'save'));
1582 $this->form_gui->addCommandButton(
'update', $this->lng->txt(
'save'));
1583 $this->form_gui->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
1584 $this->form_gui->setFormAction($this->ctrl->getFormAction($this,
'update'));
1592 if(!$ilAccess->checkAccess(
'join',
'', (
int)
$_GET[
'ref_id']))
1594 $this->ilias->raiseError($this->lng->txt(
'permission_denied'), $this->ilias->error_obj->MESSAGE);
1597 if(!$this->object->addMember($this->ilias->account, $this->object->getDefaultMemberRole(),
false))
1599 $this->ilErr->raiseError($this->object->getErrorMsg(), $this->ilErr->MESSAGE);
1602 $this->ilias->account->addDesktopItem($this->object->getRefId(),
"icrs");
1605 ilUtil::redirect($this->ctrl->getLinkTarget($this,
"view",
"",
false,
false));
1615 global $rbacsystem, $ilUser;
1621 $this->tabs_gui->addSubTabTarget(
'members', $this->ctrl->getLinkTarget($this,
'members'), array(
'members',
'changeMember',
'removeMember'), get_class($this));
1622 $this->tabs_gui->addSubTabTarget(
'icrs_members_gallery', $this->ctrl->getLinkTarget($this,
'membersGallery'),
'membersGallery', get_class($this));
1623 $this->tabs_gui->addSubTabTarget(
'mail_members', $this->ctrl->getLinkTarget($this,
'mailMembers'),
'mailMembers', get_class($this));
1630 global $rbacreview, $ilObjDataCache;
1632 include_once
'Services/AccessControl/classes/class.ilObjRole.php';
1635 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.mail_members.html',
'Services/Contact');
1639 $link_data = $this->
object->_getLinkToObject( $this->object->getRefId() );
1640 $link_to_seminar = ILIAS_HTTP_PATH.
'/'.$link_data[0];
1641 include_once
'Services/Mail/classes/class.ilMail.php';
1642 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
1644 $this->tpl->setVariable(
'ADDITIONAL_MESSAGE_TEXT', $link_to_seminar);
1646 $this->tpl->setVariable(
'OK', $this->lng->txt(
'ok'));
1648 $role_folder = $rbacreview->getRoleFolderOfObject( $this->object->getRefId() );
1649 $role_ids = $rbacreview->getRolesOfRoleFolder($role_folder[
'ref_id'],
false);
1650 foreach($role_ids as $role_id)
1652 $this->tpl->setCurrentBlock(
'mailbox_row');
1653 $role_addr = $rbacreview->getRoleMailboxAddress( $role_id );
1654 $this->tpl->setVariable(
'CHECK_MAILBOX',
ilUtil::formCheckbox(1,
'roles[]', htmlspecialchars($role_addr)));
1658 $this->tpl->setVariable(
'MAILBOX', $role_addr);
1663 $this->tpl->setVariable(
'MAILBOX',
ilObjRole::_getTranslation( $ilObjDataCache->lookupTitle( $role_id ) ).
' (' . $role_addr .
')');
1666 $this->tpl->parseCurrentBlock();
1679 $is_admin = (bool) $rbacsystem->checkAccess(
'write', $this->object->getRefId());
1681 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.icrs_members_gallery.html',
'Modules/ILinc');
1685 $this->lng->loadLanguageModule(
'ilinc');
1687 $member_ids = $this->
object->getMemberIds();
1690 $members = $this->
object->getMemberData($member_ids);
1693 $admin_ids = $this->
object->getiLincMemberIds(
true);
1698 foreach($members as $member)
1706 $public_profile = $usr_obj->getPref(
'public_profile');
1709 $this->ctrl->setParameterByClass(
'ilpublicuserprofilegui',
'user', $member[
'id']);
1710 $profile_target = $this->ctrl->getLinkTargetByClass(
'ilpublicuserprofilegui',
'getHTML');
1713 $file = $usr_obj->getPersonalPicturePath(
'xsmall');
1715 switch(in_array($member[
'ilinc_id'],$admin_ids))
1719 if($public_profile ==
'y' || $public_profile ==
'g')
1721 $this->tpl->setCurrentBlock(
'tutor_linked');
1722 $this->tpl->setVariable(
'LINK_PROFILE', $profile_target);
1723 $this->tpl->setVariable(
'SRC_USR_IMAGE',
$file);
1724 $this->tpl->parseCurrentBlock();
1728 $this->tpl->setCurrentBlock(
'tutor_not_linked');
1729 $this->tpl->setVariable(
'SRC_USR_IMAGE',
$file);
1730 $this->tpl->parseCurrentBlock();
1732 $this->tpl->setCurrentBlock(
'tutor');
1736 if($public_profile ==
'y' || $public_profile ==
'g')
1738 $this->tpl->setCurrentBlock(
'member_linked');
1739 $this->tpl->setVariable(
'LINK_PROFILE', $profile_target);
1740 $this->tpl->setVariable(
'SRC_USR_IMAGE',
$file);
1741 $this->tpl->parseCurrentBlock();
1745 $this->tpl->setCurrentBlock(
'member_not_linked');
1746 $this->tpl->setVariable(
'SRC_USR_IMAGE',
$file);
1747 $this->tpl->parseCurrentBlock();
1749 $this->tpl->setCurrentBlock(
'member');
1754 if($public_profile ==
'y' || $public_profile ==
'g')
1756 $this->tpl->setVariable(
'FIRSTNAME', $member[
'firstname']);
1757 $this->tpl->setVariable(
'LASTNAME', $member[
'lastname']);
1760 $this->tpl->setVariable(
'LOGIN', $usr_obj->getLogin());
1761 $this->tpl->parseCurrentBlock();
1764 $this->tpl->setCurrentBlock(
'members');
1765 $this->tpl->setVariable(
'MEMBERS_TABLE_HEADER',$this->lng->txt(
'ilinc_involved_users'));
1766 $this->tpl->parseCurrentBlock();
1769 $this->tpl->setVariable(
'TITLE', $this->lng->txt(
'icrs_members_print_title'));
1772 $headline = $this->
object->getTitle().
'<br />'.$this->
object->getDescription();
1773 $this->tpl->setVariable(
'HEADLINE', $headline);
1792 if ($ilAccess->checkAccess(
'read',
'', $a_target))
1794 $_GET[
'cmd'] =
'frameset';
1795 $_GET[
'ref_id'] = $a_target;
1799 $ilErr->raiseError($lng->txt(
'msg_no_perm_read'), $ilErr->FATAL);
1802 include
'repository.php';