diff --git a/assets/css/app.scss b/assets/css/app.scss index c5d99b6eaae..7f2b5a4152e 100644 --- a/assets/css/app.scss +++ b/assets/css/app.scss @@ -47,15 +47,6 @@ } @layer utilities { - .custom-collapse { - display: none; - } - .custom-collapse.active { - display: block; - } - .collapse { - visibility: inherit !important; - } .border-gray-300 { --tw-border-opacity: 1; border-color: rgba(156, 163, 175, var(--tw-border-opacity)); diff --git a/assets/css/scss/atoms/_progressbar.scss b/assets/css/scss/atoms/_progressbar.scss index 2648d5de08d..c185bf7f9c2 100644 --- a/assets/css/scss/atoms/_progressbar.scss +++ b/assets/css/scss/atoms/_progressbar.scss @@ -1,11 +1,31 @@ .p-progressbar { - @apply bg-gray-30 rounded-full border-none h-1.5; + @apply relative overflow-hidden; + + &-determinate { + .p-progressbar-value { + @apply h-full w-0 absolute border-none flex items-center justify-center overflow-hidden; + + &-animate { + @apply duration-1000 ease-in-out; + + transition-property: width; + } + } + + .p-progressbar-label { + @apply inline-flex; + } + } +} + +.p-progressbar { + @apply bg-gray-30 rounded-lg border-none h-6; &-value { - @apply bg-primary; + @apply border-none m-0 bg-primary; } &-label { - @apply text-white; + @apply text-white leading-normal; } } diff --git a/assets/css/scss/index.scss b/assets/css/scss/index.scss index 63987204861..390b1d9e405 100755 --- a/assets/css/scss/index.scss +++ b/assets/css/scss/index.scss @@ -40,6 +40,7 @@ @import "molecules/empty_state"; @import "molecules/teacher_bar"; @import "molecules/toolbar"; +@import "molecules/legacy_panel"; @import "organisms/cards"; @import "organisms/course_card"; diff --git a/assets/css/scss/molecules/_legacy_panel.scss b/assets/css/scss/molecules/_legacy_panel.scss new file mode 100644 index 00000000000..43d14052dab --- /dev/null +++ b/assets/css/scss/molecules/_legacy_panel.scss @@ -0,0 +1,28 @@ +.display-panel-collapse { + @apply rounded-lg border-gray-25; + + &__header { + @apply relative + before:content-[""] before:absolute before:rounded-l-lg before:bg-secondary before:w-1 before:h-full before:-left-1; + + a { + @apply cursor-pointer p-2 block bg-support-6 rounded-r-lg; + + &[aria-expanded=true] { + @apply rounded-b-none; + } + } + + ::before { + float: right; + } + } + + &__collapsible { + @apply hidden p-3 rounded-b; + + &.active { + @apply block shadow-lg; + } + } +} \ No newline at end of file diff --git a/assets/vue/components/social/UserProfileCard.vue b/assets/vue/components/social/UserProfileCard.vue index 964ff8ca36b..fcc773b7ee5 100644 --- a/assets/vue/components/social/UserProfileCard.vue +++ b/assets/vue/components/social/UserProfileCard.vue @@ -18,7 +18,7 @@ @@ -72,8 +72,8 @@ :key="item.variable" >
-
{{ item.label }}:
-
{{ item.value }}
+
{{ t(item.label) }}:
+
{{ t(item.value) }}
'; + $sessionInformation = '

'.get_lang('No course sessions for this user').'

'; } $courseToolInformationTotal = ''; diff --git a/public/main/exercise/exercise.class.php b/public/main/exercise/exercise.class.php index a166d5f2c99..46efff4b5d8 100644 --- a/public/main/exercise/exercise.class.php +++ b/public/main/exercise/exercise.class.php @@ -9784,7 +9784,7 @@ public function getLpBySession($sessionId) ]; } - public static function saveExerciseInLp($safe_item_id, $safe_exe_id) + public static function saveExerciseInLp($safe_item_id, $safe_exe_id, $course_id = null) { $lp = Session::read('oLP'); @@ -9796,7 +9796,9 @@ public static function saveExerciseInLp($safe_item_id, $safe_exe_id) } $viewId = $lp->get_view_id(); - $course_id = api_get_course_int_id(); + if (!isset($course_id)) { + $course_id = api_get_course_int_id(); + } $userId = (int) api_get_user_id(); $viewId = (int) $viewId; diff --git a/public/main/exercise/overview.php b/public/main/exercise/overview.php index cef730ffa72..4b3141f0723 100644 --- a/public/main/exercise/overview.php +++ b/public/main/exercise/overview.php @@ -19,11 +19,13 @@ // Notice for unauthorized people. api_protect_course_script(true); -$sessionId = api_get_session_id(); -$courseCode = api_get_course_id(); +$courseId = isset($_REQUEST['cid']) ? (int) $_REQUEST['cid'] : api_get_course_int_id(); +$sessionId = isset($_REQUEST['sid']) ? (int) $_REQUEST['sid'] : api_get_session_id(); +$courseInfo = api_get_course_info_by_id($courseId); +$courseCode = $courseInfo['code']; $exercise_id = isset($_REQUEST['exerciseId']) ? (int) $_REQUEST['exerciseId'] : 0; -$objExercise = new Exercise(); +$objExercise = new Exercise($courseId); $result = $objExercise->read($exercise_id, true); if (!$result) { @@ -32,7 +34,7 @@ if ('true' === api_get_plugin_setting('positioning', 'tool_enable')) { $plugin = Positioning::create(); - if ($plugin->blockFinalExercise(api_get_user_id(), $exercise_id, api_get_course_int_id(), $sessionId)) { + if ($plugin->blockFinalExercise(api_get_user_id(), $exercise_id, $courseId, $sessionId)) { api_not_allowed(true); } } @@ -203,8 +205,8 @@ $attempts = Event::getExerciseResultsByUser( api_get_user_id(), $objExercise->id, - api_get_course_int_id(), - api_get_session_id(), + $courseId, + $sessionId, $learnpath_id, $learnpath_item_id, 'desc' @@ -243,7 +245,7 @@ $attempt_result['max_score'], $objExercise, $attempt_result['exe_user_id'], - api_get_course_int_id(), + $courseId, $sessionId ); } @@ -444,8 +446,8 @@ $isLimitReached = ExerciseLib::isQuestionsLimitPerDayReached( api_get_user_id(), count($objExercise->get_validated_question_list()), - api_get_course_int_id(), - api_get_session_id() + $courseId, + $sessionId ); if (!empty($exercise_url_button) && !$isLimitReached) { diff --git a/public/main/inc/lib/api.lib.php b/public/main/inc/lib/api.lib.php index 4e78d1debf6..f8a0ae5f7cc 100644 --- a/public/main/inc/lib/api.lib.php +++ b/public/main/inc/lib/api.lib.php @@ -888,6 +888,9 @@ function api_valid_email($address) function api_protect_course_script($print_headers = false, $allow_session_admins = false, string $checkTool = '', $cid = null): bool { $course_info = api_get_course_info(); + if (empty($course_info) && isset($_REQUEST['cid'])) { + $course_info = api_get_course_info_by_id((int) $_REQUEST['cid']); + } if (isset($cid)) { $course_info = api_get_course_info_by_id($cid); @@ -2049,7 +2052,11 @@ function api_get_cidreq($addSessionId = true, $addGroupId = true, $origin = '') if ($addSessionId) { if (!empty($url)) { - $url .= 0 == api_get_session_id() ? '&sid=0' : '&sid='.api_get_session_id(); + $sessionId = api_get_session_id(); + if (0 === $sessionId && isset($_REQUEST['sid'])) { + $sessionId = (int) $_REQUEST['sid']; + } + $url .= 0 === $sessionId ? '&sid=0' : '&sid='.$sessionId; } } diff --git a/public/main/inc/lib/display.lib.php b/public/main/inc/lib/display.lib.php index 2e06181fd87..6b65b1f3b3a 100644 --- a/public/main/inc/lib/display.lib.php +++ b/public/main/inc/lib/display.lib.php @@ -2458,25 +2458,23 @@ public static function panelCollapse( }); '; $html = ' -
-
-
- - '.$title.' - -
+
+
-
'; +
'; $html .= $content; $html .= '
'; diff --git a/public/main/inc/lib/usermanager.lib.php b/public/main/inc/lib/usermanager.lib.php index 1f9aa59bb91..98689e2dd39 100644 --- a/public/main/inc/lib/usermanager.lib.php +++ b/public/main/inc/lib/usermanager.lib.php @@ -4559,11 +4559,11 @@ public static function get_user_id_of_course_admin_or_session_admin(array $cours if (1 == $num_rows) { $row = Database::fetch_array($rs); - return $row['uid']; + return (int) $row['uid']; } else { $my_num_rows = $num_rows; - return Database::result($rs, $my_num_rows - 1, 'uid'); + return (int) Database::result($rs, $my_num_rows - 1, 'uid'); } } elseif ($session > 0) { $sql = 'SELECT u.id as uid FROM '.$table_user.' u @@ -4576,7 +4576,7 @@ public static function get_user_id_of_course_admin_or_session_admin(array $cours if (Database::num_rows($rs) > 0) { $row = Database::fetch_assoc($rs); - return $row['uid']; + return (int) $row['uid']; } } diff --git a/public/main/lp/learnpath.class.php b/public/main/lp/learnpath.class.php index 62d26e24d38..5c94a4f126c 100644 --- a/public/main/lp/learnpath.class.php +++ b/public/main/lp/learnpath.class.php @@ -2017,11 +2017,10 @@ public static function get_progress_bar($percentage = -1, $text_add = '') { $text = $percentage.$text_add; - return '
-
- '.$text.' + return '
+
+
'.$text.'
'; } diff --git a/public/main/lp/lp_controller.php b/public/main/lp/lp_controller.php index e2b6c1204da..a6b3a0be7e3 100644 --- a/public/main/lp/lp_controller.php +++ b/public/main/lp/lp_controller.php @@ -27,12 +27,12 @@ $current_course_tool = TOOL_LEARNPATH; $lpItemId = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; $lpId = isset($_REQUEST['lp_id']) ? (int) $_REQUEST['lp_id'] : 0; -$course_id = api_get_course_int_id(); -$session_id = api_get_session_id(); +$courseId = isset($_REQUEST['cid']) ? (int) $_REQUEST['cid'] : api_get_course_int_id(); +$sessionId = isset($_REQUEST['sid']) ? (int) $_REQUEST['sid'] : api_get_session_id(); $lpRepo = Container::getLpRepository(); $lpItemRepo = Container::getLpItemRepository(); -$courseInfo = api_get_course_info(); -$course = api_get_course_entity(); +$courseInfo = api_get_course_info_by_id($courseId); +$course = api_get_course_entity($courseId); $userId = api_get_user_id(); $glossaryExtraTools = api_get_setting('show_glossary_in_extra_tools'); $showGlossary = in_array($glossaryExtraTools, ['true', 'lp', 'exercise_and_lp']); @@ -71,15 +71,15 @@ if (isset($oLP) && is_object($oLP)) { if (1 == $myrefresh || empty($oLP->cc) || - $oLP->cc != api_get_course_id() || - $oLP->lp_view_session_id != $session_id + $oLP->cc != $course->getCode() || + $oLP->lp_view_session_id != $sessionId ) { if ($debug) { error_log('Course has changed, discard lp object'); error_log('$oLP->lp_view_session_id: '.$oLP->lp_view_session_id); - error_log('api_get_session_id(): '.$session_id); + error_log('api_get_session_id(): '.$sessionId); error_log('$oLP->cc: '.$oLP->cc); - error_log('api_get_course_id(): '.api_get_course_id()); + error_log('api_get_course_id(): '.$course->getCode()); } if (1 === $myrefresh) { @@ -237,11 +237,8 @@ case 'send_notify_teacher': // Send notification to the teacher $studentInfo = api_get_user_info(); - $course_info = api_get_course_info(); - $sessionId = api_get_session_id(); - - $courseName = $course_info['title']; - $courseUrl = $course_info['course_public_url']; + $courseName = $courseInfo['title']; + $courseUrl = $courseInfo['course_public_url']; if (!empty($sessionId)) { $sessionInfo = api_get_session_info($sessionId); $courseName = $sessionInfo['name']; @@ -249,7 +246,7 @@ } $url = Display::url($courseName, $courseUrl, ['title' => get_lang('Go to the course')]); - $coachList = CourseManager::get_coachs_from_course($sessionId, api_get_course_int_id()); + $coachList = CourseManager::get_coachs_from_course($sessionId, $courseId); foreach ($coachList as $coach_course) { $recipientName = $coach_course['full_name']; $coachInfo = api_get_user_info($coach_course['user_id']); @@ -693,7 +690,7 @@ if (!$lp_found) { require 'lp_list.php'; } else { - $result = ScormExport::exportToPdf($lpId, api_get_course_info()); + $result = ScormExport::exportToPdf($lpId, $courseInfo); if (!$result) { require 'lp_list.php'; } @@ -1005,7 +1002,7 @@ $redirectTo = isset($_GET['redirectTo']) ? $_GET['redirectTo'] : ''; switch ($redirectTo) { case 'course_home': - $url = api_get_path(WEB_PATH).'course/'.api_get_course_int_id().'/home?'.api_get_cidreq(); + $url = api_get_path(WEB_PATH).'course/'.$courseId.'/home?'.api_get_cidreq(); break; case 'lp_list': $url = 'lp_controller.php?'.api_get_cidreq(); diff --git a/public/main/lp/lp_view.php b/public/main/lp/lp_view.php index 6c893b10a30..c1724e7d51a 100644 --- a/public/main/lp/lp_view.php +++ b/public/main/lp/lp_view.php @@ -28,9 +28,12 @@ if (empty($lp_id)) { api_not_allowed(); } -$sessionId = api_get_session_id(); -$course_code = api_get_course_id(); -$course_id = api_get_course_int_id(); + +$course_id = isset($_REQUEST['cid']) ? (int) $_REQUEST['cid'] : api_get_course_int_id(); +$sessionId = isset($_REQUEST['sid']) ? (int) $_REQUEST['sid'] : api_get_session_id(); + +$courseInfo = api_get_course_info_by_id($course_id); +$course_code = $courseInfo['code']; $user_id = api_get_user_id(); $course = api_get_course_entity($course_id); $session = api_get_session_entity($sessionId); @@ -282,7 +285,7 @@ $safe_exe_id = (int) $_REQUEST['exeId']; if (!empty($safe_id) && !empty($safe_item_id)) { - Exercise::saveExerciseInLp($safe_item_id, $safe_exe_id); + Exercise::saveExerciseInLp($safe_item_id, $safe_exe_id, $course_id); } if (EXERCISE_FEEDBACK_TYPE_END != intval($_GET['fb_type'])) { $src = 'blank.php?msg=exerciseFinished&'.api_get_cidreq(true, true, 'learnpath'); diff --git a/src/CoreBundle/Resources/views/Account/edit.html.twig b/src/CoreBundle/Resources/views/Account/edit.html.twig index 1e90198df8d..f8141ab7e38 100644 --- a/src/CoreBundle/Resources/views/Account/edit.html.twig +++ b/src/CoreBundle/Resources/views/Account/edit.html.twig @@ -41,22 +41,30 @@ }); -

{{ user.userIdentifier }}

+
+

{{ user.fullName }}

+
{# #} {# Reset password#} {# #} - - - {{ form_start(form, { 'action': path('chamilo_core_account_edit'), 'attr': { 'class': 'edit' } }) }} - {{ form_widget(form, {'attr': {'class': 'flex flex-col gap-4'}}) }} +
+
+ +
+
+ {{ form_start(form, { 'action': path('chamilo_core_account_edit'), 'attr': { 'class': 'edit' } }) }} + {{ form_widget(form, {'attr': {'class': 'flex flex-col gap-4'}}) }} -
- +
+ +
+ {{ form_end(form) }} +
- {{ form_end(form) }} + {% endautoescape %} {% endblock %} diff --git a/translations/messages.de.po b/translations/messages.de.po index 7be0d03ba74..ca3986ce11e 100644 --- a/translations/messages.de.po +++ b/translations/messages.de.po @@ -25136,3 +25136,6 @@ msgstr "hat folgende Kompetenzen erworben" msgid "Certificate Footer" msgstr "" + +msgid "No course session for this user" +msgstr "Keine Sessions für diesen Benutzer" diff --git a/translations/messages.fr.po b/translations/messages.fr.po index 290a7fad4b6..0ea08195979 100644 --- a/translations/messages.fr.po +++ b/translations/messages.fr.po @@ -29213,3 +29213,6 @@ msgstr "a obtenu les compétences suivantes " msgid "Certificate Footer" msgstr "" + +msgid "No course session for this user" +msgstr "Pas de cours de session pour cet utilisateur" diff --git a/translations/messages.pot b/translations/messages.pot index 507176b543b..6e500021e3c 100644 --- a/translations/messages.pot +++ b/translations/messages.pot @@ -27515,3 +27515,6 @@ msgstr "" msgid "Select date .." msgstr "" + +msgid "No course sessions for this user" +msgstr ""