diff --git a/controllers/copy.php b/controllers/copy.php index 9476018e215e95259c888e139a3dce4ad6880323..148dcb0bce0dda8e3587c2914ed49394b2aa3e6a 100755 --- a/controllers/copy.php +++ b/controllers/copy.php @@ -34,7 +34,8 @@ class CopyController extends PluginController $params = [ "semester_id", "dozent_id", "lock_copied_courses", "invisible_copied_courses", "cycles", "resource_assignments", - "week_offset", "end_offset", "copy_tutors", "with_children" + "week_offset", "end_offset", "copy_tutors", "with_children", + "contents_scm" ]; foreach ($params as $param) { $config_name = "COURSECOPY_SETTINGS_".strtoupper($param); @@ -250,6 +251,17 @@ class CopyController extends PluginController } } } + + //Inhalte: + if (Request::get("contents_scm")) { + foreach (StudipScmEntry::findByRange_id($oldcourse->getId(), 'ORDER BY position ASC') as $scm) { + $new_scm = new StudipScmEntry(); + $new_scm->setData($scm->toRawArray()); + $new_scm->setId($new_scm->getNewId()); + $new_scm['range_id'] = $newcourse->getId(); + $new_scm->store(); + } + } } } PageLayout::postSuccess(_("Die Veranstaltungen wurden erfolgreich kopiert.")); diff --git a/plugin.manifest b/plugin.manifest index a8383471d13f2e147a822f22024811b8930f8c11..9898ce7d743d1219ca5b434f94f3cca4469aacd6 100755 --- a/plugin.manifest +++ b/plugin.manifest @@ -1,6 +1,6 @@ pluginname=CourseCopy pluginclassname=CourseCopy -version=1.5.1 +version=1.6 origin=data-quest studipMinVersion=4.0 studipMaxVersion=4.99.99 diff --git a/views/copy/info.php b/views/copy/info.php index fb2d3cda03d4693309679ec76f80324d24545067..df6a66fcad8a14e9b95d6ecf3ff97f53e6e16a5c 100755 --- a/views/copy/info.php +++ b/views/copy/info.php @@ -83,6 +83,17 @@ </fieldset> + <fieldset> + <legend><?= _("Inhalte") ?></legend> + + <label> + <input type="checkbox" + name="contents_scm" + value="1"<?= UserConfig::get($GLOBALS['user']->id)->COURSECOPY_SETTINGS_CONTENTS_SCM ? " checked" : "" ?>> + <?= _("Freie Inhaltsseiten mit kopieren") ?> + </label> + </fieldset> + <div data-dialog-button> <?= \Studip\Button::create(_("Kopieren"), "copy", array('onclick' => "return window.confirm('"._("Wirklich kopieren?")."');")) ?> </div>