Merge remote-tracking branch 'origin/master'

pull/5413/head
Angel Fernando Quiroz Campos 7 months ago
commit 23f5ab93af
  1. 26
      assets/css/app.scss
  2. 24
      assets/js/translatehtml.js
  3. 14
      public/main/announcements/announcements.php
  4. 4
      public/main/exercise/exercise_report.php
  5. 2
      public/main/exercise/exercise_show.php
  6. 15
      public/main/forum/forumfunction.inc.php
  7. 6
      public/main/gradebook/lib/be/category.class.php
  8. 8
      public/main/gradebook/lib/fe/displaygradebook.php
  9. 58
      public/main/gradebook/lib/fe/gradebooktable.class.php
  10. 13
      public/main/inc/ajax/model.ajax.php
  11. 125
      public/main/inc/lib/AnnouncementManager.php
  12. 2
      public/main/inc/lib/extra_field.lib.php
  13. 66
      public/main/inc/lib/formvalidator/Element/DatePicker.php
  14. 17
      public/main/inc/lib/formvalidator/Element/DateTimePicker.php
  15. 2
      public/main/inc/lib/pear/HTML/QuickForm/advmultiselect.php
  16. 4
      public/main/inc/lib/sessionmanager.lib.php
  17. 8
      public/main/inc/lib/webservices/Rest.php

@ -599,6 +599,32 @@ form .field {
textarea {
width: 100%;
}
.freeze {
display: block;
padding-top: 10px;
}
.freeze + label,
.html-editor-container + label,
.advmultiselect + label {
font-size: 13px;
@apply absolute top-0 left-0 text-support-3 text-caption px-1 bg-white text-primary;
}
}
.flatpickr-calendar .flatpickr-validate-btn {
margin-top: 10px;
width: 100%;
padding: 5px;
background-color: #569ff7;
border: none;
cursor: pointer;
color: #ffffff;
}
.mce-translatehtml, span[lang] {
display: none;
}
//@import 'primevue-md-light-indigo/theme.css';

