From b05d7ad4d3d805fc3c622953a85333ade00a86f2 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 26 Feb 2018 02:01:48 +1300 Subject: Remove Traccar from templates --- templates/mail/test.vm | 2 +- templates/sms/test.vm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'templates') diff --git a/templates/mail/test.vm b/templates/mail/test.vm index 8c06f96a7..93cbdc549 100644 --- a/templates/mail/test.vm +++ b/templates/mail/test.vm @@ -1,4 +1,4 @@ -#set($subject = "Traccar test message") +#set($subject = "Test message") diff --git a/templates/sms/test.vm b/templates/sms/test.vm index 0311b6203..d25f218ce 100644 --- a/templates/sms/test.vm +++ b/templates/sms/test.vm @@ -1 +1 @@ -Traccar test message +Test message -- cgit v1.2.3 From f7a4d1977e71797b231ebb9a55308fee7c2b64d7 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Wed, 11 Apr 2018 14:55:11 +0500 Subject: Add support of multiple Maintenances --- schema/changelog-3.17.xml | 70 +++++++++++++++++++++ schema/changelog-master.xml | 1 + src/org/traccar/Context.java | 14 ++++- src/org/traccar/api/resource/EventResource.java | 4 ++ .../traccar/api/resource/MaintenanceResource.java | 36 +++++++++++ src/org/traccar/database/DataManager.java | 3 + src/org/traccar/database/MaintenancesManager.java | 27 ++++++++ src/org/traccar/database/NotificationManager.java | 6 +- src/org/traccar/database/PermissionsManager.java | 11 +++- .../traccar/events/MaintenanceEventHandler.java | 43 ++++++------- src/org/traccar/model/Event.java | 10 +++ src/org/traccar/model/Maintenance.java | 51 +++++++++++++++ src/org/traccar/notification/EventForwarder.java | 8 +++ .../notification/NotificationFormatter.java | 7 ++- src/org/traccar/reports/Events.java | 22 ++++++- templates/export/events.xlsx | Bin 12336 -> 8738 bytes templates/mail/maintenance.vm | 2 +- templates/sms/maintenance.vm | 2 +- 18 files changed, 281 insertions(+), 36 deletions(-) create mode 100644 schema/changelog-3.17.xml create mode 100644 src/org/traccar/api/resource/MaintenanceResource.java create mode 100644 src/org/traccar/database/MaintenancesManager.java create mode 100644 src/org/traccar/model/Maintenance.java (limited to 'templates') diff --git a/schema/changelog-3.17.xml b/schema/changelog-3.17.xml new file mode 100644 index 000000000..e0b7de10a --- /dev/null +++ b/schema/changelog-3.17.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/schema/changelog-master.xml b/schema/changelog-master.xml index 0c6941eed..3e7944238 100644 --- a/schema/changelog-master.xml +++ b/schema/changelog-master.xml @@ -17,4 +17,5 @@ + diff --git a/src/org/traccar/Context.java b/src/org/traccar/Context.java index 09e3c619b..a1a5f5a8e 100644 --- a/src/org/traccar/Context.java +++ b/src/org/traccar/Context.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2017 Anton Tananaev (anton@traccar.org) + * Copyright 2015 - 2018 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,6 +35,7 @@ import org.traccar.database.DeviceManager; import org.traccar.database.DriversManager; import org.traccar.database.IdentityManager; import org.traccar.database.LdapProvider; +import org.traccar.database.MaintenancesManager; import org.traccar.database.MediaManager; import org.traccar.database.NotificationManager; import org.traccar.database.PermissionsManager; @@ -64,6 +65,7 @@ import org.traccar.model.Device; import org.traccar.model.Driver; import org.traccar.model.Geofence; import org.traccar.model.Group; +import org.traccar.model.Maintenance; import org.traccar.model.Notification; import org.traccar.model.User; import org.traccar.geolocation.GoogleGeolocationProvider; @@ -232,6 +234,12 @@ public final class Context { return commandsManager; } + private static MaintenancesManager maintenancesManager; + + public static MaintenancesManager getMaintenancesManager() { + return maintenancesManager; + } + private static StatisticsManager statisticsManager; public static StatisticsManager getStatisticsManager() { @@ -385,6 +393,8 @@ public final class Context { commandsManager = new CommandsManager(dataManager); + maintenancesManager = new MaintenancesManager(dataManager); + statisticsManager = new StatisticsManager(); if (config.getBoolean("sms.smpp.enable")) { @@ -469,6 +479,8 @@ public final class Context { return (BaseObjectManager) driversManager; } else if (clazz.equals(Command.class)) { return (BaseObjectManager) commandsManager; + } else if (clazz.equals(Maintenance.class)) { + return (BaseObjectManager) maintenancesManager; } else if (clazz.equals(Notification.class)) { return (BaseObjectManager) notificationManager; } diff --git a/src/org/traccar/api/resource/EventResource.java b/src/org/traccar/api/resource/EventResource.java index a7cf9edbd..e0ccf7020 100644 --- a/src/org/traccar/api/resource/EventResource.java +++ b/src/org/traccar/api/resource/EventResource.java @@ -13,6 +13,7 @@ import org.traccar.Context; import org.traccar.api.BaseResource; import org.traccar.model.Event; import org.traccar.model.Geofence; +import org.traccar.model.Maintenance; @Path("events") @Produces(MediaType.APPLICATION_JSON) @@ -28,6 +29,9 @@ public class EventResource extends BaseResource { if (event.getGeofenceId() != 0) { Context.getPermissionsManager().checkPermission(Geofence.class, getUserId(), event.getGeofenceId()); } + if (event.getMaintenanceId() != 0) { + Context.getPermissionsManager().checkPermission(Maintenance.class, getUserId(), event.getMaintenanceId()); + } return event; } diff --git a/src/org/traccar/api/resource/MaintenanceResource.java b/src/org/traccar/api/resource/MaintenanceResource.java new file mode 100644 index 000000000..b3726b429 --- /dev/null +++ b/src/org/traccar/api/resource/MaintenanceResource.java @@ -0,0 +1,36 @@ +/* + * Copyright 2018 Anton Tananaev (anton@traccar.org) + * Copyright 2018 Andrey Kunitsyn (andrey@traccar.org) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.traccar.api.resource; + +import javax.ws.rs.Consumes; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; + +import org.traccar.api.ExtendedObjectResource; +import org.traccar.model.Maintenance; + +@Path("maintenances") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +public class MaintenanceResource extends ExtendedObjectResource { + + public MaintenanceResource() { + super(Maintenance.class); + } + +} diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java index a997a89f6..84f8f0394 100644 --- a/src/org/traccar/database/DataManager.java +++ b/src/org/traccar/database/DataManager.java @@ -48,6 +48,7 @@ import org.traccar.model.Driver; import org.traccar.model.Event; import org.traccar.model.Geofence; import org.traccar.model.Group; +import org.traccar.model.Maintenance; import org.traccar.model.ManagedUser; import org.traccar.model.Notification; import org.traccar.model.Permission; @@ -405,6 +406,8 @@ public class DataManager { return Calendar.class; case "command": return Command.class; + case "maintenance": + return Maintenance.class; case "notification": return Notification.class; default: diff --git a/src/org/traccar/database/MaintenancesManager.java b/src/org/traccar/database/MaintenancesManager.java new file mode 100644 index 000000000..4e266cb78 --- /dev/null +++ b/src/org/traccar/database/MaintenancesManager.java @@ -0,0 +1,27 @@ +/* + * Copyright 2018 Anton Tananaev (anton@traccar.org) + * Copyright 2018 Andrey Kunitsyn (andrey@traccar.org) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.traccar.database; + +import org.traccar.model.Maintenance; + +public class MaintenancesManager extends ExtendedObjectManager { + + public MaintenancesManager(DataManager dataManager) { + super(dataManager, Maintenance.class); + } + +} diff --git a/src/org/traccar/database/NotificationManager.java b/src/org/traccar/database/NotificationManager.java index 1c59a8666..9f2606f7f 100644 --- a/src/org/traccar/database/NotificationManager.java +++ b/src/org/traccar/database/NotificationManager.java @@ -78,8 +78,10 @@ public class NotificationManager extends ExtendedObjectManager { usersToForward = new HashSet<>(); } for (long userId : users) { - if (event.getGeofenceId() == 0 || Context.getGeofenceManager() != null - && Context.getGeofenceManager().checkItemPermission(userId, event.getGeofenceId())) { + if ((event.getGeofenceId() == 0 || Context.getGeofenceManager() != null + && Context.getGeofenceManager().checkItemPermission(userId, event.getGeofenceId())) + && (event.getMaintenanceId() == 0 + || Context.getMaintenancesManager().checkItemPermission(userId, event.getMaintenanceId()))) { if (usersToForward != null) { usersToForward.add(userId); } diff --git a/src/org/traccar/database/PermissionsManager.java b/src/org/traccar/database/PermissionsManager.java index 3ae5961ce..b5f062d2b 100644 --- a/src/org/traccar/database/PermissionsManager.java +++ b/src/org/traccar/database/PermissionsManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2017 Anton Tananaev (anton@traccar.org) + * Copyright 2015 - 2018 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ import org.traccar.model.Device; import org.traccar.model.Driver; import org.traccar.model.Geofence; import org.traccar.model.Group; +import org.traccar.model.Maintenance; import org.traccar.model.ManagedUser; import org.traccar.model.Notification; import org.traccar.model.Permission; @@ -337,6 +338,8 @@ public class PermissionsManager { manager = Context.getCalendarManager(); } else if (object.equals(Command.class)) { manager = Context.getCommandsManager(); + } else if (object.equals(Maintenance.class)) { + manager = Context.getMaintenancesManager(); } else if (object.equals(Notification.class)) { manager = Context.getNotificationManager(); } else { @@ -362,6 +365,7 @@ public class PermissionsManager { Context.getDriversManager().refreshUserItems(); Context.getAttributesManager().refreshUserItems(); Context.getCommandsManager().refreshUserItems(); + Context.getMaintenancesManager().refreshUserItems(); if (Context.getNotificationManager() != null) { Context.getNotificationManager().refreshUserItems(); } @@ -374,6 +378,7 @@ public class PermissionsManager { Context.getDriversManager().refreshExtendedPermissions(); Context.getAttributesManager().refreshExtendedPermissions(); Context.getCommandsManager().refreshExtendedPermissions(); + Context.getMaintenancesManager().refreshExtendedPermissions(); } public void refreshPermissions(Permission permission) { @@ -394,6 +399,8 @@ public class PermissionsManager { Context.getCalendarManager().refreshUserItems(); } else if (permission.getPropertyClass().equals(Command.class)) { Context.getCommandsManager().refreshUserItems(); + } else if (permission.getPropertyClass().equals(Maintenance.class)) { + Context.getMaintenancesManager().refreshUserItems(); } else if (permission.getPropertyClass().equals(Notification.class) && Context.getNotificationManager() != null) { Context.getNotificationManager().refreshUserItems(); @@ -407,6 +414,8 @@ public class PermissionsManager { Context.getAttributesManager().refreshExtendedPermissions(); } else if (permission.getPropertyClass().equals(Command.class)) { Context.getCommandsManager().refreshExtendedPermissions(); + } else if (permission.getPropertyClass().equals(Maintenance.class)) { + Context.getMaintenancesManager().refreshExtendedPermissions(); } else if (permission.getPropertyClass().equals(Notification.class) && Context.getNotificationManager() != null) { Context.getNotificationManager().refreshExtendedPermissions(); diff --git a/src/org/traccar/events/MaintenanceEventHandler.java b/src/org/traccar/events/MaintenanceEventHandler.java index 86abf7c17..001b414c0 100644 --- a/src/org/traccar/events/MaintenanceEventHandler.java +++ b/src/org/traccar/events/MaintenanceEventHandler.java @@ -1,6 +1,6 @@ /* - * Copyright 2016 Anton Tananaev (anton@traccar.org) - * Copyright 2016 Andrey Kunitsyn (andrey@traccar.org) + * Copyright 2016 - 2018 Anton Tananaev (anton@traccar.org) + * Copyright 2016 - 2018 Andrey Kunitsyn (andrey@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,35 +16,24 @@ */ package org.traccar.events; -import java.util.Collections; +import java.util.HashMap; import java.util.Map; import org.traccar.BaseEventHandler; import org.traccar.Context; -import org.traccar.model.Device; import org.traccar.model.Event; +import org.traccar.model.Maintenance; import org.traccar.model.Position; public class MaintenanceEventHandler extends BaseEventHandler { - public static final String ATTRIBUTE_MAINTENANCE_START = "maintenance.start"; - public static final String ATTRIBUTE_MAINTENANCE_INTERVAL = "maintenance.interval"; - @Override protected Map analyzePosition(Position position) { - Device device = Context.getIdentityManager().getById(position.getDeviceId()); - if (device == null || !Context.getIdentityManager().isLatestPosition(position)) { + if (Context.getIdentityManager().getById(position.getDeviceId()) == null + || !Context.getIdentityManager().isLatestPosition(position)) { return null; } - double maintenanceInterval = Context.getDeviceManager() - .lookupAttributeDouble(device.getId(), ATTRIBUTE_MAINTENANCE_INTERVAL, 0, false); - if (maintenanceInterval == 0) { - return null; - } - double maintenanceStart = Context.getDeviceManager() - .lookupAttributeDouble(device.getId(), ATTRIBUTE_MAINTENANCE_START, 0, false); - double oldTotalDistance = 0.0; double newTotalDistance = 0.0; @@ -54,16 +43,20 @@ public class MaintenanceEventHandler extends BaseEventHandler { } newTotalDistance = position.getDouble(Position.KEY_TOTAL_DISTANCE); - oldTotalDistance -= maintenanceStart; - newTotalDistance -= maintenanceStart; - - if ((long) (oldTotalDistance / maintenanceInterval) < (long) (newTotalDistance / maintenanceInterval)) { - Event event = new Event(Event.TYPE_MAINTENANCE, position.getDeviceId(), position.getId()); - event.set(Position.KEY_TOTAL_DISTANCE, newTotalDistance); - return Collections.singletonMap(event, position); + Map events = new HashMap<>(); + for (long maintenanceId : Context.getMaintenancesManager().getAllDeviceItems(position.getDeviceId())) { + Maintenance maintenance = Context.getMaintenancesManager().getById(maintenanceId); + if (maintenance.getLapse() != 0 + && (long) ((oldTotalDistance - maintenance.getStart()) / maintenance.getLapse()) + < (long) ((newTotalDistance - maintenance.getStart()) / maintenance.getLapse())) { + Event event = new Event(Event.TYPE_MAINTENANCE, position.getDeviceId(), position.getId()); + event.setMaintenanceId(maintenanceId); + event.set(Position.KEY_TOTAL_DISTANCE, newTotalDistance); + events.put(event, position); + } } - return null; + return events; } } diff --git a/src/org/traccar/model/Event.java b/src/org/traccar/model/Event.java index 465afeb35..ee7fcc679 100644 --- a/src/org/traccar/model/Event.java +++ b/src/org/traccar/model/Event.java @@ -91,4 +91,14 @@ public class Event extends Message { this.geofenceId = geofenceId; } + private long maintenanceId = 0; + + public long getMaintenanceId() { + return maintenanceId; + } + + public void setMaintenanceId(long maintenanceId) { + this.maintenanceId = maintenanceId; + } + } diff --git a/src/org/traccar/model/Maintenance.java b/src/org/traccar/model/Maintenance.java new file mode 100644 index 000000000..827fd3b85 --- /dev/null +++ b/src/org/traccar/model/Maintenance.java @@ -0,0 +1,51 @@ +/* + * Copyright 2018 Anton Tananaev (anton@traccar.org) + * Copyright 2018 Andrey Kunitsyn (andrey@traccar.org) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.traccar.model; + +public class Maintenance extends ExtendedModel { + + private String name; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + private double start; + + public double getStart() { + return start; + } + + public void setStart(double start) { + this.start = start; + } + + private double lapse; + + public double getLapse() { + return lapse; + } + + public void setLapse(double lapse) { + this.lapse = lapse; + } + +} diff --git a/src/org/traccar/notification/EventForwarder.java b/src/org/traccar/notification/EventForwarder.java index b13f8fe43..9d2181e21 100644 --- a/src/org/traccar/notification/EventForwarder.java +++ b/src/org/traccar/notification/EventForwarder.java @@ -25,6 +25,7 @@ import org.traccar.helper.Log; import org.traccar.model.Device; import org.traccar.model.Event; import org.traccar.model.Geofence; +import org.traccar.model.Maintenance; import org.traccar.model.Position; import java.nio.charset.StandardCharsets; @@ -48,6 +49,7 @@ public abstract class EventForwarder { private static final String KEY_EVENT = "event"; private static final String KEY_GEOFENCE = "geofence"; private static final String KEY_DEVICE = "device"; + private static final String KEY_MAINTENANCE = "maintenance"; private static final String KEY_USERS = "users"; public final void forwardEvent(Event event, Position position, Set users) { @@ -98,6 +100,12 @@ public abstract class EventForwarder { data.put(KEY_GEOFENCE, geofence); } } + if (event.getMaintenanceId() != 0) { + Maintenance maintenance = Context.getMaintenancesManager().getById(event.getMaintenanceId()); + if (maintenance != null) { + data.put(KEY_MAINTENANCE, maintenance); + } + } data.put(KEY_USERS, Context.getUsersManager().getItems(users)); try { return Context.getObjectMapper().writeValueAsString(data); diff --git a/src/org/traccar/notification/NotificationFormatter.java b/src/org/traccar/notification/NotificationFormatter.java index 114825a83..524153721 100644 --- a/src/org/traccar/notification/NotificationFormatter.java +++ b/src/org/traccar/notification/NotificationFormatter.java @@ -1,6 +1,6 @@ /* - * Copyright 2016 - 2017 Anton Tananaev (anton@traccar.org) - * Copyright 2017 Andrey Kunitsyn (andrey@traccar.org) + * Copyright 2016 - 2018 Anton Tananaev (anton@traccar.org) + * Copyright 2017 - 2018 Andrey Kunitsyn (andrey@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -57,6 +57,9 @@ public final class NotificationFormatter { if (event.getGeofenceId() != 0) { velocityContext.put("geofence", Context.getGeofenceManager().getById(event.getGeofenceId())); } + if (event.getMaintenanceId() != 0) { + velocityContext.put("maintenance", Context.getMaintenancesManager().getById(event.getMaintenanceId())); + } String driverUniqueId = event.getString(Position.KEY_DRIVER_UNIQUE_ID); if (driverUniqueId != null) { velocityContext.put("driver", Context.getDriversManager().getDriverByUniqueId(driverUniqueId)); diff --git a/src/org/traccar/reports/Events.java b/src/org/traccar/reports/Events.java index 7cb6ef6eb..66d9e708d 100644 --- a/src/org/traccar/reports/Events.java +++ b/src/org/traccar/reports/Events.java @@ -1,6 +1,6 @@ /* - * Copyright 2016 Anton Tananaev (anton@traccar.org) - * Copyright 2016 Andrey Kunitsyn (andrey@traccar.org) + * Copyright 2016 - 2018 Anton Tananaev (anton@traccar.org) + * Copyright 2016 - 2018 Andrey Kunitsyn (andrey@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,6 +33,7 @@ import org.traccar.model.Device; import org.traccar.model.Event; import org.traccar.model.Geofence; import org.traccar.model.Group; +import org.traccar.model.Maintenance; import org.traccar.reports.model.DeviceReport; public final class Events { @@ -51,7 +52,10 @@ public final class Events { for (Event event : events) { if (all || types.contains(event.getType())) { long geofenceId = event.getGeofenceId(); - if (geofenceId == 0 || Context.getGeofenceManager().checkItemPermission(userId, geofenceId)) { + long maintenanceId = event.getMaintenanceId(); + if ((geofenceId == 0 || Context.getGeofenceManager().checkItemPermission(userId, geofenceId)) + && (maintenanceId == 0 + || Context.getMaintenancesManager().checkItemPermission(userId, maintenanceId))) { result.add(event); } } @@ -67,6 +71,7 @@ public final class Events { ArrayList devicesEvents = new ArrayList<>(); ArrayList sheetNames = new ArrayList<>(); HashMap geofenceNames = new HashMap<>(); + HashMap maintenanceNames = new HashMap<>(); for (long deviceId: ReportUtils.getDeviceList(deviceIds, groupIds)) { Context.getPermissionsManager().checkDevice(userId, deviceId); Collection events = Context.getDataManager().getEvents(deviceId, from, to); @@ -75,6 +80,7 @@ public final class Events { Event event = iterator.next(); if (all || types.contains(event.getType())) { long geofenceId = event.getGeofenceId(); + long maintenanceId = event.getMaintenanceId(); if (geofenceId != 0) { if (Context.getGeofenceManager().checkItemPermission(userId, geofenceId)) { Geofence geofence = Context.getGeofenceManager().getById(geofenceId); @@ -84,6 +90,15 @@ public final class Events { } else { iterator.remove(); } + } else if (maintenanceId != 0) { + if (Context.getMaintenancesManager().checkItemPermission(userId, maintenanceId)) { + Maintenance maintenance = Context.getMaintenancesManager().getById(maintenanceId); + if (maintenance != null) { + maintenanceNames.put(maintenanceId, maintenance.getName()); + } + } else { + iterator.remove(); + } } } else { iterator.remove(); @@ -109,6 +124,7 @@ public final class Events { jxlsContext.putVar("devices", devicesEvents); jxlsContext.putVar("sheetNames", sheetNames); jxlsContext.putVar("geofenceNames", geofenceNames); + jxlsContext.putVar("maintenanceNames", maintenanceNames); jxlsContext.putVar("from", from); jxlsContext.putVar("to", to); ReportUtils.processTemplateWithSheets(inputStream, outputStream, jxlsContext); diff --git a/templates/export/events.xlsx b/templates/export/events.xlsx index f3151d11c..5c5633f3a 100644 Binary files a/templates/export/events.xlsx and b/templates/export/events.xlsx differ diff --git a/templates/mail/maintenance.vm b/templates/mail/maintenance.vm index 7f69b6c0d..c6973f97a 100644 --- a/templates/mail/maintenance.vm +++ b/templates/mail/maintenance.vm @@ -3,7 +3,7 @@ Device: $device.name
-Maintenance is required
+Maintenance is required: $maintenance.name
Time: $dateTool.format("YYYY-MM-dd HH:mm:ss", $event.serverTime, $locale, $timezone)
Point: #{if}($position.address)$position.address#{else}$position.latitude°, $position.longitude°#{end}
diff --git a/templates/sms/maintenance.vm b/templates/sms/maintenance.vm index 554b74400..621beae46 100644 --- a/templates/sms/maintenance.vm +++ b/templates/sms/maintenance.vm @@ -1 +1 @@ -$device.name maintenance is required at $dateTool.format("YYYY-MM-dd HH:mm:ss", $event.serverTime, $locale, $timezone) +$device.name maintenance $maintenance.name is required at $dateTool.format("YYYY-MM-dd HH:mm:ss", $event.serverTime, $locale, $timezone) -- cgit v1.2.3