diff --git a/main/lp/learnpath.class.php b/main/lp/learnpath.class.php index 1e9ea05701..26785669c0 100755 --- a/main/lp/learnpath.class.php +++ b/main/lp/learnpath.class.php @@ -12070,9 +12070,7 @@ EOD; $cb->set_tools_to_build(['learnpaths']); //Setting elements that will be copied - $cb->set_tools_specific_id_list( - ['learnpaths' => [$this->lp_id]] - ); + $cb->set_tools_specific_id_list(['learnpaths' => [$this->lp_id]]); $course = $cb->build(); diff --git a/src/Chamilo/CourseBundle/Component/CourseCopy/CourseBuilder.php b/src/Chamilo/CourseBundle/Component/CourseCopy/CourseBuilder.php index 76ffb6f424..facfbc081d 100644 --- a/src/Chamilo/CourseBundle/Component/CourseCopy/CourseBuilder.php +++ b/src/Chamilo/CourseBundle/Component/CourseCopy/CourseBuilder.php @@ -1522,12 +1522,12 @@ class CourseBuilder $obj->expired_on, $obj->session_id, $obj->category_id, + $obj->subscribe_users, + $obj->hide_toc_frame, $items ); - $extraFieldValue = new \ExtraFieldValue('lp'); $lp->extraFields = $extraFieldValue->getAllValuesByItem($obj->id); - $this->course->add_resource($lp); if (!empty($obj->preview_image)) { diff --git a/src/Chamilo/CourseBundle/Component/CourseCopy/CourseRestorer.php b/src/Chamilo/CourseBundle/Component/CourseCopy/CourseRestorer.php index 1264ec84f8..818ec391e7 100644 --- a/src/Chamilo/CourseBundle/Component/CourseCopy/CourseRestorer.php +++ b/src/Chamilo/CourseBundle/Component/CourseCopy/CourseRestorer.php @@ -2835,11 +2835,11 @@ class CourseRestorer 'theme' => '', 'session_id' => $session_id, '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, 'category_id' => $categoryId, 'max_attempts' => 0, - 'subscribe_users' => 0, ]; if (!empty($condition_session)) { diff --git a/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/CourseCopyLearnpath.php b/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/CourseCopyLearnpath.php index 781d7ebf77..d7e54a93e9 100644 --- a/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/CourseCopyLearnpath.php +++ b/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/CourseCopyLearnpath.php @@ -90,6 +90,9 @@ class CourseCopyLearnpath extends Resource */ public $preview_image; + public $subscribeUsers; + public $hideTableOfContents; + /** * Create a new learnpath. * @@ -141,6 +144,8 @@ class CourseCopyLearnpath extends Resource $expired_on, $session_id, $categoryId, + $subscribeUsers, + $hideTableOfContents, $items ) { parent::__construct($id, RESOURCE_LEARNPATH); @@ -170,6 +175,8 @@ class CourseCopyLearnpath extends Resource $this->author = $author; $this->preview_image = $preview_image; $this->categoryId = $categoryId; + $this->subscribeUsers = $subscribeUsers; + $this->hideTableOfContents = $hideTableOfContents; $this->items = $items; }