Merge remote-tracking branch 'origin/master'

pull/5502/head
Angel Fernando Quiroz Campos 7 months ago
commit f9dd081573
  1. 5
      assets/vue/views/social/SocialLayout.vue
  2. 23
      public/main/inc/lib/sessionmanager.lib.php
  3. 2
      public/main/template/default/my_space/user_details.html.twig
  4. 1
      src/CoreBundle/Controller/PlatformConfigurationController.php
  5. 88
      src/CoreBundle/Migrations/Schema/V200/Version20240509123200.php
  6. 2
      src/CoreBundle/Settings/SocialSettingsSchema.php
  7. 4
      translations/messages.de.po
  8. 4
      translations/messages.en.po
  9. 14
      translations/messages.es.po
  10. 4
      translations/messages.fr.po
  11. 2
      translations/messages.pot

@ -8,7 +8,7 @@
<component :is="currentComponent" />
</div>
<div class="flex flex-col w-full md:w-1/4 lg:w-1/6" v-if="!isSearchPage">
<MyGroupsCard />
<MyGroupsCard v-if="!hideSocialGroupBlock" />
<MyFriendsCard />
<MySkillsCard />
</div>
@ -34,7 +34,10 @@ import { useSocialInfo } from "../../composables/useSocialInfo"
import { useSocialStore } from "../../store/socialStore"
import { useI18n } from "vue-i18n"
import { useSecurityStore } from "../../store/securityStore"
import { usePlatformConfig } from "../../store/platformConfig"
const platformConfigStore = usePlatformConfig()
const hideSocialGroupBlock = "true" === platformConfigStore.getSetting("social.hide_social_groups_block")
const route = useRoute()
const { t } = useI18n()
const securityStore = useSecurityStore()

