Skip to content

Commit

Permalink
Add group column for student boss - refs BT#9431
Browse files Browse the repository at this point in the history
  • Loading branch information
ilosada committed Mar 30, 2015
1 parent 0b77b66 commit 91c2f25
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
13 changes: 13 additions & 0 deletions main/inc/ajax/model.ajax.php
Expand Up @@ -602,6 +602,12 @@ function getWhereClause($col, $oper, $val)
$column_names[] = $extra['3'];
}
}

if (api_is_student_boss()) {
$columns[] = 'group';
$column_names[] = get_lang('Group');
}

if (!in_array($sidx, array('title'))) {
$sidx = 'title';
}
Expand All @@ -621,6 +627,13 @@ function getWhereClause($col, $oper, $val)
null,
$sessionIdList
);
if (api_is_student_boss()) {
foreach ($result as &$item) {
$userGroups = GroupPortalManager::get_groups_by_user($item['user_id']);
$item['group'] = implode(", ", array_column($userGroups, 'name'));
unset($item['user_id']);
}
}

break;
case 'get_user_skill_ranking':
Expand Down
1 change: 1 addition & 0 deletions main/inc/lib/course.lib.php
Expand Up @@ -1556,6 +1556,7 @@ public static function get_user_list_from_course_code(
$user_data = UserManager::get_extra_user_data_by_field($user['user_id'], $extra['1']);
$report_info[$extra['1']] = $user_data[$extra['1']];
}
$report_info['user_id'] = $user['user_id'];
$users[] = $report_info;
}
} else {
Expand Down
5 changes: 5 additions & 0 deletions main/mySpace/company_reports.php
Expand Up @@ -64,6 +64,11 @@
}
}

if (api_is_student_boss()) {
$column_model[] = array('name'=>'group', 'index'=>'group', 'width'=>'50', 'align'=>'left','sortable'=>'false');
$columns[] = get_lang('Group');
}

// Autowidth
$extra_params['autowidth'] = 'true';
// height auto
Expand Down

0 comments on commit 91c2f25

Please sign in to comment.