Show course members.
443 include_once
'Modules/Course/classes/class.ilCourseParticipants.php';
445 if (
$_GET[
"search_crs"] !=
"") {
446 $_POST[
"search_crs"] = explode(
",",
$_GET[
"search_crs"]);
447 $_GET[
"search_crs"] =
"";
448 } elseif (
$_SESSION[
"search_crs"] !=
"") {
453 if (is_array(
$_POST[
'search_crs'])) {
454 $_POST[
'search_crs'] = array_filter(array_map(
'intval',
$_POST[
'search_crs']));
457 if (!is_array(
$_POST[
"search_crs"]) ||
458 count(
$_POST[
"search_crs"]) == 0) {
460 $this->showMyCourses();
462 foreach (
$_POST[
'search_crs'] as $crs_id) {
464 if ($oTmpCrs->getShowMembers() == $oTmpCrs->SHOW_MEMBERS_DISABLED) {
465 unset(
$_POST[
'search_crs']);
466 ilUtil::sendInfo($this->lng->txt(
'mail_crs_list_members_not_available_for_at_least_one_crs'));
467 return $this->showMyCourses();
472 $this->tpl->setTitle($this->lng->txt(
"mail_addressbook"));
474 $this->ctrl->setParameter($this,
"view",
"crs_members");
475 if (
$_GET[
"ref"] !=
"") {
476 $this->ctrl->setParameter($this,
"ref",
$_GET[
"ref"]);
478 if (is_array(
$_POST[
"search_crs"])) {
479 $this->ctrl->setParameter($this,
"search_crs", implode(
",",
$_POST[
"search_crs"]));
481 $this->tpl->setVariable(
"ACTION", $this->ctrl->getFormAction($this));
482 $this->ctrl->clearParameters($this);
484 $this->lng->loadLanguageModule(
'crs');
485 include_once
'Services/Contact/classes/class.ilMailSearchCoursesMembersTableGUI.php';
488 $tableData = array();
489 $searchTpl =
new ilTemplate(
'tpl.mail_search_template.html',
true,
true,
'Services/Contact');
490 foreach (
$_POST[
"search_crs"] as $crs_id) {
491 $members_obj = ilCourseParticipants::_getinstanceByObjId($crs_id);
492 $tmp_members = $members_obj->getParticipants();
493 $course_members =
ilUtil::_sortIds($tmp_members,
'usr_data',
'lastname',
'usr_id');
495 foreach ($course_members as $member) {
497 if (!$tmp_usr->getActive()) {
506 $fullname =
$name[
'lastname'] .
', ' .
$name[
'firstname'];
510 'members_id' => $member,
511 'members_login' =>
$login,
512 'members_name' => $fullname,
513 'members_crs_grp' => $this->cache->lookupTitle($crs_id),
514 'search_crs' => $crs_id
520 $rowData[
'status'] =
'';
521 if ($member != $this->
user->getId()) {
522 if ($relation->isOwnedByActor()) {
523 $rowData[
'status'] = $this->lng->txt(
'buddy_bs_state_' . $state_name .
'_a');
525 $rowData[
'status'] = $this->lng->txt(
'buddy_bs_state_' . $state_name .
'_p');
530 $tableData[] = $rowData;
533 $table->setData($tableData);
535 if (count($tableData)) {
536 $searchTpl->setVariable(
"TXT_MARKED_ENTRIES", $this->lng->txt(
"marked_entries"));
539 $searchTpl->setVariable(
'TABLE', $table->getHtml());
540 $this->tpl->setContent($searchTpl->get());
542 if (
$_GET[
"ref"] !=
"wsp") {
543 $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)