aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/reports/ReportUtils.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-03-14 09:11:11 +0500
committerAbyss777 <abyss@fox5.ru>2017-03-14 09:11:11 +0500
commit632e6ad06c435ca8d044e5ae3209cde36cf42743 (patch)
tree959a7791c6c436f1a8452de9adf0b3d5e0d36dcf /src/org/traccar/reports/ReportUtils.java
parent2309d53f52f25efe00f2195a58c448506a2605ab (diff)
downloadtrackermap-server-632e6ad06c435ca8d044e5ae3209cde36cf42743.tar.gz
trackermap-server-632e6ad06c435ca8d044e5ae3209cde36cf42743.tar.bz2
trackermap-server-632e6ad06c435ca8d044e5ae3209cde36cf42743.zip
- Use ternary operator
- Apply server.forceSettings to speed units, distance units and timezone - Use hyphens for date formatting
Diffstat (limited to 'src/org/traccar/reports/ReportUtils.java')
-rw-r--r--src/org/traccar/reports/ReportUtils.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/org/traccar/reports/ReportUtils.java b/src/org/traccar/reports/ReportUtils.java
index 968fb357b..3699b1bea 100644
--- a/src/org/traccar/reports/ReportUtils.java
+++ b/src/org/traccar/reports/ReportUtils.java
@@ -33,7 +33,7 @@ public final class ReportUtils {
public static String getDistanceUnit(long userId) {
String unit = Context.getPermissionsManager().getUser(userId).getDistanceUnit();
- if (unit == null) {
+ if (unit == null || Context.getPermissionsManager().getServer().getForceSettings()) {
unit = Context.getPermissionsManager().getServer().getDistanceUnit();
}
return unit != null ? unit : "km";
@@ -41,7 +41,7 @@ public final class ReportUtils {
public static String getSpeedUnit(long userId) {
String unit = Context.getPermissionsManager().getUser(userId).getSpeedUnit();
- if (unit == null) {
+ if (unit == null || Context.getPermissionsManager().getServer().getForceSettings()) {
unit = Context.getPermissionsManager().getServer().getSpeedUnit();
}
return unit != null ? unit : "kn";
@@ -49,7 +49,7 @@ public final class ReportUtils {
public static TimeZone getTimezone(long userId) {
String timezone = Context.getPermissionsManager().getUser(userId).getTimezone();
- if (timezone == null) {
+ if (timezone == null || Context.getPermissionsManager().getServer().getForceSettings()) {
timezone = Context.getPermissionsManager().getServer().getTimezone();
}
return timezone != null ? TimeZone.getTimeZone(timezone) : TimeZone.getDefault();