From b392a4af78e01c8e0f50aad5468e9583675b24be Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 6 Apr 2024 09:17:52 -0700 Subject: Move to the legacy folder --- web/app/view/edit/Attributes.js | 65 ------ web/app/view/edit/AttributesController.js | 124 ----------- web/app/view/edit/Calendars.js | 50 ----- web/app/view/edit/CalendarsController.js | 31 --- web/app/view/edit/ComputedAttributes.js | 80 ------- web/app/view/edit/ComputedAttributesController.js | 31 --- web/app/view/edit/Devices.js | 161 -------------- web/app/view/edit/DevicesController.js | 139 ------------ web/app/view/edit/Drivers.js | 54 ----- web/app/view/edit/DriversController.js | 31 --- web/app/view/edit/Geofences.js | 63 ------ web/app/view/edit/GeofencesController.js | 30 --- web/app/view/edit/Groups.js | 109 ---------- web/app/view/edit/GroupsController.js | 141 ------------- web/app/view/edit/Maintenances.js | 77 ------- web/app/view/edit/MaintenancesController.js | 31 --- web/app/view/edit/Notifications.js | 111 ---------- web/app/view/edit/NotificationsController.js | 31 --- web/app/view/edit/SavedCommands.js | 65 ------ web/app/view/edit/SavedCommandsController.js | 31 --- web/app/view/edit/Toolbar.js | 49 ----- web/app/view/edit/ToolbarController.js | 70 ------- web/app/view/edit/Users.js | 156 -------------- web/app/view/edit/UsersController.js | 244 ---------------------- 24 files changed, 1974 deletions(-) delete mode 100644 web/app/view/edit/Attributes.js delete mode 100644 web/app/view/edit/AttributesController.js delete mode 100644 web/app/view/edit/Calendars.js delete mode 100644 web/app/view/edit/CalendarsController.js delete mode 100644 web/app/view/edit/ComputedAttributes.js delete mode 100644 web/app/view/edit/ComputedAttributesController.js delete mode 100644 web/app/view/edit/Devices.js delete mode 100644 web/app/view/edit/DevicesController.js delete mode 100644 web/app/view/edit/Drivers.js delete mode 100644 web/app/view/edit/DriversController.js delete mode 100644 web/app/view/edit/Geofences.js delete mode 100644 web/app/view/edit/GeofencesController.js delete mode 100644 web/app/view/edit/Groups.js delete mode 100644 web/app/view/edit/GroupsController.js delete mode 100644 web/app/view/edit/Maintenances.js delete mode 100644 web/app/view/edit/MaintenancesController.js delete mode 100644 web/app/view/edit/Notifications.js delete mode 100644 web/app/view/edit/NotificationsController.js delete mode 100644 web/app/view/edit/SavedCommands.js delete mode 100644 web/app/view/edit/SavedCommandsController.js delete mode 100644 web/app/view/edit/Toolbar.js delete mode 100644 web/app/view/edit/ToolbarController.js delete mode 100644 web/app/view/edit/Users.js delete mode 100644 web/app/view/edit/UsersController.js (limited to 'web/app/view/edit') diff --git a/web/app/view/edit/Attributes.js b/web/app/view/edit/Attributes.js deleted file mode 100644 index af4f5a90..00000000 --- a/web/app/view/edit/Attributes.js +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2016 - 2017 Anton Tananaev (anton@traccar.org) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -Ext.define('Traccar.view.edit.Attributes', { - extend: 'Traccar.view.GridPanel', - xtype: 'attributesView', - - requires: [ - 'Traccar.view.edit.AttributesController', - 'Traccar.view.edit.Toolbar' - ], - - controller: 'attributes', - - tbar: { - xtype: 'editToolbar' - }, - - listeners: { - selectionchange: 'onSelectionChange' - }, - - columns: { - defaults: { - flex: 1, - minWidth: Traccar.Style.columnWidthNormal - }, - items: [{ - text: Strings.sharedName, - dataIndex: 'name', - filter: 'string', - renderer: function (value) { - var attribute; - if (this.attributesStore) { - attribute = Ext.getStore(this.attributesStore).getById(value); - } - return attribute && attribute.get('name') || value; - } - }, { - text: Strings.stateValue, - dataIndex: 'value', - renderer: function (value, metaData, record) { - var attribute; - if (this.attributesStore) { - attribute = Ext.getStore(this.attributesStore).getById(record.get('name')); - } - return Traccar.AttributeFormatter.renderAttribute(value, attribute); - } - }] - } -}); diff --git a/web/app/view/edit/AttributesController.js b/web/app/view/edit/AttributesController.js deleted file mode 100644 index 84ff6adf..00000000 --- a/web/app/view/edit/AttributesController.js +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright 2016 - 2017 Anton Tananaev (anton@traccar.org) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -Ext.define('Traccar.view.edit.AttributesController', { - extend: 'Traccar.view.edit.ToolbarController', - alias: 'controller.attributes', - - requires: [ - 'Traccar.view.dialog.Attribute', - 'Traccar.store.Attributes', - 'Traccar.model.Attribute' - ], - - removeTitle: Strings.stateName, - - init: function () { - var store, propertyName, i = 0, attributes; - store = Ext.create('Traccar.store.Attributes'); - store.setProxy(Ext.create('Ext.data.proxy.Memory')); - if (typeof this.getView().record.get('attributes') === 'undefined') { - this.getView().record.set('attributes', {}); - } - attributes = this.getView().record.get('attributes'); - for (propertyName in attributes) { - if (attributes.hasOwnProperty(propertyName)) { - store.add(Ext.create('Traccar.model.Attribute', { - priority: i++, - name: propertyName, - value: attributes[propertyName] - })); - } - } - store.addListener('add', function (store, records) { - var i, view; - view = this.getView(); - for (i = 0; i < records.length; i++) { - view.record.get('attributes')[records[i].get('name')] = records[i].get('value'); - } - view.record.dirty = true; - }, this); - store.addListener('update', function (store, record, operation) { - var view; - view = this.getView(); - if (operation === Ext.data.Model.EDIT) { - if (record.modified.name !== record.get('name')) { - delete view.record.get('attributes')[record.modified.name]; - } - view.record.get('attributes')[record.get('name')] = record.get('value'); - view.record.dirty = true; - } - }, this); - store.addListener('remove', function (store, records) { - var i, view; - view = this.getView(); - for (i = 0; i < records.length; i++) { - delete view.record.get('attributes')[records[i].get('name')]; - } - view.record.dirty = true; - }, this); - - this.getView().setStore(store); - if (this.getView().record instanceof Traccar.model.Device) { - this.getView().attributesStore = 'DeviceAttributes'; - } else if (this.getView().record instanceof Traccar.model.Geofence) { - this.getView().attributesStore = 'GeofenceAttributes'; - } else if (this.getView().record instanceof Traccar.model.Group) { - this.getView().attributesStore = 'GroupAttributes'; - } else if (this.getView().record instanceof Traccar.model.Server) { - this.getView().attributesStore = 'ServerAttributes'; - } else if (this.getView().record instanceof Traccar.model.User) { - this.getView().attributesStore = 'UserAttributes'; - } - }, - - comboConfig: { - xtype: 'combobox', - reference: 'nameComboField', - name: 'name', - fieldLabel: Strings.sharedName, - displayField: 'name', - valueField: 'key', - allowBlank: false, - queryMode: 'local', - listeners: { - change: 'onNameChange' - } - }, - - initDialog: function (record) { - var nameTextField, dialog = Ext.create('Traccar.view.dialog.Attribute'); - if (this.getView().attributesStore) { - this.comboConfig.store = this.getView().attributesStore; - nameTextField = dialog.lookupReference('nameTextField'); - dialog.down('form').insert(0, this.comboConfig); - dialog.down('form').remove(nameTextField); - } - dialog.down('form').loadRecord(record); - dialog.show(); - }, - - onAddClick: function () { - var objectInstance = Ext.create('Traccar.model.Attribute'); - objectInstance.store = this.getView().getStore(); - this.initDialog(objectInstance); - }, - - onEditClick: function () { - this.initDialog(this.getView().getSelectionModel().getSelection()[0]); - } -}); diff --git a/web/app/view/edit/Calendars.js b/web/app/view/edit/Calendars.js deleted file mode 100644 index 23f20e25..00000000 --- a/web/app/view/edit/Calendars.js +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2016 - 2017 Anton Tananaev (anton@traccar.org) - * Copyright 2016 - 2017 Andrey Kunitsyn (andrey@traccar.org) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -Ext.define('Traccar.view.edit.Calendars', { - extend: 'Traccar.view.GridPanel', - xtype: 'calendarsView', - - requires: [ - 'Traccar.view.edit.CalendarsController', - 'Traccar.view.edit.Toolbar' - ], - - controller: 'calendars', - store: 'Calendars', - - tbar: { - xtype: 'editToolbar' - }, - - listeners: { - selectionchange: 'onSelectionChange' - }, - - columns: { - defaults: { - flex: 1, - minWidth: Traccar.Style.columnWidthNormal - }, - items: [{ - text: Strings.sharedName, - dataIndex: 'name', - filter: 'string' - }] - } -}); diff --git a/web/app/view/edit/CalendarsController.js b/web/app/view/edit/CalendarsController.js deleted file mode 100644 index d11ec379..00000000 --- a/web/app/view/edit/CalendarsController.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2016 - 2017 Anton Tananaev (anton@traccar.org) - * Copyright 2016 - 2017 Andrey Kunitsyn (andrey@traccar.org) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -Ext.define('Traccar.view.edit.CalendarsController', { - extend: 'Traccar.view.edit.ToolbarController', - alias: 'controller.calendars', - - requires: [ - 'Traccar.view.dialog.Calendar', - 'Traccar.model.Calendar' - ], - - objectModel: 'Traccar.model.Calendar', - objectDialog: 'Traccar.view.dialog.Calendar', - removeTitle: Strings.sharedCalendar -}); diff --git a/web/app/view/edit/ComputedAttributes.js b/web/app/view/edit/ComputedAttributes.js deleted file mode 100644 index 9f0b9396..00000000 --- a/web/app/view/edit/ComputedAttributes.js +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2017 Anton Tananaev (anton@traccar.org) - * Copyright 2017 Andrey Kunitsyn (andrey@traccar.org) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -Ext.define('Traccar.view.edit.ComputedAttributes', { - extend: 'Traccar.view.GridPanel', - xtype: 'computedAttributesView', - - requires: [ - 'Traccar.view.edit.ComputedAttributesController', - 'Traccar.view.edit.Toolbar' - ], - - controller: 'computedAttributes', - store: 'ComputedAttributes', - - tbar: { - xtype: 'editToolbar' - }, - - listeners: { - selectionchange: 'onSelectionChange' - }, - - columns: { - defaults: { - flex: 1, - minWidth: Traccar.Style.columnWidthNormal - }, - items: [{ - text: Strings.sharedDescription, - dataIndex: 'description', - filter: 'string' - }, { - text: Strings.sharedAttribute, - dataIndex: 'attribute', - filter: { - type: 'list', - labelField: 'name', - store: 'PositionAttributes' - }, - renderer: function (value) { - return Ext.getStore('PositionAttributes').getAttributeName(value); - } - }, { - text: Strings.sharedExpression, - dataIndex: 'expression' - }, { - text: Strings.sharedType, - dataIndex: 'type', - filter: { - type: 'list', - labelField: 'name', - store: 'AttributeValueTypes' - }, - renderer: function (value) { - var type = Ext.getStore('AttributeValueTypes').getById(value); - if (type) { - return type.get('name'); - } else { - return value; - } - } - }] - } -}); diff --git a/web/app/view/edit/ComputedAttributesController.js b/web/app/view/edit/ComputedAttributesController.js deleted file mode 100644 index 6ae14102..00000000 --- a/web/app/view/edit/ComputedAttributesController.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2016 - 2017 Anton Tananaev (anton@traccar.org) - * Copyright 2016 - 2017 Andrey Kunitsyn (andrey@traccar.org) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -Ext.define('Traccar.view.edit.ComputedAttributesController', { - extend: 'Traccar.view.edit.ToolbarController', - alias: 'controller.computedAttributes', - - requires: [ - 'Traccar.view.dialog.ComputedAttribute', - 'Traccar.model.ComputedAttribute' - ], - - objectModel: 'Traccar.model.ComputedAttribute', - objectDialog: 'Traccar.view.dialog.ComputedAttribute', - removeTitle: Strings.sharedComputedAttribute -}); diff --git a/web/app/view/edit/Devices.js b/web/app/view/edit/Devices.js deleted file mode 100644 index 5f54202a..00000000 --- a/web/app/view/edit/Devices.js +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright 2015 - 2017 Anton Tananaev (anton@traccar.org) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -Ext.define('Traccar.view.edit.Devices', { - extend: 'Traccar.view.GridPanel', - xtype: 'devicesView', - - requires: [ - 'Traccar.AttributeFormatter', - 'Traccar.view.edit.DevicesController', - 'Traccar.view.ArrayListFilter', - 'Traccar.view.DeviceMenu' - ], - - controller: 'devices', - - store: 'VisibleDevices', - - stateful: true, - stateId: 'devices-grid', - - tbar: { - componentCls: 'toolbar-header-style', - defaults: { - xtype: 'button', - disabled: true, - tooltipType: 'title' - }, - items: [{ - xtype: 'tbtext', - html: Strings.deviceTitle, - baseCls: 'x-panel-header-title-default' - }, { - xtype: 'tbfill', - disabled: false - }, { - handler: 'onAddClick', - reference: 'toolbarAddButton', - glyph: 'xf067@FontAwesome', - tooltip: Strings.sharedAdd - }, { - handler: 'onEditClick', - reference: 'toolbarEditButton', - glyph: 'xf040@FontAwesome', - tooltip: Strings.sharedEdit - }, { - handler: 'onRemoveClick', - reference: 'toolbarRemoveButton', - glyph: 'xf00d@FontAwesome', - tooltip: Strings.sharedRemove - }, { - handler: 'onCommandClick', - reference: 'deviceCommandButton', - glyph: 'xf093@FontAwesome', - tooltip: Strings.deviceCommand - }, { - xtype: 'deviceMenu', - reference: 'toolbarDeviceMenu', - enableToggle: false - }] - }, - - listeners: { - selectionchange: 'onSelectionChange' - }, - - viewConfig: { - enableTextSelection: true, - getRowClass: function (record) { - var result = '', status = record.get('status'); - if (record.get('disabled')) { - result = 'view-item-disabled '; - } - if (status) { - result += Ext.getStore('DeviceStatuses').getById(status).get('color'); - } - return result; - } - }, - - columns: { - defaults: { - flex: 1, - minWidth: Traccar.Style.columnWidthNormal - }, - items: [{ - text: Strings.sharedName, - dataIndex: 'name', - filter: 'string' - }, { - text: Strings.deviceIdentifier, - dataIndex: 'uniqueId', - hidden: true, - filter: 'string' - }, { - text: Strings.sharedPhone, - dataIndex: 'phone', - hidden: true - }, { - text: Strings.deviceModel, - dataIndex: 'model', - hidden: true - }, { - text: Strings.deviceContact, - dataIndex: 'contact', - hidden: true - }, { - text: Strings.groupDialog, - dataIndex: 'groupId', - hidden: true, - filter: { - type: 'list', - labelField: 'name', - store: 'Groups' - }, - renderer: Traccar.AttributeFormatter.getFormatter('groupId') - }, { - text: Strings.sharedDisabled, - dataIndex: 'disabled', - renderer: Traccar.AttributeFormatter.getFormatter('disabled'), - hidden: true, - filter: 'boolean' - }, { - text: Strings.deviceStatus, - dataIndex: 'status', - filter: { - type: 'list', - labelField: 'name', - store: 'DeviceStatuses' - }, - renderer: function (value) { - var status; - if (value) { - status = Ext.getStore('DeviceStatuses').getById(value); - if (status) { - return status.get('name'); - } - } - return null; - } - }, { - text: Strings.deviceLastUpdate, - dataIndex: 'lastUpdate', - renderer: Traccar.AttributeFormatter.getFormatter('lastUpdate') - }] - } -}); diff --git a/web/app/view/edit/DevicesController.js b/web/app/view/edit/DevicesController.js deleted file mode 100644 index 16e54b21..00000000 --- a/web/app/view/edit/DevicesController.js +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright 2015 - 2017 Anton Tananaev (anton@traccar.org) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -Ext.define('Traccar.view.edit.DevicesController', { - extend: 'Traccar.view.edit.ToolbarController', - alias: 'controller.devices', - - requires: [ - 'Traccar.view.dialog.SendCommand', - 'Traccar.view.dialog.Device', - 'Traccar.view.permissions.Geofences', - 'Traccar.view.permissions.ComputedAttributes', - 'Traccar.view.permissions.Drivers', - 'Traccar.view.permissions.SavedCommands', - 'Traccar.view.BaseWindow', - 'Traccar.model.Device', - 'Traccar.model.Command' - ], - - config: { - listen: { - controller: { - '*': { - selectreport: 'deselectDevice', - selectevent: 'deselectDevice' - }, - 'root': { - selectdevice: 'selectDevice' - }, - 'map': { - selectdevice: 'selectDevice', - deselectfeature: 'deselectFeature' - } - }, - store: { - '#Devices': { - update: 'onUpdateDevice' - } - } - } - }, - - objectModel: 'Traccar.model.Device', - objectDialog: 'Traccar.view.dialog.Device', - removeTitle: Strings.sharedDevice, - - init: function () { - var self = this, readonly, deviceReadonly; - deviceReadonly = Traccar.app.getPreference('deviceReadonly', false) && !Traccar.app.getUser().get('administrator'); - readonly = Traccar.app.getPreference('readonly', false) && !Traccar.app.getUser().get('administrator'); - this.lookupReference('toolbarAddButton').setDisabled(readonly || deviceReadonly); - this.lookupReference('toolbarDeviceMenu').setHidden(readonly || deviceReadonly); - - setInterval(function () { - self.getView().getView().refresh(); - }, Traccar.Style.refreshPeriod); - }, - - onCommandClick: function () { - var device, deviceId, dialog, typesStore, commandsStore; - device = this.getView().getSelectionModel().getSelection()[0]; - deviceId = device.get('id'); - - dialog = Ext.create('Traccar.view.dialog.SendCommand'); - dialog.deviceId = deviceId; - - commandsStore = dialog.lookupReference('commandsComboBox').getStore(); - commandsStore.getProxy().setExtraParam('deviceId', deviceId); - if (!Traccar.app.getPreference('limitCommands', false)) { - commandsStore.add({ - id: 0, - description: Strings.sharedNew - }); - } - commandsStore.load({ - addRecords: true - }); - - typesStore = dialog.lookupReference('commandType').getStore(); - typesStore.getProxy().setExtraParam('deviceId', deviceId); - typesStore.load(); - - dialog.show(); - }, - - updateButtons: function (selected) { - var readonly, deviceReadonly, empty, deviceMenu; - deviceReadonly = Traccar.app.getPreference('deviceReadonly', false) && !Traccar.app.getUser().get('administrator'); - readonly = Traccar.app.getPreference('readonly', false) && !Traccar.app.getUser().get('administrator'); - empty = selected.length === 0; - this.lookupReference('toolbarEditButton').setDisabled(empty || readonly || deviceReadonly); - this.lookupReference('toolbarRemoveButton').setDisabled(empty || readonly || deviceReadonly); - deviceMenu = this.lookupReference('toolbarDeviceMenu'); - deviceMenu.device = empty ? null : selected[0]; - deviceMenu.setDisabled(empty); - this.lookupReference('deviceCommandButton').setDisabled(empty || readonly); - }, - - onSelectionChange: function (el, records) { - if (records && records.length) { - this.updateButtons(records); - this.fireEvent('selectdevice', records[0], true); - } - }, - - selectDevice: function (device) { - this.getView().getSelectionModel().select([device], false, true); - this.updateButtons(this.getView().getSelectionModel().getSelected().items); - this.getView().getView().focusRow(device); - }, - - deselectDevice: function (object) { - if (object) { - this.deselectFeature(); - } - }, - - onUpdateDevice: function () { - this.updateButtons(this.getView().getSelectionModel().getSelected().items); - }, - - deselectFeature: function () { - this.getView().getSelectionModel().deselectAll(); - } -}); diff --git a/web/app/view/edit/Drivers.js b/web/app/view/edit/Drivers.js deleted file mode 100644 index 7bd10a68..00000000 --- a/web/app/view/edit/Drivers.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2017 Anton Tananaev (anton@traccar.org) - * Copyright 2017 Andrey Kunitsyn (andrey@traccar.org) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -Ext.define('Traccar.view.edit.Drivers', { - extend: 'Traccar.view.GridPanel', - xtype: 'driversView', - - requires: [ - 'Traccar.view.edit.DriversController', - 'Traccar.view.edit.Toolbar' - ], - - controller: 'drivers', - store: 'Drivers', - - tbar: { - xtype: 'editToolbar' - }, - - listeners: { - selectionchange: 'onSelectionChange' - }, - - columns: { - defaults: { - flex: 1, - minWidth: Traccar.Style.columnWidthNormal - }, - items: [{ - text: Strings.sharedName, - dataIndex: 'name', - filter: 'string' - }, { - text: Strings.deviceIdentifier, - dataIndex: 'uniqueId', - filter: 'string' - }] - } -}); diff --git a/web/app/view/edit/DriversController.js b/web/app/view/edit/DriversController.js deleted file mode 100644 index 6c8a63cc..00000000 --- a/web/app/view/edit/DriversController.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2017 Anton Tananaev (anton@traccar.org) - * Copyright 2017 Andrey Kunitsyn (andrey@traccar.org) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -Ext.define('Traccar.view.edit.DriversController', { - extend: 'Traccar.view.edit.ToolbarController', - alias: 'controller.drivers', - - requires: [ - 'Traccar.view.dialog.Driver', - 'Traccar.model.Driver' - ], - - objectModel: 'Traccar.model.Driver', - objectDialog: 'Traccar.view.dialog.Driver', - removeTitle: Strings.sharedDriver -}); diff --git a/web/app/view/edit/Geofences.js b/web/app/view/edit/Geofences.js deleted file mode 100644 index 0e1e6773..00000000 --- a/web/app/view/edit/Geofences.js +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2016 - 2018 Anton Tananaev (anton@traccar.org) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -Ext.define('Traccar.view.edit.Geofences', { - extend: 'Traccar.view.GridPanel', - xtype: 'geofencesView', - - requires: [ - 'Traccar.view.edit.GeofencesController', - 'Traccar.view.edit.Toolbar' - ], - - controller: 'geofences', - store: 'Geofences', - - tbar: { - xtype: 'editToolbar' - }, - - listeners: { - selectionchange: 'onSelectionChange' - }, - - columns: { - defaults: { - flex: 1, - minWidth: Traccar.Style.columnWidthNormal - }, - items: [{ - text: Strings.sharedName, - dataIndex: 'name', - filter: 'string' - }, { - text: Strings.sharedDescription, - dataIndex: 'description', - filter: 'string' - }, { - text: Strings.sharedCalendar, - dataIndex: 'calendarId', - hidden: true, - filter: { - type: 'list', - labelField: 'name', - store: 'AllCalendars' - }, - renderer: Traccar.AttributeFormatter.getFormatter('calendarId') - }] - } -}); diff --git a/web/app/view/edit/GeofencesController.js b/web/app/view/edit/GeofencesController.js deleted file mode 100644 index 73d367ac..00000000 --- a/web/app/view/edit/GeofencesController.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2016 - 2017 Anton Tananaev (anton@traccar.org) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -Ext.define('Traccar.view.edit.GeofencesController', { - extend: 'Traccar.view.edit.ToolbarController', - alias: 'controller.geofences', - - requires: [ - 'Traccar.view.dialog.Geofence', - 'Traccar.model.Geofence' - ], - - objectModel: 'Traccar.model.Geofence', - objectDialog: 'Traccar.view.dialog.Geofence', - removeTitle: Strings.sharedGeofence -}); diff --git a/web/app/view/edit/Groups.js b/web/app/view/edit/Groups.js deleted file mode 100644 index 8b09316c..00000000 --- a/web/app/view/edit/Groups.js +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright 2016 - 2018 Anton Tananaev (anton@traccar.org) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -Ext.define('Traccar.view.edit.Groups', { - extend: 'Traccar.view.GridPanel', - xtype: 'groupsView', - - requires: [ - 'Traccar.AttributeFormatter', - 'Traccar.view.edit.GroupsController', - 'Traccar.view.edit.Toolbar' - ], - - controller: 'groups', - store: 'Groups', - - tbar: { - xtype: 'editToolbar', - items: [{ - xtype: 'button', - disabled: true, - handler: 'onGeofencesClick', - reference: 'toolbarGeofencesButton', - glyph: 'xf21d@FontAwesome', - tooltip: Strings.sharedGeofences, - tooltipType: 'title' - }, { - xtype: 'button', - disabled: true, - handler: 'onAttributesClick', - reference: 'toolbarAttributesButton', - glyph: 'xf0ae@FontAwesome', - tooltip: Strings.sharedComputedAttributes, - tooltipType: 'title' - }, { - xtype: 'button', - disabled: true, - handler: 'onDriversClick', - reference: 'toolbarDriversButton', - glyph: 'xf084@FontAwesome', - tooltip: Strings.sharedDrivers, - tooltipType: 'title' - }, { - xtype: 'button', - disabled: true, - handler: 'onCommandsClick', - reference: 'toolbarCommandsButton', - glyph: 'xf093@FontAwesome', - tooltip: Strings.sharedSavedCommands, - tooltipType: 'title' - }, { - xtype: 'button', - disabled: true, - handler: 'onNotificationsClick', - reference: 'toolbarNotificationsButton', - glyph: 'xf003@FontAwesome', - tooltip: Strings.sharedNotifications, - tooltipType: 'title' - }, { - xtype: 'button', - disabled: true, - handler: 'onMaintenancesClick', - reference: 'toolbarMaintenancesButton', - glyph: 'xf0ad@FontAwesome', - tooltip: Strings.sharedMaintenance, - tooltipType: 'title' - }] - }, - - listeners: { - selectionchange: 'onSelectionChange' - }, - - columns: { - defaults: { - flex: 1, - minWidth: Traccar.Style.columnWidthNormal - }, - items: [{ - text: Strings.sharedName, - dataIndex: 'name', - filter: 'string' - }, { - text: Strings.groupDialog, - dataIndex: 'groupId', - hidden: true, - filter: { - type: 'list', - labelField: 'name', - store: 'AllGroups' - }, - renderer: Traccar.AttributeFormatter.getFormatter('groupId') - }] - } -}); diff --git a/web/app/view/edit/GroupsController.js b/web/app/view/edit/GroupsController.js deleted file mode 100644 index ae96a248..00000000 --- a/web/app/view/edit/GroupsController.js +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright 2016 - 2018 Anton Tananaev (anton@traccar.org) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -Ext.define('Traccar.view.edit.GroupsController', { - extend: 'Traccar.view.edit.ToolbarController', - alias: 'controller.groups', - - requires: [ - 'Traccar.view.dialog.Group', - 'Traccar.view.permissions.Geofences', - 'Traccar.view.permissions.ComputedAttributes', - 'Traccar.view.permissions.Drivers', - 'Traccar.view.permissions.SavedCommands', - 'Traccar.view.permissions.Maintenances', - 'Traccar.view.BaseWindow', - 'Traccar.model.Group' - ], - - objectModel: 'Traccar.model.Group', - objectDialog: 'Traccar.view.dialog.Group', - removeTitle: Strings.groupDialog, - - init: function () { - this.lookupReference('toolbarDriversButton').setHidden( - Traccar.app.getVehicleFeaturesDisabled() || Traccar.app.getBooleanAttributePreference('ui.disableDrivers')); - this.lookupReference('toolbarAttributesButton').setHidden( - Traccar.app.getBooleanAttributePreference('ui.disableComputedAttributes')); - this.lookupReference('toolbarCommandsButton').setHidden(Traccar.app.getPreference('limitCommands', false)); - this.lookupReference('toolbarMaintenancesButton').setHidden( - Traccar.app.getVehicleFeaturesDisabled() || Traccar.app.getBooleanAttributePreference('ui.disableMaintenance')); - }, - - onGeofencesClick: function () { - var group = this.getView().getSelectionModel().getSelection()[0]; - Ext.create('Traccar.view.BaseWindow', { - title: Strings.sharedGeofences, - items: { - xtype: 'linkGeofencesView', - baseObjectName: 'groupId', - linkObjectName: 'geofenceId', - storeName: 'Geofences', - baseObject: group.getId() - } - }).show(); - }, - - onAttributesClick: function () { - var group = this.getView().getSelectionModel().getSelection()[0]; - Ext.create('Traccar.view.BaseWindow', { - title: Strings.sharedComputedAttributes, - items: { - xtype: 'linkComputedAttributesView', - baseObjectName: 'groupId', - linkObjectName: 'attributeId', - storeName: 'ComputedAttributes', - baseObject: group.getId() - } - }).show(); - }, - - onDriversClick: function () { - var group = this.getView().getSelectionModel().getSelection()[0]; - Ext.create('Traccar.view.BaseWindow', { - title: Strings.sharedDrivers, - items: { - xtype: 'linkDriversView', - baseObjectName: 'groupId', - linkObjectName: 'driverId', - storeName: 'Drivers', - baseObject: group.getId() - } - }).show(); - }, - - onCommandsClick: function () { - var group = this.getView().getSelectionModel().getSelection()[0]; - Ext.create('Traccar.view.BaseWindow', { - title: Strings.sharedSavedCommands, - items: { - xtype: 'linkSavedCommandsView', - baseObjectName: 'groupId', - linkObjectName: 'commandId', - storeName: 'Commands', - baseObject: group.getId() - } - }).show(); - }, - - onNotificationsClick: function () { - var group = this.getView().getSelectionModel().getSelection()[0]; - Ext.create('Traccar.view.BaseWindow', { - title: Strings.sharedNotifications, - items: { - xtype: 'linkNotificationsView', - baseObjectName: 'groupId', - linkObjectName: 'notificationId', - storeName: 'Notifications', - baseObject: group.getId() - } - }).show(); - }, - - onMaintenancesClick: function () { - var group = this.getView().getSelectionModel().getSelection()[0]; - Ext.create('Traccar.view.BaseWindow', { - title: Strings.sharedMaintenance, - items: { - xtype: 'linkMaintenancesView', - baseObjectName: 'groupId', - linkObjectName: 'maintenanceId', - storeName: 'Maintenances', - baseObject: group.getId() - } - }).show(); - }, - - onSelectionChange: function (selection, selected) { - var disabled = selected.length === 0; - this.lookupReference('toolbarGeofencesButton').setDisabled(disabled); - this.lookupReference('toolbarAttributesButton').setDisabled(disabled); - this.lookupReference('toolbarDriversButton').setDisabled(disabled); - this.lookupReference('toolbarCommandsButton').setDisabled(disabled); - this.lookupReference('toolbarNotificationsButton').setDisabled(disabled); - this.lookupReference('toolbarMaintenancesButton').setDisabled(disabled); - this.callParent(arguments); - } -}); diff --git a/web/app/view/edit/Maintenances.js b/web/app/view/edit/Maintenances.js deleted file mode 100644 index da129154..00000000 --- a/web/app/view/edit/Maintenances.js +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2018 Anton Tananaev (anton@traccar.org) - * Copyright 2018 Andrey Kunitsyn (andrey@traccar.org) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -Ext.define('Traccar.view.edit.Maintenances', { - extend: 'Traccar.view.GridPanel', - xtype: 'maintenancesView', - - requires: [ - 'Traccar.view.edit.MaintenancesController', - 'Traccar.view.edit.Toolbar' - ], - - controller: 'maintenances', - store: 'Maintenances', - - tbar: { - xtype: 'editToolbar' - }, - - listeners: { - selectionchange: 'onSelectionChange' - }, - - columns: { - defaults: { - flex: 1, - minWidth: Traccar.Style.columnWidthNormal - }, - items: [{ - text: Strings.sharedName, - dataIndex: 'name', - filter: 'string' - }, { - text: Strings.sharedType, - dataIndex: 'type', - filter: { - type: 'list', - idField: 'key', - labelField: 'name', - store: 'MaintenanceTypes' - }, - renderer: function (value) { - var attribute = Ext.getStore('MaintenanceTypes').getById(value); - return attribute && attribute.get('name') || value; - } - }, { - text: Strings.maintenanceStart, - dataIndex: 'start', - renderer: function (value, metaData, record) { - return Traccar.AttributeFormatter.renderAttribute( - value, Ext.getStore('MaintenanceTypes').getById(record.get('type'))); - } - }, { - text: Strings.maintenancePeriod, - dataIndex: 'period', - renderer: function (value, metaData, record) { - return Traccar.AttributeFormatter.renderAttribute( - value, Ext.getStore('MaintenanceTypes').getById(record.get('type'))); - } - }] - } -}); diff --git a/web/app/view/edit/MaintenancesController.js b/web/app/view/edit/MaintenancesController.js deleted file mode 100644 index 19762e61..00000000 --- a/web/app/view/edit/MaintenancesController.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2018 Anton Tananaev (anton@traccar.org) - * Copyright 2018 Andrey Kunitsyn (andrey@traccar.org) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -Ext.define('Traccar.view.edit.MaintenancesController', { - extend: 'Traccar.view.edit.ToolbarController', - alias: 'controller.maintenances', - - requires: [ - 'Traccar.view.dialog.Maintenance', - 'Traccar.model.Maintenance' - ], - - objectModel: 'Traccar.model.Maintenance', - objectDialog: 'Traccar.view.dialog.Maintenance', - removeTitle: Strings.sharedMaintenance -}); diff --git a/web/app/view/edit/Notifications.js b/web/app/view/edit/Notifications.js deleted file mode 100644 index 9cf97b19..00000000 --- a/web/app/view/edit/Notifications.js +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright 2017 - 2018 Anton Tananaev (anton@traccar.org) - * Copyright 2017 - 2018 Andrey Kunitsyn (andrey@traccar.org) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -Ext.define('Traccar.view.edit.Notifications', { - extend: 'Traccar.view.GridPanel', - xtype: 'notificationsView', - - requires: [ - 'Traccar.view.edit.NotificationsController', - 'Traccar.view.edit.Toolbar' - ], - - controller: 'notifications', - store: 'Notifications', - - tbar: { - xtype: 'editToolbar' - }, - - listeners: { - selectionchange: 'onSelectionChange' - }, - - columns: { - defaults: { - flex: 1, - minWidth: Traccar.Style.columnWidthNormal - }, - items: [{ - text: Strings.notificationType, - dataIndex: 'type', - flex: 2, - renderer: function (value) { - return Traccar.app.getEventString(value); - }, - filter: { - type: 'list', - idField: 'type', - labelField: 'name', - store: 'AllNotificationTypes' - } - }, { - text: Strings.notificationAlways, - dataIndex: 'always', - renderer: Traccar.AttributeFormatter.getFormatter('always'), - filter: 'boolean' - }, { - text: Strings.sharedAlarms, - dataIndex: 'attributes', - renderer: function (value) { - var i, key, result = '', alarms = value && value['alarms']; - if (alarms) { - alarms = alarms.split(','); - for (i = 0; i < alarms.length; i++) { - key = 'alarm' + alarms[i].charAt(0).toUpperCase() + alarms[i].slice(1); - if (result) { - result += ', '; - } - result += Strings[key] || key; - } - } - return result; - } - }, { - text: Strings.notificationNotificators, - dataIndex: 'notificators', - flex: 2, - filter: { - type: 'arraylist', - idField: 'type', - labelField: 'name', - store: 'AllNotificators' - }, - renderer: function (value) { - var result = '', i, notificators; - if (value) { - notificators = value.split(/[ ,]+/).filter(Boolean); - for (i = 0; i < notificators.length; i++) { - result += Traccar.app.getNotificatorString(notificators[i]) + (i < notificators.length - 1 ? ', ' : ''); - } - } - return result; - } - }, { - text: Strings.sharedCalendar, - dataIndex: 'calendarId', - hidden: true, - filter: { - type: 'list', - labelField: 'name', - store: 'AllCalendars' - }, - renderer: Traccar.AttributeFormatter.getFormatter('calendarId') - }] - } -}); diff --git a/web/app/view/edit/NotificationsController.js b/web/app/view/edit/NotificationsController.js deleted file mode 100644 index ad22a686..00000000 --- a/web/app/view/edit/NotificationsController.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2017 Anton Tananaev (anton@traccar.org) - * Copyright 2017 Andrey Kunitsyn (andrey@traccar.org) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -Ext.define('Traccar.view.edit.NotificationsController', { - extend: 'Traccar.view.edit.ToolbarController', - alias: 'controller.notifications', - - requires: [ - 'Traccar.view.dialog.Notification', - 'Traccar.model.Notification' - ], - - objectModel: 'Traccar.model.Notification', - objectDialog: 'Traccar.view.dialog.Notification', - removeTitle: Strings.sharedNotification -}); diff --git a/web/app/view/edit/SavedCommands.js b/web/app/view/edit/SavedCommands.js deleted file mode 100644 index 9e5f4869..00000000 --- a/web/app/view/edit/SavedCommands.js +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2017 Anton Tananaev (anton@traccar.org) - * Copyright 2017 Andrey Kunitsyn (andrey@traccar.org) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -Ext.define('Traccar.view.edit.SavedCommands', { - extend: 'Traccar.view.GridPanel', - xtype: 'savedCommandsView', - - requires: [ - 'Traccar.view.edit.SavedCommandsController', - 'Traccar.view.edit.Toolbar' - ], - - controller: 'savedCommands', - store: 'Commands', - - tbar: { - xtype: 'editToolbar' - }, - - listeners: { - selectionchange: 'onSelectionChange' - }, - - columns: { - defaults: { - flex: 1, - minWidth: Traccar.Style.columnWidthNormal - }, - items: [{ - text: Strings.sharedDescription, - dataIndex: 'description', - filter: 'string' - }, { - text: Strings.sharedType, - dataIndex: 'type', - filter: { - type: 'list', - idField: 'type', - labelField: 'name', - store: 'AllCommandTypes' - }, - renderer: Traccar.AttributeFormatter.getFormatter('commandType') - }, { - text: Strings.commandSendSms, - dataIndex: 'textChannel', - renderer: Traccar.AttributeFormatter.getFormatter('textChannel'), - filter: 'boolean' - }] - } -}); diff --git a/web/app/view/edit/SavedCommandsController.js b/web/app/view/edit/SavedCommandsController.js deleted file mode 100644 index 1511661e..00000000 --- a/web/app/view/edit/SavedCommandsController.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2017 Anton Tananaev (anton@traccar.org) - * Copyright 2017 Andrey Kunitsyn (andrey@traccar.org) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -Ext.define('Traccar.view.edit.SavedCommandsController', { - extend: 'Traccar.view.edit.ToolbarController', - alias: 'controller.savedCommands', - - requires: [ - 'Traccar.view.dialog.SavedCommand', - 'Traccar.model.Command' - ], - - objectModel: 'Traccar.model.Command', - objectDialog: 'Traccar.view.dialog.SavedCommand', - removeTitle: Strings.sharedSavedCommand -}); diff --git a/web/app/view/edit/Toolbar.js b/web/app/view/edit/Toolbar.js deleted file mode 100644 index 6999030b..00000000 --- a/web/app/view/edit/Toolbar.js +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2015 - 2017 Anton Tananaev (anton@traccar.org) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -Ext.define('Traccar.view.edit.Toolbar', { - extend: 'Ext.toolbar.Toolbar', - xtype: 'editToolbar', - - initComponent: function () { - this.callParent(arguments); - this.add(0, [{ - xtype: 'button', - handler: 'onAddClick', - reference: 'toolbarAddButton', - glyph: 'xf067@FontAwesome', - tooltip: Strings.sharedAdd, - tooltipType: 'title' - }, { - xtype: 'button', - disabled: true, - handler: 'onEditClick', - reference: 'toolbarEditButton', - glyph: 'xf040@FontAwesome', - tooltip: Strings.sharedEdit, - tooltipType: 'title' - }, { - xtype: 'button', - disabled: true, - handler: 'onRemoveClick', - reference: 'toolbarRemoveButton', - glyph: 'xf00d@FontAwesome', - tooltip: Strings.sharedRemove, - tooltipType: 'title' - }]); - } -}); diff --git a/web/app/view/edit/ToolbarController.js b/web/app/view/edit/ToolbarController.js deleted file mode 100644 index d3ca9de6..00000000 --- a/web/app/view/edit/ToolbarController.js +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2017 Anton Tananaev (anton@traccar.org) - * Copyright 2017 Andrey Kunitsyn (andrey@traccar.org) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -Ext.define('Traccar.view.edit.ToolbarController', { - extend: 'Ext.app.ViewController', - alias: 'controller.toolbarController', - - onAddClick: function () { - var dialog, objectInstance = Ext.create(this.objectModel); - objectInstance.store = this.getView().getStore(); - if (objectInstance.store instanceof Ext.data.ChainedStore) { - objectInstance.store = objectInstance.store.getSource(); - } - dialog = Ext.create(this.objectDialog); - dialog.down('form').loadRecord(objectInstance); - dialog.show(); - }, - - onEditClick: function () { - var dialog, objectInstance = this.getView().getSelectionModel().getSelection()[0]; - dialog = Ext.create(this.objectDialog); - dialog.down('form').loadRecord(objectInstance); - dialog.show(); - }, - - onRemoveClick: function () { - var objectInstance = this.getView().getSelectionModel().getSelection()[0]; - Ext.Msg.show({ - title: this.removeTitle, - message: Strings.sharedRemoveConfirm, - buttons: Ext.Msg.YESNO, - buttonText: { - yes: Strings.sharedRemove, - no: Strings.sharedCancel - }, - fn: function (btn) { - var store = objectInstance.store; - if (btn === 'yes') { - store.remove(objectInstance); - store.sync({ - failure: function (batch) { - store.rejectChanges(); - Traccar.app.showError(batch.exceptions[0].getError().response); - } - }); - } - } - }); - }, - - onSelectionChange: function (selection, selected) { - var disabled = selected.length === 0; - this.lookupReference('toolbarEditButton').setDisabled(disabled); - this.lookupReference('toolbarRemoveButton').setDisabled(disabled); - } -}); diff --git a/web/app/view/edit/Users.js b/web/app/view/edit/Users.js deleted file mode 100644 index 5d9a14f0..00000000 --- a/web/app/view/edit/Users.js +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright 2015 - 2018 Anton Tananaev (anton@traccar.org) - * Copyright 2016 - 2018 Andrey Kunitsyn (andrey@traccar.org) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -Ext.define('Traccar.view.edit.Users', { - extend: 'Traccar.view.GridPanel', - xtype: 'usersView', - - requires: [ - 'Traccar.view.edit.UsersController', - 'Traccar.view.edit.Toolbar' - ], - - controller: 'users', - store: 'Users', - - tbar: { - xtype: 'editToolbar', - scrollable: true, - items: [{ - disabled: true, - handler: 'onGeofencesClick', - reference: 'userGeofencesButton', - glyph: 'xf21d@FontAwesome', - tooltip: Strings.sharedGeofences, - tooltipType: 'title' - }, { - disabled: true, - handler: 'onDevicesClick', - reference: 'userDevicesButton', - glyph: 'xf248@FontAwesome', - tooltip: Strings.deviceTitle, - tooltipType: 'title' - }, { - disabled: true, - handler: 'onGroupsClick', - reference: 'userGroupsButton', - glyph: 'xf247@FontAwesome', - tooltip: Strings.settingsGroups, - tooltipType: 'title' - }, { - disabled: true, - handler: 'onUsersClick', - reference: 'userUsersButton', - glyph: 'xf0c0@FontAwesome', - tooltip: Strings.settingsUsers, - tooltipType: 'title' - }, { - disabled: true, - handler: 'onNotificationsClick', - reference: 'userNotificationsButton', - glyph: 'xf003@FontAwesome', - tooltip: Strings.sharedNotifications, - tooltipType: 'title' - }, { - disabled: true, - handler: 'onCalendarsClick', - reference: 'userCalendarsButton', - glyph: 'xf073@FontAwesome', - tooltip: Strings.sharedCalendars, - tooltipType: 'title' - }, { - disabled: true, - handler: 'onAttributesClick', - reference: 'userAttributesButton', - glyph: 'xf0ae@FontAwesome', - tooltip: Strings.sharedComputedAttributes, - tooltipType: 'title' - }, { - disabled: true, - handler: 'onDriversClick', - reference: 'userDriversButton', - glyph: 'xf084@FontAwesome', - tooltip: Strings.sharedDrivers, - tooltipType: 'title' - }, { - xtype: 'button', - disabled: true, - handler: 'onCommandsClick', - reference: 'userCommandsButton', - glyph: 'xf093@FontAwesome', - tooltip: Strings.sharedSavedCommands, - tooltipType: 'title' - }, { - xtype: 'button', - disabled: true, - handler: 'onMaintenancesClick', - reference: 'userMaintenancesButton', - glyph: 'xf0ad@FontAwesome', - tooltip: Strings.sharedMaintenance, - tooltipType: 'title' - }] - }, - - listeners: { - selectionchange: 'onSelectionChange' - }, - - columns: { - defaults: { - flex: 1, - minWidth: Traccar.Style.columnWidthNormal - }, - items: [{ - text: Strings.sharedName, - dataIndex: 'name', - filter: 'string' - }, { - text: Strings.userEmail, - dataIndex: 'email', - filter: 'string' - }, { - text: Strings.userAdmin, - dataIndex: 'administrator', - renderer: Traccar.AttributeFormatter.getFormatter('administrator'), - filter: 'boolean' - }, { - text: Strings.serverReadonly, - dataIndex: 'readonly', - hidden: true, - renderer: Traccar.AttributeFormatter.getFormatter('readonly'), - filter: 'boolean' - }, { - text: Strings.userDeviceReadonly, - dataIndex: 'deviceReadonly', - renderer: Traccar.AttributeFormatter.getFormatter('deviceReadonly'), - hidden: true, - filter: 'boolean' - }, { - text: Strings.sharedDisabled, - dataIndex: 'disabled', - renderer: Traccar.AttributeFormatter.getFormatter('disabled'), - filter: 'boolean' - }, { - text: Strings.userExpirationTime, - dataIndex: 'expirationTime', - hidden: true, - renderer: Traccar.AttributeFormatter.getFormatter('expirationTime'), - filter: 'date' - }] - } -}); diff --git a/web/app/view/edit/UsersController.js b/web/app/view/edit/UsersController.js deleted file mode 100644 index 9e810435..00000000 --- a/web/app/view/edit/UsersController.js +++ /dev/null @@ -1,244 +0,0 @@ -/* - * Copyright 2015 - 2017 Anton Tananaev (anton@traccar.org) - * Copyright 2016 - 2017 Andrey Kunitsyn (andrey@traccar.org) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -Ext.define('Traccar.view.edit.UsersController', { - extend: 'Traccar.view.edit.ToolbarController', - alias: 'controller.users', - - requires: [ - 'Traccar.view.dialog.User', - 'Traccar.view.permissions.Devices', - 'Traccar.view.permissions.Groups', - 'Traccar.view.permissions.Geofences', - 'Traccar.view.permissions.Calendars', - 'Traccar.view.permissions.Users', - 'Traccar.view.permissions.ComputedAttributes', - 'Traccar.view.permissions.Drivers', - 'Traccar.view.permissions.SavedCommands', - 'Traccar.view.permissions.Notifications', - 'Traccar.view.permissions.Maintenances', - 'Traccar.view.BaseWindow', - 'Traccar.model.User' - ], - - objectModel: 'Traccar.model.User', - objectDialog: 'Traccar.view.dialog.User', - removeTitle: Strings.settingsUser, - - init: function () { - Ext.getStore('Users').load(); - this.lookupReference('userUsersButton').setHidden(!Traccar.app.getUser().get('administrator')); - this.lookupReference('userDriversButton').setHidden( - Traccar.app.getVehicleFeaturesDisabled() || Traccar.app.getBooleanAttributePreference('ui.disableDrivers')); - this.lookupReference('userAttributesButton').setHidden( - Traccar.app.getBooleanAttributePreference('ui.disableComputedAttributes')); - this.lookupReference('userCalendarsButton').setHidden( - Traccar.app.getBooleanAttributePreference('ui.disableCalendars')); - this.lookupReference('userCommandsButton').setHidden(Traccar.app.getPreference('limitCommands', false)); - this.lookupReference('userMaintenancesButton').setHidden( - Traccar.app.getVehicleFeaturesDisabled() || Traccar.app.getBooleanAttributePreference('ui.disableMaintenance')); - }, - - onEditClick: function () { - var dialog, user = this.getView().getSelectionModel().getSelection()[0]; - dialog = Ext.create('Traccar.view.dialog.User', { - selfEdit: user.get('id') === Traccar.app.getUser().get('id') - }); - dialog.down('form').loadRecord(user); - dialog.show(); - }, - - onAddClick: function () { - var user, dialog; - user = Ext.create('Traccar.model.User'); - if (Traccar.app.getUser().get('administrator')) { - user.set('deviceLimit', -1); - } - if (Traccar.app.getUser().get('expirationTime')) { - user.set('expirationTime', Traccar.app.getUser().get('expirationTime')); - } - dialog = Ext.create('Traccar.view.dialog.User'); - dialog.down('form').loadRecord(user); - dialog.show(); - }, - - onDevicesClick: function () { - var user = this.getView().getSelectionModel().getSelection()[0]; - Ext.getStore('AllGroups').load(); - Ext.create('Traccar.view.BaseWindow', { - title: Strings.deviceTitle, - items: { - xtype: 'linkDevicesView', - baseObjectName: 'userId', - linkObjectName: 'deviceId', - storeName: 'AllDevices', - linkStoreName: 'Devices', - baseObject: user.getId() - } - }).show(); - }, - - onGroupsClick: function () { - var user = this.getView().getSelectionModel().getSelection()[0]; - Ext.create('Traccar.view.BaseWindow', { - title: Strings.settingsGroups, - items: { - xtype: 'linkGroupsView', - baseObjectName: 'userId', - linkObjectName: 'groupId', - storeName: 'AllGroups', - linkStoreName: 'Groups', - baseObject: user.getId() - } - }).show(); - }, - - onGeofencesClick: function () { - var user = this.getView().getSelectionModel().getSelection()[0]; - Ext.create('Traccar.view.BaseWindow', { - title: Strings.sharedGeofences, - items: { - xtype: 'linkGeofencesView', - baseObjectName: 'userId', - linkObjectName: 'geofenceId', - storeName: 'AllGeofences', - linkStoreName: 'Geofences', - baseObject: user.getId() - } - }).show(); - }, - - onNotificationsClick: function () { - var user = this.getView().getSelectionModel().getSelection()[0]; - Ext.create('Traccar.view.BaseWindow', { - title: Strings.sharedNotifications, - items: { - xtype: 'linkNotificationsView', - baseObjectName: 'userId', - linkObjectName: 'notificationId', - storeName: 'AllNotifications', - linkStoreName: 'Notifications', - baseObject: user.getId() - } - }).show(); - }, - - onCalendarsClick: function () { - var user = this.getView().getSelectionModel().getSelection()[0]; - Ext.create('Traccar.view.BaseWindow', { - title: Strings.sharedCalendars, - items: { - xtype: 'linkCalendarsView', - baseObjectName: 'userId', - linkObjectName: 'calendarId', - storeName: 'AllCalendars', - linkStoreName: 'Calendars', - baseObject: user.getId() - } - }).show(); - }, - - onUsersClick: function () { - var user = this.getView().getSelectionModel().getSelection()[0]; - Ext.create('Traccar.view.BaseWindow', { - title: Strings.settingsUsers, - items: { - xtype: 'linkUsersView', - baseObjectName: 'userId', - linkObjectName: 'managedUserId', - storeName: 'Users', - baseObject: user.getId() - } - }).show(); - }, - - onAttributesClick: function () { - var user = this.getView().getSelectionModel().getSelection()[0]; - Ext.create('Traccar.view.BaseWindow', { - title: Strings.sharedComputedAttributes, - items: { - xtype: 'linkComputedAttributesView', - baseObjectName: 'userId', - linkObjectName: 'attributeId', - storeName: 'AllComputedAttributes', - linkStoreName: 'ComputedAttributes', - baseObject: user.getId() - } - }).show(); - }, - - onDriversClick: function () { - var user = this.getView().getSelectionModel().getSelection()[0]; - Ext.create('Traccar.view.BaseWindow', { - title: Strings.sharedDrivers, - items: { - xtype: 'linkDriversView', - baseObjectName: 'userId', - linkObjectName: 'driverId', - storeName: 'AllDrivers', - linkStoreName: 'Drivers', - baseObject: user.getId() - } - }).show(); - }, - - onCommandsClick: function () { - var user = this.getView().getSelectionModel().getSelection()[0]; - Ext.create('Traccar.view.BaseWindow', { - title: Strings.sharedSavedCommands, - items: { - xtype: 'linkSavedCommandsView', - baseObjectName: 'userId', - linkObjectName: 'commandId', - storeName: 'AllCommands', - linkStoreName: 'Commands', - baseObject: user.getId() - } - }).show(); - }, - - onMaintenancesClick: function () { - var user = this.getView().getSelectionModel().getSelection()[0]; - Ext.create('Traccar.view.BaseWindow', { - title: Strings.sharedMaintenance, - items: { - xtype: 'linkMaintenancesView', - baseObjectName: 'userId', - linkObjectName: 'maintenanceId', - storeName: 'AllMaintenances', - linkStoreName: 'Maintenances', - baseObject: user.getId() - } - }).show(); - }, - - onSelectionChange: function (selection, selected) { - var disabled = selected.length === 0; - this.lookupReference('userDevicesButton').setDisabled(disabled); - this.lookupReference('userGroupsButton').setDisabled(disabled); - this.lookupReference('userGeofencesButton').setDisabled(disabled); - this.lookupReference('userNotificationsButton').setDisabled(disabled); - this.lookupReference('userCalendarsButton').setDisabled(disabled); - this.lookupReference('userAttributesButton').setDisabled(disabled); - this.lookupReference('userDriversButton').setDisabled(disabled); - this.lookupReference('userCommandsButton').setDisabled(disabled); - this.lookupReference('userMaintenancesButton').setDisabled(disabled); - this.lookupReference('userUsersButton').setDisabled(disabled || selected[0].get('userLimit') === 0); - this.callParent(arguments); - } -}); -- cgit v1.2.3