Use sid instead id_session

pull/3124/head
Julio Montoya 5 years ago
parent 5c908c976a
commit 0c6218aba4
  1. 2
      public/main/course_home/course_home.php
  2. 2
      public/main/course_home/redirect.php
  3. 1
      public/main/inc/ajax/session.ajax.php
  4. 6
      public/main/inc/lib/course.lib.php
  5. 4
      public/main/inc/lib/display.lib.php
  6. 2
      public/main/inc/lib/exercise.lib.php
  7. 46
      public/main/inc/lib/formvalidator/FormValidator.class.php
  8. 6
      public/main/inc/lib/userportal.lib.php
  9. 2
      public/main/survey/fillsurvey.php
  10. 4
      public/main/survey/surveyUtil.class.php
  11. 2
      public/main/template/default/admin/career_dashboard.html.twig
  12. 2
      public/main/template/default/user_portal/classic_session.html.twig
  13. 4
      src/CoreBundle/EventListener/LoginSuccessHandler.php
  14. 2
      src/CourseBundle/Component/CourseCopy/CourseRestorer.php
  15. 2
      src/ThemeBundle/Resources/views/Course/about.html.twig
  16. 10
      src/ThemeBundle/Resources/views/Resource/upload.html.twig

@ -4,6 +4,6 @@
$courseCode = isset($_GET['cDir']) ? htmlentities($_GET['cDir']) : '';
$sessionId = isset($_GET['id_session']) ? (int) $_GET['id_session'] : '';
$url = "../../public/courses/$courseCode?id_session=$sessionId";
$url = "../../public/courses/$courseCode?sid=$sessionId";
header("Location: $url");
exit;

