From 2488742514fe173a0068a81d2d62f94931c73180 Mon Sep 17 00:00:00 2001
From: Moritz Strohm <strohm@data-quest.de>
Date: Mon, 17 Jun 2019 15:22:53 +0200
Subject: [PATCH] cherry-picked commit 01a76b0689393277fb89ca2b493133a53c1deb5c

---
 CourseCopy.class.php | 21 ++++++++++++---------
 controllers/copy.php |  2 +-
 views/copy/info.php  |  6 +++++-
 3 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/CourseCopy.class.php b/CourseCopy.class.php
index 4501425..aab4a41 100755
--- a/CourseCopy.class.php
+++ b/CourseCopy.class.php
@@ -4,18 +4,21 @@ class CourseCopy extends StudIPPlugin implements AdminCourseAction
 {
     public function getAdminActionURL()
     {
-        return PluginEngine::getURL($this, array(), "copy/info");
+        return PluginEngine::getURL($this, [], "copy/info");
     }
 
-    public function useMultimode() {
-        if (version_compare($GLOBALS['SOFTWARE_VERSION'], "3.4.99", ">=")) {
-            //Damit es im Dialog geöffnet wird
-            return \Studip\Button::createAccept(_("Kopieren"), "edit", array('data-dialog' => 1));
-        } else {
-            return _("Kopieren");
-        }
+
+    public function useMultimode()
+    {
+        //Damit es im Dialog geöffnet wird
+        return \Studip\Button::createAccept(
+            dgettext('CourseCopy', 'Kopieren'),
+            'edit',
+            ['data-dialog' => 1]
+        );
     }
 
+
     public function getAdminCourseActionTemplate($course_id, $values = null, $semester = null) {
         $factory = new Flexi_TemplateFactory(__DIR__."/views");
         $template = $factory->open("action/checkbox.php");
@@ -23,4 +26,4 @@ class CourseCopy extends StudIPPlugin implements AdminCourseAction
         $template->set_attribute("plugin", $this);
         return $template;
     }
-}
\ No newline at end of file
+}
diff --git a/controllers/copy.php b/controllers/copy.php
index a3ece22..474a8d7 100755
--- a/controllers/copy.php
+++ b/controllers/copy.php
@@ -114,4 +114,4 @@ class CopyController extends PluginController
         }
         $this->redirect(URLHelper::getURL("dispatch.php/admin/courses/index"));
     }
-}
\ No newline at end of file
+}
diff --git a/views/copy/info.php b/views/copy/info.php
index af20d7e..1e31ee0 100755
--- a/views/copy/info.php
+++ b/views/copy/info.php
@@ -28,8 +28,12 @@
             <input type="checkbox" name="cycles" value="1" checked>
             <?= _("Regelmäßige Termine mit kopieren") ?>
         </label>
+        <label>
+            <input type="checkbox" name="lock_copied_courses" value="1">
+            <?= _('Kopierte Veranstaltungen sperren') ?>
+        </label>
     </fieldset>
     <div data-dialog-button>
         <?= \Studip\Button::create(_("Kopieren"), "copy", array('onclick' => "return window.confirm('"._("Wirklich kopieren?")."');")) ?>
     </div>
-</form>
\ No newline at end of file
+</form>
-- 
GitLab