aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/reports
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/reports')
-rw-r--r--src/org/traccar/reports/ReportUtils.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/org/traccar/reports/ReportUtils.java b/src/org/traccar/reports/ReportUtils.java
index 74cdaf9b5..5f718feac 100644
--- a/src/org/traccar/reports/ReportUtils.java
+++ b/src/org/traccar/reports/ReportUtils.java
@@ -62,15 +62,19 @@ public final class ReportUtils {
}
public static String getDistanceUnit(long userId) {
- return (String) Context.getPermissionsManager().lookupPreference(userId, "distanceUnit", "km");
+ return (String) Context.getPermissionsManager().lookupAttribute(userId, "distanceUnit", "km");
}
public static String getSpeedUnit(long userId) {
- return (String) Context.getPermissionsManager().lookupPreference(userId, "speedUnit", "kn");
+ return (String) Context.getPermissionsManager().lookupAttribute(userId, "speedUnit", "kn");
+ }
+
+ public static String getVolumeUnit(long userId) {
+ return (String) Context.getPermissionsManager().lookupAttribute(userId, "volumeUnit", "ltr");
}
public static TimeZone getTimezone(long userId) {
- String timezone = (String) Context.getPermissionsManager().lookupPreference(userId, "timezone", null);
+ String timezone = (String) Context.getPermissionsManager().lookupAttribute(userId, "timezone", null);
return timezone != null ? TimeZone.getTimeZone(timezone) : TimeZone.getDefault();
}
@@ -137,6 +141,7 @@ public final class ReportUtils {
org.jxls.common.Context jxlsContext = PoiTransformer.createInitialContext();
jxlsContext.putVar("distanceUnit", getDistanceUnit(userId));
jxlsContext.putVar("speedUnit", getSpeedUnit(userId));
+ jxlsContext.putVar("volumeUnit", getVolumeUnit(userId));
jxlsContext.putVar("webUrl", Context.getVelocityEngine().getProperty("web.url"));
jxlsContext.putVar("dateTool", new DateTool());
jxlsContext.putVar("numberTool", new NumberTool());