Show course members.
406 include_once
'Modules/Course/classes/class.ilCourseParticipants.php';
408 if (
$_GET[
"search_crs"] !=
"") {
409 $_POST[
"search_crs"] = explode(
",",
$_GET[
"search_crs"]);
410 $_GET[
"search_crs"] =
"";
411 } elseif (
$_SESSION[
"search_crs"] !=
"") {
416 if (is_array(
$_POST[
'search_crs'])) {
417 $_POST[
'search_crs'] = array_filter(array_map(
'intval',
$_POST[
'search_crs']));
420 if (!is_array(
$_POST[
"search_crs"]) ||
421 count(
$_POST[
"search_crs"]) == 0) {
423 $this->showMyCourses();
425 foreach (
$_POST[
'search_crs'] as $crs_id) {
427 if ($oTmpCrs->getShowMembers() == $oTmpCrs->SHOW_MEMBERS_DISABLED) {
428 unset(
$_POST[
'search_crs']);
429 ilUtil::sendInfo($this->lng->txt(
'mail_crs_list_members_not_available_for_at_least_one_crs'));
430 return $this->showMyCourses();
435 $this->tpl->setTitle($this->lng->txt(
"mail_addressbook"));
437 $this->ctrl->setParameter($this,
"view",
"crs_members");
438 if (
$_GET[
"ref"] !=
"") {
439 $this->ctrl->setParameter($this,
"ref",
$_GET[
"ref"]);
441 if (is_array(
$_POST[
"search_crs"])) {
442 $this->ctrl->setParameter($this,
"search_crs", implode(
",",
$_POST[
"search_crs"]));
444 $this->tpl->setVariable(
"ACTION", $this->ctrl->getFormAction($this));
445 $this->ctrl->clearParameters($this);
447 $this->lng->loadLanguageModule(
'crs');
448 include_once
'Services/Contact/classes/class.ilMailSearchCoursesMembersTableGUI.php';
451 $tableData = array();
452 $searchTpl =
new ilTemplate(
'tpl.mail_search_template.html',
true,
true,
'Services/Contact');
453 foreach (
$_POST[
"search_crs"] as $crs_id) {
454 $members_obj = ilCourseParticipants::_getinstanceByObjId($crs_id);
455 $tmp_members = $members_obj->getParticipants();
456 $course_members =
ilUtil::_sortIds($tmp_members,
'usr_data',
'lastname',
'usr_id');
458 foreach ($course_members as $member) {
460 if (!$tmp_usr->getActive()) {
469 $fullname =
$name[
'lastname'] .
', ' .
$name[
'firstname'];
473 'members_id' => $member,
474 'members_login' =>
$login,
475 'members_name' => $fullname,
476 'members_crs_grp' => $this->cache->lookupTitle($crs_id),
477 'search_crs' => $crs_id
483 $rowData[
'status'] =
'';
484 if ($member != $this->
user->getId()) {
485 if ($relation->isOwnedByActor()) {
486 $rowData[
'status'] = $this->lng->txt(
'buddy_bs_state_' . $state_name .
'_a');
488 $rowData[
'status'] = $this->lng->txt(
'buddy_bs_state_' . $state_name .
'_p');
493 $tableData[] = $rowData;
496 $table->setData($tableData);
498 if (count($tableData)) {
499 $searchTpl->setVariable(
"TXT_MARKED_ENTRIES", $this->lng->txt(
"marked_entries"));
502 $searchTpl->setVariable(
'TABLE', $table->getHtml());
503 $this->tpl->setContent($searchTpl->get());
505 if (
$_GET[
"ref"] !=
"wsp") {
506 $this->tpl->printToStdout();
static _lookupLogin($a_user_id)
lookup login
static _lookupName($a_user_id)
lookup user name
static convertUpperCamelCaseToUnderscoreCase($value)
Convert a value given in camel case conversion to underscore case conversion (e.g.
static getInstanceByGlobalUser()
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static _sortIds($a_ids, $a_table, $a_field, $a_id_name)
Function that sorts ids by a given table field using WHERE IN E.g: __sort(array(6,7),'usr_data','lastname','usr_id') => sorts by lastname.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static _lookupPref($a_usr_id, $a_keyword)