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'])
95 $success = $this->
object->update();
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 $success = $icrsObj->addMember($this->ilias->account, $icrsObj->getDefaultAdminRole(),
true);
166 $this->ilErr->raiseError($icrsObj->getErrorMsg(), $this->ilErr->MESSAGE);
173 $this->ilias->account->addDesktopItem($icrsObj->getRefId(),
'icrs');
181 $this->form_gui->setValuesByPost();
182 return $this->tpl->setVariable(
'ADM_CONTENT', $this->form_gui->getHtml());
193 global $rbacsystem,$ilAccess;
195 $this->ctrl->setParameter($this,
'ref_id',$this->ref_id);
197 if($rbacsystem->checkAccess(
'read',$this->ref_id))
199 $tabs_gui->addTarget(
'ilinc_classrooms',
200 $this->ctrl->getLinkTarget($this,
''),
201 array(
'',
'view',
'editClassroom',
'updateClassroom',
'removeClassroom')
205 if($this->ilias->getSetting(
'ilinc_active'))
207 if($ilAccess->checkAccess(
'write',
'', $this->ref_id))
209 $tabs_gui->addTarget(
'edit_properties',
210 $this->ctrl->getLinkTarget($this,
'edit'), array(
'edit',
'update',
'save'), get_class($this));
220 if($ilAccess->checkAccess(
'write',
'',$this->ref_id))
222 $tabs_gui->addTarget(
"ilinc_involved_users",
223 $this->ctrl->getLinkTarget($this,
"members"),
224 array(
"members",
"mailMembers",
"membersGallery",
"showProfile",
'changeMember',
'RemoveMember'),
227 elseif ($ilAccess->checkAccess(
'read',
'',$this->ref_id))
229 $tabs_gui->addTarget(
"ilinc_involved_users",
230 $this->ctrl->getLinkTarget($this,
"membersGallery"),
231 array(
"members",
"mailMembers",
"membersGallery",
"showProfile"),
235 if ($rbacsystem->checkAccess(
'write',$this->ref_id) and $this->
object->isDocent($this->ilias->account))
238 $tabs_gui->addTarget(
"ilinc_manage_course_documents",
239 $url = $this->object->userLogin($this->ilias->account),
"agenda",
"",
"_blank");
254 if ($rbacsystem->checkAccess(
'edit_permission',$this->ref_id))
256 $tabs_gui->addTarget(
"perm_settings",
257 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
261 if ($this->ctrl->getTargetScript() ==
"repository.php" and !empty(
$_SESSION[
'il_rep_clipboard']))
263 $tabs_gui->addTarget(
"clipboard",
264 $this->ctrl->getLinkTarget($this,
"clipboard"),
"clipboard", get_class($this));
267 if ($this->ctrl->getTargetScript() ==
"adm_object.php")
269 if ($this->tree->getSavedNodeData($this->ref_id))
271 $tabs_gui->addTarget(
"trash",
272 $this->ctrl->getLinkTarget($this,
"trash"),
"trash", get_class($this));
279 unset(
$_SESSION[
"grp_delete_member_ids"]);
280 unset(
$_SESSION[
"grp_delete_subscriber_ids"]);
288 public function __search($a_search_string,$a_search_for)
290 include_once(
"./classes/class.ilSearch.php");
292 $this->lng->loadLanguageModule(
"content");
294 $search->setPerformUpdate(
false);
296 $search->setCombination(
"and");
297 $search->setSearchFor(array(0 => $a_search_for));
298 $search->setSearchType(
'new');
300 if($search->validate($message))
302 $search->performSearch();
307 $this->ctrl->redirect($this,
"searchUserForm");
310 return $search->getResultByType($a_search_for);
315 $return_to =
"searchUserForm";
317 if ($a_cmd ==
"listUsersRole" or $a_cmd ==
"listUsersGroup")
319 $return_to =
"search";
323 $tpl =& $tbl->getTemplateObject();
326 $tpl->setCurrentBlock(
"tbl_form_header");
327 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
328 $tpl->parseCurrentBlock();
330 $tpl->setCurrentBlock(
"tbl_action_btn");
331 $tpl->setVariable(
"BTN_NAME",$return_to);
332 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"back"));
333 $tpl->parseCurrentBlock();
335 $tpl->setCurrentBlock(
"tbl_action_btn");
336 $tpl->setVariable(
"BTN_NAME",
"addUser");
337 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"add"));
338 $tpl->parseCurrentBlock();
340 if (!empty($a_user_ids))
343 $tpl->setCurrentBlock(
"tbl_action_toggle_checkboxes");
344 $tpl->setVariable(
"JS_VARNAME",
"user");
346 $tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
347 $tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
348 $tpl->parseCurrentBlock();
351 $tpl->setCurrentBlock(
"tbl_action_row");
352 $tpl->setVariable(
"COLUMN_COUNTS",5);
354 $tpl->parseCurrentBlock();
356 $tbl->setTitle($this->lng->txt(
"ilinc_header_edit_users"),
"icon_usr_b.gif",$this->lng->txt(
"ilinc_header_edit_users"));
357 $tbl->setHeaderNames(array(
"",
358 $this->lng->txt(
"username"),
359 $this->lng->txt(
"firstname"),
360 $this->lng->txt(
"lastname"),
361 $this->lng->txt(
"last_visit")));
362 $tbl->setHeaderVars(array(
"",
367 array(
"ref_id" => $this->object->getRefId(),
369 "cmdClass" =>
"ilobjilinccoursegui",
370 "cmdNode" =>
$_GET[
"cmdNode"]));
372 $tbl->setColumnWidth(array(
"",
"33%",
"33%",
"33%"));
377 $this->tpl->setVariable(
"SEARCH_RESULT_TABLE",$tbl->tpl->get());
385 $tpl =& $tbl->getTemplateObject();
387 $tpl->setCurrentBlock(
"tbl_form_header");
388 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
389 $tpl->parseCurrentBlock();
391 $tpl->setCurrentBlock(
"tbl_action_btn");
392 $tpl->setVariable(
"BTN_NAME",
"searchUserForm");
393 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"back"));
394 $tpl->parseCurrentBlock();
396 $tpl->setCurrentBlock(
"tbl_action_btn");
397 $tpl->setVariable(
"BTN_NAME",
"listUsersRole");
398 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"grp_list_users"));
399 $tpl->parseCurrentBlock();
401 if (!empty($a_role_ids))
404 $tpl->setCurrentBlock(
"tbl_action_toggle_checkboxes");
405 $tpl->setVariable(
"JS_VARNAME",
"role");
407 $tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
408 $tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
409 $tpl->parseCurrentBlock();
412 $tpl->setCurrentBlock(
"tbl_action_row");
413 $tpl->setVariable(
"COLUMN_COUNTS",5);
415 $tpl->parseCurrentBlock();
417 $tbl->setTitle($this->lng->txt(
"ilinc_header_edit_users"),
"icon_usr_b.gif",$this->lng->txt(
"ilinc_header_edit_users"));
418 $tbl->setHeaderNames(array(
"",
419 $this->lng->txt(
"obj_role"),
420 $this->lng->txt(
"grp_count_members")));
421 $tbl->setHeaderVars(array(
"",
424 array(
"ref_id" => $this->object->getRefId(),
426 "cmdClass" =>
"ilobjilincoursegui",
427 "cmdNode" =>
$_GET[
"cmdNode"]));
429 $tbl->setColumnWidth(array(
"",
"80%",
"19%"));
435 $this->tpl->setVariable(
"SEARCH_RESULT_TABLE",$tbl->tpl->get());
443 $tpl =& $tbl->getTemplateObject();
445 $tpl->setCurrentBlock(
"tbl_form_header");
446 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
447 $tpl->parseCurrentBlock();
449 $tpl->setCurrentBlock(
"tbl_action_btn");
450 $tpl->setVariable(
"BTN_NAME",
"searchUserForm");
451 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"back"));
452 $tpl->parseCurrentBlock();
454 $tpl->setCurrentBlock(
"tbl_action_btn");
455 $tpl->setVariable(
"BTN_NAME",
"listUsersGroup");
456 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"grp_list_users"));
457 $tpl->parseCurrentBlock();
459 if (!empty($a_grp_ids))
462 $tpl->setCurrentBlock(
"tbl_action_toggle_checkboxes");
463 $tpl->setVariable(
"JS_VARNAME",
"group");
465 $tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
466 $tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
467 $tpl->parseCurrentBlock();
470 $tpl->setCurrentBlock(
"tbl_action_row");
471 $tpl->setVariable(
"COLUMN_COUNTS",5);
473 $tpl->parseCurrentBlock();
475 $tbl->setTitle($this->lng->txt(
"ilinc_header_edit_users"),
"icon_usr_b.gif",$this->lng->txt(
"ilinc_header_edit_users"));
476 $tbl->setHeaderNames(array(
"",
477 $this->lng->txt(
"obj_grp"),
478 $this->lng->txt(
"grp_count_members")));
479 $tbl->setHeaderVars(array(
"",
482 array(
"ref_id" => $this->object->getRefId(),
484 "cmdClass" =>
"ilobjilinccoursegui",
485 "cmdNode" =>
$_GET[
"cmdNode"]));
487 $tbl->setColumnWidth(array(
"",
"80%",
"19%"));
493 $this->tpl->setVariable(
"SEARCH_RESULT_TABLE",$tbl->tpl->get());
500 include_once
"./Services/Table/classes/class.ilTableGUI.php";
510 $offset =
$_GET[
"update_subscribers"] ?
$_GET[
"offset"] : 0;
511 $order =
$_GET[
"update_subscribers"] ?
$_GET[
"sort_by"] :
'login';
512 $direction =
$_GET[
"update_subscribers"] ?
$_GET[
"sort_order"] :
'';
516 $offset =
$_GET[
"offset"];
517 $order =
$_GET[
"sort_by"] ?
$_GET[
"sort_by"] :
"title";
518 $direction =
$_GET[
"sort_order"];
522 $offset =
$_GET[
"offset"];
523 $order =
$_GET[
"sort_by"] ?
$_GET[
"sort_by"] :
"title";
524 $direction =
$_GET[
"sort_order"];
528 $offset =
$_GET[
"offset"];
530 if (
$_GET[
"sort_by"] ==
"title" or empty(
$_GET[
"sort_by"]))
532 $_GET[
"sort_by"] =
"login";
534 $order =
$_GET[
"sort_by"];
535 $direction =
$_GET[
"sort_order"];
539 $tbl->setOrderColumn($order);
540 $tbl->setOrderDirection($direction);
541 $tbl->setOffset($offset);
542 $tbl->setLimit(
$_GET[
"limit"]);
544 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
545 $tbl->setData($result_set);
550 global $rbacsystem,$rbacreview;
555 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
557 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
560 if(!is_array(
$_POST[
"role"]))
568 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.grp_usr_selection.html");
569 $this->
__showButton(
"searchUserForm",$this->lng->txt(
"grp_new_search"));
573 foreach(
$_POST[
"role"] as $role_id)
575 $members = array_merge($rbacreview->assignedUsers($role_id),$members);
578 $members = array_unique($members);
583 foreach($members as $user)
590 $user_ids[$counter] = $user;
593 $f_result[$counter][] = $tmp_obj->getLogin();
594 $f_result[$counter][] = $tmp_obj->getLastname();
595 $f_result[$counter][] = $tmp_obj->getFirstname();
608 global $rbacsystem,$rbacreview,
$tree;
613 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
615 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
618 if(!is_array(
$_POST[
"group"]))
626 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.grp_usr_selection.html");
627 $this->
__showButton(
"searchUserForm",$this->lng->txt(
"grp_new_search"));
631 foreach(
$_POST[
"group"] as $group_id)
633 if (!$tree->isInTree($group_id))
642 $members = array_merge($tmp_obj->getGroupMemberIds(),$members);
647 $members = array_unique($members);
652 foreach($members as $user)
659 $user_ids[$counter] = $user;
662 $f_result[$counter][] = $tmp_obj->getLogin();
663 $f_result[$counter][] = $tmp_obj->getLastname();
664 $f_result[$counter][] = $tmp_obj->getFirstname();
710 if(!$this->ilias->getSetting(
'ilinc_active'))
712 $this->ilias->raiseError($lng->txt(
'ilinc_server_not_active'), $this->ilias->error_obj->MESSAGE);
715 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.icrs_members.html',
'Modules/ILinc');
718 $this->lng->loadLanguageModule(
'ilinc');
721 $is_admin = (bool)$ilAccess->checkAccess(
'write',
'', $this->object->getRefId());
724 $ilToolbar->addButton($this->lng->txt(
'ilinc_add_user'), $this->ctrl->getLinkTargetByClass(
'ilRepositorySearchGUI',
'start'));
728 $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\"/>";
729 $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\"/>";
730 $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\"/>";
733 $access_leave = $ilAccess->checkAccess(
'leave',
'', $this->object->getRefId());
734 $access_write = $ilAccess->checkAccess(
'write',
'', $this->object->getRefId());
736 $member_ids = $this->
object->getMemberIds();
739 $members = $this->
object->getMemberData($member_ids);
742 $docent_ids = $this->
object->getiLincMemberIds(
true);
743 $student_ids = $this->
object->getiLincMemberIds(
false);
746 $result_set = array();
747 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
748 foreach($members as $mem)
751 $link_change = $this->ctrl->getLinkTarget($this,
'changeMember').
'&mem_id='.$mem[
'id'];
752 if(($mem[
'id'] == $ilUser->getId() && $access_leave) || $access_delete)
754 $link_leave = $this->ctrl->getLinkTarget($this,
'removeMember').
'&mem_id='.$mem[
'id'];
758 $member_functions =
'';
761 $member_functions =
"<a href=\"$link_change\">$val_change</a>";
763 if(($mem[
'id'] == $ilUser->getId() && $access_leave) || $access_write)
765 $link_leave = $this->ctrl->getLinkTarget($this,
'removeMember').
'&mem_id='.$mem[
'id'];
766 $member_functions .=
"<a href=\"$link_leave\">$val_leave</a>";
770 $str_member_roles = $this->
object->getMemberRolesTitle($mem[
'id']);
774 $result_set[$counter][
'checkbox'] = ilUtil::formCheckBox(0,
'user_id[]', $mem[
'id']);
777 $status = $this->
object->checkiLincMemberStatus($mem[
'ilinc_id'], $docent_ids, $student_ids);
778 if($status == ILINC_MEMBER_NOTSET)
780 $status =
"<span class='warning'>".$this->lng->txt($status).
"</span>";
784 $status = $this->lng->txt($status);
787 $result_set[$counter][
'login'] = $mem[
'login'];
788 $result_set[$counter][
'firstname'] = $mem[
'firstname'];
789 $result_set[$counter][
'lastname'] = $mem[
'lastname'];
790 $result_set[$counter][
'attending_as'] = $status;
791 $result_set[$counter][
'role'] = $str_member_roles;
792 $result_set[$counter][
'options'] =
"<a href=\"$link_contact\">".$val_contact.
"</a>".$member_functions;
796 unset($member_functions);
799 include_once
'Modules/ILinc/classes/class.iliLinkMembersTableGUI.php';
801 $oTable->setTitle($this->lng->txt(
'ilinc_involved_users'),
'icon_usr_b.gif', $this->lng->txt(
'ilinc_involved_users'));
803 return $this->tpl->setVariable(
'MEMBER_TABLE', $oTable->getHTML());
808 global $ilUser,$rbacsystem,$ilAccess,
$ilErr;
810 $next_class = $this->ctrl->getNextClass($this);
811 $cmd = $this->ctrl->getCmd();
816 case "ilconditionhandlerinterface":
817 include_once
'./classes/class.ilConditionHandlerInterface.php';
822 $this->ctrl->saveParameter($this,
'item_id',$_GET[
'item_id']);
823 $this->ctrl->forwardCommand($new_gui);
828 $this->ctrl->forwardCommand($new_gui);
832 case 'ilrepositorysearchgui':
833 include_once(
'./Services/Search/classes/class.ilRepositorySearchGUI.php');
835 $rep_search->setCallback($this,
'addUserObject');
838 $this->tabs_gui->setTabActive(
'members');
839 $this->ctrl->setReturn($this,
'members');
840 $ret =& $this->ctrl->forwardCommand($rep_search);
842 $this->tabs_gui->setSubTabActive(
'members');
845 case "ilobjilincclassroomgui":
846 include_once (
'./Modules/ILinc/classes/class.ilObjiLincClassroomGUI.php');
848 $ret =& $this->ctrl->forwardCommand($icla_gui);
851 case 'ilpermissiongui':
852 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
854 $ret =& $this->ctrl->forwardCommand($perm_gui);
857 case 'ilpublicuserprofilegui':
858 require_once
'./Services/User/classes/class.ilPublicUserProfileGUI.php';
860 $html = $this->ctrl->forwardCommand($profile_gui);
862 $this->tabs_gui->setTabActive(
'group_members');
863 $this->tabs_gui->setSubTabActive(
'grp_members_gallery');
864 $this->tpl->setVariable(
"ADM_CONTENT", $html);
868 if (!$this->
getCreationMode() and !$ilAccess->checkAccess(
'visible',
'',$this->object->getRefId(),
'icrs'))
870 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"),$ilErr->MESSAGE);
886 global
$ilCtrl, $ilNavigationHistory, $ilAccess;
888 if(!$ilAccess->checkAccess(
'read',
'', $this->object->getRefId()))
890 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'), $this->ilias->error_obj->MESSAGE);
895 $ilAccess->checkAccess(
'read',
'', $this->object->getRefId()))
897 $ilNavigationHistory->addItem($this->object->getRefId(),
898 'repository.php?cmd=view&ref_id='.$this->object->getRefId(),
'icrs');
901 if(strtolower(
$_GET[
'baseClass']) ==
'iladministrationgui')
913 $url = $this->
object->userLogin($this->ilias->account);
917 $this->ilias->raiseError($this->object->getErrorMsg(),$this->ilias->error_obj->FATAL);
927 $this->lng->loadLanguageModule(
'search');
930 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
932 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
935 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.grp_members_search.html");
937 $this->tpl->setVariable(
"F_ACTION",$this->ctrl->getFormAction($this));
938 $this->tpl->setVariable(
"SEARCH_ASSIGN_USR",$this->lng->txt(
"grp_search_members"));
939 $this->tpl->setVariable(
"SEARCH_SEARCH_TERM",$this->lng->txt(
"search_search_term"));
940 $this->tpl->setVariable(
"SEARCH_VALUE",
$_SESSION[
"grp_search_str"] ?
$_SESSION[
"grp_search_str"] :
"");
941 $this->tpl->setVariable(
"SEARCH_FOR",$this->lng->txt(
"exc_search_for"));
942 $this->tpl->setVariable(
"SEARCH_ROW_TXT_USER",$this->lng->txt(
"exc_users"));
943 $this->tpl->setVariable(
"SEARCH_ROW_TXT_ROLE",$this->lng->txt(
"exc_roles"));
944 $this->tpl->setVariable(
"SEARCH_ROW_TXT_GROUP",$this->lng->txt(
"exc_groups"));
945 $this->tpl->setVariable(
"BTN2_VALUE",$this->lng->txt(
"cancel"));
946 $this->tpl->setVariable(
"BTN1_VALUE",$this->lng->txt(
"search"));
948 $usr = (
$_POST[
"search_for"] ==
"usr" ||
$_POST[
"search_for"] ==
"") ? 1 : 0;
949 $grp = (
$_POST[
"search_for"] ==
"grp") ? 1 : 0;
950 $role = (
$_POST[
"search_for"] ==
"role") ? 1 : 0;
961 global $rbacsystem,
$tree;
967 if(!$rbacsystem->checkAccess(
"write", $this->object->getRefId()))
969 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
972 if(!isset(
$_POST[
"search_for"]) or !isset(
$_POST[
"search_str"]))
988 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.grp_usr_selection.html");
989 $this->
__showButton(
"searchUserForm",$this->lng->txt(
"grp_new_search"));
994 switch(
$_POST[
"search_for"])
997 foreach($result as $user)
1004 $user_ids[$counter] = $user[
"id"];
1007 $f_result[$counter][] = $tmp_obj->getLogin();
1008 $f_result[$counter][] = $tmp_obj->getFirstname();
1009 $f_result[$counter][] = $tmp_obj->getLastname();
1020 foreach($result as $role)
1023 if ($role[
"id"] == ANONYMOUS_ROLE_ID)
1034 if ($tmp_obj->getCountMembers() == 0)
1039 $role_ids[$counter] = $role[
"id"];
1042 $f_result[$counter][] = array($tmp_obj->getTitle(),$tmp_obj->getDescription());
1043 $f_result[$counter][] = $tmp_obj->getCountMembers();
1054 foreach($result as $group)
1056 if(!$tree->isInTree($group[
"id"]))
1067 if ($tmp_obj->getId() == $this->
object->getId())
1072 $grp_ids[$counter] = $group[
"id"];
1075 $f_result[$counter][] = array($tmp_obj->getTitle(),$tmp_obj->getDescription());
1076 $f_result[$counter][] = $tmp_obj->getCountMembers();
1082 if(!count($f_result))
1102 $user_ids =
$_POST[
"user"];
1106 if (empty($user_ids[0]))
1109 $this->ilErr->raiseError($this->lng->txt(
"no_checkbox"),$this->ilErr->MESSAGE);
1112 foreach ($user_ids as $new_member)
1114 $user_obj = $this->ilias->obj_factory->getInstanceByObjId($new_member);
1116 if (!$this->object->addMember($user_obj,$this->object->getDefaultMemberRole(),
false))
1119 $this->ilErr->raiseError($this->object->getErrorMsg(),$this->ilErr->MESSAGE);
1122 $user_obj->addDesktopItem($this->object->getRefId(),
"icrs");
1123 $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'));
1133 ilUtil::redirect($this->ctrl->getLinkTarget($this,
"members",
"",
false,
false));
1142 global $ilUser, $rbacreview;
1146 $user_ids = array();
1148 if(isset(
$_POST[
'user_id']))
1150 $user_ids =
$_POST[
'user_id'];
1152 else if(isset(
$_GET[
'mem_id']))
1154 $user_ids[] =
$_GET[
'mem_id'];
1156 else if(isset(
$_GET[
'mem_id_arr']))
1158 $user_ids = explode(
',',
$_GET[
'mem_id_arr']);
1161 if(empty($user_ids[0]))
1163 $this->ilErr->raiseError($this->lng->txt(
"no_checkbox"), $this->ilErr->MESSAGE);
1166 if(count($user_ids) == 1 && $ilUser->getId() != $user_ids[0])
1168 if(!$rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID) &&
1169 !in_array($ilUser->getId(), $this->
object->getAdminIds()))
1171 $this->ilErr->raiseError($this->lng->txt(
"ilinc_err_no_permission"), $this->ilErr->MESSAGE);
1176 $is_dismiss_me = array_search($this->ilias->account->getId(), $user_ids);
1178 $confirm =
"confirmedRemoveMember";
1179 $cancel =
"canceled";
1180 $info = ($is_dismiss_me !==
false) ?
"ilinc_dismiss_myself" :
"ilinc_dismiss_member";
1182 $return =
"members";
1187 if(is_array($user_ids))
1189 foreach($user_ids as $id)
1194 'title' => $obj_data->getTitle(),
1195 'desc' => $obj_data->getDescription(),
1196 'last_update' => $obj_data->getLastUpdateDate()
1203 $data[$user_ids] = array(
1205 'title' => $obj_data->getTitle(),
1206 'desc' => $obj_data->getDescription(),
1207 'last_update' => $obj_data->getLastUpdateDate(),
1212 if(is_array($user_ids))
1214 $_SESSION[
'saved_post'][
'user_id'] = $user_ids;
1218 $_SESSION[
'saved_post'][
'user_id'][0] = $user_ids;
1223 $_SESSION[
'saved_post'][
'status'] = $status;
1226 include_once
'Modules/ILinc/classes/class.iliLinkConfirmationTableGUI.php';
1227 $this->ctrl->setParameter($this,
'cmd_return_location', $a_cmd_return_location);
1228 $this->ctrl->setParameter($this,
'mem_id_arr', implode(
',', $user_ids));
1230 $oTable->addCommandButton($cancel, $this->lng->txt(
'cancel'));
1231 $oTable->addCommandButton($confirm, $this->lng->txt(
'confirm'));
1233 return $this->tpl->setContent($oTable->getHTML());
1240 function confirmationObject($user_id =
'', $confirm =
'', $cancel =
'', $info =
'', $status =
'', $a_cmd_return_location =
'', $invokeMethod =
'')
1253 $removed_self =
false;
1258 foreach(
$_SESSION[
"saved_post"][
"user_id"] as $member_id)
1262 if (!$this->object->removeMember($user_obj))
1265 ilUtil::redirect($this->ctrl->getLinkTarget($this,
"members",
"",
false,
false));
1268 $user_obj->dropDesktopItem($this->object->getRefId(),
"icrs");
1270 if (!$removed_self and $user_obj->getId() == $this->ilias->account->getId())
1272 $removed_self =
true;
1276 $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'));
1286 ilUtil::redirect(
"repository.php?ref_id=".$this->tree->getParentId($this->ref_id));
1289 ilUtil::redirect($this->ctrl->getLinkTarget($this,
"members",
"",
false,
false));
1298 global $rbacreview, $ilUser;
1302 $member_ids = array();
1304 if(isset(
$_POST[
'user_id']))
1306 $member_ids =
$_POST[
'user_id'];
1308 else if(isset(
$_GET[
'mem_id']))
1310 $member_ids[0] =
$_GET[
'mem_id'];
1312 else if(isset(
$_GET[
'mem_id_arr']))
1314 $member_ids = explode(
',',
$_GET[
'mem_id_arr']);
1317 if(empty($member_ids[0]))
1319 $this->ilErr->raiseError($this->lng->txt(
'no_checkbox'), $this->ilErr->MESSAGE);
1322 if(!$rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID) &&
1323 !in_array($ilUser->getId(), $this->
object->getAdminIds()))
1325 $this->ilErr->raiseError($this->lng->txt(
'grp_err_no_permission'), $this->ilErr->MESSAGE);
1328 $stati = array_flip($this->object->getLocalRoles(
true));
1331 $docent_ids = $this->
object->getiLincMemberIds(
true);
1332 $student_ids = $this->
object->getiLincMemberIds(
false);
1337 foreach($member_ids as $member_id)
1340 $mem_status = $this->
object->getMemberRoles($member_id);
1342 include_once
'Modules/ILinc/classes/class.ilObjiLincUser.php';
1345 $ilinc_status = $this->
object->checkiLincMemberStatus($ilinc_user->id, $docent_ids, $student_ids);
1347 $docent = 0; $student = 0;
1349 if($ilinc_status == ILINC_MEMBER_DOCENT)
1353 else if($ilinc_status == ILINC_MEMBER_STUDENT)
1358 $radio1 =
ilUtil::formRadioButton($docent,
'ilinc_member_status_select['.$member->getId().
']['.$ilinc_user->id.
']', ILINC_MEMBER_DOCENT);
1359 $radio2 =
ilUtil::formRadioButton($student,
'ilinc_member_status_select['.$member->getId().
']['.$ilinc_user->id.
']', ILINC_MEMBER_STUDENT);
1361 $data[$member->getId()] = array(
1362 'login' => $member->getLogin(),
1363 'firstname' => $member->getFirstname(),
1364 'lastname' => $member->getLastname(),
1365 'attending_as' => $radio1.
' '.$this->lng->txt(
'ilinc_docent').
'<br/ '.$radio2.
' '.$this->lng->txt(
'ilinc_student'),
1366 'grp_role' =>
ilUtil::formSelect($mem_status,
'member_status_select['.$member->getId().
'][]', $stati,
true,
true, 3)
1373 include_once
'Modules/ILinc/classes/class.iliLinkMembersTableGUI.php';
1374 $this->ctrl->setParameter($this,
'mem_id_arr', implode(
',', $member_ids));
1376 $oTable->setTitle($this->lng->txt(
'grp_mem_change_status'),
'icon_usr_b.gif', $this->lng->txt(
'grp_mem_change_status'));
1378 return $this->tpl->setContent($oTable->getHTML());
1389 if(!$ilAccess->checkAccess(
'write',
'', $this->object->getRefId()))
1391 $this->ilErr->raiseError(
'permission_denied',$this->ilErr->MESSAGE);
1394 if(isset(
$_POST[
'member_status_select']))
1396 foreach(
$_POST[
'member_status_select'] as $key => $value)
1398 $this->
object->leave($key);
1399 $this->
object->join($key,$value);
1403 if(isset(
$_POST[
'ilinc_member_status_select']))
1405 $users_to_add = array();
1406 $users_to_register = array();
1407 $users_to_unregister = array();
1409 foreach(
$_POST[
'ilinc_member_status_select'] as $user_id => $ilinc_arr)
1411 $ilinc_user_id = key($ilinc_arr);
1412 $ilinc_user_status = current($ilinc_arr);
1419 if($ilinc_user_id == 0)
1426 include_once
'Modules/ILinc/classes/class.ilObjiLincUser.php';
1429 if(!$ilinc_user->id)
1432 $users_to_add[] =& $user_obj;
1436 $users_to_register[$ilinc_user->id] = ILINC_MEMBER_STUDENT;
1443 $users_to_unregister[] = $ilinc_user_id;
1444 $users_to_register[$ilinc_user_id] = $ilinc_user_status;
1448 if(!$this->object->unregisterUsers($users_to_unregister))
1452 $this->ilErr->raiseError($this->object->getErrorMsg(),$this->ilErr->MESSAGE);
1455 if(count($users_to_add) > 0)
1458 foreach ($users_to_add as $user)
1460 if (!$this->object->addUser($user))
1464 $this->ilErr->raiseError($this->object->getErrorMsg(),$this->ilErr->MESSAGE);
1469 include_once
'Modules/ILinc/classes/class.ilObjiLincUser.php';
1471 $users_to_register[$ilinc_user->id] = ILINC_MEMBER_STUDENT;
1476 if(!$this->object->registerUsers($users_to_register))
1480 $this->ilErr->raiseError($this->object->getErrorMsg(),$this->ilErr->MESSAGE);
1485 ilUtil::redirect($this->ctrl->getLinkTarget($this,
'members',
'',
false,
false));
1490 if(!$this->ilias->getSetting(
'ilinc_active'))
1492 $this->ilias->raiseError($this->lng->txt(
'ilinc_server_not_active'), $this->ilias->error_obj->MESSAGE);
1497 return $this->tpl->setVariable(
'ADM_CONTENT', $this->form_gui->getHtml());
1502 $this->form_gui->setValuesByArray(array(
1503 'title' => $this->object->getTitle(),
1504 'desc' => $this->
object->getDescription(),
1505 'activated' => (int)$this->object->activated,
1506 'akclassvalue1' => $this->object->getAKClassValue1(),
1507 'akclassvalue2' => $this->
object->getAKClassValue2(),
1513 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
1516 $this->form_gui->setTableWidth(
'600');
1517 if($a_mode ==
'create')
1519 $this->form_gui->setTitle($this->lng->txt(
'icrs_new'));
1523 $this->form_gui->setTitle($this->lng->txt(
'icrs_edit'));
1528 $text_input =
new ilTextInputGUI($this->lng->txt(
'title'),
'title');
1530 $this->form_gui->addItem($text_input);
1534 $this->form_gui->addItem($text_area);
1538 $this->form_gui->addItem($text_area);
1541 if($this->ilias->getSetting(
'ilinc_akclassvalues_active'))
1544 $section_header->setTitle($this->lng->txt(
'akclassvalues'));
1545 $this->form_gui->addItem($section_header);
1547 $text_input =
new ilTextInputGUI($this->lng->txt(
'akclassvalue1'),
'akclassvalue1');
1548 if($this->ilias->getSetting(
'ilinc_akclassvalues_required'))
1552 $this->form_gui->addItem($text_input);
1554 $text_input =
new ilTextInputGUI($this->lng->txt(
'akclassvalue2'),
'akclassvalue2');
1555 $this->form_gui->addItem($text_input);
1558 if($this->call_by_reference)
1560 $this->ctrl->setParameter($this,
'obj_id', $this->obj_id);
1564 if($a_mode ==
'create')
1566 $this->ctrl->setParameter($this,
'mode',
'create');
1567 $this->ctrl->setParameter($this,
'new_type',
'icrs');
1569 $this->form_gui->addCommandButton(
'save', $this->lng->txt(
'icrs_add'));
1570 $this->form_gui->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
1571 $this->form_gui->setFormAction($this->ctrl->getFormAction($this,
'save'));
1575 $this->form_gui->addCommandButton(
'update', $this->lng->txt(
'save'));
1576 $this->form_gui->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
1577 $this->form_gui->setFormAction($this->ctrl->getFormAction($this,
'update'));
1585 if(!$ilAccess->checkAccess(
'join',
'', (
int)
$_GET[
'ref_id']))
1587 $this->ilias->raiseError($this->lng->txt(
'permission_denied'), $this->ilias->error_obj->MESSAGE);
1590 if(!$this->object->addMember($this->ilias->account, $this->object->getDefaultMemberRole(),
false))
1592 $this->ilErr->raiseError($this->object->getErrorMsg(), $this->ilErr->MESSAGE);
1595 $this->ilias->account->addDesktopItem($this->object->getRefId(),
"icrs");
1598 ilUtil::redirect($this->ctrl->getLinkTarget($this,
"view",
"",
false,
false));
1608 global $rbacsystem, $ilUser;
1614 $this->tabs_gui->addSubTabTarget(
'members', $this->ctrl->getLinkTarget($this,
'members'), array(
'members',
'changeMember',
'removeMember'), get_class($this));
1615 $this->tabs_gui->addSubTabTarget(
'icrs_members_gallery', $this->ctrl->getLinkTarget($this,
'membersGallery'),
'membersGallery', get_class($this));
1616 $this->tabs_gui->addSubTabTarget(
'mail_members', $this->ctrl->getLinkTarget($this,
'mailMembers'),
'mailMembers', get_class($this));
1623 global $rbacreview, $ilObjDataCache;
1625 include_once
'Services/AccessControl/classes/class.ilObjRole.php';
1628 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.mail_members.html',
'Services/Contact');
1632 $link_data = $this->
object->_getLinkToObject( $this->object->getRefId() );
1633 $link_to_seminar = ILIAS_HTTP_PATH.
'/'.$link_data[0];
1635 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
1637 $this->tpl->setVariable(
'ADDITIONAL_MESSAGE_TEXT', $link_to_seminar);
1639 $this->tpl->setVariable(
'OK', $this->lng->txt(
'ok'));
1641 $role_folder = $rbacreview->getRoleFolderOfObject( $this->object->getRefId() );
1642 $role_ids = $rbacreview->getRolesOfRoleFolder($role_folder[
'ref_id'],
false);
1643 foreach($role_ids as $role_id)
1645 $this->tpl->setCurrentBlock(
'mailbox_row');
1646 $role_addr = $rbacreview->getRoleMailboxAddress( $role_id );
1647 $this->tpl->setVariable(
'CHECK_MAILBOX',
ilUtil::formCheckbox(1,
'roles[]', htmlspecialchars($role_addr)));
1651 $this->tpl->setVariable(
'MAILBOX', $role_addr);
1656 $this->tpl->setVariable(
'MAILBOX',
ilObjRole::_getTranslation( $ilObjDataCache->lookupTitle( $role_id ) ).
' (' . $role_addr .
')');
1659 $this->tpl->parseCurrentBlock();
1672 $is_admin = (bool) $rbacsystem->checkAccess(
'write', $this->object->getRefId());
1674 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.icrs_members_gallery.html',
'Modules/ILinc');
1678 $this->lng->loadLanguageModule(
'ilinc');
1680 $member_ids = $this->
object->getMemberIds();
1683 $members = $this->
object->getMemberData($member_ids);
1686 $admin_ids = $this->
object->getiLincMemberIds(
true);
1691 foreach($members as $member)
1699 $public_profile = $usr_obj->getPref(
'public_profile');
1702 $this->ctrl->setParameterByClass(
'ilpublicuserprofilegui',
'user', $member[
'id']);
1703 $profile_target = $this->ctrl->getLinkTargetByClass(
'ilpublicuserprofilegui',
'getHTML');
1706 $file = $usr_obj->getPersonalPicturePath(
'xsmall');
1708 switch(in_array($member[
'ilinc_id'],$admin_ids))
1712 if($public_profile ==
'y' || $public_profile ==
'g')
1714 $this->tpl->setCurrentBlock(
'tutor_linked');
1715 $this->tpl->setVariable(
'LINK_PROFILE', $profile_target);
1716 $this->tpl->setVariable(
'SRC_USR_IMAGE',
$file);
1717 $this->tpl->parseCurrentBlock();
1721 $this->tpl->setCurrentBlock(
'tutor_not_linked');
1722 $this->tpl->setVariable(
'SRC_USR_IMAGE',
$file);
1723 $this->tpl->parseCurrentBlock();
1725 $this->tpl->setCurrentBlock(
'tutor');
1729 if($public_profile ==
'y' || $public_profile ==
'g')
1731 $this->tpl->setCurrentBlock(
'member_linked');
1732 $this->tpl->setVariable(
'LINK_PROFILE', $profile_target);
1733 $this->tpl->setVariable(
'SRC_USR_IMAGE',
$file);
1734 $this->tpl->parseCurrentBlock();
1738 $this->tpl->setCurrentBlock(
'member_not_linked');
1739 $this->tpl->setVariable(
'SRC_USR_IMAGE',
$file);
1740 $this->tpl->parseCurrentBlock();
1742 $this->tpl->setCurrentBlock(
'member');
1747 if($public_profile ==
'y' || $public_profile ==
'g')
1749 $this->tpl->setVariable(
'FIRSTNAME', $member[
'firstname']);
1750 $this->tpl->setVariable(
'LASTNAME', $member[
'lastname']);
1753 $this->tpl->setVariable(
'LOGIN', $usr_obj->getLogin());
1754 $this->tpl->parseCurrentBlock();
1757 $this->tpl->setCurrentBlock(
'members');
1758 $this->tpl->setVariable(
'MEMBERS_TABLE_HEADER',$this->lng->txt(
'ilinc_involved_users'));
1759 $this->tpl->parseCurrentBlock();
1762 $this->tpl->setVariable(
'TITLE', $this->lng->txt(
'icrs_members_print_title'));
1765 $headline = $this->
object->getTitle().
'<br />'.$this->
object->getDescription();
1766 $this->tpl->setVariable(
'HEADLINE', $headline);
1785 if ($ilAccess->checkAccess(
'read',
'', $a_target))
1787 $_GET[
'cmd'] =
'frameset';
1788 $_GET[
'ref_id'] = $a_target;
1792 $ilErr->raiseError($lng->txt(
'msg_no_perm_read'), $ilErr->FATAL);
1795 include
'repository.php';