Show course members.
408 include_once
'Modules/Course/classes/class.ilCourseParticipants.php';
410 if (
$_GET[
"search_crs"] !=
"") {
411 $_POST[
"search_crs"] = explode(
",",
$_GET[
"search_crs"]);
412 $_GET[
"search_crs"] =
"";
413 } elseif (
$_SESSION[
"search_crs"] !=
"") {
418 if (is_array(
$_POST[
'search_crs'])) {
419 $_POST[
'search_crs'] = array_filter(array_map(
'intval',
$_POST[
'search_crs']));
422 if (!is_array(
$_POST[
"search_crs"]) ||
423 count(
$_POST[
"search_crs"]) == 0) {
425 $this->showMyCourses();
427 foreach (
$_POST[
'search_crs'] as $crs_id) {
429 if ($oTmpCrs->getShowMembers() == $oTmpCrs->SHOW_MEMBERS_DISABLED) {
430 unset(
$_POST[
'search_crs']);
431 ilUtil::sendInfo($this->lng->txt(
'mail_crs_list_members_not_available_for_at_least_one_crs'));
432 return $this->showMyCourses();
437 $this->tpl->setTitle($this->lng->txt(
"mail_addressbook"));
439 $this->ctrl->setParameter($this,
"view",
"crs_members");
440 if (
$_GET[
"ref"] !=
"") {
441 $this->ctrl->setParameter($this,
"ref",
$_GET[
"ref"]);
443 if (is_array(
$_POST[
"search_crs"])) {
444 $this->ctrl->setParameter($this,
"search_crs", implode(
",",
$_POST[
"search_crs"]));
446 $this->tpl->setVariable(
"ACTION", $this->ctrl->getFormAction($this));
447 $this->ctrl->clearParameters($this);
449 $this->lng->loadLanguageModule(
'crs');
450 include_once
'Services/Contact/classes/class.ilMailSearchCoursesMembersTableGUI.php';
453 $tableData = array();
454 $searchTpl =
new ilTemplate(
'tpl.mail_search_template.html',
true,
true,
'Services/Contact');
455 foreach (
$_POST[
"search_crs"] as $crs_id) {
456 $members_obj = ilCourseParticipants::_getinstanceByObjId($crs_id);
457 $tmp_members = $members_obj->getParticipants();
458 $course_members =
ilUtil::_sortIds($tmp_members,
'usr_data',
'lastname',
'usr_id');
460 foreach ($course_members as $member) {
462 if (!$tmp_usr->getActive()) {
471 $fullname =
$name[
'lastname'] .
', ' .
$name[
'firstname'];
475 'members_id' => $member,
476 'members_login' =>
$login,
477 'members_name' => $fullname,
478 'members_crs_grp' => $this->cache->lookupTitle($crs_id),
479 'search_crs' => $crs_id
485 $rowData[
'status'] =
'';
486 if ($member != $this->
user->getId()) {
487 if ($relation->isOwnedByRequest()) {
488 $rowData[
'status'] = $this->lng->txt(
'buddy_bs_state_' . $state_name .
'_a');
490 $rowData[
'status'] = $this->lng->txt(
'buddy_bs_state_' . $state_name .
'_p');
495 $tableData[] = $rowData;
498 $table->setData($tableData);
500 if (count($tableData)) {
501 $searchTpl->setVariable(
"TXT_MARKED_ENTRIES", $this->lng->txt(
"marked_entries"));
504 $searchTpl->setVariable(
'TABLE',
$table->getHtml());
505 $this->tpl->setContent($searchTpl->get());
507 if (
$_GET[
"ref"] !=
"wsp") {
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.
special template class to simplify handling of ITX/PEAR
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)
if(empty($password)) $table