aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--web/app/AttributeFormatter.js17
-rw-r--r--web/app/view/dialog/Notification.js8
-rw-r--r--web/app/view/edit/Geofences.js12
-rw-r--r--web/app/view/edit/Notifications.js14
-rw-r--r--web/app/view/permissions/Geofences.js14
-rw-r--r--web/app/view/permissions/Notifications.js16
6 files changed, 73 insertions, 8 deletions
diff --git a/web/app/AttributeFormatter.js b/web/app/AttributeFormatter.js
index 289aff9..4de8d9e 100644
--- a/web/app/AttributeFormatter.js
+++ b/web/app/AttributeFormatter.js
@@ -1,5 +1,5 @@
/*
- * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org)
+ * Copyright 2015 - 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
@@ -97,6 +97,19 @@ Ext.define('Traccar.AttributeFormatter', {
return null;
},
+ calendarIdFormatter: function (value) {
+ var calendar, store;
+ if (value !== 0) {
+ store = Ext.getStore('AllCalendars');
+ if (store.getTotalCount() === 0) {
+ store = Ext.getStore('Calendars');
+ }
+ calendar = store.getById(value);
+ return calendar ? calendar.get('name') : '';
+ }
+ return null;
+ },
+
driverUniqueIdFormatter: function (value) {
var driver, store;
if (value !== 0) {
@@ -174,6 +187,8 @@ Ext.define('Traccar.AttributeFormatter', {
return this.groupIdFormatter;
case 'geofenceId':
return this.geofenceIdFormatter;
+ case 'calendarId':
+ return this.calendarIdFormatter;
case 'lastUpdate':
return this.lastUpdateFormatter;
case 'spentFuel':
diff --git a/web/app/view/dialog/Notification.js b/web/app/view/dialog/Notification.js
index f4204cb..4cba519 100644
--- a/web/app/view/dialog/Notification.js
+++ b/web/app/view/dialog/Notification.js
@@ -66,7 +66,13 @@ Ext.define('Traccar.view.dialog.Notification', {
uncheckedValue: false,
name: 'sms',
fieldLabel: Strings.notificationSms
- }, {
+ }]
+ }, {
+ xtype: 'fieldset',
+ title: Strings.sharedExtra,
+ collapsible: true,
+ collapsed: true,
+ items: [{
xtype: 'clearableComboBox',
reference: 'calendarCombo',
name: 'calendarId',
diff --git a/web/app/view/edit/Geofences.js b/web/app/view/edit/Geofences.js
index 9c564bc..0e1e677 100644
--- a/web/app/view/edit/Geofences.js
+++ b/web/app/view/edit/Geofences.js
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 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
@@ -48,6 +48,16 @@ Ext.define('Traccar.view.edit.Geofences', {
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/Notifications.js b/web/app/view/edit/Notifications.js
index e17100a..3620682 100644
--- a/web/app/view/edit/Notifications.js
+++ b/web/app/view/edit/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
@@ -74,6 +74,16 @@ Ext.define('Traccar.view.edit.Notifications', {
dataIndex: 'sms',
renderer: Traccar.AttributeFormatter.getFormatter('sms'),
filter: 'boolean'
+ }, {
+ 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/permissions/Geofences.js b/web/app/view/permissions/Geofences.js
index efdf18d..e2e85a3 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/Notifications.js b/web/app/view/permissions/Notifications.js
index 9386d6d..e21d277 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
@@ -62,6 +62,18 @@ Ext.define('Traccar.view.permissions.Notifications', {
minWidth: Traccar.Style.columnWidthNormal,
renderer: Traccar.AttributeFormatter.getFormatter('sms'),
filter: 'boolean'
+ }, {
+ 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')
}]
}
});