Internal - Fix lang vars, fix course public URL

pull/3464/head
Julio Montoya 4 years ago
parent 0b0dc1b950
commit 628e18b255
  1. 23
      public/main/inc/lib/api.lib.php
  2. 1
      public/main/session/resume_session.php
  3. 18
      public/main/template/default/session/resume_session.html.twig

@ -6794,13 +6794,13 @@ function api_get_jquery_libraries_js($libraries)
* @param int $sessionId The session ID - optional (takes it from context if not given)
* @param int $groupId The group ID - optional (takes it from context if not given)
*
* @return string The URL to a course, a session, or empty string if nothing works e.g. https://localhost/courses/ABC/index.php?session_id=3&gidReq=1
* @return string The URL to a course, a session, or empty string if nothing works
* e.g. https://localhost/courses/ABC/index.php?session_id=3&gidReq=1
*
* @author Julio Montoya <gugli100@gmail.com>
*/
function api_get_course_url($courseCode = null, $sessionId = null, $groupId = null)
{
$courseDirectory = '';
$url = '';
// If courseCode not set, get context or []
if (empty($courseCode)) {
@ -6809,11 +6809,6 @@ function api_get_course_url($courseCode = null, $sessionId = null, $groupId = nu
$courseInfo = api_get_course_info($courseCode);
}
// If course defined, get directory, otherwise keep empty string
if (!empty($courseInfo['directory'])) {
$courseDirectory = $courseInfo['directory'];
}
// If sessionId not set, get context or 0
if (empty($sessionId)) {
$sessionId = api_get_session_id();
@ -6825,14 +6820,14 @@ function api_get_course_url($courseCode = null, $sessionId = null, $groupId = nu
}
// Build the URL
if (!empty($courseDirectory)) {
if (!empty($courseInfo)) {
// directory not empty, so we do have a course
$url = api_get_path(WEB_COURSE_PATH).$courseDirectory.'/index.php?id_session='.$sessionId.'&gidReq='.$groupId;
} elseif (!empty($sessionId) &&
'true' !== api_get_setting('session.remove_session_url')
) {
// if the course was unset and the session was set, send directly to the session
$url = api_get_path(WEB_CODE_PATH).'session/index.php?session_id='.$sessionId;
$url = $courseInfo['course_public_url'].'?sid='.$sessionId.'&gid='.$groupId;
} else {
if (!empty($sessionId) && 'true' !== api_get_setting('session.remove_session_url')) {
// if the course was unset and the session was set, send directly to the session
$url = api_get_path(WEB_CODE_PATH).'session/index.php?session_id='.$sessionId;
}
}
// if not valid combination was found, return an empty string

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\Promotion;

@ -7,16 +7,16 @@
<table id="session-properties" class="table table-bordered">
<tr>
<td>{{ 'CreatedBy'|get_lang }}</td>
<td>{{ 'Created by'|get_lang }}</td>
<td>{{ session_admin.complete_name_with_message_link }}</td>
</tr>
<tr>
<td>{{ 'GeneralCoach' | get_lang}} :</td>
<td>{{ 'General coach' | get_lang}} :</td>
<td>{{ general_coach.complete_name_with_message_link }}</td>
</tr>
{% if session_category %}
<tr>
<td>{{ 'SessionCategory' | get_lang}} </td>
<td>{{ 'Session category' | get_lang}} </td>
<td>{{ session_category }}</td>
</tr>
{% endif %}
@ -30,15 +30,15 @@
</tr>
{% else %}
<tr>
<td>{{ 'DisplayDates' | get_lang}} </td>
<td>{{ 'Dates shown' | get_lang}} </td>
<td>{{ session_dates.display }}</td>
</tr>
<tr>
<td>{{ 'AccessDates' | get_lang}} </td>
<td>{{ 'Access dates for students' | get_lang}} </td>
<td>{{ session_dates.access }}</td>
</tr>
<tr>
<td>{{ 'CoachDates' | get_lang}} </td>
<td>{{ 'Access dates for coaches' | get_lang}} </td>
<td>{{ session_dates.coach }}</td>
</tr>
{% endif %}
@ -50,7 +50,7 @@
</td>
</tr>
<tr>
<td>{{ 'ShowDescription' | get_lang}} </td>
<td>{{ 'Show description' | get_lang}} </td>
<td>
{% if session.show_description == 1 %}
{{ 'Yes' | get_lang}}
@ -60,7 +60,7 @@
</td>
</tr>
<tr>
<td>{{ 'SessionVisibility' | get_lang}} </td>
<td>{{ 'Visibility after end date' | get_lang}} </td>
<td>
{{ session_visibility }}
</td>
@ -104,7 +104,7 @@
{% if programmed_announcement %}
<tr>
<td>{{ 'ScheduledAnnouncements' | get_lang}}</td>
<td>{{ 'Scheduled announcements' | get_lang }}</td>
<td>
<a class="btn btn-default" href="{{ _p.web_main }}session/scheduled_announcement.php?session_id={{ session.id }}">
{{ 'Edit' | get_lang }}

Loading…
Cancel
Save