aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/reports
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-09-06 13:43:51 +0500
committerAbyss777 <abyss@fox5.ru>2017-09-06 13:43:51 +0500
commitfe5e6f7e1aaa01dfe8d61af46c3b818f8c566a25 (patch)
tree778b00dd1a6162007cb08239d475884843a678ba /src/org/traccar/reports
parent3e5167131c758dd6e75e0f5d9b265a1514baac0c (diff)
downloadtraccar-server-fe5e6f7e1aaa01dfe8d61af46c3b818f8c566a25.tar.gz
traccar-server-fe5e6f7e1aaa01dfe8d61af46c3b818f8c566a25.tar.bz2
traccar-server-fe5e6f7e1aaa01dfe8d61af46c3b818f8c566a25.zip
Move units to attributes and add volume units
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());