Skip to content
Permalink
Browse files

Send message to coach instead of going to profile see BT#12671

  • Loading branch information...
jmontoyaa committed May 5, 2017
1 parent 7aafec9 commit 3cf853ab47b68664d70aa8dee2d059c829ebcb2d
Showing with 16 additions and 11 deletions.
  1. +8 −11 main/group/group_space.php
  2. +8 −0 main/inc/lib/api.lib.php
@@ -34,7 +34,6 @@
/* Ensure all private groups // Juan Carlos Raña Trabado */
$forums_of_groups = get_forums_of_group($current_group);
if (!GroupManager::userHasAccessToBrowse($user_id, $current_group, api_get_session_id())) {
api_not_allowed(true);
}
@@ -58,10 +57,15 @@
GroupManager :: is_self_unregistration_allowed($user_id, $current_group)
) {
GroupManager::unsubscribe_users($user_id, $current_group);
Display::addFlash(Display::return_message(get_lang('StudentDeletesHimself'), 'normal'));
Display::addFlash(
Display::return_message(get_lang('StudentDeletesHimself'), 'normal')
);
}
Display::display_header($nameTools.' '.Security::remove_XSS($current_group['name']), 'Group');
Display::display_header(
$nameTools.' '.Security::remove_XSS($current_group['name']),
'Group'
);
/* Introduction section (editable by course admin) */
Display::display_introduction_section(TOOL_GROUP);
@@ -111,7 +115,6 @@
/*
* Group Tools
*/
// If the user is subscribed to the group or the user is a tutor of the group then
if (api_is_allowed_to_edit(false, true) ||
GroupManager::is_user_in_group(api_get_user_id(), $current_group)
@@ -128,7 +131,6 @@
!empty($user_is_tutor) ||
api_is_allowed_to_edit(false, true)
) {
$actions_array[] = array(
'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?forum='.$value['forum_id'].'&'.api_get_cidreq().'&origin=group',
'content' => Display::return_icon(
@@ -221,7 +223,6 @@
}
} else {
$actions_array = array();
// Link to the forum of this group
$forums_of_groups = get_forums_of_group($current_group);
@@ -302,7 +303,6 @@
* List all the tutors of the current group
*/
$tutors = GroupManager::get_subscribed_tutors($current_group);
$tutor_info = '';
if (count($tutors) == 0) {
$tutor_info = get_lang('GroupNoneMasc');
@@ -314,10 +314,7 @@
$completeName = $userInfo['complete_name'];
$photo = '<img src="'.$userInfo['avatar'].'" alt="'.$completeName.'" width="32" height="32" title="'.$completeName.'" />';
$tutor_info .= '<li>';
$tutor_info .= Display::url(
$userInfo['complete_name'],
$userInfo['profile_url']
);
$tutor_info .= $userInfo['complete_name_with_message_link'];
$tutor_info .= '</li>';
}
$tutor_info .= '</ul>';
@@ -1413,6 +1413,14 @@ function _api_format_user($user, $add_password = false, $loadAvatars = true)
$result['profile_url'] = api_get_path(WEB_CODE_PATH).'social/profile.php?u='.$user_id;
// Send message link
$sendMessage = api_get_path(WEB_AJAX_PATH).'user_manager.ajax.php?a=get_user_popup&user_id='.$user_id;
$result['complete_name_with_message_link'] = Display::url(
$result['complete_name'],
$sendMessage,
['class' => 'ajax']
);
if (isset($user['extra'])) {
$result['extra'] = $user['extra'];
}

0 comments on commit 3cf853a

Please sign in to comment.
You can’t perform that action at this time.