Lps: Add subscribe users + hide TOC when copying a LP BT#18064

pull/3773/head
Julio Montoya 5 years ago
parent 24a5aebc5f
commit a43cf297bb
  1. 4
      main/lp/learnpath.class.php
  2. 4
      src/Chamilo/CourseBundle/Component/CourseCopy/CourseBuilder.php
  3. 4
      src/Chamilo/CourseBundle/Component/CourseCopy/CourseRestorer.php
  4. 7
      src/Chamilo/CourseBundle/Component/CourseCopy/Resources/CourseCopyLearnpath.php

@ -12070,9 +12070,7 @@ EOD;
$cb->set_tools_to_build(['learnpaths']); $cb->set_tools_to_build(['learnpaths']);
//Setting elements that will be copied //Setting elements that will be copied
$cb->set_tools_specific_id_list( $cb->set_tools_specific_id_list(['learnpaths' => [$this->lp_id]]);
['learnpaths' => [$this->lp_id]]
);
$course = $cb->build(); $course = $cb->build();

@ -1522,12 +1522,12 @@ class CourseBuilder
$obj->expired_on, $obj->expired_on,
$obj->session_id, $obj->session_id,
$obj->category_id, $obj->category_id,
$obj->subscribe_users,
$obj->hide_toc_frame,
$items $items
); );
$extraFieldValue = new \ExtraFieldValue('lp'); $extraFieldValue = new \ExtraFieldValue('lp');
$lp->extraFields = $extraFieldValue->getAllValuesByItem($obj->id); $lp->extraFields = $extraFieldValue->getAllValuesByItem($obj->id);
$this->course->add_resource($lp); $this->course->add_resource($lp);
if (!empty($obj->preview_image)) { if (!empty($obj->preview_image)) {

@ -2835,11 +2835,11 @@ class CourseRestorer
'theme' => '', 'theme' => '',
'session_id' => $session_id, 'session_id' => $session_id,
'prerequisite' => 0, 'prerequisite' => 0,
'hide_toc_frame' => 0, 'hide_toc_frame' => self::DBUTF8(isset($lp->hideTableOfContents) ? $lp->hideTableOfContents : 0),
'subscribe_users' => self::DBUTF8(isset($lp->subscribeUsers) ? $lp->subscribeUsers : 0),
'seriousgame_mode' => 0, 'seriousgame_mode' => 0,
'category_id' => $categoryId, 'category_id' => $categoryId,
'max_attempts' => 0, 'max_attempts' => 0,
'subscribe_users' => 0,
]; ];
if (!empty($condition_session)) { if (!empty($condition_session)) {

@ -90,6 +90,9 @@ class CourseCopyLearnpath extends Resource
*/ */
public $preview_image; public $preview_image;
public $subscribeUsers;
public $hideTableOfContents;
/** /**
* Create a new learnpath. * Create a new learnpath.
* *
@ -141,6 +144,8 @@ class CourseCopyLearnpath extends Resource
$expired_on, $expired_on,
$session_id, $session_id,
$categoryId, $categoryId,
$subscribeUsers,
$hideTableOfContents,
$items $items
) { ) {
parent::__construct($id, RESOURCE_LEARNPATH); parent::__construct($id, RESOURCE_LEARNPATH);
@ -170,6 +175,8 @@ class CourseCopyLearnpath extends Resource
$this->author = $author; $this->author = $author;
$this->preview_image = $preview_image; $this->preview_image = $preview_image;
$this->categoryId = $categoryId; $this->categoryId = $categoryId;
$this->subscribeUsers = $subscribeUsers;
$this->hideTableOfContents = $hideTableOfContents;
$this->items = $items; $this->items = $items;
} }

Loading…
Cancel
Save