diff --git a/Audit trail.mpr b/Audit trail.mpr index 1e9aa31..3d8fde6 100644 Binary files a/Audit trail.mpr and b/Audit trail.mpr differ diff --git a/gradle.properties b/gradle.properties index ab81545..02e4fba 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -version=10.2.1 \ No newline at end of file +version=10.2.2 \ No newline at end of file diff --git a/javasource/audittrail/log/CreateLogObject.java b/javasource/audittrail/log/CreateLogObject.java index 0f53d24..187c48d 100644 --- a/javasource/audittrail/log/CreateLogObject.java +++ b/javasource/audittrail/log/CreateLogObject.java @@ -84,7 +84,6 @@ public static IMendixObject createAuditLogItems(final IMendixObject auditableObj + auditableObject.getId().toLong() + "), state: " + auditableObject.getState() + "/" + logType); final IContext sudoContext = context.createSudoClone(); - sudoContext.getSession().setTimeZone(getTimeZone(context)); final IMendixObject logObject = Core.instantiate(sudoContext, Log.getType()); IMendixIdentifier userObjectId = null; @@ -190,13 +189,6 @@ public static IMendixObject createAuditLogItems(final IMendixObject auditableObj } } - private static String getTimeZone(final IContext context) { - final TimeZone tz = context.getSession().getTimeZone(); - if (tz != null) return tz.getID(); - if (Constants.getServerTimeZone() == null || Constants.getServerTimeZone().isEmpty()) return "GMT"; - return Constants.getServerTimeZone(); - } - private static int createLogLines(final IMendixObject inputObject, final IMendixObject logObject, final IContext sudoContext, final IContext currentContext, final TypeOfLog logType, final String skipAssociation) throws CoreException { boolean isNew = false; @@ -476,19 +468,31 @@ private static String parseDate(final Date date, final IContext context) { List dateFormats = new LinkedList(); if (Constants.getLogServerTimeZoneDateNotation()) { - dateFormats.add(dateInZone(date, TimeZone.getTimeZone(Constants.getServerTimeZone()))); + dateFormats.add(dateInZone(date, Constants.getServerTimeZone())); } - if (Constants.getLogSessionTimeZoneDateNotation() && context.getSession() != null && context.getSession().getTimeZone() != null) { - dateFormats.add(dateInZone(date, context.getSession().getTimeZone())); + if (Constants.getLogSessionTimeZoneDateNotation()) { + dateFormats.add(dateInZone(date, getSessionTimeZone(context))); } return dateFormats.stream().collect(Collectors.joining(" / ")); } - private static String dateInZone(final Date date, final TimeZone zone) { + private static String getSessionTimeZone(final IContext context) { + if (context.getSession() != null && context.getSession().getTimeZone() != null) { + return context.getSession().getTimeZone().getID(); + } + + if (Constants.getServerTimeZone() != null && !Constants.getServerTimeZone().isEmpty()) { + return Constants.getServerTimeZone(); + } + + return "GMT"; + } + + private static String dateInZone(final Date date, final String zone) { final DateFormat dateFormat = new SimpleDateFormat(Constants.getLogLineDateFormat()); - dateFormat.setTimeZone(zone); - return dateFormat.format(date) + " (" + zone.getID() + ")"; + dateFormat.setTimeZone(TimeZone.getTimeZone(zone)); + return dateFormat.format(date) + " (" + zone + ")"; } } diff --git a/marketplace/release-notes/10.2.2.txt b/marketplace/release-notes/10.2.2.txt new file mode 100644 index 0000000..85792dc --- /dev/null +++ b/marketplace/release-notes/10.2.2.txt @@ -0,0 +1 @@ +We removed a deprecated method usage to make the module compatible with the 11.12 release of Studio Pro \ No newline at end of file