summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java/org/openslx/dozmod/thrift
diff options
context:
space:
mode:
authorStephan Schwaer2015-10-08 17:47:28 +0200
committerStephan Schwaer2015-10-08 17:47:28 +0200
commitf95d4dadb306f050ab77730f85154e1bd5959498 (patch)
tree54d07ee64d5958dd37f96c46867e605faa285a85 /dozentenmodul/src/main/java/org/openslx/dozmod/thrift
parent[client] Fixed layout problems in transferPanel with long image names. (diff)
downloadtutor-module-f95d4dadb306f050ab77730f85154e1bd5959498.tar.gz
tutor-module-f95d4dadb306f050ab77730f85154e1bd5959498.tar.xz
tutor-module-f95d4dadb306f050ab77730f85154e1bd5959498.zip
[client] Show date of version to be deleted and fix to correctly check permissions when trying to delete.
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/thrift')
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/thrift/ThriftActions.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/ThriftActions.java b/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/ThriftActions.java
index 74d4a601..7f725857 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/ThriftActions.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/ThriftActions.java
@@ -745,14 +745,15 @@ public class ThriftActions {
*
* @param frame next parent frame of the caller of this method
* @param imageBaseId uuid of the image that belongs to the version
- * @param imageVersionId id of the image version to be deleted
+ * @param version id of the image version to be deleted
* @param callback called to inform the GUI about the deletion status (see
* DeleteCallback interface)
*/
- public static void deleteImageVersion(final Frame frame, final String imageVersionId,
+ public static void deleteImageVersion(final Frame frame, final ImageVersionDetails version,
final DeleteCallback callback) {
- if (imageVersionId == null || imageVersionId.isEmpty())
+ if (version == null || version.versionId == null || version.versionId.isEmpty())
return;
+ String versionId = version.versionId;
boolean success = false;
List<LectureSummary> lectureList = null;
try {
@@ -770,7 +771,7 @@ public class ThriftActions {
boolean matches = false;
if (lectureList != null && !lectureList.isEmpty()) {
for (LectureSummary lecture : lectureList) {
- if (imageVersionId.equals(lecture.getImageVersionId())) {
+ if (versionId.equals(lecture.getImageVersionId())) {
if (!matches)
questionText = "Diese Version ist zu folgende Veranstaltungen verknüpft:\n";
matches = true;
@@ -781,13 +782,13 @@ public class ThriftActions {
questionText += "\nWollen Sie diese Version samt Veranstaltungen löschen?\n";
}
if (!matches)
- questionText = "Wollen Sie diese Image-Version wirklich löschen?";
+ questionText = "Wollen Sie die Image-Version vom " + FormatHelper.shortDate(version.createTime) + " Uhr wirklich löschen?";
if (!userConfirmed(frame, questionText))
return;
try {
- ThriftManager.getSatClient().deleteImageVersion(Session.getSatelliteToken(), imageVersionId);
- LOGGER.info("Deleted version '" + imageVersionId + "'.");
+ ThriftManager.getSatClient().deleteImageVersion(Session.getSatelliteToken(), versionId);
+ LOGGER.info("Deleted version '" + versionId + "'.");
success = true;
} catch (TException e) {
ThriftError.showMessage(frame, LOGGER, e, "Fehler beim Löschen der Version");