Merge branch '1.11.x' of github.com:chamilo/chamilo-lms into 1.11.x

pull/3893/head
Yannick Warnier 4 years ago
commit 899bfcfe76
  1. 64
      diff
  2. 7
      main/admin/download_import_users.php
  3. 27
      main/inc/ajax/myspace.ajax.php
  4. 10
      main/inc/lib/course.lib.php
  5. 4
      main/inc/lib/document.lib.php
  6. 13
      main/mySpace/myStudents.php
  7. 28
      main/mySpace/session.php

64
diff

@ -0,0 +1,64 @@
diff --git a/main/admin/download_import_users.php b/main/admin/download_import_users.php
index cda0d8955268efd4fa71439c05a1c7dcb3cff473..fca6179b9001ac8c478ee2b1b3b7b9301c8e7e00 100644
--- a/main/admin/download_import_users.php
+++ b/main/admin/download_import_users.php
@@ -15,7 +15,8 @@ set_time_limit(0);
/**
* Read all the archive files previously placed in app/cache/backup/import_users/[user]/
* when users were imported through CSV (one can only see the users imported by
- * oneself)
+ * oneself).
+ *
* @return array Array of archives found in the app/cache/backup
*/
function readImportedUsersArchives(string $path = '', string $parentFile = null, int $userId = 0): array
@@ -52,11 +53,13 @@ function readImportedUsersArchives(string $path = '', string $parentFile = null,
}
krsort($data);
+
return $data;
}
/**
- * Print an HTML table of archives of imported users
+ * Print an HTML table of archives of imported users.
+ *
* @return string HTML table or empty string if no results
*/
function getImportedUsersArchivesTable(): string
diff --git a/main/inc/ajax/myspace.ajax.php b/main/inc/ajax/myspace.ajax.php
index 8edcb16aeece373355d68494c85509e36042524c..872267301441d45fdb19ae9b49a874a51063bc6a 100755
--- a/main/inc/ajax/myspace.ajax.php
+++ b/main/inc/ajax/myspace.ajax.php
@@ -203,7 +203,7 @@ switch ($action) {
break;
case 'show_conditional_to_export_pdf':
$studentId = isset($_REQUEST['student']) ? (int) $_REQUEST['student'] : 0;
- $sId = isset($_REQUEST['session_to_export']) ? (int) $_REQUEST['session_to_export']: 0;
+ $sId = isset($_REQUEST['session_to_export']) ? (int) $_REQUEST['session_to_export'] : 0;
$form = new FormValidator(
'conditional_to_export_pdf',
diff --git a/main/inc/lib/document.lib.php b/main/inc/lib/document.lib.php
index 77d105d82388759a5791e9d84800afb867290763..b3e6a664f77582fb30915c3f25b50f82ac0849e9 100644
--- a/main/inc/lib/document.lib.php
+++ b/main/inc/lib/document.lib.php
@@ -5106,7 +5106,7 @@ class DocumentManager
$foldersSortedByTitles[$folder_titles[$folder]] = [
'id' => $folder_id,
'selected' => $selected,
- 'label' => $label
+ 'label' => $label,
];
}
foreach ($folder_titles as $title) {
@@ -5135,7 +5135,7 @@ class DocumentManager
$foldersSortedByTitles[$folder_titles[$folder]] = [
'id' => $folder_id,
'selected' => $selected,
- 'label' => $label
+ 'label' => $label,
];
}
foreach ($folder_titles as $title) {

@ -15,7 +15,8 @@ set_time_limit(0);
/**
* Read all the archive files previously placed in app/cache/backup/import_users/[user]/
* when users were imported through CSV (one can only see the users imported by
* oneself)
* oneself).
*
* @return array Array of archives found in the app/cache/backup
*/
function readImportedUsersArchives(string $path = '', string $parentFile = null, int $userId = 0): array
@ -52,11 +53,13 @@ function readImportedUsersArchives(string $path = '', string $parentFile = null,
}
krsort($data);
return $data;
}
/**
* Print an HTML table of archives of imported users
* Print an HTML table of archives of imported users.
*
* @return string HTML table or empty string if no results
*/
function getImportedUsersArchivesTable(): string

@ -201,5 +201,32 @@ switch ($action) {
header('Cache-Control: no-cache');
echo json_encode($result);
break;
case 'show_conditional_to_export_pdf':
$studentId = isset($_REQUEST['student']) ? (int) $_REQUEST['student'] : 0;
$sId = isset($_REQUEST['session_to_export']) ? (int) $_REQUEST['session_to_export'] : 0;
$form = new FormValidator(
'conditional_to_export_pdf',
'post',
api_get_path(WEB_CODE_PATH).'mySpace/session.php?'
.http_build_query(
[
'student' => $studentId,
'action' => 'export_to_pdf',
'type' => 'achievement',
'session_to_export' => $sId,
]
),
'',
[],
FormValidator::LAYOUT_INLINE
);
$form->addCheckBox('hide_connection_time', null, get_lang('HideConnectionTime'));
$form->addHtml('<br><br>');
$form->addButtonSave(get_lang('Generate'), 'submitLink');
$content = $form->returnForm();
echo $content;
break;
}
exit;

@ -7170,11 +7170,11 @@ class CourseManager
* If withSession is 1, only the sessions will be taken.
* If withSession is different from 0 and 1, the whole set will be take.
*
* @param int $courseId
* @param int $withSession
* @param int $userId
* @param null $startDate
* @param null $endDate
* @param int $courseId
* @param int $withSession
* @param int $userId
* @param string|int|null $startDate
* @param string|int|null $endDate
*/
public static function getAccessCourse(
$courseId = 0,

@ -5106,7 +5106,7 @@ class DocumentManager
$foldersSortedByTitles[$folder_titles[$folder]] = [
'id' => $folder_id,
'selected' => $selected,
'label' => $label
'label' => $label,
];
}
foreach ($folder_titles as $title) {
@ -5135,7 +5135,7 @@ class DocumentManager
$foldersSortedByTitles[$folder_titles[$folder]] = [
'id' => $folder_id,
'selected' => $selected,
'label' => $label
'label' => $label,
];
}
foreach ($folder_titles as $title) {

@ -1284,15 +1284,20 @@ if (empty($details)) {
);
$sessionAction .= Display::url(
Display::return_icon('pdf.png', get_lang('CertificateOfAchievement'), [], ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH).'mySpace/session.php?'
api_get_path(WEB_AJAX_PATH).'myspace.ajax.php?'
.http_build_query(
[
'a' => 'show_conditional_to_export_pdf',
'student' => $student_id,
'action' => 'export_to_pdf',
'type' => 'achievement',
'session_to_export' => $sId,
'type' => 'achievement',
]
)
),
[
'class' => "ajax",
'data-size' => 'sm',
'data-title' => get_lang('CertificateOfAchievement'),
]
);
}
echo $sessionAction;

