diff --git a/documentation/changelog.html b/documentation/changelog.html
index d89950d03f..8096f4df0c 100644
--- a/documentation/changelog.html
+++ b/documentation/changelog.html
@@ -30,6 +30,7 @@
Added sessions history (optional access to previous sessions in read-only for students)
Added advanced search in sessions: you can also search by session name, session category, tutor and visibility. (DT#5541)
Added an option to configure courses as "auto-registered" (every user has it in his courses list and is automatically subscribed)
+ Added chat tool to the groups(DT#3318)
Allowed password to be recovered using username *or* e-mail
Added editable section to the registration form
Reporting: notification of user who have never been active yet
diff --git a/main/chat/chat_banner.php b/main/chat/chat_banner.php
index 8fa8c32be1..d3ddf87760 100755
--- a/main/chat/chat_banner.php
+++ b/main/chat/chat_banner.php
@@ -31,15 +31,54 @@
*/
$language_file = array ('chat');
-
include('../inc/global.inc.php');
+require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php';
+
+//$interbreadcrumb[] = array ("url" => "chat.php", "name" => get_lang("Chat"));
+//$noPHP_SELF=true;
+//$shortBanner=false;
+//Display::display_header(null,"Chat");
+
+$tool_name = get_lang('Chat');
+
+// If it is a group chat then the breadcrumbs.
+if ($_SESSION['_gid'] OR $_GET['group_id']) {
+
+ if (isset($_SESSION['_gid'])) {
+ $_clean['group_id']=(int)$_SESSION['_gid'];
+ }
+ if (isset($_GET['group_id'])) {
+ $_clean['group_id']=(int)Database::escape_string($_GET['group_id']);
+ }
+ $group_properties = GroupManager :: get_group_properties($_clean['group_id']);
+ $interbreadcrumb[] = array ("url" => "../group/group.php", "name" => get_lang('Groups'));
+ $interbreadcrumb[] = array ("url"=>"../group/group_space.php?gidReq=".$_SESSION['_gid'], "name"=> get_lang('GroupSpace').' ('.$group_properties['name'].')');
+ $noPHP_SELF=true;
+ $shortBanner=false;
+ $add_group_to_title = ' ('.$group_properties['name'].')';
+ $groupfilter='group_id="'.$_clean['group_id'].'"';
-$interbreadcrumb[] = array ("url" => "chat.php", "name" => get_lang("Chat"));
-$noPHP_SELF=true;
-$shortBanner=false;
+ //ensure this tool in groups whe it's private or deactivated
+ /*if ($group_properties['chat_state']==0)
+ {
+ echo api_not_allowed();
+ }
+ elseif ($group_properties['chat_state']==2)
+ {
+ if (!api_is_allowed_to_edit(false,true) and !GroupManager :: is_user_in_group($_user['user_id'], $_SESSION['_gid']))
+ {
+ echo api_not_allowed();
+ }
+ }*/
-Display::display_header(null,"Chat");
+}
+else
+{
+ $groupfilter='group_id=0';
+}
+Display::display_header($tool_name, 'Chat');
+//$is_allowed_to_edit = api_is_allowed_to_edit(false,true);
?>