@ -2,6 +2,10 @@
import { usePlatformConfig } from "../vue/store/platformConfig";
function normalizeLocale(locale) {
return locale.split('_')[0];
}
export default function translateHtml() {
const platformConfigStore = usePlatformConfig();
@ -10,15 +14,13 @@ export default function translateHtml() {
window.user.locale &&
"true" === platformConfigStore.getSetting("editor.translate_html")
) {
var isoCode = window.user.locale;
var isoCode = normalizeLocale(window.user.locale);
const translateElement = document.querySelector(".mce-translatehtml");
if (translateElement) {
document.querySelectorAll(".mce-translatehtml").forEach(function (el) {
el.style.display = "none";
});
const selectedLang = document.querySelectorAll(
'[lang="' + isoCode + '"]'
);
const selectedLang = document.querySelectorAll(`[lang="${isoCode}"]`);
if (selectedLang.length > 0) {
selectedLang.forEach(function (userLang) {
userLang.classList.remove("hidden");
@ -37,19 +39,7 @@ export default function translateHtml() {
el.style.display = "none";
});
// To show only the content by user language.
if (isoCode == "pl_PL") {
isoCode = "pl";
}
if (isoCode == "fr_FR") {
isoCode = "fr";
}
if (isoCode == "en_US") {
isoCode = "en";
}
const selectedLang = document.querySelectorAll(
'span[lang="' + isoCode + '"]'
);
const selectedLang = document.querySelectorAll(`span[lang="${isoCode}"]`);
if (selectedLang.length > 0) {
selectedLang.forEach(function (userLang) {
userLang.classList.remove("hidden");

@ -199,28 +199,28 @@ switch ($action) {
[
'name' => 'title',
'index' => 'title',
'width' => '300',
'width' => '400px',
'align' => 'left',
'sortable' => 'false',
],
[
'name' => 'username',
'index' => 'username',
'width' => '100',
'width' => '350px',
'align' => 'left',
'sortable' => 'false',
],
[
'name' => 'lastedit_date',
'index' => 'lastedit_date',
'width' => '200',
'width' => '350px',
'align' => 'left',
'sortable' => 'false',
],
[
'name' => 'actions',
'index' => 'actions',
'width' => '150',
'width' => '150px',
'align' => 'left',
'sortable' => 'false',
],
@ -262,11 +262,7 @@ switch ($action) {
});
</script>';
$count = AnnouncementManager::getAnnouncements(
$token,
$announcement_number,
true
);
$count = AnnouncementManager::getNumberAnnouncements();
if (empty($count)) {
$html = '';

@ -59,7 +59,7 @@ $TBL_TRACK_ATTEMPT = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
$TBL_LP_ITEM_VIEW = Database::get_course_table(TABLE_LP_ITEM_VIEW);
$allowCoachFeedbackExercises = 'true' === api_get_setting('allow_coach_feedback_exercises');
$course_id = api_get_course_int_id();
$exercise_id = isset($_REQUEST['exerciseId']) ? (int) $_REQUEST['exerciseId'] : 0;
$exercise_id = isset($_REQUEST['exerciseId']) ? (int) $_REQUEST['exerciseId'] : (isset($_GET['id']) ? (int) $_GET['id'] : 0);
$locked = api_resource_is_locked_by_gradebook($exercise_id, LINK_EXERCISE);
$sessionId = api_get_session_id();
@ -408,7 +408,7 @@ if (isset($_REQUEST['comments']) &&
$sql = "UPDATE $TBL_LP_ITEM_VIEW
SET score = '".(float) $tot."'
$statusCondition
WHERE c_id = $course_id AND iid = $lp_item_view_id";
WHERE iid = $lp_item_view_id";
Database::query($sql);
header('Location: '.api_get_path(WEB_CODE_PATH).'exercise/exercise_show.php?id='.$id.'&student='.$student_id.'&'.api_get_cidreq());

@ -865,7 +865,7 @@ foreach ($questionList as $questionId) {
} // end of large foreach on questions
// Display the text when finished message if we are on a LP #4227
$end_of_message = $objExercise->getFinishText();
$end_of_message = $objExercise->getFinishText($totalScore, $totalWeighting);
if (!empty($end_of_message) && ('learnpath' === $origin)) {
echo Display::return_message($end_of_message, 'normal', false);
echo "<div class='clear'>&nbsp;</div>";

@ -4282,7 +4282,7 @@ function set_notification($content, $id, $addOnly = false, $userInfo = [], $cour
* about a new post in a certain forum or thread.
*
* @param string $content does the user want to be notified about a forum or about a thread
* @param int $id the id of the forum or thread
* @param int $id the id of the forum or thread
*
* @return array returns
*
@ -4293,7 +4293,7 @@ function set_notification($content, $id, $addOnly = false, $userInfo = [], $cour
*
* @since May 2008, dokeos 1.8.5
*/
function get_notifications($content, $id)
function get_notifications(string $content, int $id): array
{
// Database table definition
$table_users = Database::get_main_table(TABLE_MAIN_USER);
@ -4306,14 +4306,21 @@ function get_notifications($content, $id)
$field = 'forum_id';
}
$id = (int) $id;
$sessionId = api_get_session_id();
$conditionSession = "";
if (!empty($sessionId)) {
$users = SessionManager::getUsersByCourseSession($sessionId, api_get_course_info());
if (!empty($users)) {
$conditionSession = " AND user.id IN(".implode(',', $users).")";
}
}
$sql = "SELECT user.id as user_id, user.firstname, user.lastname, user.email, user.id user
FROM $table_users user, $table_notification notification
WHERE
notification.c_id = $course_id AND user.active = 1 AND
user.id = notification.user_id AND
notification.$field = $id ";
notification.$field = $id $conditionSession";
$result = Database::query($sql);
$return = [];

@ -463,6 +463,10 @@ class Category implements GradebookItem
$bond = ' AND';
}
if (!isset($session_id)) {
$session_id = api_get_session_id();
}
if (empty($session_id)) {
$sql .= $bond.' (session_id IS NULL OR session_id = 0) ';
} else {
@ -1466,7 +1470,7 @@ class Category implements GradebookItem
{
$tbl_main_courses = Database::get_main_table(TABLE_MAIN_COURSE);
$tbl_main_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$sql = 'SELECT DISTINCT(code), title, id
$sql = 'SELECT DISTINCT(code), title, cc.id
FROM '.$tbl_main_courses.' cc, '.$tbl_main_course_user.' cu
WHERE cc.id = cu.c_id AND cu.status = '.COURSEMANAGER;
if (!api_is_platform_admin()) {

@ -383,7 +383,7 @@ class DisplayGradebook
Display::getMdiIcon('table-plus', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add classroom activity')).'</a>';
$cats = Category::load($selectcat);
if (!empty($cats[0]->getCourseId()) && empty($messageResource)) {
if (isset($cats[0]) && !empty($cats[0]->getCourseId()) && empty($messageResource)) {
$actionsLeft .= '<a href="gradebook_add_link.php?'.$my_api_cidreq.'&selectcat='.$catobj->get_id().'">'.
Display::getMdiIcon('link-plus', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add online activity')).'</a>';
} else {
@ -426,7 +426,7 @@ class DisplayGradebook
// Right icons
if ($accessToEdit) {
$actionsRight = '<a href="gradebook_edit_cat.php?editcat='.$catobj->get_id(
).'&cid='.$catobj->getCourseId().'&id_session='.$catobj->get_session_id().'">'.
).'&cid='.$catobj->getCourseId().'&sid='.$catobj->get_session_id().'">'.
Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Edit')).'</a>';
if ('true' == api_get_plugin_setting('customcertificate', 'enable_plugin_customcertificate') &&
@ -504,7 +504,7 @@ class DisplayGradebook
}
$min_certification = get_lang('Minimum certification score').' : '.$min_certification;
$edit_icon = '<a href="gradebook_edit_cat.php?editcat='.$catobj->get_id().'&cid='.$catobj->getCourseId().'&id_session='.$catobj->get_session_id().'">'.
$edit_icon = '<a href="gradebook_edit_cat.php?editcat='.$catobj->get_id().'&cid='.$catobj->getCourseId().'&sid='.$catobj->get_session_id().'">'.
Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Edit')).'</a>';
$msg = $weight.' - '.$min_certification.$edit_icon;
@ -587,7 +587,7 @@ class DisplayGradebook
$allevals = $catcourse[0]->get_evaluations(
$userId,
true,
api_get_course_id()
api_get_course_int_id()
);
$alllinks = $catcourse[0]->get_links(
$userId,

@ -947,37 +947,39 @@ class GradebookTable extends SortableTable
) {
$id_cat = (int) $_GET['selectcat'];
$category = Category::load($id_cat);
$weight_category = (int) $this->build_weight($category[0]);
$course_code = $this->build_course_code($category[0]);
$localCourseInfo = api_get_course_info($course_code);
$localCourseId = $localCourseInfo['real_id'];
$weight_total_links = round($weight_total_links);
if ($weight_total_links > $weight_category ||
$weight_total_links < $weight_category ||
$weight_total_links > $weight_category
) {
$warning_message = sprintf(get_lang('The sum of all weights of activities must be %s'), $weight_category);
$modify_icons =
'<a href="gradebook_edit_cat.php?editcat='.$id_cat.'&cid='.$localCourseId.'&sid='.api_get_session_id().'">'.
Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit'), ['alt' => $warning_message]);
$warning_message .= $modify_icons;
echo Display::return_message($warning_message, 'warning', false);
}
if (isset($category[0])) {
$weight_category = (int) $this->build_weight($category[0]);
$course_code = $this->build_course_code($category[0]);
$localCourseInfo = api_get_course_info($course_code);
$localCourseId = $localCourseInfo['real_id'];
$weight_total_links = round($weight_total_links);
if ($weight_total_links > $weight_category ||
$weight_total_links < $weight_category ||
$weight_total_links > $weight_category
) {
$warning_message = sprintf(get_lang('The sum of all weights of activities must be %s'), $weight_category);
$modify_icons =
'<a href="gradebook_edit_cat.php?editcat='.$id_cat.'&cid='.$localCourseId.'&sid='.api_get_session_id().'">'.
Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit'), ['alt' => $warning_message]);
$warning_message .= $modify_icons;
echo Display::return_message($warning_message, 'warning', false);
}
$content_html = DocumentManager::replace_user_info_into_html(
api_get_user_id(),
$localCourseInfo,
api_get_session_id()
);
$content_html = DocumentManager::replace_user_info_into_html(
api_get_user_id(),
$localCourseInfo,
api_get_session_id()
);
if (!empty($content_html)) {
$new_content = explode('</head>', $content_html['content']);
}
if (!empty($content_html)) {
$new_content = explode('</head>', $content_html['content']);
}
if (empty($new_content[0])) {
// Set default certificate
DocumentManager::generateDefaultCertificate($localCourseInfo);
if (empty($new_content[0])) {
// Set default certificate
DocumentManager::generateDefaultCertificate($localCourseInfo);
}
}
}

@ -16,6 +16,8 @@ require_once __DIR__.'/../global.inc.php';
$action = $_GET['a'];
$page = (int) $_REQUEST['page']; //page
$limit = (int) $_REQUEST['rows']; //quantity of rows
$cid = isset($_REQUEST['cid']) ? (int) $_REQUEST['cid'] : null;
$sid = isset($_REQUEST['sid']) ? (int) $_REQUEST['sid'] : null;
// Makes max row persistence after refreshing the grid
$savedRows = Session::read('max_rows_'.$action);
@ -551,7 +553,7 @@ switch ($action) {
$count = $skill->getUserListSkillRankingCount();
break;
case 'get_course_announcements':
$count = AnnouncementManager::getNumberAnnouncements();
$count = AnnouncementManager::getNumberAnnouncements($cid, $sid);
break;
case 'get_work_teacher':
$count = getWorkListTeacher(0, $limit, null, null, $whereCondition, true);
@ -1371,13 +1373,8 @@ switch ($action) {
$result = AnnouncementManager::getAnnouncements(
null,
null,
false,
$start,
$limit,
$sidx,
$sord,
$titleToSearch,
$userIdToSearch
$cid,
$sid
);
break;

@ -1336,51 +1336,35 @@ class AnnouncementManager
/**
* @param $stok
* @param $announcement_number
* @param bool $getCount
* @param null $start
* @param null $limit
* @param string $sidx
* @param string $sord
* @param string $titleToSearch
* @param int $userIdToSearch
* @param int $userId
* @param int $courseId
* @param int $sessionId
* @param int $courseId
* @param int $sessionId
*
* @return array
*/
public static function getAnnouncements(
$stok,
$announcement_number,
$getCount = false,
$start = null,
$limit = null,
$sidx = '',
$sord = '',
$titleToSearch = '',
$userIdToSearch = 0,
$userId = 0,
$courseId = 0,
$sessionId = 0
) {
$group_id = api_get_group_id();
$session_id = $sessionId ?: api_get_session_id();
if (empty($courseId)) {
$courseInfo = api_get_course_info();
$courseId = $courseInfo['real_id'];
} else {
$courseId = (int) $courseId;
$courseInfo = api_get_course_info_by_id($courseId);
}
?int $courseId = null,
?int $sessionId = null
): array {
$groupId = api_get_group_id();
if (empty($courseInfo)) {
return [];
if (null === $courseId) {
$courseId = api_get_course_int_id();
}
if (null === $sessionId) {
$sessionId = api_get_session_id();
}
$repo = Container::getAnnouncementRepository();
$course = api_get_course_entity($courseId);
$session = api_get_session_entity($session_id);
$group = api_get_group_entity(api_get_group_id());
if (null === $course) {
return [];
}
$session = api_get_session_entity($sessionId);
$group = api_get_group_entity($groupId);
if (api_is_allowed_to_edit(false, true)) {
$qb = $repo->getResourcesByCourse($course, $session, $group, null, true, true);
@ -1398,7 +1382,8 @@ class AnnouncementManager
$bottomAnnouncement = $announcement_number;
$displayed = [];
$actionUrl = api_get_path(WEB_CODE_PATH).'announcements/announcements.php?'.api_get_cidreq();
$cidReq = 'cid='.$courseId.'&sid='.$sessionId.'&gid='.$groupId;
$actionUrl = api_get_path(WEB_CODE_PATH).'announcements/announcements.php?'.$cidReq;
$emailIcon = Display::getMdiIcon(StateIcon::MAIL_NOTIFICATION, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Announcement sent by e-mail'));
$attachmentIcon = Display::getMdiIcon(ObjectIcon::ATTACHMENT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Attachment'));
@ -1478,16 +1463,6 @@ class AnnouncementManager
get_lang('Down')
);
/*$isTutor = false;
if (!empty($group_id)) {
$groupInfo = GroupManager::get_group_properties(api_get_group_id());
//User has access in the group?
$isTutor = GroupManager::is_tutor_of_group(
api_get_user_id(),
$groupInfo
);
}*/
$results = [];
/** @var CAnnouncement $announcement */
foreach ($announcements as $announcement) {
@ -1503,7 +1478,7 @@ class AnnouncementManager
$disableEdit = false;
$to = [];
$separated = AbstractResource::separateUsersGroups($to);
if (!empty($group_id)) {
if (!empty($groupId)) {
// If the announcement was sent to many groups, disable edition inside a group
if (isset($separated['groups']) && count($separated['groups']) > 1) {
$disableEdit = true;
@ -1515,7 +1490,7 @@ class AnnouncementManager
}
// Announcement sent to only a user
if ($separated['groups'] > 1 && !in_array($group_id, $separated['groups'])) {
if ($separated['groups'] > 1 && !in_array($groupId, $separated['groups'])) {
$disableEdit = true;
}
} else {
@ -1525,12 +1500,6 @@ class AnnouncementManager
}
$title = $announcement->getTitle().$groupReference.$sent_to_icon;
/*$item_visibility = api_get_item_visibility(
$courseInfo,
TOOL_ANNOUNCEMENT,
$row['id'],
$session_id
);*/
$visibility = $announcement->isVisible($course, $session);
// show attachment list
@ -1554,14 +1523,6 @@ class AnnouncementManager
$actionUrl.'&action=view&id='.$announcementId
);
// we can edit if : we are the teacher OR the element belongs to
// the session we are coaching OR the option to allow users to edit is on
/*if api_is_allowed_to_edit(false, true) ||
(api_is_session_general_coach() && api_is_element_in_the_session(TOOL_ANNOUNCEMENT, $announcementId)) ||
(api_get_course_setting('allow_user_edit_announcement') && !api_is_anonymous()) ||
($isTutor)
//$row['to_group_id'] == $group_id &&
) {*/
if ($repo->isGranted(ResourceNodeVoter::EDIT, $announcement)) {
if (true === $disableEdit) {
$modify_icons = $editIconDisable;
@ -1644,45 +1605,23 @@ class AnnouncementManager
/**
* @return int
*/
public static function getNumberAnnouncements()
public static function getNumberAnnouncements(?int $courseId = null, ?int $sessionId = null): int
{
$session_id = api_get_session_id();
$courseInfo = api_get_course_info();
$courseId = $courseInfo['real_id'];
$userId = api_get_user_id();
if (null === $courseId) {
$courseId = api_get_course_int_id();
}
if (null === $sessionId) {
$sessionId = api_get_session_id();
}
$userId = api_get_user_id();
$repo = Container::getAnnouncementRepository();
$course = api_get_course_entity($courseId);
$session = api_get_session_entity($session_id);
$session = api_get_session_entity($sessionId);
$group = api_get_group_entity(api_get_group_id());
if (api_is_allowed_to_edit(false, true)) {
// check teacher status
if (empty($_GET['origin']) || 'learnpath' !== $_GET['origin']) {
/*if (0 == api_get_group_id()) {
$group_condition = '';
} else {
$group_condition = " AND (ip.to_group_id='".api_get_group_id()."' OR ip.to_group_id = 0 OR ip.to_group_id IS NULL)";
}
$sql = "SELECT
announcement.*,
ip.visibility,
ip.to_group_id,
ip.insert_user_id
FROM $tbl_announcement announcement
INNER JOIN $tbl_item_property ip
ON (announcement.c_id = ip.c_id AND announcement.id = ip.ref)
WHERE
announcement.c_id = $courseId AND
ip.c_id = $courseId AND
ip.tool = 'announcement' AND
ip.visibility <> '2'
$group_condition
$condition_session
GROUP BY ip.ref
ORDER BY display_order DESC
LIMIT 0, $maximum";*/
$qb = $repo->getResourcesByCourse($course, $session, $group);
$qb->select('count(resource)');
@ -1700,5 +1639,7 @@ class AnnouncementManager
return $qb->getQuery()->getSingleScalarResult();
}
return 0;
}
}

@ -3176,7 +3176,7 @@ JAVASCRIPT;
}
break;
case self::FIELD_TYPE_SELECT_MULTIPLE:
$displayedValue = $valueData['value'];
$displayedValue = $valueData['field_value'];
break;
default:
$displayedValue = $valueData['field_value'];

@ -92,32 +92,70 @@ class DatePicker extends HTML_QuickForm_text
*
* @return string
*/
private function getElementJS()
private function getElementJS(): string
{
$js = null;
$localeCode = $this->getLocaleCode();
$id = $this->getAttribute('id');
//timeFormat: 'hh:mm'
$js .= "<script>
$(function() {
var config = {
$localeScript = '';
if ($localeCode !== 'en') {
$localeScript = '<script async="false" src="/build/flatpickr/l10n/' . $localeCode . '.js"></script>';
}
return $localeScript . "<script>
document.addEventListener('DOMContentLoaded', function () {
const fp = flatpickr('#{$id}', {
locale: '{$localeCode}',
altInput: true,
altFormat: '".get_lang('F d, Y')."',
enableTime: false,
dateFormat: 'Y-m-d',
wrap: true,
locale: {
firstDayOfWeek: 1
}
};
$('#{$id}').flatpickr(config);
time_24hr: true,
wrap: false
});
if ($('label[for=\"".$id."\"]').length > 0) {
$('label[for=\"".$id."\"]').hide();
}
document.querySelector('label[for=\"' + '{$id}' + '\"]').classList.add('datepicker-label');
});
});
</script>";
}
/**
* 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(): string
{
$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 $js;
return $localeCode;
}
}

@ -79,14 +79,25 @@ class DateTimePicker extends HTML_QuickForm_text
$js = $localeScript . "<script>
document.addEventListener('DOMContentLoaded', function () {
flatpickr('#{$id}', {
const fp = 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
wrap: false,
onReady: function(selectedDates, dateStr, instance) {
const validateButton = document.createElement('button');
validateButton.textContent = '".get_lang('Validate')."';
validateButton.className = 'flatpickr-validate-btn';
validateButton.type = 'button';
validateButton.onclick = function() {
instance.close();
};
instance.calendarContainer.appendChild(validateButton);
}
});
document.querySelector('label[for=\"' + '{$id}' + '\"]').classList.add('datepicker-label');
@ -104,7 +115,7 @@ class DateTimePicker extends HTML_QuickForm_text
*
* @return string Locale code (e.g., 'es', 'en', 'fr').
*/
private function getLocaleCode()
private function getLocaleCode(): string
{
$locale = api_get_language_isocode();
$userInfo = api_get_user_info();

@ -473,7 +473,7 @@ class HTML_QuickForm_advmultiselect extends HTML_QuickForm_select
} else {
$this->_elementTemplate = '
{javascript}
<div class="grid grid-cols-3">
<div class="grid grid-cols-3 advmultiselect">
<div><!-- BEGIN label_2 -->{label_2}<!-- END label_2 --> {unselected}</div>
<div><div class="text-center">{add}{remove}</div></div>
<div><!-- BEGIN label_3 -->{label_3}<!-- END label_3 -->{selected}</div>

@ -2766,7 +2766,7 @@ class SessionManager
$sessionName = $session->getTitle();
$cat->set_name($courseInfo['code'].' - '.get_lang('Session').' '.$sessionName);
$cat->set_session_id($sessionId);
$cat->set_course_code($courseInfo['code']);
$cat->setCourseId($courseId);
$cat->set_description(null);
//$cat->set_user_id($stud_id);
$cat->set_parent_id(0);
@ -2820,7 +2820,7 @@ class SessionManager
$evaluationList = $cat->get_evaluations(
null,
false,
$courseInfo['code'],
$courseId,
0
);

@ -464,14 +464,6 @@ class Rest extends WebService
$announcements = AnnouncementManager::getAnnouncements(
null,
null,
false,
null,
null,
null,
null,
null,
0,
$this->user->getId(),
$this->course->getId(),
$sessionId
);

Loading…
Cancel
Save