@ -2893,7 +2893,7 @@ class SessionManager
// Subscribe all the users from the session to this course inside the session
self::insertUsersInCourse(
array_column($user_list, 'id'),
array_column($user_list, 'user_id'),
$courseId,
$sessionId,
['visibility' => $sessionVisibility],
@ -9840,6 +9840,9 @@ class SessionManager
}
}
/**
* @throws \Doctrine\ORM\Exception\ORMException
*/
public static function insertUsersInCourse(
array $studentIds,
int $courseId,
@ -9856,25 +9859,17 @@ class SessionManager
foreach ($studentIds as $studentId) {
$user = api_get_user_entity($studentId);
$session->addUserInCourse($relationInfo['status'], $user, $course)
->setVisibility($relationInfo['visibility']);
if (!$session->hasUserInCourse($user, $course)) {
$session->addUserInCourse($relationInfo['status'], $user, $course)
->setVisibility($relationInfo['visibility']);
Event::logUserSubscribedInCourseSession($user, $course, $session);
}
$subscription = new SessionRelUser();
$subscription->setUser($user);
$subscription->setSession($session);
$subscription->setRelationType(Session::STUDENT);
Event::logUserSubscribedInCourseSession($user, $course, $session);
if ($updateSession && !$session->hasUser($subscription)) {
if ($updateSession) {
$session->addUserInSession(Session::STUDENT, $user);
}
}
try {
try {
$em->persist($session);
$em->flush();
} catch (\Exception $e) {

@ -19,7 +19,7 @@
<div class="flex-auto lg:flex-1/3 px-4">
{{ display.reporting_user_details(user) }}
{% if user_extra.boss_list %}
<h3 class="font-semibold mt-4">Student Boss:</h3>
<h3 class="font-semibold mt-4">{{ 'Student\'s superior'|trans }}</h3>
{% for boss in user_extra.boss_list %}
<p>{{ boss }}</p>
{% endfor %}

@ -81,6 +81,7 @@ class PlatformConfigurationController extends AbstractController
'profile.allow_social_map_fields',
'forum.global_forums_course_id',
'document.students_download_folders',
'social.hide_social_groups_block',
];
$user = $this->userHelper->getCurrent();

@ -0,0 +1,88 @@
<?php
declare(strict_types=1);
namespace Chamilo\CoreBundle\Migrations\Schema\V200;
use Chamilo\CoreBundle\Entity\ResourceLink;
use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo;
use Chamilo\CoreBundle\Repository\Node\CourseRepository;
use Chamilo\CoreBundle\Repository\ToolRepository;
use Chamilo\CourseBundle\Entity\CTool;
use Doctrine\DBAL\Schema\Schema;
final class Version20240509123200 extends AbstractMigrationChamilo
{
public function getDescription(): string
{
return 'Ensure all courses have the required tools post-migration.';
}
public function up(Schema $schema): void
{
$courseRepo = $this->container->get(CourseRepository::class);
$toolRepo = $this->container->get(ToolRepository::class);
$admin = $this->getAdmin();
// Define your tool list
$requiredTools = [
'course_description',
'document',
'learnpath',
'link',
'quiz',
'announcement',
'gradebook',
'glossary',
'attendance',
'course_progress',
'agenda',
'forum',
'dropbox',
'member',
'group',
'chat',
'student_publication',
'survey',
'wiki',
'notebook',
'course_tool',
'course_homepage',
'tracking',
'course_setting',
'course_maintenance',
];
$courses = $courseRepo->findAll();
foreach ($courses as $course) {
foreach ($requiredTools as $toolName) {
$ctool = $course->getTools()->filter(
fn(CTool $ct) => $ct->getTool()->getTitle() === $toolName
)->first() ?? null;
if (!$ctool) {
$tool = $toolRepo->findOneBy(['title' => $toolName]);
if ($tool) {
$linkVisibility = ($toolName == 'course_setting' || $toolName == 'course_maintenance')
? ResourceLink::VISIBILITY_DRAFT : ResourceLink::VISIBILITY_PUBLISHED;
$ctool = new CTool();
$ctool->setTool($tool);
$ctool->setTitle($toolName);
$ctool->setVisibility(true);
$ctool->setParent($course);
$ctool->setCreator($admin);
$ctool->addCourseLink($course, null, null, $linkVisibility);
$this->entityManager->persist($ctool);
error_log("Tool '{$toolName}' needs to be added to course ID {$course->getId()}.");
$course->addTool($ctool);
error_log("Tool '{$toolName}' created and linked to course.");
}
}
}
}
$this->entityManager->flush();
$this->entityManager->clear();
}
}

@ -23,6 +23,7 @@ class SocialSettingsSchema extends AbstractSettingsSchema
'disable_dislike_option' => 'false',
'social_show_language_flag_in_profile' => 'false',
'social_make_teachers_friend_all' => 'false',
'hide_social_groups_block' => 'false',
]
)
;
@ -44,6 +45,7 @@ class SocialSettingsSchema extends AbstractSettingsSchema
->add('disable_dislike_option', YesNoType::class)
->add('social_show_language_flag_in_profile', YesNoType::class)
->add('social_make_teachers_friend_all', YesNoType::class)
->add('hide_social_groups_block', YesNoType::class)
;
$this->updateFormFieldsFromSettingsInfo($builder);

@ -22603,8 +22603,8 @@ msgstr "Frist für die Einreichung der Arbeit (Für den Lernenden sichtbar)"
msgid "Follow up message about student %s"
msgstr "Follow-up Nachricht über Lernende %s"
msgid "Hi,<br/><br/>"
msgstr "Hallo,<br/><br/>"
msgid "Hi,<br/><br/>User %s sent a follow up message about student %s.<br/><br/>The message can be seen here %s"
msgstr "Hallo,<br/><br/>Benutzer %s hat eine Follow-up-Nachricht zum Lernenden %s gesendet.<br/><br/>Die Nachricht ist an %s sichtbar"
msgid "Include services"
msgstr "Einschließlich Dienstleistungen"

@ -22487,8 +22487,8 @@ msgstr "Posted deadline for sending the work (Visible to the learner)"
msgid "Follow up message about student %s"
msgstr "Follow up message about student %s"
msgid "Hi,<br/><br/>"
msgstr "Hi,<br/><br/>"
msgid "Hi,<br/><br/>User %s sent a follow up message about student %s.<br/><br/>The message can be seen here %s"
msgstr "Hi,<br/><br/>User %s sent a follow up message about student %s.<br/><br/>The message can be seen here %s"
msgid "Include services"
msgstr "Include services"

@ -22515,8 +22515,8 @@ msgstr "Fecha límite publicada para enviar el trabajo (visible para el alumno)"
msgid "Follow up message about student %s"
msgstr "Mensaje de seguimiento sobre alumno %s"
msgid "Hi,<br/><br/>"
msgstr "Hola,<br/><br/>"
msgid "Hi,<br/><br/>User %s sent a follow up message about student %s.<br/><br/>The message can be seen here %s"
msgstr "Hola,<br/><br/>El usuario %s ha enviado un mensaje de seguimiento sobre el alumno %s.<br/><br/>El mensaje se puede ver en %s"
msgid "Include services"
msgstr "Incluir los servicios"
@ -25276,7 +25276,6 @@ msgstr "Recordarme"
msgid "My Skills"
msgstr "Mis competencias"
#, fuzzy
msgid "Text appearing at the end of the test when the user has failed."
msgstr "Texto que aparece al final del examen cuando el usuario no ha aprobado."
@ -25287,8 +25286,7 @@ msgid "Learn more about Chamilo and its use, official references links"
msgstr "Aprenda más sobre Chamilo y su uso, enlaces a referencias oficiales"
msgid "Manage the skills of your users, through courses and badges"
msgstr ""
"Gestione las habilidades de sus usuarios, a través de cursos y distintivos"
msgstr "Gestione las habilidades de sus usuarios, a través de cursos y distintivos"
msgid "Signed in as"
msgstr "Conectado como"
@ -25308,13 +25306,11 @@ msgstr ""
"Otros usuarios no podrán verlos."
msgid "Select 'Yes' to remove the button to delete all announcements, as this can be used by mistake by teachers."
msgstr ""
"Seleccione 'Sí' para eliminar el botón de borrar todos los anuncios, ya que "
msgstr "Seleccione 'Sí' para eliminar el botón de borrar todos los anuncios, ya que "
"los formadores pueden usarlo por error."
msgid "This gives the HRM a little more power by allowing them to edit/delete agenda events in the course-session."
msgstr ""
"Esto otorga al responable RRHH un poco más de poder al permitirle editar/"
msgstr "Esto otorga al responable RRHH un poco más de poder al permitirle editar/"
"eliminar eventos de la agenda en la sesión del curso."
msgid "Default calendar display mode"

@ -23138,8 +23138,8 @@ msgstr "Date limite affichée d'envoi du travail (visible par l'apprenant)"
msgid "Follow up message about student %s"
msgstr "Message de suivi concernant l'apprenant %s"
msgid "Hi,<br/><br/>"
msgstr "Bonjour,<br/><br/>"
msgid "Hi,<br/><br/>User %s sent a follow up message about student %s.<br/><br/>The message can be seen here %s"
msgstr "Bonjour,<br/><br/>L'utilisateur %s a envoyé un message de suivi concernant l'apprenant %s.<br/><br/>Le message est visible sur %s"
msgid "Include services"
msgstr "Inclure les services"

@ -22480,7 +22480,7 @@ msgstr ""
msgid "Follow up message about student %s"
msgstr ""
msgid "Hi,<br/><br/>"
msgid "Hi,<br/><br/>User %s sent a follow up message about student %s.<br/><br/>The message can be seen here %s"
msgstr ""
msgid "Include services"

Loading…
Cancel
Save