Merge remote-tracking branch 'origin/master'

pull/5437/head
Angel Fernando Quiroz Campos 2 years ago
commit cf1b711427
  1. 1
      composer.json
  2. 1
      config/bundles.php
  3. 3
      config/routes.yaml
  4. 14
      public/main/course_copy/recycle_course.php
  5. 30
      public/main/course_info/delete_course.php
  6. 6
      public/main/exercise/question_pool.php
  7. 6
      public/main/inc/lib/api.lib.php
  8. 91
      public/main/inc/lib/course_request.lib.php
  9. 6
      public/main/inc/lib/diagnoser.lib.php
  10. 35
      public/main/inc/lib/internationalization.lib.php
  11. 20
      public/main/inc/lib/sessionmanager.lib.php
  12. 6
      public/main/inc/lib/statistics.lib.php
  13. 10
      public/main/search/load_search.php
  14. 4
      public/main/tracking/lp_report.php
  15. 2
      public/plugin/buycourses/src/course_catalog.php
  16. 17
      src/CoreBundle/Form/ContactType.php
  17. 10
      src/CoreBundle/Resources/views/Contact/index.html.twig
  18. 6
      src/CoreBundle/Resources/views/Mailer/Legacy/exercise_result_alert_body.html.twig
  19. 7
      src/CoreBundle/Security/Authorization/Voter/ResourceNodeVoter.php
  20. 14
      translations/messages.en.po
  21. 12
      translations/messages.pot

@ -82,6 +82,7 @@
"friendsofsymfony/jsrouting-bundle": "*",
"graphp/algorithms": "~0.8",
"graphp/graphviz": "~0.2",
"gregwar/captcha-bundle": "^2.2",
"jbroadway/urlify": "~1.1",
"jeroendesloovere/vcard": "~1.7",
"jimmiw/php-time-ago": "~3.2",

@ -36,4 +36,5 @@ return [
Hautelook\AliceBundle\HautelookAliceBundle::class => ['dev' => true, 'test' => true],
Sonata\Exporter\Bridge\Symfony\SonataExporterBundle::class => ['all' => true],
Oh\GoogleMapFormTypeBundle\OhGoogleMapFormTypeBundle::class => ['all' => true],
Gregwar\CaptchaBundle\GregwarCaptchaBundle::class => ['all' => true],
];

@ -53,3 +53,6 @@ web_ajax:
web_main:
path: main/
gregwar_captcha_routing:
resource: "@GregwarCaptchaBundle/Resources/config/routing/routing.yml"

