See BT#7682
1.10.x
Julio Montoya 10 years ago
parent f0abad1340
commit 3263daf660
  1. 4
      main/group/group.php
  2. 8
      main/inc/lib/groupmanager.lib.php

@ -185,10 +185,12 @@ echo UserManager::getUserSubscriptionTab(4);
if (api_get_setting('allow_group_categories') == 'true') {
$defaultCategory = [
'id' => 0,
'iid' => 0,
'description' => '',
'title' => get_lang('DefaultGroupCategory')
];
$group_cats = array_merge($group_cats, [$defaultCategory]);
$group_cats = array_merge([$defaultCategory], $group_cats);
foreach ($group_cats as $index => $category) {
$categoryId = $category['id'];
$group_list = GroupManager::get_group_list($categoryId);

@ -73,12 +73,12 @@ class GroupManager
/**
* Get list of groups for current course.
* @param int $category The id of the category from which the groups are
* @param int $categoryId The id of the category from which the groups are
* requested
* @param string $course_code Default is current course
* @return array An array with all information about the groups.
*/
public static function get_group_list($category = null, $course_code = null, $status = null)
public static function get_group_list($categoryId = null, $course_code = null, $status = null)
{
$course_info = api_get_course_info($course_code);
$session_id = api_get_session_id();
@ -109,8 +109,8 @@ class GroupManager
$sql .= " WHERE 1=1 ";
if ($category != null) {
$sql .= " AND g.category_id = '".intval($category)."' ";
if (!is_null($categoryId)) {
$sql .= " AND g.category_id = '".intval($categoryId)."' ";
$session_condition = api_get_session_condition($session_id);
if (!empty($session_condition)) {
$sql .= $session_condition;

Loading…
Cancel
Save