aboutsummaryrefslogtreecommitdiff
path: root/web/app/AttributeFormatter.js
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2018-03-19 12:34:49 +0500
committerAbyss777 <abyss@fox5.ru>2018-03-19 12:34:49 +0500
commitebccd5864e93312321c0226d603e453f6cdeec25 (patch)
treeaa8355566da6cf6064b4119c07ecc39feae326d7 /web/app/AttributeFormatter.js
parent464aa58c49ac5e04d419a68b6ee5bcf9d0c36798 (diff)
downloadetbsa-traccar-web-ebccd5864e93312321c0226d603e453f6cdeec25.tar.gz
etbsa-traccar-web-ebccd5864e93312321c0226d603e453f6cdeec25.tar.bz2
etbsa-traccar-web-ebccd5864e93312321c0226d603e453f6cdeec25.zip
Add Calendar column to some grids
Diffstat (limited to 'web/app/AttributeFormatter.js')
-rw-r--r--web/app/AttributeFormatter.js17
1 files changed, 16 insertions, 1 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':