From 17157262fef1c046d116b2270f4e1d335fe9da1b Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Tue, 26 Jun 2018 12:00:15 +0500 Subject: Implement refactored notifications --- web/app/view/edit/Notifications.js | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'web/app/view/edit') diff --git a/web/app/view/edit/Notifications.js b/web/app/view/edit/Notifications.js index 3620682..9e24d3d 100644 --- a/web/app/view/edit/Notifications.js +++ b/web/app/view/edit/Notifications.js @@ -60,20 +60,25 @@ Ext.define('Traccar.view.edit.Notifications', { renderer: Traccar.AttributeFormatter.getFormatter('always'), filter: 'boolean' }, { - text: Strings.notificationWeb, - dataIndex: 'web', - renderer: Traccar.AttributeFormatter.getFormatter('web'), - filter: 'boolean' - }, { - text: Strings.notificationMail, - dataIndex: 'mail', - renderer: Traccar.AttributeFormatter.getFormatter('mail'), - filter: 'boolean' - }, { - text: Strings.notificationSms, - dataIndex: 'sms', - renderer: Traccar.AttributeFormatter.getFormatter('sms'), - 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.sharedCalendar, dataIndex: 'calendarId', -- cgit v1.2.3