|
|
|
@ -2,26 +2,30 @@ |
|
|
|
|
|
|
|
|
|
/* For licensing terms, see /license.txt */ |
|
|
|
|
|
|
|
|
|
use Chamilo\CoreBundle\Framework\Container; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* This script gives information about a course. |
|
|
|
|
* |
|
|
|
|
* @author Bart Mollet |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
$cidReset = true; |
|
|
|
|
require_once __DIR__.'/../inc/global.inc.php'; |
|
|
|
|
$this_section = SECTION_PLATFORM_ADMIN; |
|
|
|
|
|
|
|
|
|
api_protect_admin_script(); |
|
|
|
|
|
|
|
|
|
if (!isset($_GET['code'])) { |
|
|
|
|
if (!isset($_GET['id'])) { |
|
|
|
|
api_not_allowed(true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$courseInfo = api_get_course_info($_GET['code']); |
|
|
|
|
if (empty($courseInfo)) { |
|
|
|
|
$course = api_get_course_entity($_GET['id']); |
|
|
|
|
if (null === $course) { |
|
|
|
|
api_not_allowed(true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$courseId = $course->getId(); |
|
|
|
|
$sessionId = isset($_GET['id_session']) ? (int) $_GET['id_session'] : 0; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -92,22 +96,26 @@ function get_course_usage($course, $session_id = 0) |
|
|
|
|
return $usage; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$courseUrl = api_get_course_url($courseId); |
|
|
|
|
$interbreadcrumb[] = ['url' => 'index.php', 'name' => get_lang('Administration')]; |
|
|
|
|
$interbreadcrumb[] = ['url' => 'course_list.php', 'name' => get_lang('Courses')]; |
|
|
|
|
$courseId = $courseInfo['real_id']; |
|
|
|
|
$tool_name = $courseInfo['title'].' ('.$courseInfo['visual_code'].')'; |
|
|
|
|
Display::display_header($tool_name); |
|
|
|
|
|
|
|
|
|
Display::display_header($course->getTitleAndCode()); |
|
|
|
|
|
|
|
|
|
echo Display::toolbarAction( |
|
|
|
|
'info', |
|
|
|
|
[ |
|
|
|
|
Display::url( |
|
|
|
|
Display::return_icon('home.png', get_lang('Course home'), [], ICON_SIZE_MEDIUM), |
|
|
|
|
$courseInfo['course_public_url'] |
|
|
|
|
$courseUrl |
|
|
|
|
), |
|
|
|
|
] |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
$illustrationRepo = Container::getIllustrationRepository(); |
|
|
|
|
$illustrationUrl = $illustrationRepo->getIllustrationUrl($course, 'course_picture_medium'); |
|
|
|
|
echo ' <img class="img-thumbnail" src="'.$illustrationUrl.'" />'; |
|
|
|
|
|
|
|
|
|
/*echo Display::page_header(get_lang('Course usage')); |
|
|
|
|
$table = new SortableTableFromArray( |
|
|
|
|
get_course_usage($courseInfo, $sessionId), |
|
|
|
@ -161,7 +169,7 @@ if (Database::num_rows($res) > 0) { |
|
|
|
|
$users[] = $user; |
|
|
|
|
} |
|
|
|
|
$table = new SortableTableFromArray($users, 0, 20, 'user_table'); |
|
|
|
|
$table->set_additional_parameters(['code' => $courseInfo['code']]); |
|
|
|
|
$table->set_additional_parameters(['code' => $course->getCode()]); |
|
|
|
|
$table->set_other_tables(['usage_table', 'class_table']); |
|
|
|
|
$table->set_header(0, get_lang('Code'), true); |
|
|
|
|
if ($is_western_name_order) { |
|
|
|
@ -179,7 +187,7 @@ if (Database::num_rows($res) > 0) { |
|
|
|
|
echo get_lang('No users in course'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$sessionList = SessionManager::get_session_by_course($courseInfo['real_id']); |
|
|
|
|
$sessionList = SessionManager::get_session_by_course($courseId); |
|
|
|
|
|
|
|
|
|
$url = api_get_path(WEB_CODE_PATH); |
|
|
|
|
if (!empty($sessionList)) { |
|
|
|
|