@ -28,6 +28,7 @@ if (!$allowToTrack) {
$studentId = isset($_GET['student']) ? (int) $_GET['student'] : 0;
$sessionId = isset($_GET['sid']) ? (int) $_GET['sid'] : 0;
$hideConnectionTime = isset($_REQUEST['hide_connection_time']) ? (int) $_REQUEST['hide_connection_time'] : 0;
$currentUrl = api_get_self().'?student='.$studentId.'&sid='.$sessionId;
switch ($action) {
@ -118,9 +119,13 @@ switch ($action) {
$courseTable .= '<table class="table table-hover table-striped data_table">';
$courseTable .= '<thead>';
$courseTable .= '<tr>
<th>'.get_lang('FormationUnit').'</th>
<th>'.get_lang('ConnectionTime').'</th>
<th>'.get_lang('Progress').'</th>';
<th>'.get_lang('FormationUnit').'</th>';
if (!$hideConnectionTime) {
$courseTable .= '<th>'.get_lang('ConnectionTime').'</th>';
}
$courseTable .= '<th>'.get_lang('Progress').'</th>';
if ('attendance' === $type) {
$courseTable .= '<th>'.get_lang('Score').'</th>';
@ -177,9 +182,11 @@ switch ($action) {
<td>
<a href="'.$courseInfoItem['course_public_url'].'?id_session='.$sessionToExport.'">'.
$courseInfoItem['title'].'</a>
</td>
<td >'.$time_spent_on_course.'</td>
<td >'.$progress.'</td>';
</td>';
if (!$hideConnectionTime) {
$courseTable .= '<td >'.$time_spent_on_course.'</td>';
}
$courseTable .= '<td >'.$progress.'</td>';
if ('attendance' === $type) {
$courseTable .= '<td >'.$score.'</td>';
}
@ -197,10 +204,11 @@ switch ($action) {
$totalTimeFormatted = api_time_to_hms($totalCourseTime);
$courseTable .= '
<tr>
<th>'.get_lang('Total').'</th>
<th>'.$totalTimeFormatted.'</th>
<th>'.$totalProgressFormatted.'</th>
';
<th>'.get_lang('Total').'</th>';
if (!$hideConnectionTime) {
$courseTable .= '<th>'.$totalTimeFormatted.'</th>';
}
$courseTable .= '<th>'.$totalProgressFormatted.'</th>';
if ('attendance' === $type) {
$courseTable .= '<th>'.$totalScoreFormatted.'</th>';
}

Loading…
Cancel
Save