Admin: Add configuration setting "show_my_lps_page" BT#17714

Shows a link to the "my learning paths" page in the /index.php and
/user_portal.php
It also enables the main/lp/my_list.php page.
pull/3547/head
Julio Montoya 5 years ago
parent 3dc2aeac8b
commit 512e1f6346
  1. 3
      main/inc/lib/course.lib.php
  2. 10
      main/inc/lib/userportal.lib.php
  3. 4
      main/install/configuration.dist.php
  4. 11
      main/lang/english/trad4all.inc.php
  5. 1
      main/lang/french/trad4all.inc.php
  6. 15
      main/lang/spanish/trad4all.inc.php
  7. 92
      main/lp/my_list.php
  8. 26
      main/template/default/learnpath/my_list.tpl

@ -3064,11 +3064,10 @@ class CourseManager
$useUserLanguageFilterIfAvailable = true,
$showCoursesSessionWithDifferentKey = false
) {
$user_id = intval($user_id);
$user_id = (int) $user_id;
$urlId = api_get_current_access_url_id();
$course_list = [];
$codes = [];
$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
$tbl_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$tbl_user_course_category = Database::get_main_table(TABLE_USER_COURSE_CATEGORY);

@ -895,7 +895,7 @@ class IndexManager
'title' => get_lang('Compose'),
];
if (api_get_setting('allow_social_tool') == 'true') {
if (api_get_setting('allow_social_tool') === 'true') {
$total_invitations = Display::badge($total_invitations);
$items[] = [
'class' => 'invitations-social',
@ -942,6 +942,14 @@ class IndexManager
];
}
if (api_get_configuration_value('show_my_lps_page')) {
$items[] = [
'icon' => Display::return_icon('learnpath.png', get_lang('MyLps')),
'link' => api_get_path(WEB_CODE_PATH).'lp/my_list.php',
'title' => get_lang('MyLps'),
];
}
if (bbb::showGlobalConferenceLink($userInfo)) {
$bbb = new bbb('', '', true, api_get_user_id());
$url = $bbb->getListingUrl();

@ -1611,6 +1611,10 @@ $_configuration['auth_password_links'] = [
// filling the database with images
//$_configuration['ck_editor_block_image_copy_paste'] = false;
// Shows a link to the "my lps" page in the /index.php and /user_portal.php page.
// It also enables the main/lp/my_list.php page.
//$_configuration['show_my_lps_page'] = false;
// KEEP THIS AT THE END
// -------- Custom DB changes
// Add user activation by confirmation email

@ -5832,7 +5832,7 @@ $Item = "Item";
$ConfigureDashboardPlugin = "Configure Dashboard Plugin";
$EditBlocks = "Edit blocks";
$Never = "Never";
$YourAccountIsActiveYouCanLoginAndCheckYourCourses = "Dear user,
$YourAccountIsActiveYouCanLoginAndCheckYourCourses = "Dear user,
Your account has now been activated on the platform. Please login and enjoy your courses.";
$SessionFields = "Session fields";
@ -8006,11 +8006,11 @@ $SpecificDate = "Specific dispatch date";
$BaseDate = "Dispatch based on the session's start/end dates";
$AfterOrBefore = "After or before";
$Before = "Before";
$ScheduleAnnouncementDescription = "This form allows scheduling announcements to be sent automatically to the students who are taking a course in a session.
$ScheduleAnnouncementDescription = "This form allows scheduling announcements to be sent automatically to the students who are taking a course in a session.
There are two types of announcements that can be sent:
There are two types of announcements that can be sent:
Specific date: In this case a specific day is selected to make the announcement.
Specific date: In this case a specific day is selected to make the announcement.
Based on the start / end date of the session: in this case the number of days to pass before sending the announcement must be indicated. And those days can be associated to before or after the start / end date. For example: 3 days after the start date.";
$MandatorySurveyNoAnswered = "A mandatory survey is waiting your answer. To enter the course, you must first complete the survey.";
@ -8669,4 +8669,5 @@ $UserByEntityReport = "User by organization";
$LpByAuthor = "Learning path by author";
$SessionImportAssignments = "Import assignments from base course";
$RedirectToPortalHome = "Redirect to the platform home page";
?>
$MyLps = "My learning paths";
?>

@ -8601,4 +8601,5 @@ $UserByEntityReport = "Utilisateur par organisation";
$LpByAuthor = "Parcours par auteur";
$SessionImportAssignments = "Importer les travaux du cours de base";
$RedirectToPortalHome = "Rediriger vers la page d'accueil de la plateforme";
$MyLps = "Mes parcours";
?>

@ -432,13 +432,13 @@ $LatestVersionIs = "La última versión es";
$YourVersionNotUpToDate = "Su versión no está actualizada";
$Hotpotatoes = "Hotpotatoes";
$ZeroMeansNoQuestionWillBeSelectedMinusOneMeansThatAllQuestionsWillBeSelected = "-1 = Todas las preguntas serán seleccionadas. 0 = Ninguna pregunta será seleccionada.";
$EmailNotificationTemplateDescription = "Puede modificar el correo enviado a los usuarios al terminar el ejercicio. Puede usar los siguientes términos:
$EmailNotificationTemplateDescription = "Puede modificar el correo enviado a los usuarios al terminar el ejercicio. Puede usar los siguientes términos:
{{ student.username }}
{{ student.firstname }}
{{ student.firstname }}
{{ student.lastname }}
{{ student.official_code }}
{{ exercise.title }}
{{ student.official_code }}
{{ exercise.title }}
{{ exercise.start_time }}
{{ exercise.end_time }}
{{ course.title }}
@ -6157,7 +6157,7 @@ $LastConnexionDate = "Fecha de la última conexión";
$ToolVideoconference = "Videoconferencia";
$BigBlueButtonEnableTitle = "Herramienta de videoconferencia BigBlueButton";
$BigBlueButtonEnableComment = "Seleccione si desea habilitar la herramienta de videoconferencia BigBlueButton. Una vez activada, se mostrará como una herramienta en la página principal todos los curso. Los profesores podrán lanzar una videoconferencia en cualquier momento, pero los estudiantes sólo podrán unirse a una ya lanzada.
Si no dispone de un servidor BigBlueButton, pruebe a
Si no dispone de un servidor BigBlueButton, pruebe a
<a href=\"http://bigbluebutton.org/\" target=\"_blank\">configurar uno</a> o pida ayuda a los <a href=\"http://www.chamilo.org/en/providers\" target=\"_blank\">proveedores oficiales de Chamilo</a>.
BigBlueButton es libre, pero su instalación requiere ciertas habilidades técnicas que no todo el mundo posee. Puede instalarlo por su cuenta o buscar ayuda profesional con el consiguiente costo. En la lógica del software libre, nosotros le ofrecemos las herramientas para hacer más fácil su trabajo y le recomendamos profesionales (los proveedores oficiales de Chamilo) que serán capaces de ayudarle.";
$BigBlueButtonHostTitle = "Servidor BigBlueButton";
@ -6175,7 +6175,7 @@ La carpeta de los usuarios y las carpetas que contiene de cada uno de ellos, se
Si se hace visible la carpeta de los usuarios y la carpeta de uno o más alumnos, el resto de los alumnos podrán ver todo su contenido. En este caso, el alumno propietario de la carpeta también podrá desde la herramienta documentos (sólo dentro de su carpeta): crear y editar documentos web, convertir un documento web en una plantilla para uso personal, crear y editar dibujos SVG y PNG, grabar archivos de audio en formato WAV, convertir texto en audio en formato MP3, realizar capturas a través de su webcam, enviar documentos, crear carpetas, mover carpetas y archivos, borrar carpetas y archivos, y descargar copias de seguridad de su carpeta.
Por otra parte, la herramienta documentos se sincroniza con el gestor de archivos del editor web, así que los cambios en la gestión de los documentos realizados en una u otra afectarán a ambas.
Por otra parte, la herramienta documentos se sincroniza con el gestor de archivos del editor web, así que los cambios en la gestión de los documentos realizados en una u otra afectarán a ambas.
Así pues, la carpeta de usuario no sólo es un lugar para depositar los archivos, sino que se convierte en un completo gestor de los documentos que los estudiantes utilizan durante el curso. Además, recuerde que cualquier usuario podrá copiar un archivo, que sea visible, de cualquier carpeta de la herramienta documentos (sea o no la suya) a su portafolios o área personal de documentos de la red social, donde estará disponible para que lo pueda usar en otros cursos.";
$HelpFolderChat = "INFORMACIÓN SOLO VISIBLE POR EL PROFESORADO:\nEsta carpeta contiene todas las sesiones que se han realizado en el chat. Aunque muchas veces las sesiones en el chat pueden ser triviales, en otras pueden ser dignas de ser tratadas como un documento más de trabajo. Para ello, sin cambiar la visibilidad de esta carpeta, haga visible el archivo y enlácelo donde considere oportuno. No se recomienda hacer visible esta carpeta.";
@ -8697,4 +8697,5 @@ $UserByEntityReport = "Usuario por entidad";
$LpByAuthor = "Lección por autor";
$SessionImportAssignments = "Importar los tareas del curso base";
$RedirectToPortalHome = "Redirigir a la página de inicio de la plataforma";
?>
$MyLps = "Mis lecciones";
?>

@ -0,0 +1,92 @@
<?php
/* For licensing terms, see /license.txt */
use Chamilo\CourseBundle\Entity\CLp;
$cidReset = true;
require_once __DIR__.'/../inc/global.inc.php';
if (false === api_get_configuration_value('show_my_lps_page')) {
api_not_allowed(true);
}
api_block_anonymous_users();
$userId = api_get_user_id();
$courses = CourseManager::get_courses_list_by_user_id($userId, true);
$lps = [];
if (!empty($courses)) {
$courseIdList = array_column($courses, 'real_id');
$courseWithSession = [];
foreach ($courses as $course) {
if (isset($course['session_id'])) {
if (SESSION_VISIBLE === api_get_session_visibility($course['session_id'])) {
$courseWithSession[$course['real_id']] = $course['session_id'];
}
}
}
$courseCondition = " AND lp.cId IN ('".implode("', '", $courseIdList)."') ";
$order = ' ORDER BY lp.createdOn ASC, lp.name ASC';
$now = api_get_utc_datetime();
$conditions = " (
(lp.publicatedOn IS NOT NULL AND lp.publicatedOn < '$now' AND lp.expiredOn IS NOT NULL AND lp.expiredOn > '$now') OR
(lp.publicatedOn IS NOT NULL AND lp.publicatedOn < '$now' AND lp.expiredOn IS NULL) OR
(lp.publicatedOn IS NULL AND lp.expiredOn IS NOT NULL AND lp.expiredOn > '$now') OR
(lp.publicatedOn IS NULL AND lp.expiredOn IS NULL )
)
";
$dql = "SELECT lp FROM ChamiloCourseBundle:CLp as lp
WHERE
$conditions
$courseCondition
ORDER BY lp.createdOn ASC, lp.name ASC
";
$learningPaths = Database::getManager()->createQuery($dql)->getResult();
/** @var CLp $lp */
foreach ($learningPaths as $lp) {
$id = $lp->getIid();
$courseId = $lp->getCId();
$courseInfo = api_get_course_info_by_id($courseId);
$lpVisibility = learnpath::is_lp_visible_for_student($id, $userId, $courseInfo);
if (false === $lpVisibility) {
continue;
}
$sessionId = 0;
if (isset($courseWithSession[$courseId])) {
$sessionId = $courseWithSession[$courseId];
}
$lpSessionId = $lp->getSessionId();
if (!empty($lpSessionId)) {
$sessionId = $lpSessionId;
}
$params = '&cidReq='.$courseInfo['code'].'&id_session='.$sessionId;
$link = api_get_path(WEB_CODE_PATH).'lp/lp_controller.php?action=view'.$params.'&lp_id='.$id;
$icon = Display::url(
Display::return_icon(
'learnpath.png',
get_lang('Lp')
),
$link
);
$lps[] = [
'name' => $lp->getName(),
'link' => $link,
'icon' => $icon,
'creation_date' => api_get_local_time($lp->getCreatedOn()),
];
}
}
$template = new Template(get_lang('MyLps'));
$template->assign('lps', $lps);
$content = $template->fetch($template->get_template('learnpath/my_list.tpl'));
$template->assign('content', $content);
$template->display_one_col_template();

@ -0,0 +1,26 @@
<h3>
{{ 'MyLps' | get_lang }}
</h3>
<table class="table">
<tr>
<th>
{{ 'Title' | get_lang }}
</th>
<th>
{{ 'CreationDate' | get_lang }}
</th>
</tr>
{% for lp in lps %}
<tr>
<td>
{{ lp.icon }}
<a href="{{ lp.link }}" target="_blank">
{{ lp.name }}
</a>
</td>
<td>
{{ lp.creation_date }}
</td>
</tr>
{% endfor %}
</table>
Loading…
Cancel
Save