|
|
|
@ -42,6 +42,11 @@ if (isset($_GET['action'])) { |
|
|
|
|
Export::export_table_csv($data); |
|
|
|
|
exit; |
|
|
|
|
break; |
|
|
|
|
case 'export_pdf': |
|
|
|
|
$overview = GroupManager::getOverview($courseId, $keyword); |
|
|
|
|
$pdf = new PDF(); |
|
|
|
|
$pdf ->content_to_pdf($overview); |
|
|
|
|
break; |
|
|
|
|
case 'export': |
|
|
|
|
$groupId = isset($_GET['id']) ? intval($_GET['id']) : null; |
|
|
|
|
$groups = GroupManager::get_group_list(); |
|
|
|
@ -101,6 +106,7 @@ echo '<div class="actions">'; |
|
|
|
|
Display::return_icon('new_group.png', get_lang('NewGroupCreate'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
|
|
|
echo '<a href="group.php?'.api_get_cidreq().'">'. |
|
|
|
|
Display::return_icon('group.png', get_lang('Groups'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
|
|
|
|
|
|
|
|
if (api_get_setting('allow_group_categories') == 'true') { |
|
|
|
|
echo '<a href="group_category.php?'.api_get_cidreq().'&action=add_category">'. |
|
|
|
|
Display::return_icon('new_folder.png', get_lang('AddCategory'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
|
|
@ -114,6 +120,9 @@ echo '<div class="actions">'; |
|
|
|
|
echo '<a href="group_overview.php?'.api_get_cidreq().'&action=export_all&type=csv">'. |
|
|
|
|
Display::return_icon('export_csv.png', get_lang('Export'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
|
|
|
|
|
|
|
|
echo '<a href="group_overview.php?'.api_get_cidreq().'&action=export_pdf">'. |
|
|
|
|
Display::return_icon('pdf.png', get_lang('ExportToPDF'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
|
|
|
|
|
|
|
|
echo '<a href="group_overview.php?'.api_get_cidreq().'&action=export&type=xls">'. |
|
|
|
|
Display::return_icon('export_excel.png', get_lang('ExportAsXLS'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
|
|
|
|
|
|
|
@ -123,51 +132,7 @@ echo '<div class="actions">'; |
|
|
|
|
$form->display(); |
|
|
|
|
echo '</div>'; |
|
|
|
|
|
|
|
|
|
$categories = GroupManager::get_categories(); |
|
|
|
|
|
|
|
|
|
foreach ($categories as $category) { |
|
|
|
|
if (api_get_setting('allow_group_categories') == 'true') { |
|
|
|
|
echo '<h2>'.$category['title'].'</h2>'; |
|
|
|
|
} |
|
|
|
|
if (!empty($keyword)) { |
|
|
|
|
$groups = GroupManager::getGroupListFilterByName($keyword, $category['id'], $courseId); |
|
|
|
|
} else { |
|
|
|
|
$groups = GroupManager::get_group_list($category['id']); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
echo '<ul>'; |
|
|
|
|
if (!empty($groups)) { |
|
|
|
|
foreach ($groups as $group) { |
|
|
|
|
echo '<li>'; |
|
|
|
|
echo Display::tag('h3', Security::remove_XSS($group['name'])); |
|
|
|
|
|
|
|
|
|
$users = GroupManager::getTutors($group['id']); |
|
|
|
|
if (!empty($users)) { |
|
|
|
|
echo '<ul>'; |
|
|
|
|
echo Display::tag('h4', get_lang('Tutors')); |
|
|
|
|
foreach ($users as $user) { |
|
|
|
|
$user_info = api_get_user_info($user['user_id']); |
|
|
|
|
//$username = api_htmlentities(sprintf(get_lang('LoginX'), $user_info['username']), ENT_QUOTES); |
|
|
|
|
echo '<li title="'.$user_info['username'].'">'.$user_info['complete_name_with_username'].'</li>'; |
|
|
|
|
} |
|
|
|
|
echo '</ul>'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$users = GroupManager::getStudents($group['id']); |
|
|
|
|
if (!empty($users)) { |
|
|
|
|
echo '<ul>'; |
|
|
|
|
echo Display::tag('h4', get_lang('Students')); |
|
|
|
|
foreach ($users as $user) { |
|
|
|
|
$user_info = api_get_user_info($user['user_id']); |
|
|
|
|
echo '<li title="'.$user_info['username'].'">'.$user_info['complete_name_with_username'].'</li>'; |
|
|
|
|
} |
|
|
|
|
echo '</ul>'; |
|
|
|
|
} |
|
|
|
|
echo '</li>'; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
echo '</ul>'; |
|
|
|
|
} |
|
|
|
|
echo GroupManager::getOverview($courseId, $keyword); |
|
|
|
|
|
|
|
|
|
if (!isset ($_GET['origin']) || $_GET['origin'] != 'learnpath') { |
|
|
|
|
Display::display_footer(); |
|
|
|
|