From 9eab12090920bdaf2c176560167ded1610d170bc Mon Sep 17 00:00:00 2001 From: Julian Prud'homme Date: Mon, 11 Jun 2007 10:57:29 +0200 Subject: [PATCH] [svn r12575] fix a bug with the group tutor : http://projects.dokeos.com/?do=details&id=1640 --- main/group/group.php | 10 +++++++--- main/group/group_edit.php | 11 +++++++++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/main/group/group.php b/main/group/group.php index 2ca34ab440..6111a7e710 100644 --- a/main/group/group.php +++ b/main/group/group.php @@ -301,11 +301,15 @@ foreach ($group_cats as $index => $category) $row[] = ($this_group['maximum_number_of_members'] == MEMBER_PER_GROUP_NO_LIMIT ? '-' : $this_group['maximum_number_of_members']); // tutor name $tutor_info = ''; - if($this_group['id_tutor'] != 0) + + if(count($tutorsids_of_group)>0) { - $tutor = api_get_user_info($this_group['id_tutor']); - $tutor_info = Display::encrypted_mailto_link($tutor['mail'],$tutor['firstName'].' '.$tutor['lastName']); + foreach($tutorsids_of_group as $tutor_id){ + $tutor = api_get_user_info($tutor_id); + $tutor_info .= Display::encrypted_mailto_link($tutor['mail'],$tutor['firstName'].' '.$tutor['lastName']).', '; + } } + $tutor_info = substr($tutor_info,0,strlen($tutor_info)-2); $row[] = $tutor_info; // edit-links if (api_is_allowed_to_edit()) diff --git a/main/group/group_edit.php b/main/group/group_edit.php index daaaa4fa47..8e5bdde469 100644 --- a/main/group/group_edit.php +++ b/main/group/group_edit.php @@ -164,13 +164,20 @@ $form->addElement('radio', 'announcements_state', null, get_lang('Public'), TOOL $form->addElement('radio', 'announcements_state', null, get_lang('Private'), TOOL_PRIVATE); // getting all the users -$complete_user_list = CourseManager :: get_user_list_from_course_code($_course['id']); +if(isset($_SESSION['id_session'])){ + $complete_user_list = CourseManager :: get_user_list_from_course_code($_course['id'],true,$_SESSION['id_session']); + $complete_user_list2 = CourseManager :: get_coach_list_from_course_code($_course['id'],$_SESSION['id_session']); + $complete_user_list = array_merge($complete_user_list,$complete_user_list2); +} +else{ + $complete_user_list = CourseManager :: get_user_list_from_course_code($_course['id']); +} $possible_users = array (); foreach ($complete_user_list as $index => $user) { $possible_users[$user['user_id']] = $user['lastname'].' '.$user['firstname']; } - +//print_r($complete_user_list2); // Group tutors $group_tutor_list = GroupManager :: get_subscribed_tutors($current_group['id']); $selected_users = array ();