@ -71,17 +71,17 @@ if (Security::check_token('post') && (
/* to delete, course code confirmation must be equal that current course code */
if ($current_course_code == $courseCodeConfirmation) {
$cr->recycle($recycle_type);
echo Display::return_message(get_lang('RecycleFinished'), 'confirm');
echo Display::return_message(get_lang('Recycle is finished'), 'confirm');
} else {
$messageFailCourseCode = '<p>'.get_lang('CourseRegistrationCodeIncorrect').'</p>';
$messageFailCourseCode .= '<p><a class="btn btn--primary" href="'.api_get_self().'?'.api_get_cidreq().'">'.
get_lang('BackToPreviousPage').
get_lang('Back to previous page').
'</a></p>';
echo Display::return_message($messageFailCourseCode, 'error', false);
}
} elseif ('select_items' == $recycle_type) {
$cr->recycle($recycle_type);
echo Display::return_message(get_lang('RecycleFinished'), 'confirm');
echo Display::return_message(get_lang('Recycle is finished'), 'confirm');
}
} elseif (Security::check_token('post') && (
isset($_POST['recycle_option']) &&
@ -104,15 +104,15 @@ if (Security::check_token('post') && (
} else {
echo Display::return_message(get_lang('Warning: using this tool, you will delete learning objects in your course. There is no UNDO possible. We advise you to create a <a href="create_backup.php">backup</a> before.'), 'warning', false);
$form = new FormValidator('recycle_course', 'post', api_get_self().'?'.api_get_cidreq());
$form->addElement('header', get_lang('SelectOptionForBackup'));
$form->addElement('radio', 'recycle_option', null, get_lang('FullRecycle'), 'full_backup');
$form->addElement('radio', 'recycle_option', null, get_lang('LetMeSelectItems'), 'select_items');
$form->addElement('header', get_lang('Please select a backup option'));
$form->addElement('radio', 'recycle_option', null, get_lang('Delete everything'), 'full_backup');
$form->addElement('radio', 'recycle_option', null, get_lang('Let me select learning objects'), 'select_items');
//Confirmation input code
$form->addElement(
'label',
'',
'<span class="hidden course-full-delete">'.get_lang('CourseCodeConfirmation').'</span>',
'<span class="hidden course-full-delete">'.get_lang('Course code confirmation').'</span>',
null,
null
);

@ -23,7 +23,7 @@ if (!api_is_allowed_to_edit()) {
api_not_allowed(true);
}
$tool_name = get_lang('DelCourse');
$tool_name = get_lang('Completely delete this course');
$type_info_message = 'warning';
if (isset($_GET['delete']) && 'yes' === $_GET['delete'] && $_GET['course_code'] && !empty($_GET['course_code'])) {
if ($current_course_code == $_GET['course_code']) {
@ -31,33 +31,33 @@ if (isset($_GET['delete']) && 'yes' === $_GET['delete'] && $_GET['course_code']
// DELETE CONFIRMATION MESSAGE
Session::erase('_cid');
Session::erase('_real_cid');
$message = '<h3>'.get_lang('CourseTitle').' : '.$current_course_name.'</h3>';
$message .= '<h3>'.get_lang('CourseCode').' : '.$current_course_code.'</h3>';
$message .= get_lang('HasDel');
$message .= '<br /><br /><a href="../../index.php">'.get_lang('BackHome').'</a>';
$message = '<h3>'.get_lang('Course title').' : '.$current_course_name.'</h3>';
$message .= '<h3>'.get_lang('Course code').' : '.$current_course_code.'</h3>';
$message .= get_lang('has been deleted');
$message .= '<br /><br /><a href="../../index.php">'.get_lang('Back to Home Page.').'</a>';
} else {
/* message if code course is incorrect */
$message = '<h3>'.get_lang('CourseTitle').' : '.$current_course_name.'</h3>';
$message .= '<h3>'.get_lang('CourseCode').' : '.$current_course_code.'</h3>';
$message .= '<p>'.get_lang('CourseRegistrationCodeIncorrect').'</p>';
$message = '<h3>'.get_lang('Course title').' : '.$current_course_name.'</h3>';
$message .= '<h3>'.get_lang('Course code').' : '.$current_course_code.'</h3>';
$message .= '<p>'.get_lang('Course registration code incorrect').'</p>';
$message .= '<p><a class="btn btn--primary" href="'
.api_get_path(WEB_CODE_PATH)
.'course_info/delete_course.php?'
.api_get_cidreq()
.'">'.get_lang('BackToPreviousPage').'</a>';
$message .= '<br /><br /><a href="../../index.php">'.get_lang('BackHome').'</a>';
.'">'.get_lang('Back to previous page').'</a>';
$message .= '<br /><br /><a href="../../index.php">'.get_lang('Back to Home Page.').'</a>';
$type_info_message = 'error';
}
} else {
$message = '<h3>'.get_lang('CourseTitle').' : '.$current_course_name.'</h3>';
$message .= '<h3>'.get_lang('CourseCode').' : '.$current_course_code.'</h3>';
$message .= '<p>'.get_lang('ByDel').'</p>';
$message = '<h3>'.get_lang('Course title').' : '.$current_course_name.'</h3>';
$message .= '<h3>'.get_lang('Course code').' : '.$current_course_code.'</h3>';
$message .= '<p>'.get_lang('Deleting this area will permanently delete all the content (documents, links...) it contains and unregister all its members (not remove them from other courses). <p>Do you really want to delete the course?</p>').'<p>';
$message .= '<p><span class="form_required">*</span>'
.get_lang('CourseCodeConfirmation')
.get_lang('Course code confirmation')
.'&nbsp;<input type="text" name="course_code" id="course_code"></p>';
$message .= '<p>';
$message .= '<button class="btn btn--danger delete-course">'.get_lang('ValidateChanges').'</button>';
$message .= '<button class="btn btn--danger delete-course">'.get_lang('Validate changes').'</button>';
$message .= '&nbsp;';
$message .= '<a class="btn btn--primary"href="'
.api_get_path(WEB_CODE_PATH)

@ -395,7 +395,7 @@ if (1 == $exercise_id_changed) {
// Exercise List
$my_exercise_list = [];
$my_exercise_list['0'] = get_lang('AllTests');
$my_exercise_list['0'] = get_lang('All tests');
$my_exercise_list['-1'] = get_lang('Orphan questions');
$titleSavedAsHtml = ('true' === api_get_setting('editor.save_titles_as_html'));
if (is_array($exercise_list)) {
@ -470,7 +470,7 @@ $form
$form
->addSelect(
'courseCategoryId',
get_lang('QuestionCategory'),
get_lang('Questions category'),
$categoryList,
['onchange' => 'submit_form(this);', 'id' => 'courseCategoryId']
)
@ -884,7 +884,7 @@ $headers = [
'',
get_lang('Question'),
get_lang('Type'),
get_lang('QuestionCategory'),
get_lang('Questions category'),
get_lang('Difficulty'),
$actionLabel,
];

@ -1088,16 +1088,16 @@ function api_block_inactive_user()
$tpl = new Template(null, true, true, false, true, false, true, 0);
$tpl->assign('hide_login_link', 1);
//api_not_allowed(true, get_lang('AccountInactive'));
//api_not_allowed(true, get_lang('Account inactive'));
// we were not in a course, return to home page
$msg = Display::return_message(
get_lang('AccountInactive'),
get_lang('Account inactive'),
'error',
false
);
$msg .= '<p class="text-center">
<a class="btn btn--plain" href="'.$homeUrl.'">'.get_lang('BackHome').'</a></p>';
<a class="btn btn--plain" href="'.$homeUrl.'">'.get_lang('Back to Home Page.').'</a></p>';
$tpl->assign('content', $msg);
$tpl->display_one_col_template();

@ -140,24 +140,24 @@ class CourseRequestManager
// E-mail language: The platform language seems to be the best choice.
$email_language = api_get_setting('platformLanguage');
$email_subject = sprintf(get_lang('CourseRequestEmailSubject', null, $email_language), '['.api_get_setting('siteName').']', $code);
$email_body = get_lang('CourseRequestMailOpening', null, $email_language)."\n\n";
$email_body .= get_lang('CourseName', null, $email_language).': '.$title."\n";
$email_body .= get_lang('Fac', null, $email_language).': '.$category_code."\n";
$email_body .= get_lang('CourseCode', null, $email_language).': '.$code."\n";
$email_body .= get_lang('Professor', null, $email_language).': '.api_get_person_name($user_info['firstname'], $user_info['lastname'], null, null, $email_language)."\n";
$email_body .= get_lang('Email', null, $email_language).': '.$user_info['mail']."\n";
$email_body .= get_lang('Description', null, $email_language).': '.$description."\n";
$email_body .= get_lang('Objectives', null, $email_language).': '.$objectives."\n";
$email_body .= get_lang('TargetAudience', null, $email_language).': '.$target_audience."\n";
$email_body .= get_lang('Ln', null, $email_language).': '.$course_language."\n";
$email_body .= get_lang('FillWithExemplaryContent', null, $email_language).': '.($exemplary_content ? get_lang('Yes', null, $email_language) : get_lang('No', null, $email_language))."\n";
$email_subject = sprintf(get_lang('%s A request for a new course %s', $email_language), '['.api_get_setting('siteName').']', $code);
$email_body = get_lang('We registered the following request for a new course:', $email_language)."\n\n";
$email_body .= get_lang('Course name', $email_language).': '.$title."\n";
$email_body .= get_lang('Fac', $email_language).': '.$category_code."\n";
$email_body .= get_lang('Course code', $email_language).': '.$code."\n";
$email_body .= get_lang('Professor', $email_language).': '.api_get_person_name($user_info['firstname'], $user_info['lastname'], null, null, $email_language)."\n";
$email_body .= get_lang('Email', $email_language).': '.$user_info['mail']."\n";
$email_body .= get_lang('Description', $email_language).': '.$description."\n";
$email_body .= get_lang('Objectives', $email_language).': '.$objectives."\n";
$email_body .= get_lang('Target audience', $email_language).': '.$target_audience."\n";
$email_body .= get_lang('Ln', $email_language).': '.$course_language."\n";
$email_body .= get_lang('Fill with demo content', $email_language).': '.($exemplary_content ? get_lang('Yes', $email_language) : get_lang('No', $email_language))."\n";
// Sending an e-mail to the platform administrator.
$email_body_admin = $email_body;
$email_body_admin .= "\n".get_lang('CourseRequestPageForApproval', null, $email_language).' '.api_get_path(WEB_CODE_PATH).'admin/course_request_edit.php?id='.$last_insert_id."\n";
$email_body_admin .= "\n".get_lang('CourseRequestLegalNote', null, $email_language)."\n";
$email_body_admin .= "\n".get_lang('This course request can be approved on the following page:', $email_language).' '.api_get_path(WEB_CODE_PATH).'admin/course_request_edit.php?id='.$last_insert_id."\n";
$email_body_admin .= "\n".get_lang('The information about this course request is considered protected; it can be used only to open a new course within our e-learning portal; it should not be revealed to third parties.', $email_language)."\n";
$sender_name_teacher = api_get_person_name($user_info['firstname'], $user_info['lastname'], null, PERSON_NAME_EMAIL_ADDRESS);
$sender_email_teacher = $user_info['mail'];
@ -179,10 +179,10 @@ class CourseRequestManager
);
// Sending an e-mail to the request.
$email_body_teacher = get_lang('Dear', null, $email_language).' ';
$email_body_teacher = get_lang('Dear', $email_language).' ';
$email_body_teacher .= api_get_person_name($user_info['firstname'], $user_info['lastname'], null, null, $email_language).",\n\n";
$email_body_teacher .= $email_body;
$email_body_teacher .= "\n".get_lang('Formula', null, $email_language)."\n";
$email_body_teacher .= "\n".get_lang('Formula', $email_language)."\n";
$email_body_teacher .= api_get_person_name(
api_get_setting('administratorName'),
api_get_setting('administratorSurname'),
@ -190,10 +190,10 @@ class CourseRequestManager
null,
$email_language
)."\n";
$email_body_teacher .= get_lang('Manager', null, $email_language).' '.api_get_setting('siteName')."\n";
$email_body_teacher .= get_lang('Phone', null, $email_language).': '.api_get_setting('administratorTelephone')."\n";
$email_body_teacher .= get_lang('Email', null, $email_language).': '.api_get_setting('emailAdministrator', null, $email_language)."\n";
$email_body_teacher .= "\n".get_lang('CourseRequestLegalNote', null, $email_language)."\n";
$email_body_teacher .= get_lang('Manager', $email_language).' '.api_get_setting('siteName')."\n";
$email_body_teacher .= get_lang('Phone', $email_language).': '.api_get_setting('administratorTelephone')."\n";
$email_body_teacher .= get_lang('Email', $email_language).': '.api_get_setting('emailAdministrator', null, $email_language)."\n";
$email_body_teacher .= "\n".get_lang('The information about this course request is considered protected; it can be used only to open a new course within our e-learning portal; it should not be revealed to third parties.', $email_language)."\n";
// Swap the sender and the recipient.
$sender_name_admin = $recipient_name_admin;
@ -492,12 +492,12 @@ class CourseRequestManager
// E-mail language: The platform language seems to be the best choice
$email_language = api_get_setting('platformLanguage');
$email_subject = sprintf(
get_lang('CourseRequestAcceptedEmailSubject', null, $email_language),
get_lang('%s The course request %s has been approved', $email_language),
'['.api_get_setting('siteName').']',
$course->getCode()
);
$email_body = get_lang('Dear', null, $email_language).' ';
$email_body = get_lang('Dear', $email_language).' ';
$email_body .= api_get_person_name(
$user_info['firstname'],
$user_info['lastname'],
@ -507,15 +507,14 @@ class CourseRequestManager
).",\n\n";
$email_body .= sprintf(
get_lang(
'CourseRequestAcceptedEmailText',
null,
'Your course request %s has been approved. A new course %s has been created and you are registered in it as a teacher.\n\nYou can access your newly created course from: %s',
$email_language
),
$course->getCode(),
$course->getCode(),
api_get_course_url($course->getId())
)."\n";
$email_body .= "\n".get_lang('Formula', null, $email_language)."\n";
$email_body .= "\n".get_lang('Formula', $email_language)."\n";
$email_body .= api_get_person_name(
api_get_setting('administratorName'),
api_get_setting('administratorSurname'),
@ -523,10 +522,10 @@ class CourseRequestManager
null,
$email_language
)."\n";
$email_body .= get_lang('Manager', null, $email_language).' '.api_get_setting('siteName')."\n";
$email_body .= get_lang('Phone', null, $email_language).': '.api_get_setting('administratorTelephone')."\n";
$email_body .= get_lang('Email', null, $email_language).': '.api_get_setting('emailAdministrator', null, $email_language)."\n";
$email_body .= "\n".get_lang('CourseRequestLegalNote', null, $email_language)."\n";
$email_body .= get_lang('Manager', $email_language).' '.api_get_setting('siteName')."\n";
$email_body .= get_lang('Phone', $email_language).': '.api_get_setting('administratorTelephone')."\n";
$email_body .= get_lang('Email', $email_language).': '.api_get_setting('emailAdministrator', null, $email_language)."\n";
$email_body .= "\n".get_lang('The information about this course request is considered protected; it can be used only to open a new course within our e-learning portal; it should not be revealed to third parties.', $email_language)."\n";
$sender_name = api_get_person_name(
api_get_setting('administratorName'),
@ -598,17 +597,17 @@ class CourseRequestManager
// E-mail language: The platform language seems to be the best choice.
$email_language = api_get_setting('platformLanguage');
$email_subject = sprintf(get_lang('CourseRequestRejectedEmailSubject', null, $email_language), '['.api_get_setting('siteName').']', $code);
$email_subject = sprintf(get_lang('%s The course request %s has been rejected', $email_language), '['.api_get_setting('siteName').']', $code);
$email_body = get_lang('Dear', null, $email_language).' ';
$email_body = get_lang('Dear', $email_language).' ';
$email_body .= api_get_person_name($user_info['firstname'], $user_info['lastname'], null, null, $email_language).",\n\n";
$email_body .= sprintf(get_lang('CourseRequestRejectedEmailText', null, $email_language), $code)."\n";
$email_body .= "\n".get_lang('Formula', null, $email_language)."\n";
$email_body .= sprintf(get_lang('To our regret we have to inform you that your course request %s has been rejected due to not fulfilling the requirements of our Terms and Conditions.', $email_language), $code)."\n";
$email_body .= "\n".get_lang('Formula', $email_language)."\n";
$email_body .= api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname'), null, null, $email_language)."\n";
$email_body .= get_lang('Manager', null, $email_language).' '.api_get_setting('siteName')."\n";
$email_body .= get_lang('Phone', null, $email_language).': '.api_get_setting('administratorTelephone')."\n";
$email_body .= get_lang('Email', null, $email_language).': '.api_get_setting('emailAdministrator', null, $email_language)."\n";
$email_body .= "\n".get_lang('CourseRequestLegalNote', null, $email_language)."\n";
$email_body .= get_lang('Manager', $email_language).' '.api_get_setting('siteName')."\n";
$email_body .= get_lang('Phone', $email_language).': '.api_get_setting('administratorTelephone')."\n";
$email_body .= get_lang('Email', $email_language).': '.api_get_setting('emailAdministrator', null, $email_language)."\n";
$email_body .= "\n".get_lang('The information about this course request is considered protected; it can be used only to open a new course within our e-learning portal; it should not be revealed to third parties.', $email_language)."\n";
$sender_name = api_get_person_name(
api_get_setting('administratorName'),
@ -676,17 +675,17 @@ class CourseRequestManager
// E-mail language: The platform language seems to be the best choice.
$email_language = api_get_setting('platformLanguage');
$email_subject = sprintf(get_lang('CourseRequestAskInfoEmailSubject', null, $email_language), '['.api_get_setting('siteName').']', $code);
$email_subject = sprintf(get_lang('%s A request for additional information about the course request %s', $email_language), '['.api_get_setting('siteName').']', $code);
$email_body = get_lang('Dear', null, $email_language).' ';
$email_body = get_lang('Dear', $email_language).' ';
$email_body .= api_get_person_name($user_info['firstname'], $user_info['lastname'], null, null, $email_language).",\n\n";
$email_body .= sprintf(get_lang('CourseRequestAskInfoEmailText', null, $email_language), $code)."\n";
$email_body .= "\n".get_lang('Formula', null, $email_language)."\n";
$email_body .= sprintf(get_lang('We have received your request for a new course with code %s. Before we consider it for approval, we need some additional information.\n\nPlease, provide brief information about the course content (description), the objectives, the learners or the users that are to be involved in the proposed course. If it is applicable, mention the name of the institution or the unit on which behalf you made the course request.', $email_language), $code)."\n";
$email_body .= "\n".get_lang('Formula', $email_language)."\n";
$email_body .= api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname'))."\n";
$email_body .= get_lang('Manager', null, $email_language).' '.api_get_setting('siteName')."\n";
$email_body .= get_lang('Phone', null, $email_language).': '.api_get_setting('administratorTelephone')."\n";
$email_body .= get_lang('Email', null, $email_language).': '.api_get_setting('emailAdministrator')."\n";
$email_body .= "\n".get_lang('CourseRequestLegalNote', null, $email_language)."\n";
$email_body .= get_lang('Manager', $email_language).' '.api_get_setting('siteName')."\n";
$email_body .= get_lang('Phone', $email_language).': '.api_get_setting('administratorTelephone')."\n";
$email_body .= get_lang('Email', $email_language).': '.api_get_setting('emailAdministrator')."\n";
$email_body .= "\n".get_lang('The information about this course request is considered protected; it can be used only to open a new course within our e-learning portal; it should not be revealed to third parties.', $email_language)."\n";
$sender_name = api_get_person_name(
api_get_setting('administratorName'),

@ -116,12 +116,12 @@ class Diagnoser
$table = new SortableTableFromArray($data, 1, 1000);
$table->set_additional_parameters(['section' => 'courses_space']);
$table->set_header(0, '', false);
$table->set_header(1, get_lang('CourseCode'), true);
$table->set_header(1, get_lang('Course code'), true);
$table->set_header(2, 'Space used on disk (MB)', true);
$table->set_header(3, 'Set max course space (MB)', false);
$table->set_header(4, get_lang('Edit'), false);
$table->set_header(5, get_lang('LastVisit'), true);
$table->set_header(6, get_lang('CurrentDirectory'), false);
$table->set_header(5, get_lang('Latest visit'), true);
$table->set_header(6, get_lang('Current folder'), false);
$table->display();
} else {

@ -65,12 +65,45 @@ function get_lang(string $variable, ?string $locale = null): string
// Using symfony
$defaultDomain = 'messages';
return $translator->trans(
// Check for locale fallbacks (in case no translation is available).
static $fallbacks = null;
$englishInQueue = (!empty($locale) && $locale === 'en_US');
if ($fallbacks === null) {
if (!empty($locale)) {
while (!empty($parent = SubLanguageManager::getParentLocale($locale))) {
$fallbacks[] = $parent;
if ($parent === 'en_US') {
$englishInQueue = true;
}
}
}
// If there were no parent language, still consider en_US as global fallback
if (!$englishInQueue) {
$fallbacks[] = 'en_US';
}
}
// Test a basic translation to the current language.
$translation = $translator->trans(
$variable,
[],
$defaultDomain,
$locale
);
// If no translation was found, $translation is empty.
// Check fallbacks for a valid translation.
$i = 0;
while (empty($translation) && !empty($fallbacks[$i])) {
$fallback = $fallbacks[$i];
$translation = $translator->trans(
$variable,
[],
$defaultDomain,
$fallback
);
$i++;
}
return $translation;
}
/**

@ -747,7 +747,7 @@ class SessionManager
switch ($session['visibility']) {
case SESSION_VISIBLE_READ_ONLY: //1
$session['visibility'] = get_lang('ReadOnly');
$session['visibility'] = get_lang('Read only');
break;
case SESSION_VISIBLE: //2
case SESSION_AVAILABLE: //4
@ -882,8 +882,8 @@ class SessionManager
}
}
$activeIcon = Display::getMdiIcon(StateIcon::ACTIVE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('active'));
$inactiveIcon = Display::getMdiIcon(StateIcon::INACTIVE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('inactive'));
$activeIcon = Display::getMdiIcon(StateIcon::ACTIVE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Active'));
$inactiveIcon = Display::getMdiIcon(StateIcon::INACTIVE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Inactive'));
foreach ($sessions as $session) {
if ($showCountUsers) {
@ -932,7 +932,7 @@ class SessionManager
$session['visibility'] = get_lang('Visible');
break;
case SESSION_INVISIBLE: //3
$session['visibility'] = api_ucfirst(get_lang('invisible'));
$session['visibility'] = api_ucfirst(get_lang('Invisible'));
break;
}
@ -8038,7 +8038,7 @@ class SessionManager
$statusList = self::getStatusList();
$form->addSelect(
'status',
get_lang('SessionStatus'),
get_lang('Session status'),
$statusList,
[
'id' => 'status',
@ -8527,7 +8527,7 @@ class SessionManager
];
}
$columns[] = get_lang('SessionStatus');
$columns[] = get_lang('Session status');
$list = self::getStatusList();
$listToString = '';
foreach ($list as $statusId => $status) {
@ -8627,7 +8627,7 @@ class SessionManager
];
}
$columns[] = get_lang('SessionStatus');
$columns[] = get_lang('Session status');
$list = self::getStatusList();
$listToString = '';
foreach ($list as $statusId => $status) {
@ -8795,7 +8795,7 @@ class SessionManager
];
}
$columns[] = get_lang('SessionStatus');
$columns[] = get_lang('Session status');
$list = self::getStatusList();
$listToString = '';
foreach ($list as $statusId => $status) {
@ -9708,7 +9708,7 @@ class SessionManager
$list = self::getStatusList();
if (!isset($list[$status])) {
return get_lang('NoStatus');
return get_lang('No status');
}
return $list[$status];
@ -9909,7 +9909,7 @@ class SessionManager
}
$userId = (int) $userId;
$content = Display::page_subheader(get_lang('OngoingTraining'));
$content = Display::page_subheader(get_lang('Ongoing training'));
$content .= '
<script>
resizeIframe = function(iFrame) {

@ -1001,8 +1001,8 @@ class Statistics
}
$parameters['date_diff'] = $date_diff;
$parameters['report'] = 'courselastvisit';
$table_header[] = [get_lang("CourseCode"), true];
$table_header[] = [get_lang("LastAccess"), true];
$table_header[] = [get_lang("Course code"), true];
$table_header[] = [get_lang("Latest access"), true];
ob_start();
Display:: display_sortable_table(
@ -1015,7 +1015,7 @@ class Statistics
$content .= ob_get_contents();
ob_end_clean();
} else {
$content = get_lang('NoSearchResults');
$content = get_lang('No search results');
}
return $content;

@ -41,7 +41,7 @@ switch ($action) {
SESSION_VISIBLE_READ_ONLY,
false
);
Display::addFlash(Display::return_message(get_lang('UserAdded')));
Display::addFlash(Display::return_message(get_lang('The user has been added')));
header("Location: ".api_get_self().'?user_id='.$userToLoad.'#session-table');
break;
case 'unsubscribe_user':
@ -55,7 +55,7 @@ switch ($action) {
$em = Database::getManager();
$formSearch = new FormValidator('load', 'get', api_get_self());
$formSearch->addHeader(get_lang('Load Diagnosis'));
$formSearch->addHeader(get_lang('Load diagnosis'));
if (!empty($userInfo)) {
$users = [];
switch ($userInfo['status']) {
@ -115,7 +115,7 @@ if ($userToLoad) {
}
}
$formSearch->addButtonSearch(get_lang('Show Diagnostic'), 'save');
$formSearch->addButtonSearch(get_lang('Show diagnosis'), 'save');
$form = new FormValidator('search', 'post', api_get_self().'?user_id='.$userToLoad.'#session-table');
$form->addHeader(get_lang('Diagnosis'));
@ -508,7 +508,7 @@ $userForm->addButtonSave(get_lang('Save'), 'submit_partial[collapseEight]');
$userForm->addEndPanel();
$form->addButtonSave(get_lang('Save Diagnostic Changes'), 'save');
$form->addButtonSave(get_lang('Save diagnostic changes'), 'save');
// Get list of session status
$statusList = SessionManager::getStatusList();
@ -518,7 +518,7 @@ foreach ($statusList as $nro => $name) {
}
$form->addSelect(
'filter_status',
get_lang('SessionStatus'),
get_lang('Session status'),
$statusSelectList,
['id' => 'filter_status']
);

@ -406,8 +406,8 @@ $headers[] = get_lang('Username');
foreach ($lps as $lp) {
$lpName = $lp->getTitle();
$headers[] = get_lang('Progress').': '.$lpName;
$headers[] = get_lang('FirstAccess').': '.$lpName;
$headers[] = get_lang('LastAccess').': '.$lpName;
$headers[] = get_lang('First access').': '.$lpName;
$headers[] = get_lang('Latest access').': '.$lpName;
$headers[] = get_lang('Time').': '.$lpName;
$headers[] = get_lang('Score').': '.$lpName;
}

@ -33,7 +33,7 @@ if ($form->validate()) {
}
$form->addHeader($plugin->get_lang('SearchFilter'));
$form->addText('name', get_lang('CourseName'), false);
$form->addText('name', get_lang('Course name'), false);
$form->addElement(
'number',
'min',

@ -18,6 +18,7 @@ use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Contracts\Translation\TranslatorInterface;
use Gregwar\CaptchaBundle\Type\CaptchaType;
/**
* @template-extends AbstractType<array>
@ -76,6 +77,22 @@ class ContactType extends AbstractType
new NotBlank(),
],
])
->add('captcha', CaptchaType::class, [
'label' => $this->translator->trans('Verification'),
'width' => 200,
'height' => 50,
'length' => 6,
'quality' => 90,
'distortion' => true,
'background_color' => [255, 255, 255],
'reload' => true,
'as_url' => true,
'attr' => [
'class' => 'captcha_image',
'placeholder' => $this->translator->trans('Type the letters'),
],
'invalid_message' => $this->translator->trans('The security code entered was incorrect.'),
])
->add('submit', SubmitType::class, [
'label' => $this->translator->trans('Send'),
'attr' => [

@ -4,13 +4,13 @@
{% block content %}
<section id="contact-us" class="py-8">
<div class="max-w-md mx-auto">
<div class="mx-auto w-full">
<h2 class="text-2xl font-semibold text-center mb-6">{{ "Contact Us"|get_lang }}</h2>
{{ form_start(form, {'attr': {'class': 'bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4'}}) }}
{% for message in app.flashes('success') %}
<div class="mb-4 bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded relative" role="alert">
<div class="alert alert-success">
{{ message }}
</div>
{% endfor %}
@ -54,6 +54,12 @@
{{ termsContent | raw }}
</div>
<div class="mb-4">
{{ form_label(form.captcha) }}
{{ form_widget(form.captcha) }}
{{ form_errors(form.captcha) }}
</div>
{{ form_end(form) }}
</div>
</section>

@ -1,8 +1,8 @@
<div id="email-message" style="padding-top:10px; padding-bottom:10px;">
<p><strong>{{ 'DearStudentEmailIntroduction'|trans }}</strong> {{ 'AttemptVCC'|trans }} </p>
<p><strong>{{ 'Dear learner,'|trans }}</strong> {{ 'Your following attempt has been viewed/commented/corrected by the trainer'|trans }} </p>
<div style="border-color: #bce8f1; padding: 15px; background-color: #d9edf7; margin-bottom: 15px; font-size: 16px; color:#31708f;">
<p>
<strong>{{ 'CourseName'|trans }}: </strong>
<strong>{{ 'Course name'|trans }}: </strong>
{{ course_title }}
<br>
<strong>{{ 'Exercise'|trans }}: </strong>
@ -10,7 +10,7 @@
</p>
</div>
<p>{{ 'ClickLinkToViewComment'|trans }}</p>
<p>{{ 'Click the link below to access your account and view your commented Examsheet.'|trans }}</p>
<p><a style="font-weight: bold; color: #2BA6CB;" href="{{ url }}">{{ url }}</a></p>
<div style="text-align: right;">
<p><strong>{{ 'Regards'|trans }}</strong><br>

@ -12,6 +12,7 @@ use Chamilo\CoreBundle\Entity\ResourceNode;
use Chamilo\CoreBundle\Entity\ResourceRight;
use Chamilo\CoreBundle\Entity\Session;
use Chamilo\CourseBundle\Entity\CGroup;
use ChamiloSession;
use Laminas\Permissions\Acl\Acl;
use Laminas\Permissions\Acl\Resource\GenericResource;
use Laminas\Permissions\Acl\Role\GenericRole;
@ -149,6 +150,12 @@ class ResourceNodeVoter extends Voter
$courseId = (int) $request->getSession()->get('cid');
$sessionId = (int) $request->getSession()->get('sid');
$groupId = (int) $request->getSession()->get('gid');
if (0 === $courseId) {
$courseId = (int) ChamiloSession::read('cid');
$sessionId = (int) ChamiloSession::read('sid');
$groupId = (int) ChamiloSession::read('gid');
}
}
$links = $resourceNode->getResourceLinks();

@ -1746,7 +1746,7 @@ msgid "has been deleted"
msgstr "has been deleted"
msgid "Deleting this area will permanently delete all the content (documents, links...) it contains and unregister all its members (not remove them from other courses). <p>Do you really want to delete the course?"
msgstr "Deleting this area will permanently delete all the content (documents, links...) it contains and unregister all its members (not remove them from other courses). <p>Do you really want to delete the course?"
msgstr "Deleting this course will permanently delete all the content (documents, links...) it contains and unregister all its members (not remove them from other courses). <p>Do you really want to delete the course?</p>"
msgid "YES"
msgstr "YES"
@ -27483,3 +27483,15 @@ msgstr "Course coach email sender"
msgid "No reply email sender"
msgstr "No reply email sender"
msgid "Course registration code incorrect"
msgstr "Course registration code incorrect"
msgid "Load diagnosis"
msgstr "Load diagnosis"
msgid "Show diagnosis"
msgstr "Show diagnosis"
msgid "Save diagnosis changes"
msgstr "Save diagnosis changes"

@ -27476,3 +27476,15 @@ msgstr ""
msgid "No reply email sender"
msgstr ""
msgid "Course registration code incorrect"
msgstr ""
msgid "Load diagnosis"
msgstr ""
msgid "Show diagnosis"
msgstr ""
msgid "Save diagnosis changes"
msgstr ""

Loading…
Cancel
Save