Merge branch 'master' of github.com:chamilo/chamilo-lms

pull/5013/head
Yannick Warnier 12 months ago
commit 97aa10b7b1
  1. 2
      README.md
  2. 5
      public/main/admin/access_url_add_users_to_url.php
  3. 11
      public/main/admin/access_url_edit.php
  4. 11
      public/main/admin/access_urls.php
  5. 9
      public/main/auth/my_progress.php
  6. 70
      public/main/inc/lib/formvalidator/Element/DateTimePicker.php
  7. 2
      public/main/inc/lib/sessionmanager.lib.php
  8. 4
      webpack.config.js

@ -93,7 +93,7 @@ git pull
composer update
# Database update
php bin/console doctrine:schema:update --force
php bin/console doctrine:schema:update --force --complete
# Clean Symfony cache
php bin/console cache:clear

@ -44,12 +44,9 @@ Display::page_subheader2($tool_name);
if ($_POST['form_sent']) {
$form_sent = $_POST['form_sent'];
$users = is_array($_POST['user_list']) ? $_POST['user_list'] : [];
$users = is_array($_POST['user_list']) ? array_map('intval', $_POST['user_list']) : [];
$url_list = is_array($_POST['url_list']) ? $_POST['url_list'] : [];
$first_letter_user = $_POST['first_letter_user'];
foreach ($users as $key => $value) {
$users[$key] = (int) $value;
}
if (1 == $form_sent) {
if (0 == count($users) || 0 == count($url_list)) {

@ -5,6 +5,9 @@
/**
* @author Julio Montoya <gugli100@gmail.com>
*/
use Symfony\Component\HttpFoundation\Request as HttpRequest;
$cidReset = true;
require_once __DIR__.'/../inc/global.inc.php';
$this_section = SECTION_PLATFORM_ADMIN;
@ -16,6 +19,8 @@ if (!api_get_multiple_access_url()) {
exit;
}
$httpRequest = HttpRequest::createFromGlobals();
$form = new FormValidator('add_url');
$form->addUrl('url', 'URL');
@ -32,8 +37,8 @@ $defaults['url'] = 'http://';
$form->setDefaults($defaults);
$submit_name = get_lang('Add URL');
if (isset($_GET['url_id'])) {
$url_id = (int) $_GET['url_id'];
if ($httpRequest->query->has('url_id')) {
$url_id = $httpRequest->query->getInt('url_id');
$num_url_id = UrlManager::url_id_exist($url_id);
if (1 != $num_url_id) {
header('Location: access_urls.php');
@ -55,7 +60,7 @@ if (isset($_GET['url_id'])) {
$form->addButtonCreate($submit_name);
//the first url with id = 1 will be always active
if (isset($_GET['url_id']) && 1 != $_GET['url_id']) {
if ($httpRequest->query->has('url_id') && 1 !== $httpRequest->query->getInt('url_id')) {
$form->addElement('checkbox', 'active', null, get_lang('active'));
}

@ -8,6 +8,9 @@
* @author Julio Montoya <gugli100@gmail.com>
* @author Yannick Warnier <yannick.warnier@beeznest.com>
*/
use Symfony\Component\HttpFoundation\Request as HttpRequest;
$cidReset = true;
require_once __DIR__.'/../inc/global.inc.php';
$this_section = SECTION_PLATFORM_ADMIN;
@ -20,6 +23,8 @@ if (!api_get_multiple_access_url()) {
exit;
}
$httpRequest = HttpRequest::createFromGlobals();
$interbreadcrumb[] = ['url' => 'index.php', 'name' => get_lang('Administration')];
$tool_name = get_lang('Multiple access URL / Branding');
Display :: display_header($tool_name);
@ -29,10 +34,10 @@ $current_access_url_id = api_get_current_access_url_id();
$url_list = UrlManager::get_url_data();
// Actions
if (isset($_GET['action'])) {
$url_id = empty($_GET['url_id']) ? 0 : (int) $_GET['url_id'];
if ($httpRequest->query->has('action')) {
$url_id = $httpRequest->query->getInt('url_id');
switch ($_GET['action']) {
switch ($httpRequest->query->get('action')) {
case 'delete_url':
$result = UrlManager::delete($url_id);
if ($result) {

@ -4,6 +4,9 @@
/**
* Reporting page on the user's own progress.
*/
use Symfony\Component\HttpFoundation\Request as HttpRequest;
$cidReset = true;
require_once __DIR__.'/../inc/global.inc.php';
@ -13,6 +16,8 @@ if (('true' === api_get_setting('platform.block_my_progress_page'))) {
api_not_allowed(true);
}
$httpRequest = HttpRequest::createFromGlobals();
$this_section = SECTION_TRACKING;
$nameTools = get_lang('Progress');
@ -26,8 +31,8 @@ if ($pluginCalendar) {
$user_id = api_get_user_id();
$courseUserList = CourseManager::get_courses_list_by_user_id($user_id);
$dates = $issues = '';
$sessionId = isset($_GET['sid']) ? (int) $_GET['sid'] : 0;
$courseId = isset($_GET['cid']) ? (int) $_GET['cid'] : 0;
$sessionId = $httpRequest->query->getInt('sid');
$courseId = $httpRequest->query->get('cid');
/*
if (!empty($courseUserList)) {

@ -69,26 +69,64 @@ class DateTimePicker extends HTML_QuickForm_text
*/
private function getElementJS()
{
$js = null;
$localeCode = $this->getLocaleCode();
$id = $this->getAttribute('id');
//timeFormat: 'hh:mm'
$js .= "<script>
$(function() {
var config = {
altInput: true,
altFormat: '".get_lang('F d, Y')." ".get_lang('at')." H:i',
enableTime: true,
dateFormat: 'Y-m-d H:i',
time_24hr: true,
wrap: false,
locale: {
firstDayOfWeek: 1
}
};
$('#{$id}').flatpickr(config);
$localeScript = '';
if ($localeCode !== 'en') {
$localeScript = '<script async="false" src="/build/flatpickr/l10n/' . $localeCode . '.js"></script>';
}
$js = $localeScript . "<script>
document.addEventListener('DOMContentLoaded', function () {
flatpickr('#{$id}', {
locale: '{$localeCode}',
altInput: true,
altFormat: '".get_lang('F d, Y')." ".get_lang('at')." H:i',
enableTime: true,
dateFormat: 'Y-m-d H:i',
time_24hr: true,
wrap: false
});
});
</script>";
return $js;
}
/**
* Retrieves the locale code based on user and course settings.
* Extracts the ISO language code from user or course settings and checks
* its availability in the list of supported locales. Returns 'en' if the language
* is not available.
*
* @return string Locale code (e.g., 'es', 'en', 'fr').
*/
private function getLocaleCode()
{
$locale = api_get_language_isocode();
$userInfo = api_get_user_info();
if (is_array($userInfo) && !empty($userInfo['language'])) {
$locale = $userInfo['language'];
}
$courseInfo = api_get_course_info();
if (isset($courseInfo)) {
$locale = $courseInfo['language'];
}
$localeCode = explode('_', $locale)[0];
$availableLocales = [
'ar', 'ar-dz', 'at', 'az', 'be', 'bg', 'bn', 'bs', 'cat', 'ckb', 'cs', 'cy', 'da', 'de',
'eo', 'es', 'et', 'fa', 'fi', 'fo', 'fr', 'ga', 'gr', 'he', 'hi', 'hr', 'hu', 'hy',
'id', 'is', 'it', 'ja', 'ka', 'km', 'ko', 'kz', 'lt', 'lv', 'mk', 'mn', 'ms', 'my',
'nl', 'nn', 'no', 'pa', 'pl', 'pt', 'ro', 'ru', 'si', 'sk', 'sl', 'sq', 'sr', 'sr-cyr',
'sv', 'th', 'tr', 'uk', 'uz', 'uz_latn', 'vn', 'zh', 'zh-tw'
];
if (!in_array($localeCode, $availableLocales)) {
$localeCode = 'en';
}
return $localeCode;
}
}

@ -8122,7 +8122,7 @@ class SessionManager
// Dates
$form->addDateTimePicker(
'access_start_date',
[get_lang('Access start'), get_lang('Date on which the session is made available to all')],
[get_lang('Access start date'), get_lang('Date on which the session is made available to all')],
['id' => 'access_start_date']
);

@ -98,6 +98,10 @@ Encore
pattern: /(jquery.qtip.css)$/,
to: 'libs/qtip2/dist/jquery.qtip.css'
},
{
from: './node_modules/flatpickr/dist/l10n',
to: 'flatpickr/l10n/[name].[ext]'
},
//{from: './node_modules/ckeditor4/', to: 'libs/ckeditor/[path][name].[ext]', pattern: /\.(js|css)$/, includeSubdirectories: false},
//{from: './node_modules/ckeditor4/adapters', to: 'libs/ckeditor/adapters/[path][name].[ext]'},
//{from: './node_modules/ckeditor4/lang', to: 'libs/ckeditor/lang/[path][name].[ext]'},

Loading…
Cancel
Save