From eea8e3cde73b7fe2640c6fe187ffb4d899381a60 Mon Sep 17 00:00:00 2001 From: Alexander Menk Date: Mon, 19 Dec 2016 14:53:16 +0100 Subject: #2702 [WIP] Implement SET_TIMEZONE for watch Protocol Problem: Positive time zone needs to be + prepended, custom formatter does not seem to be called --- web/app/view/CommandDialog.js | 14 ++++++++++++++ web/app/view/CommandDialogController.js | 10 ++++++++++ web/l10n/de.json | 1 + web/l10n/en.json | 1 + 4 files changed, 26 insertions(+) (limited to 'web') diff --git a/web/app/view/CommandDialog.js b/web/app/view/CommandDialog.js index af36f55..cb6fed2 100644 --- a/web/app/view/CommandDialog.js +++ b/web/app/view/CommandDialog.js @@ -89,6 +89,20 @@ Ext.define('Traccar.view.CommandDialog', { name: 'message', hidden: true }] + }, { + xtype: 'fieldcontainer', + reference: 'paramSetTimezone', + name: 'attributes', + hidden: true, + + items: [{ + xtype: 'numberfield', + fieldLabel: Strings.commandTimezoneOffset, + name: 'timezone', + minValue: -12, + step: 0.5, + maxValue: +14 + }] }, { xtype: 'textfield', reference: 'paramCustom', diff --git a/web/app/view/CommandDialogController.js b/web/app/view/CommandDialogController.js index 9442e4f..ca50361 100644 --- a/web/app/view/CommandDialogController.js +++ b/web/app/view/CommandDialogController.js @@ -28,6 +28,8 @@ Ext.define('Traccar.view.CommandDialogController', { selected.getValue() !== 'sendSms' && selected.getValue() !== 'sendUssd'); this.lookupReference('paramSmsMessage').setHidden( selected.getValue() !== 'sendSms'); + this.lookupReference('paramSetTimezone').setHidden( + selected.getValue() !== 'setTimezone'); this.lookupReference('paramCustom').setHidden( selected.getValue() !== 'custom'); }, @@ -78,6 +80,14 @@ Ext.define('Traccar.view.CommandDialogController', { }); } + if (record.get('type') === 'setTimezone') { + attributes = this.lookupReference('paramSetTimezone'); + value = attributes.down('numberfield[name="timezone"]').getValue(); + record.set('attributes', { + timezone: value + }); + } + if (record.get('type') === 'custom') { value = this.lookupReference('paramCustom').getValue(); record.set('attributes', { diff --git a/web/l10n/de.json b/web/l10n/de.json index 1379c39..e8c8671 100644 --- a/web/l10n/de.json +++ b/web/l10n/de.json @@ -144,6 +144,7 @@ "commandData": "Daten", "commandPhone": "Rufnummer", "commandMessage": "Nachricht", + "commandTimezoneOffset": "Zeitverschiebung zu UTC", "eventAll": "Alle Ereignisse", "eventDeviceOnline": "Gerät ist online", "eventDeviceOffline": "Gerät ist offline", diff --git a/web/l10n/en.json b/web/l10n/en.json index baff8b0..e7ff00b 100644 --- a/web/l10n/en.json +++ b/web/l10n/en.json @@ -144,6 +144,7 @@ "commandData": "Data", "commandPhone": "Phone Number", "commandMessage": "Message", + "commandTimezoneOffset": "Timezone Offset to UTC", "eventAll": "All Events", "eventDeviceOnline": "Device is online", "eventDeviceOffline": "Device is offline", -- cgit v1.2.3