Minor - fix PHP errors.

pull/4020/head
Julio 5 years ago
parent 77629a9cce
commit 09205ed842
  1. 7
      public/main/inc/ajax/model.ajax.php
  2. 3
      public/main/inc/lib/tracking.lib.php
  3. 4
      public/main/mySpace/session.php
  4. 8
      public/main/mySpace/works_in_session_report.php
  5. 2
      public/main/template/default/my_space/works_in_session_report.html.twig
  6. 6
      public/main/tracking/courseLog.php
  7. 16
      public/plugin/buycourses/src/buy_course_plugin.class.php

@ -1854,6 +1854,7 @@ switch ($action) {
if (!empty($sessions)) {
$pdfIcon = Display::return_icon('pdf.png', get_lang('CertificateOfAchievement'), [], ICON_SIZE_SMALL);
foreach ($sessions as $session) {
$sessionEntity = api_get_session_entity($session['id']);
if (api_drh_can_access_all_session_content()) {
$count_courses_in_session = SessionManager::get_course_list_by_session_id(
$session['id'],
@ -1876,11 +1877,7 @@ switch ($action) {
true
);
$session['display_start_date'] = '';
$session['display_end_date'] = '';
$session['coach_access_start_date'] = '';
$session['coach_access_end_date'] = '';
$dateData = SessionManager::parseSessionDates($session, true);
$dateData = SessionManager::parseSessionDates($sessionEntity, true);
$dateToString = $dateData['access'];
$detailButtons = [];

@ -6429,6 +6429,9 @@ class Tracking
Course $course,
SessionEntity $session = null
) {
// @todo
return null;
return Database::getManager()
->createQuery("
SELECT csp

@ -377,7 +377,7 @@ if (api_is_platform_admin(true, true)) {
$toolbar = Display::toolbarAction('toolbar-session', [$actionsLeft, $actionsRight]);
echo $toolbar;
echo Display::page_header(get_lang('YourCourse sessionsList'));
echo Display::page_header(get_lang('Your sessions'));
} elseif (api_is_teacher()) {
$actionsRight = Display::url(
Display::return_icon('clock.png', get_lang('Teachers time report by session'), [], ICON_SIZE_MEDIUM),
@ -387,7 +387,7 @@ if (api_is_platform_admin(true, true)) {
$toolbar = Display::toolbarAction('toolbar-session', ['', $actionsRight]);
echo $toolbar;
echo Display::page_header(get_lang('YourCourse sessionsList'));
echo Display::page_header(get_lang('Your sessions'));
} else {
$a_sessions = Tracking::get_sessions_coached_by_user($id_coach);
}

@ -80,18 +80,18 @@ if ($session) {
$usersInfo[$user->getId()][$course->getId().'_score'] = Tracking::get_avg_student_score(
$user->getId(),
$course->getCode(),
$course,
[],
$session->getId(),
$session,
false,
false,
true
);
$usersInfo[$user->getId()][$course->getId().'_progress'] = Tracking::get_avg_student_progress(
$user->getId(),
$course->getCode(),
$course,
[],
$session->getId()
$session
);
$lastPublication = Tracking::getLastStudentPublication(

@ -14,7 +14,7 @@
<th>{{ 'LatestLoginInPlatform'|get_lang }}</th>
{% for course_code in courses %}
<th title="{{ header.title }}">{{ course_code }} <br />({{ 'BestScore' | get_lang }})</th>
<th>{{ course_code }} <br />({{ 'BestScore' | get_lang }})</th>
<th>{{ 'Progress'|get_lang }}</th>
<th>{{ 'LastSentWorkDate'|get_lang }}</th>
{% endfor %}

@ -1050,11 +1050,11 @@ if ($export_csv) {
array_unshift($csvContentInSession, $csv_headers);
if ($sessionId) {
$sessionInfo = api_get_session_info($sessionId);
$sessionDates = SessionManager::parseSessionDates($sessionInfo);
$session = api_get_session_entity($sessionId);
$sessionDates = SessionManager::parseSessionDates($session);
array_unshift($csvContentInSession, [get_lang('Date'), $sessionDates['access']]);
array_unshift($csvContentInSession, [get_lang('Session name'), $sessionInfo['name']]);
array_unshift($csvContentInSession, [get_lang('Session name'), $session->getName()]);
}
Export::arrayToCsv($csvContentInSession, 'reporting_student_list');

@ -813,25 +813,13 @@ class BuyCoursesPlugin extends Plugin
return [];
}
$item = $this->getItemByProduct(
$session->getId(),
self::PRODUCT_TYPE_SESSION
);
$item = $this->getItemByProduct($session->getId(), self::PRODUCT_TYPE_SESSION);
if (empty($item)) {
return [];
}
$sessionDates = SessionManager::parseSessionDates(
[
'display_start_date' => $session->getDisplayStartDate(),
'display_end_date' => $session->getDisplayEndDate(),
'access_start_date' => $session->getAccessStartDate(),
'access_end_date' => $session->getAccessEndDate(),
'coach_access_start_date' => $session->getCoachAccessStartDate(),
'coach_access_end_date' => $session->getCoachAccessEndDate(),
]
);
$sessionDates = SessionManager::parseSessionDates($session);
$globalParameters = $this->getGlobalParameters();
$sessionInfo = [

Loading…
Cancel
Save