From 06b2790c1e640f20e21b766705c7c79e0a864775 Mon Sep 17 00:00:00 2001
From: Daniel Haag <daniel.haag@uibk.ac.at>
Date: Mon, 26 Aug 2019 11:00:41 +0200
Subject: [PATCH] openolat#50: as closing a course does not happen in the
 lifecycle page anymore, it does only make sense to show this link when the
 delete managed flag is not set

---
 .../course/run/CourseRuntimeController.java   | 20 ++++---------------
 1 file changed, 4 insertions(+), 16 deletions(-)

diff --git a/src/main/java/org/olat/course/run/CourseRuntimeController.java b/src/main/java/org/olat/course/run/CourseRuntimeController.java
index a9cc8f1ceae..0a599f0caf6 100644
--- a/src/main/java/org/olat/course/run/CourseRuntimeController.java
+++ b/src/main/java/org/olat/course/run/CourseRuntimeController.java
@@ -628,24 +628,12 @@ public class CourseRuntimeController extends RepositoryEntryRuntimeController im
 				settingsDropdown.addComponent(new Spacer("close-delete"));
 			}
 
-			if(!closeManged || !deleteManaged) {
-				// If a resource is closable (currently only course) and
-				// deletable (currently all resources) we offer those two
-				// actions in a separate page, unless both are managed
-				// operations. In that case we don't show anything at all.				
-				// If only one of the two actions are managed, we go to the
-				// separate page as well and show only the relevant action
-				// there.
+			if(!deleteManaged) {
+				// If a course is deletable we offer this
+				// action in a separate page, unless it is a managed operation.
+				// In that case we don't show anything at all.
 				lifeCycleChangeLink = LinkFactory.createToolLink("lifeCycleChange", translate("details.lifecycle.change"), this, "o_icon o_icon-fw o_icon_lifecycle");
 				settingsDropdown.addComponent(lifeCycleChangeLink);
-			} else {				
-				if(!deleteManaged) {
-					String type = translate(handler.getSupportedType());
-					String deleteTitle = translate("details.delete.alt", new String[]{ type });
-					deleteLink = LinkFactory.createToolLink("delete", deleteTitle, this, "o_icon o_icon-fw o_icon_delete_item");
-					deleteLink.setElementCssClass("o_sel_repo_close");
-					settingsDropdown.addComponent(deleteLink);
-				}
 			}
 		}
 	}
-- 
GitLab