Fix lang vars

pull/3890/head
Julio Montoya 4 years ago
parent b5f8d6631f
commit 4127dbebfc
  1. 11
      public/main/inc/lib/course.lib.php
  2. 4
      public/main/inc/lib/usermanager.lib.php
  3. 6
      public/main/user/subscribe_user.php

@ -755,7 +755,6 @@ class CourseManager
$userCourseCategoryId = (int) $userCourseCategoryId;
$sessionId = empty($sessionId) ? api_get_session_id() : (int) $sessionId;
$status = STUDENT === $status || COURSEMANAGER === $status ? $status : STUDENT;
$courseUserTable = Database::get_main_table(TABLE_MAIN_COURSE_USER);
if (!empty($sessionId)) {
SessionManager::subscribe_users_to_session_course(
@ -802,7 +801,7 @@ class CourseManager
if ($checkTeacherPermission && !api_is_course_admin()) {
// Check in advance whether subscription is allowed or not for this course.
if (SUBSCRIBE_NOT_ALLOWED === (int) $course->getSubscribe()) {
Display::addFlash(Display::return_message(get_lang('SubscriptionNotAllowed'), 'warning'));
Display::addFlash(Display::return_message(get_lang('Subscription not allowed'), 'warning'));
return false;
}
@ -864,21 +863,21 @@ class CourseManager
Display::return_message(
sprintf(
get_lang('User %s has been registered to course %s'),
UserManager::formatUserFullName($user),
UserManager::formatUserFullName($user, true),
$course->getTitle()
)
)
);
$send = api_get_course_setting('email_alert_to_teacher_on_new_user_in_course', $course);
$send = (int) api_get_course_setting('email_alert_to_teacher_on_new_user_in_course', $course);
if (1 == $send) {
if (1 === $send) {
self::email_to_tutor(
$userId,
$courseId,
false
);
} elseif (2 == $send) {
} elseif (2 === $send) {
self::email_to_tutor(
$userId,
$courseId,

@ -6173,10 +6173,8 @@ SQL;
/**
* Return the user's full name. Optionally with the username.
*
* @param bool $includeUsername Optional. By default username is not included.
*/
public static function formatUserFullName(User $user, $includeUsername = false): string
public static function formatUserFullName(User $user, bool $includeUsername = false): string
{
$fullName = api_get_person_name($user->getFirstname(), $user->getLastname());

@ -36,7 +36,7 @@ $keyword = isset($_REQUEST['keyword']) ? Security::remove_XSS($_REQUEST['keyword
$courseInfo = api_get_course_info();
if (COURSEMANAGER == $type) {
$tool_name = get_lang('Enroll users to courseAsTeacher');
$tool_name = get_lang('Enroll teachers');
}
//extra entries in breadcrumb
@ -61,7 +61,7 @@ if (isset($_REQUEST['Registerister'])) {
if ($userInfo) {
if (COURSEMANAGER === $type) {
if (!empty($sessionId)) {
$message = $userInfo['complete_name_with_username'].' '.get_lang('has been Registeristered to your course');
$message = $userInfo['complete_name_with_username'].' '.get_lang('has been registered to your course');
SessionManager::set_coach_to_course_session(
$_REQUEST['user_id'],
$sessionId,
@ -96,7 +96,7 @@ if (isset($_POST['action'])) {
if ($userInfo) {
if (COURSEMANAGER === $type) {
if (!empty($sessionId)) {
$message = $userInfo['complete_name_with_username'].' '.get_lang('has been Registeristered to your course');
$message = $userInfo['complete_name_with_username'].' '.get_lang('has been registered to your course');
$result = SessionManager::set_coach_to_course_session(
$user_id,
$sessionId,

Loading…
Cancel
Save