@ -14,7 +14,7 @@ if (!empty($sessionName) && !empty($courseCode)) {
$sessionInfo = SessionManager::get_session_by_name($sessionName);
$courseInfo = api_get_course_info($courseCode);
if (!empty($sessionInfo) && !empty($courseInfo)) {
$url = api_get_path(WEB_COURSE_PATH).$courseInfo['directory'].'/index.php?id_session='.$sessionInfo['id'];
$url = api_get_path(WEB_COURSE_PATH).$courseInfo['directory'].'/index.php?sid='.$sessionInfo['id'];
header('Location: '.$url);
exit;
}

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

@ -3584,7 +3584,7 @@ class CourseManager
$params['title'] = $course_info['title'];
$params['title_cut'] = $course_info['title'];
$params['link'] = $course_info['course_public_url'].'?id_session=0&autoreg=1';
$params['link'] = $course_info['course_public_url'].'?sid=0&autoreg=1';
if ('true' === api_get_setting('display_teacher_in_courselist')) {
$params['teachers'] = self::getTeachersFromCourse(
$courseId,
@ -3853,7 +3853,7 @@ class CourseManager
);
}
$courseUrl = $course_info['course_public_url'].'?id_session=0';
$courseUrl = $course_info['course_public_url'].'?sid=0';
$teachers = [];
if ('true' === api_get_setting('display_teacher_in_courselist')) {
$teachers = self::getTeachersFromCourse(
@ -4074,7 +4074,7 @@ class CourseManager
}
if (COURSEMANAGER === $userInCourseStatus || $sessionCourseAvailable) {
$session_url = $course_info['course_public_url'].'?id_session='.$course_info['id_session'];
$session_url = $course_info['course_public_url'].'?sid='.$course_info['id_session'];
$session_title = '<a title="'.$course_info['name'].'" href="'.$session_url.'">'.
$course_info['name'].'</a>'.$notifications;
} else {

@ -1688,8 +1688,8 @@ class Display
api_get_path(WEB_CODE_PATH).
$notification['link'].'&cidReq='.$course_code.
'&ref='.$notification['ref'].
'&gidReq='.$notification['to_group_id'].
'&id_session='.$sessionId
'&gid='.$notification['to_group_id'].
'&sid='.$sessionId
).PHP_EOL;
}

@ -2302,7 +2302,7 @@ HOTSPOT;
$actions .= $delete_link;
}
} else {
$attempt_url = api_get_path(WEB_CODE_PATH).'exercise/result.php?'.api_get_cidreq().'&id='.$results[$i]['exe_id'].'&id_session='.$sessionId;
$attempt_url = api_get_path(WEB_CODE_PATH).'exercise/result.php?'.api_get_cidreq().'&id='.$results[$i]['exe_id'].'&sid='.$sessionId;
$attempt_link = Display::url(
get_lang('Show'),
$attempt_url,

@ -206,8 +206,8 @@ EOT;
*/
public function addCourseHiddenParams()
{
$this->addHidden('cidReq', api_get_course_id());
$this->addHidden('id_session', api_get_session_id());
$this->addHidden('cid', api_get_course_id());
$this->addHidden('sid', api_get_session_id());
}
/**
@ -1649,32 +1649,32 @@ EOT;
);
$this->addHtml('</div>');
$this->addHtml("<script>
$this->addHtml("<script>
$(function() {
var defaultValue = '$defaultId';
$('#$typeNoDots').val(defaultValue);
$('#$typeNoDots').selectpicker('render');
if (defaultValue != '') {
var selected = $('#$typeNoDots option:selected').val();
$.ajax({
var selected = $('#$typeNoDots option:selected').val();
$.ajax({
url: '$url' + '&id=' + selected+ '&template_name=$type',
success: function (data) {
$('#$templateNoDots').html(data);
$('#$templateNoDotsBlock').show();
return;
},
},
});
}
$('#$typeNoDots').on('change', function(){
var selected = $('#$typeNoDots option:selected').val();
$.ajax({
$('#$typeNoDots').on('change', function(){
var selected = $('#$typeNoDots option:selected').val();
$.ajax({
url: '$url' + '&id=' + selected,
success: function (data) {
$('#$templateNoDots').html(data);
$('#$templateNoDotsBlock').show();
return;
},
},
});
});
});
@ -1724,8 +1724,8 @@ EOT;
data.submit().always(function () {
\$this.remove();
});
});
});
$('#".$inputName."').fileupload({
url: url,
dataType: 'json',
@ -1736,11 +1736,11 @@ EOT;
previewMaxWidth: 300,
previewMaxHeight: 169,
previewCrop: true,
dropzone: $('#dropzone'),
}).on('fileuploadadd', function (e, data) {
dropzone: $('#dropzone'),
}).on('fileuploadadd', function (e, data) {
data.context = $('<div class=\"row\" />').appendTo('#files');
$.each(data.files, function (index, file) {
var node = $('<div class=\"col-sm-5 file_name\">').text(file.name);
var node = $('<div class=\"col-sm-5 file_name\">').text(file.name);
node.appendTo(data.context);
});
}).on('fileuploadprocessalways', function (e, data) {
@ -1790,8 +1790,8 @@ EOT;
$('<span class=\"message-image-success\"/>').text('".addslashes(get_lang('File upload succeeded!'))."')
);
$(data.context.children()[index]).parent().append(message);
});
$('#dropzone').removeClass('hover');
});
$('#dropzone').removeClass('hover');
".$redirectCondition."
}).on('fileuploadfail', function (e, data) {
$.each(data.files, function (index) {
@ -1802,14 +1802,14 @@ EOT;
$(data.context.children()[index]).parent().append(error);
});
$('#dropzone').removeClass('hover');
}).prop('disabled', !$.support.fileInput).parent().addClass($.support.fileInput ? undefined : 'disabled');
}).prop('disabled', !$.support.fileInput).parent().addClass($.support.fileInput ? undefined : 'disabled');
$('#dropzone').on('dragover', function (e) {
// dragleave callback implementation
// dragleave callback implementation
$('#dropzone').addClass('hover');
});
$('#dropzone').on('dragleave', function (e) {
$('#dropzone').on('dragleave', function (e) {
$('#dropzone').removeClass('hover');
});
$('.fileinput-button').hide();

@ -80,7 +80,7 @@ class IndexManager
$my_exercise['title'],
api_get_path(
WEB_CODE_PATH
).'exercise/overview.php?exerciseId='.$my_exercise['id'].'&cidReq='.$my_exercise['course_code'].'&id_session='.$my_exercise['session_id']
).'exercise/overview.php?exerciseId='.$my_exercise['id'].'&cid='.$my_exercise['course_code'].'&sid='.$my_exercise['session_id']
);
$this->tpl->assign('exercise_url', $url);
$this->tpl->assign(
@ -2309,7 +2309,7 @@ class IndexManager
ICON_SIZE_LARGE
);
$courseLink = $courseInfo['course_public_url'].'?id_session=0';
$courseLink = $courseInfo['course_public_url'].'?sid=0';
// get html course params
$courseParams = CourseManager::getCourseParamsForDisplay($id, $loadDirs);
@ -2395,7 +2395,7 @@ class IndexManager
['class' => 'sessionView'],
ICON_SIZE_LARGE
);
$courseLink = $courseInfo['course_public_url'].'?id_session='.intval($id);
$courseLink = $courseInfo['course_public_url'].'?sid='.(int) $id;
$html .= "<span class='$class1 session-view-session'>$icon$title</span>";
$html .= '<div class="'.$class2.' session-view-session-go-to-course-in-session">

@ -53,7 +53,7 @@ if (empty($courseInfo)) {
}
$userInfo = api_get_user_info();
$sessionId = isset($_GET['id_session']) ? (int) $_GET['id_session'] : api_get_session_id();
$sessionId = isset($_GET['sid']) ? (int) $_GET['sid'] : api_get_session_id();
// Breadcrumbs
if (!empty($userInfo)) {

@ -3953,9 +3953,9 @@ class SurveyUtil
$params = [
'invitationcode' => $code,
'cidReq' => $courseInfo['code'],
'cid' => $courseInfo['code'],
'course' => $courseInfo['code'],
'id_session' => $sessionId,
'sid' => $sessionId,
];
if (!empty($surveyCode)) {

@ -57,7 +57,7 @@
<ul>
{% for course in session.courses %}
<li>
<a href="{{ _p.web }}courses/{{ course.directory }}/index.php?id_session={{ sessionid }}"
<a href="{{ _p.web }}courses/{{ course.directory }}/index.php?sid={{ sessionid }}"
title="{{ course.title }}">
{{ course.title }}
</a>

@ -103,7 +103,7 @@
<img src="{{ 'teacher.png'|icon(16) }}" width="16" height="16">
{% for coach in item.coaches %}
{{ loop.index > 1 ? ' | ' }}
url('legacy_main', { 'name' : 'session/resume_session.php', 'id_session' : row.id })
url('legacy_main', { 'name' : 'session/resume_session.php', 'sid' : row.id })
<a href="{{ url('legacy_main', {'name' : 'inc/ajax/user_manager.ajax.php', 'a': 'get_user_popup', 'user_id': coach.user_id, 'session_id': row.id, 'course_id': item.real_id })|url_encode() }}"
data-title="{{ coach.full_name }}" class="ajax">

@ -118,8 +118,8 @@ class LoginSuccessHandler
if (1 == $count_of_sessions && 0 == $count_of_courses_no_sessions) {
$key = array_keys($personal_course_list);
$course_info = $personal_course_list[$key[0]]['course_info'];
$id_session = isset($course_info['session_id']) ? $course_info['session_id'] : 0;
$url = api_get_path(WEB_COURSE_PATH).$course_info['directory'].'/index.php?sid='.$id_session;
$sessionId = isset($course_info['session_id']) ? $course_info['session_id'] : 0;
$url = api_get_path(WEB_COURSE_PATH).$course_info['directory'].'/index.php?sid='.$sessionId;
}
if (0 == $count_of_sessions && 1 == $count_of_courses_no_sessions) {

@ -2788,7 +2788,7 @@ class CourseRestorer
$params = [
'c_id' => $this->destination_course_id,
'name' => self::DBUTF8($lp->name),
'link' => "lp/lp_controller.php?action=view&lp_id=$new_lp_id&id_session=$session_id",
'link' => "lp/lp_controller.php?action=view&lp_id=$new_lp_id&sid=$session_id",
'image' => 'scormbuilder.gif',
'visibility' => '0',
'admin' => '0',

@ -121,7 +121,7 @@
</a>
{% endif %}
{% elseif subscription %}
<a href="{{ _p.web }}courses/{{ course.code }}/index.php?id_session=0" class="btn btn-lg btn-success btn-block">{{ 'CourseHomepage'|trans }}</a>
<a href="{{ _p.web }}courses/{{ course.code }}/index.php?sid=0" class="btn btn-lg btn-success btn-block">{{ 'CourseHomepage'|trans }}</a>
{% else %}
<a href="{{ _p.web }}courses/{{ course.code }}/index.php?action=subscribe&sec_token={{ token }}" class="btn btn-lg btn-success btn-block">{{ 'Subscribe'|trans }}</a>
{% endif %}

@ -4,16 +4,6 @@
<script>
$(function() {
{#$('#fileupload').fileupload({#}
{# formData: {#}
{# type: '{{ type }}',#}
{# tool: '{{ tool }}',#}
{# cidReq: '{{ cidReq }}',#}
{# id_session: '{{ id_session }}',#}
{# id: '{{ id }}'#}
{# },#}
{#});#}
$('#dropzone').on('click', function() {
$('#fileupload').click();
});

Loading…
Cancel
Save