Use old lp id for BC see BT#11671

pull/2487/head
jmontoyaa 9 years ago
parent 99c54f2180
commit 44861b5194
  1. 3
      main/lp/learnpathList.class.php
  2. 3
      main/lp/lp_controller.php
  3. 19
      main/lp/lp_list.php
  4. 2
      main/lp/scorm.class.php

@ -170,7 +170,8 @@ class LearnpathList
'publicated_on' => $row->getPublicatedOn() ? $row->getPublicatedOn()->format('Y-m-d H:i:s') : null,
'expired_on' => $row->getExpiredOn() ? $row->getExpiredOn()->format('Y-m-d H:i:s') : null,
//'category_id' => $row['category_id'],
'subscribe_users' => $row->getSubscribeUsers()
'subscribe_users' => $row->getSubscribeUsers(),
'lp_old_id' => $row->getId()
);
$names[$row->getName()] = $row->getIid();
}

@ -1,13 +1,14 @@
<?php
/* For licensing terms, see /license.txt */
use ChamiloSession as Session;
/**
* Controller script. Prepares the common background variables to give to the scripts corresponding to
* the requested action
* @package chamilo.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
use ChamiloSession as Session;
// Flag to allow for anonymous user - needs to be set before global.inc.php.
$use_anonymous = true;

@ -1,6 +1,9 @@
<?php
/* For licensing terms, see /license.txt */
use ChamiloSession as Session;
use Chamilo\CourseBundle\Entity\CLpCategory;
/**
* This file was originally the copy of document.php, but many modifications happened since then ;
* the direct file view is not any more needed, if the user uploads a SCORM zip file, a directory
@ -9,8 +12,6 @@
* @package chamilo.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
use ChamiloSession as Session;
use Chamilo\CourseBundle\Entity\CLpCategory;
$this_section = SECTION_COURSES;
//@todo who turns on $lp_controller_touched?
@ -169,7 +170,7 @@ foreach ($categories as $item) {
$autolaunch_exists = false;
foreach ($flat_list as $id => $details) {
$id = $details['lp_old_id'];
// Validation when belongs to a session.
$session_img = api_get_session_image(
$details['lp_session'],
@ -182,11 +183,7 @@ foreach ($categories as $item) {
}
// Check if the learnpath is visible for student.
if (!$is_allowed_to_edit && !learnpath::is_lp_visible_for_student(
$id,
$userId
)
) {
if (!$is_allowed_to_edit && !learnpath::is_lp_visible_for_student($id, $userId)) {
continue;
}
@ -258,10 +255,7 @@ foreach ($categories as $item) {
if ($is_allowed_to_edit) {
$url_start_lp .= '&isStudentView=true';
$studentVisibility = learnpath::is_lp_visible_for_student(
$id,
$userId
);
$studentVisibility = learnpath::is_lp_visible_for_student($id, $userId);
$dsp_desc = '<em>'.$details['lp_maker'].'</em> '.($studentVisibility ? '' : ' - ('.get_lang('LPNotVisibleToStudent').')');
$extra = '<div class ="lp_content_type_label">'.$dsp_desc.'</div>';
}
@ -330,7 +324,6 @@ foreach ($categories as $item) {
$actionSeriousGame = null;
if ($is_allowed_to_edit) {
// EDIT LP
if ($current_session == $details['lp_session']) {
$dsp_edit_lp = Display::url(

@ -662,7 +662,7 @@ class scorm extends learnpath
- parse & change relative html links
- make sure the filenames are secure (filter funny characters or php extensions)
*/
if (is_dir($course_sys_dir.$new_dir) OR
if (is_dir($course_sys_dir.$new_dir) ||
@mkdir($course_sys_dir.$new_dir, api_get_permissions_for_new_directories())
) {

Loading…
Cancel
Save