aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/permissions
diff options
context:
space:
mode:
Diffstat (limited to 'web/app/view/permissions')
-rw-r--r--web/app/view/permissions/Geofences.js14
-rw-r--r--web/app/view/permissions/Maintenances.js65
-rw-r--r--web/app/view/permissions/Notifications.js49
3 files changed, 108 insertions, 20 deletions
diff --git a/web/app/view/permissions/Geofences.js b/web/app/view/permissions/Geofences.js
index efdf18da..e2e85a36 100644
--- a/web/app/view/permissions/Geofences.js
+++ b/web/app/view/permissions/Geofences.js
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 - 2017 Anton Tananaev (anton@traccar.org)
+ * 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
@@ -26,6 +26,18 @@ Ext.define('Traccar.view.permissions.Geofences', {
flex: 1,
minWidth: Traccar.Style.columnWidthNormal,
filter: 'string'
+ }, {
+ text: Strings.sharedCalendar,
+ dataIndex: 'calendarId',
+ flex: 1,
+ minWidth: Traccar.Style.columnWidthNormal,
+ hidden: true,
+ filter: {
+ type: 'list',
+ labelField: 'name',
+ store: 'AllCalendars'
+ },
+ renderer: Traccar.AttributeFormatter.getFormatter('calendarId')
}]
}
});
diff --git a/web/app/view/permissions/Maintenances.js b/web/app/view/permissions/Maintenances.js
new file mode 100644
index 00000000..c5255769
--- /dev/null
+++ b/web/app/view/permissions/Maintenances.js
@@ -0,0 +1,65 @@
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+
+Ext.define('Traccar.view.permissions.Maintenances', {
+ extend: 'Traccar.view.permissions.Base',
+ xtype: 'linkMaintenancesView',
+
+ columns: {
+ items: [{
+ text: Strings.sharedName,
+ dataIndex: 'name',
+ flex: 1,
+ minWidth: Traccar.Style.columnWidthNormal,
+ filter: 'string'
+ }, {
+ text: Strings.sharedType,
+ dataIndex: 'type',
+ flex: 1,
+ minWidth: Traccar.Style.columnWidthNormal,
+ 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',
+ flex: 1,
+ minWidth: Traccar.Style.columnWidthNormal,
+ renderer: function (value, metaData, record) {
+ return Traccar.AttributeFormatter.renderAttribute(
+ value, Ext.getStore('MaintenanceTypes').getById(record.get('type')));
+ }
+ }, {
+ text: Strings.maintenancePeriod,
+ dataIndex: 'period',
+ flex: 1,
+ minWidth: Traccar.Style.columnWidthNormal,
+ renderer: function (value, metaData, record) {
+ return Traccar.AttributeFormatter.renderAttribute(
+ value, Ext.getStore('MaintenanceTypes').getById(record.get('type')));
+ }
+ }]
+ }
+});
diff --git a/web/app/view/permissions/Notifications.js b/web/app/view/permissions/Notifications.js
index 9386d6d6..a8570fea 100644
--- a/web/app/view/permissions/Notifications.js
+++ b/web/app/view/permissions/Notifications.js
@@ -1,6 +1,6 @@
/*
- * Copyright 2017 Anton Tananaev (anton@traccar.org)
- * Copyright 2017 Andrey Kunitsyn (andrey@traccar.org)
+ * 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
@@ -42,26 +42,37 @@ Ext.define('Traccar.view.permissions.Notifications', {
renderer: Traccar.AttributeFormatter.getFormatter('always'),
filter: 'boolean'
}, {
- text: Strings.notificationWeb,
- dataIndex: 'web',
- flex: 1,
- minWidth: Traccar.Style.columnWidthNormal,
- renderer: Traccar.AttributeFormatter.getFormatter('web'),
- filter: 'boolean'
- }, {
- text: Strings.notificationMail,
- dataIndex: 'mail',
- flex: 1,
- minWidth: Traccar.Style.columnWidthNormal,
- renderer: Traccar.AttributeFormatter.getFormatter('mail'),
- filter: 'boolean'
+ 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.notificationSms,
- dataIndex: 'sms',
+ text: Strings.sharedCalendar,
+ dataIndex: 'calendarId',
flex: 1,
minWidth: Traccar.Style.columnWidthNormal,
- renderer: Traccar.AttributeFormatter.getFormatter('sms'),
- filter: 'boolean'
+ hidden: true,
+ filter: {
+ type: 'list',
+ labelField: 'name',
+ store: 'AllCalendars'
+ },
+ renderer: Traccar.AttributeFormatter.getFormatter('calendarId')
}]
}
});