@@ -62,15 +62,19 @@ public static void checkPeriodLimit(Date from, Date to) {
62
62
}
63
63
64
64
public static String getDistanceUnit (long userId ) {
65
- return (String ) Context .getPermissionsManager ().lookupPreference (userId , "distanceUnit" , "km" );
65
+ return (String ) Context .getPermissionsManager ().lookupAttribute (userId , "distanceUnit" , "km" );
66
66
}
67
67
68
68
public static String getSpeedUnit (long userId ) {
69
- return (String ) Context .getPermissionsManager ().lookupPreference (userId , "speedUnit" , "kn" );
69
+ return (String ) Context .getPermissionsManager ().lookupAttribute (userId , "speedUnit" , "kn" );
70
+ }
71
+
72
+ public static String getVolumeUnit (long userId ) {
73
+ return (String ) Context .getPermissionsManager ().lookupAttribute (userId , "volumeUnit" , "ltr" );
70
74
}
71
75
72
76
public static TimeZone getTimezone (long userId ) {
73
- String timezone = (String ) Context .getPermissionsManager ().lookupPreference (userId , "timezone" , null );
77
+ String timezone = (String ) Context .getPermissionsManager ().lookupAttribute (userId , "timezone" , null );
74
78
return timezone != null ? TimeZone .getTimeZone (timezone ) : TimeZone .getDefault ();
75
79
}
76
80
@@ -137,6 +141,7 @@ public static org.jxls.common.Context initializeContext(long userId) {
137
141
org .jxls .common .Context jxlsContext = PoiTransformer .createInitialContext ();
138
142
jxlsContext .putVar ("distanceUnit" , getDistanceUnit (userId ));
139
143
jxlsContext .putVar ("speedUnit" , getSpeedUnit (userId ));
144
+ jxlsContext .putVar ("volumeUnit" , getVolumeUnit (userId ));
140
145
jxlsContext .putVar ("webUrl" , Context .getVelocityEngine ().getProperty ("web.url" ));
141
146
jxlsContext .putVar ("dateTool" , new DateTool ());
142
147
jxlsContext .putVar ("numberTool" , new NumberTool ());
0 commit comments