diff --git a/emonitor.cfg.template b/emonitor.cfg.template
index dd199f2..a50d86d 100644
--- a/emonitor.cfg.template
+++ b/emonitor.cfg.template
@@ -14,6 +14,8 @@ cachetimeout = 300
TILE_MISSING = 'load' # load|none
ADMIN_DEFAULT_PASSWORD = 'admin'
+TELEGRAMKEY = ''
+
PATH_DATA = './data/'
PATH_INCOME = './data/income/'
PATH_DONE = './data/done/'
diff --git a/emonitor/app.py b/emonitor/app.py
index 1d24201..93365e3 100644
--- a/emonitor/app.py
+++ b/emonitor/app.py
@@ -4,7 +4,7 @@
from alembic import util as alembicutil
from sqlalchemy.exc import OperationalError
from flask import Flask, request, render_template, current_app
-from .extensions import alembic, db, login_manager, babel, cache, events, scheduler, monitorserver, signal, printers
+from .extensions import alembic, db, login_manager, babel, cache, events, scheduler, monitorserver, signal, printers, communication
from .user import User
from emonitor import __version__
@@ -58,6 +58,8 @@ class DEFAULT_CONFIG(object):
OBSERVERINTERVAL = 2 # interval for folderobserver
MONITORPING = 2 # monitor ping in minutes
+ TELEGRAMKEY = "botid"
+
def create_app(config=None, app_name=None, blueprints=None):
"""
@@ -180,6 +182,9 @@ def configure_extensions(app):
def load_user(id):
return User.getUsers(userid=id)
+ # communication
+ communication.init_app(app)
+
# add global elements
from emonitor.scheduler import eMonitorIntervalTrigger
from emonitor.modules.settings.settings import Settings
diff --git a/emonitor/communication.py b/emonitor/communication.py
new file mode 100644
index 0000000..2ba67a2
--- /dev/null
+++ b/emonitor/communication.py
@@ -0,0 +1,273 @@
+import yaml
+import logging
+from emonitor.extensions import events, babel, db
+from emonitor.modules.events.eventhandler import Eventhandler
+from emonitor.modules.alarms.alarm import Alarm
+from emonitor.modules.settings.settings import Settings
+from emonitor.modules.persons.persons import Person
+
+logger = logging.getLogger(__name__)
+
+
+class Communicator:
+ def sendMessage(self, addressee, message):
+ pass
+
+ def getUsers(self):
+ return []
+
+
+class TelegramBot(Communicator):
+ """
+ telegram connector class
+ """
+ __personidentifier__ = 'telegramid'
+ app = None
+ logger = logging.getLogger('telegram.bot')
+ logger.setLevel(logging.ERROR)
+ users = Person
+
+ def __init__(self, **kwargs):
+ # Create the EventHandler and pass it your bot's token.
+ from telegram.ext import Updater, CommandHandler, CallbackQueryHandler, MessageHandler, Filters
+ from telegram.error import InvalidToken, Unauthorized, NetworkError
+
+ self.updater = Updater(kwargs.get('token', ''))
+ self.active = False
+ self.botname = None
+
+ TelegramBot.app = kwargs.get('app', None)
+
+ try:
+ if self.updater.bot.getMe():
+ self.botname = self.updater.bot.getMe().name
+ # on different commands - answer in Telegram
+ self.updater.dispatcher.addHandler(CommandHandler("start", TelegramBot.msg_start, pass_args=True))
+ self.updater.dispatcher.addHandler(CommandHandler("Start", TelegramBot.msg_start, pass_args=True))
+ self.updater.dispatcher.addHandler(CommandHandler("hilfe", TelegramBot.msg_help, pass_args=True))
+ self.updater.dispatcher.addHandler(CommandHandler("Hilfe", TelegramBot.msg_help, pass_args=True))
+ self.updater.dispatcher.addHandler(CallbackQueryHandler(TelegramBot.msg_responder))
+ self.updater.start_polling()
+ except InvalidToken:
+ self.logger.error('invalid telegram token {}'.format(kwargs.get('token', '')))
+ self.updater = Updater(kwargs.get('token', ''))
+ except Unauthorized:
+ self.logger.error('unauthorized telegram token {}'.format(kwargs.get('token', '')))
+ except NetworkError:
+ self.logger.error('network error with telegram token {}'.format(kwargs.get('token', '')))
+
+ def updateToken(self, token=None):
+ """
+ update token after changes
+ :return: botname
+ """
+ from telegram.ext import Updater
+ from telegram.error import Unauthorized, NetworkError
+ updater = Updater(token or Settings.get('telegramkey'))
+ self.updater = updater
+ self.botname = None
+ try:
+ if updater.bot.getMe():
+ self.botname = updater.bot.getMe().name
+
+ except Unauthorized:
+ self.botname = None
+ except NetworkError:
+ self.logger.error("network error")
+
+ return self.botname
+
+ def start(self):
+ """
+ start update handler for telegram messages
+ """
+ self.logger.debug('telegram bot updater started')
+ self.active = True
+ try:
+ self.updater.idle()
+ except:
+ self.active = True
+
+ def stop(self):
+ """
+ stop update handler for telegram messages
+ """
+ self.active = False
+ self.updater.stop()
+
+ def state(self):
+ return self.active
+
+ def getUsers(self):
+ """
+ get list of users for telegram messenger
+ :return: list of persons
+ """
+ return Person.query.filter(self.users._options.like('%{}%'.format(self.__personidentifier__))).all()
+
+ def sendMessage(self, addressee, message, **kwargs):
+ """
+ send message via telegram messenger
+ :param addressee: id of user or group
+ :param message: text message
+ :param kwargs: additional attributes, 'reply_markup' defined
+ """
+ self.updater.bot.sendMessage(addressee, message, parse_mode='Markdown', reply_markup=kwargs.get('reply_markup', None))
+
+ def sendVenue(self, addressee, message, **kwargs):
+ """
+ send venue of current item
+ :param addressee: id of user or group
+ :param message: text message for header
+ :param kwargs: deliver 'lat', 'lng', 'address', 'reply_markup'
+ """
+ self.updater.bot.sendVenue(addressee, kwargs.get('lat'), kwargs.get('lng'), message, kwargs.get('address'), reply_markup=kwargs.get('reply_markup', None))
+
+ def sendFile(self, addressee, document, **kwargs):
+ """
+ send file for given parameters
+ :param addressee: id of user or group
+ :param document: document pointer to document to send
+ :param kwargs: additional attributes, 'filename', 'caption'
+ """
+ self.updater.bot.sendDocument(addressee, document, filename=kwargs.get('filename', None), caption=kwargs.get('caption', None))
+
+ @staticmethod
+ def msg_start(bot, update, **kwargs):
+ """
+ send start message and add user id to emonitor user if found
+ :param bot:
+ :param update:
+ :param kwargs:
+ """
+ for person in TelegramBot.users.getPersons():
+ if person.firstname == update.message.from_user['first_name'] and person.lastname == update.message.from_user['last_name']:
+ TelegramBot.logger.info('add telegramid {} to user {} {}'.format(update.message.from_user['id'], person.firstname, person.lastname))
+ _additional = person.options
+ _additional['telegramid'] = update.message.from_user['id']
+ person._options = yaml.safe_dump(_additional, encoding='utf-8')
+ db.session.commit()
+
+ msgtext = Settings.get('telegramsettings')['welcomemsg'] or babel.gettext('telegram.default.welcomemsg')
+ bot.sendMessage(update.message.chat_id, text=msgtext.format(vorname=update.message.from_user.first_name, nachname=update.message.from_user.last_name))
+ TelegramBot.logger.info('send message from "msg_start" to {} {}'.format(update.message.from_user.first_name, update.message.from_user.last_name))
+
+ @staticmethod
+ def msg_responder(bot, update, **kwargs):
+ """
+ Responder for incoming messages
+ :param bot:
+ :param update:
+ :param kwargs:
+ """
+ if update.callback_query.data.startswith('file_'): # send file
+ bot.sendDocument(update.callback_query.message.chat_id, open(TelegramBot.app.config.get('PATH_DONE') + update.callback_query.data.split('_')[-1], 'rb'), 'details.pdf', 'details')
+
+ elif update.callback_query.data.startswith('details_'): # details_[type]_[id]
+ if update.callback_query.data.split('_')[1] == 'alarm':
+ from telegram import InlineKeyboardMarkup, InlineKeyboardButton
+ args = {'id': int(update.callback_query.data.split('_')[-1]), 'style': 'details', 'addressees': [update.callback_query.message.chat_id], 'keyboard': InlineKeyboardMarkup, 'button': InlineKeyboardButton}
+ attrs = Alarm.getExportData('telegram', **args)
+ for addressee in [update.callback_query.message.chat_id]:
+ bot.sendMessage(addressee, attrs['details'], reply_markup=attrs['reply'], parse_mode='Markdown')
+ return
+
+ elif update.callback_query.data.startswith('location_'):
+ bot.sendLocation(update.callback_query.message.chat_id, update.callback_query.data.split('_')[1], update.callback_query.data.split('_')[2])
+
+ @staticmethod
+ def msg_help(bot, update, **kwargs):
+ """
+ send information about the bot
+ :param bot:
+ :param update:
+ :param kwargs:
+ """
+ msgtext = Settings.get('telegramsettings')['helpmsg'] or babel.gettext('telegram.default.helpmsg')
+ bot.sendMessage(update.message.chat_id, msgtext, parse_mode='Markdown')
+ TelegramBot.logger.debug("help_msg sent.")
+
+
+class Mailer(Communicator):
+
+ def __init__(self, **kwargs):
+ pass
+
+
+class Communication(object):
+ """
+ collector class for all communication interfaces
+ """
+ app = None
+
+ def __init__(self, app=None):
+ self.__dict__ = {}
+ if app is not None:
+ self.init_app(app)
+
+ def init_app(self, app):
+ Communication.app = app
+
+ try: # try telegram
+ import telegram
+ self.__dict__['telegram'] = TelegramBot(app=app, token=Settings.get('telegramsettings')['telegramkey'] or app.config.get('TELEGRAMKEY'))
+ except TypeError:
+ Settings.set('telegramsettings', {'telegramkey': ''})
+ self.__dict__['telegram'] = None
+ except ImportError:
+ logger.error("error telegram")
+ self.__dict__['telegram'] = None
+
+ try: # try mail
+ # TODO: add Mail communicator
+ pass
+ self.__dict__['mail'] = Mailer
+ except ImportError:
+ self.__dict__['mail'] = None
+ logger.error("error Mail")
+ # Mail = None
+
+ app.extensions['communication'] = self
+
+ logger.info("{} Communicator(s) loaded: {}".format(len(self.__dict__.keys()), ", ".join(self.__dict__.keys())))
+ events.addHandlerClass('*', 'emonitor.communication.Communication', Communication.handleEvent, ['in.sendertype', 'in.group', 'in.id', 'in.style'])
+
+ def updateCommunicator(self, commtype):
+ for key, communicator in self.__dict__.items():
+ if key == commtype:
+ self.__dict__[key] = TelegramBot(app=Communication.app, token=Settings.get('telegramsettings')['telegramkey'] or Communication.app.config.get('TELEGRAMKEY'))
+ return self.__dict__[key]
+
+ def _teardown(self, **kwargs):
+ pass
+
+ @staticmethod
+ def handleEvent(eventname, **kwargs):
+ hdl = [hdl for hdl in Eventhandler.getEventhandlers(event=eventname) if hdl.handler == 'emonitor.communication.Communication'][0]
+ if hdl:
+ from emonitor.extensions import communication
+ params = {}
+ for p in hdl.getParameterValues('in'):
+ params[p[0].split('.')[-1]] = p[1]
+ if params["sendertype"] == 'telegram':
+ for group, members in Settings.getYaml('telegramsettings').__dict__['groups'].items():
+ if group == params['group']:
+ from telegram import InlineKeyboardMarkup, InlineKeyboardButton
+ args = {'id': int(kwargs.get('alarmid')), 'style': params['style'], 'addressees': members[:-1], 'keyboard': InlineKeyboardMarkup, 'button': InlineKeyboardButton}
+ attrs = Alarm.getExportData('telegram', **args)
+ for member in members[:-1]:
+ if params['id'] == 'alarmid': # send alarm details with location
+ try:
+ if params.get('style') in ['text', 'details']:
+ communication.telegram.sendMessage(member, attrs['details'], reply_markup=attrs['reply'])
+ elif params.get('style') == 'venue':
+ communication.telegram.sendVenue(member, attrs['text'], lat=attrs['lat'], lng=attrs['lng'], address=attrs['address'], reply_markup=attrs['reply'])
+ except:
+ print "error handleEvent"
+ return kwargs
+
+ elif params["sendertype"] == 'mailer':
+ # TODO: implement mail notification
+ pass
+
+ return kwargs
diff --git a/emonitor/extensions.py b/emonitor/extensions.py
index 0fbdd6d..3d09b4d 100644
--- a/emonitor/extensions.py
+++ b/emonitor/extensions.py
@@ -46,3 +46,9 @@ def get_query(self, *entities, **kwargs):
# printer
from emonitor.printertype import ePrinters
printers = ePrinters()
+
+# communication
+from emonitor.communication import Communication
+communication = Communication()
+
+
diff --git a/emonitor/frontend/web/js/frontend.min.js b/emonitor/frontend/web/js/frontend.min.js
index 60fd14a..14dad65 100644
--- a/emonitor/frontend/web/js/frontend.min.js
+++ b/emonitor/frontend/web/js/frontend.min.js
@@ -1 +1 @@
-window.WebSocket=window.WebSocket||window.MozWebSocket||false;if(!window.WebSocket){$("#ws").html("-");console.log("websockets not supportetd")}else{ws=new WebSocket("ws://"+location.host+"/ws");var reloadtimer=null;var connection_info="";$.ajax({type:"POST",url:"/data/frontpage?action=translatebaseinfo",success:function(a){connection_info=a.connection_info}});ws.onclose=function(){setTimeout(function(){$("#overlaycontent").html(connection_info);$(".overlay").show()},2000);if(!reloadtimer){reloadtimer=setInterval(tryReconnect,5000)}$("#ws").html('')};ws.onmessage=function(a){var b=JSON.parse(a.data);console.log(b);alert(b)}}function tryReconnect(){$.get(window.location.href).done(function(){location.reload()}).fail(function(){console.log("reload failed")})}function closeOverlay(){$(".overlay").toggle();return false}function showMonitorDefinition(){$.ajax({type:"POST",url:"/data/monitors?action=monitoroverview",success:function(a){$("#overlaycontent").html(a);$(".overlay").show();$(".overlay").on("hide",function(){stopMonitorPing()});return false}});return false}function stopMonitorPing(){clearTimeout(nextrun)}$(".usermenu").hover(function(){$(this).find(".dropdown-menu").stop(true,true).delay(200).fadeIn(500)},function(){$(this).find(".dropdown-menu").stop(true,true).delay(200).fadeOut(500)});(function(a){a.each(["show","hide"],function(b,d){var c=a.fn[d];a.fn[d]=function(){this.trigger(d);return c.apply(this,arguments)}})})(jQuery);function showInfo(){$.ajax({type:"POST",url:"/data/frontpage?action=info",success:function(a){$("#overlaycontent").html(a);$(".overlay").toggle();return false}});return false}function showSystemInfo(){$.ajax({type:"POST",url:"/data/frontpage?action=systeminfo",success:function(a){$("#overlaycontent").html(a);$(".overlay").toggle();return false}});return false}function restartApp(){$.ajax({type:"POST",url:"/data/frontpage?action=restart",success:function(a){return false}});return false};
\ No newline at end of file
+window.WebSocket=window.WebSocket||window.MozWebSocket||false;if(!window.WebSocket){$("#ws").html("-");console.log("websockets not supportetd")}else{ws=new WebSocket("ws://"+location.host+"/ws");var reloadtimer=null;var connection_info="";$.ajax({type:"POST",url:"/data/frontpage?action=translatebaseinfo",success:function(a){connection_info=a.connection_info}});ws.onclose=function(){setTimeout(function(){$("#overlaycontent").html(connection_info);$(".overlay").show()},2000);if(!reloadtimer){reloadtimer=setInterval(tryReconnect,5000)}$("#ws").html('')};ws.onmessage=function(a){var b=JSON.parse(a.data);console.log(b)}}function tryReconnect(){$.get(window.location.href).done(function(){location.reload()}).fail(function(){console.log("reload failed")})}function closeOverlay(){$(".overlay").toggle();return false}function showMonitorDefinition(){$.ajax({type:"POST",url:"/data/monitors?action=monitoroverview",success:function(a){$("#overlaycontent").html(a);$(".overlay").show();$(".overlay").on("hide",function(){stopMonitorPing()});return false}});return false}function stopMonitorPing(){clearTimeout(nextrun)}$(".usermenu").hover(function(){$(this).find(".dropdown-menu").stop(true,true).delay(200).fadeIn(500)},function(){$(this).find(".dropdown-menu").stop(true,true).delay(200).fadeOut(500)});(function(a){a.each(["show","hide"],function(b,d){var c=a.fn[d];a.fn[d]=function(){this.trigger(d);return c.apply(this,arguments)}})})(jQuery);function showInfo(){$.ajax({type:"POST",url:"/data/frontpage?action=info",success:function(a){$("#overlaycontent").html(a);$(".overlay").toggle();return false}});return false}function showSystemInfo(){$.ajax({type:"POST",url:"/data/frontpage?action=systeminfo",success:function(a){$("#overlaycontent").html(a);$(".overlay").toggle();return false}});return false}function restartApp(){$.ajax({type:"POST",url:"/data/frontpage?action=restart",success:function(a){return false}});return false};
\ No newline at end of file
diff --git a/emonitor/modules/alarms/alarm.py b/emonitor/modules/alarms/alarm.py
index aec1e95..88a2486 100644
--- a/emonitor/modules/alarms/alarm.py
+++ b/emonitor/modules/alarms/alarm.py
@@ -310,7 +310,7 @@ def changeState(id, state):
if not alarm:
return []
- if alarm.state != state: # only change
+ if alarm.state != state and alarm.state != 0: # only change
_op = 'changestate'
else:
_op = 'added'
@@ -355,7 +355,6 @@ def changeState(id, state):
pass
finally:
monitorserver.sendMessage('0', 'reset') # refresh monitor layout
- #signal.send('alarm', 'changestate', newstate=1)
return list(set(c))
elif state == 2: # close alarm
@@ -377,9 +376,9 @@ def getExportData(exportformat, **params):
"""
Export alarm to given format
- :param exportformat: *.html*, *.png*
+ :param exportformat: *.html*, *.png*, *telegram*, [*mail*]
:param params:
- - style: exportstyle: *alarmmap*, *routemap*
+ - style: exportstyle: *alarmmap*, *routemap*, *telegram.text*, *telegram.venue*
- filename: name of exportfile
@@ -423,6 +422,29 @@ def getExportData(exportformat, **params):
if 'filename' in params and os.path.exists("%s/inc/%s.png" % (os.path.abspath(os.path.dirname(__file__)), params['filename'])):
with open("%s/inc/%s.png" % (os.path.abspath(os.path.dirname(__file__)), params['filename']), 'rb') as f:
return f.read()
+
+ elif exportformat == 'telegram': # build telegram information for alarm
+ attrs = {'text': u"{}: {}".format(alarm.key.category, alarm.key.key),
+ 'details': u"*Alarm ({})*\n*{}: {}*\n{} {} ({})\n\n{}".format(alarm.timestamp, alarm.key.category, alarm.key.key, alarm.street.name, alarm.housenumber.number, alarm.city.name, alarm.remark),
+ 'address': u"{} {} ({})".format(alarm.street.name, alarm.housenumber.number, alarm.city.name), 'filename': alarm.get('filename'),
+ 'lat': alarm.lat, 'lng': alarm.lng, 'reply': []}
+
+ if alarm.type == 1: # fax type can send file
+ attrs['reply'].append(params.get('button')("Fax", callback_data=u'file_{}'.format(attrs['filename'])))
+
+ if params.get('style') == 'text':
+ attrs['reply'].append(params.get('button')("Position", callback_data=u'location_{}_{}'.format(alarm.lat, alarm.lng)))
+
+ if params.get('style') == 'venue':
+ attrs['reply'].append(params.get('button')("Details", callback_data=u'details_alarm_{}'.format(alarm.id)))
+
+ attrs['reply'] = params.get('keyboard')([attrs['reply']])
+ return attrs
+
+ elif exportformat == 'mail':
+ # TODO: Add mailer handler
+ return None
+
abort(404)
@staticmethod
diff --git a/emonitor/modules/persons/content_admin.py b/emonitor/modules/persons/content_admin.py
index db04383..f8c778f 100644
--- a/emonitor/modules/persons/content_admin.py
+++ b/emonitor/modules/persons/content_admin.py
@@ -52,7 +52,7 @@ def getAdminContent(self, **params):
person.remark = request.form.get('remark')
_additional = {}
for field in Settings.get('persons.settings').get('additional'):
- if field.split('=')[0] in request.form.keys():
+ if field.split('=')[0] in request.form.keys() and request.form.get(field.split('=')[0]).strip() != '':
_additional[field.split('=')[0]] = request.form.get(field.split('=')[0])
person._options = yaml.safe_dump(_additional, encoding='utf-8')
db.session.commit()
diff --git a/emonitor/modules/persons/templates/admin.persons.uploadpreview.html b/emonitor/modules/persons/templates/admin.persons.uploadpreview.html
index d6c914b..ad927c8 100644
--- a/emonitor/modules/persons/templates/admin.persons.uploadpreview.html
+++ b/emonitor/modules/persons/templates/admin.persons.uploadpreview.html
@@ -6,10 +6,11 @@
{{ _('persons.upload.step5header') }}
{{ _('persons.upload.firstname') }}
{{ _('persons.upload.lastname') }}
-
{{ _('persons.upload.salutation') }}
+
{{ _('persons.upload.birthday') }}
+
{{ _('persons.upload.salutation') }}
{{ _('persons.upload.grade') }}
{{ _('persons.upload.position') }}
-
{{ _('persons.upload.identifier') }}
+
{{ _('persons.upload.identifier') }}
@@ -19,10 +20,11 @@ {{ _('persons.upload.step5header') }}
{{ val['firstname']|safe }}
{{ val['lastname']|safe }}
-
{{ val['salutation']|safe }}
+
{{ val['birthdate']|safe }}
+
{{ val['salutation']|safe }}
{{ val['grade']|safe }}
{{ val['position']|safe }}
-
{{ val['identifier']|safe }}
+
{{ val['identifier']|safe }}
{%- if val['state']=='0' %}
diff --git a/emonitor/modules/settings/__init__.py b/emonitor/modules/settings/__init__.py
index c3a6bea..8cbae08 100644
--- a/emonitor/modules/settings/__init__.py
+++ b/emonitor/modules/settings/__init__.py
@@ -26,7 +26,7 @@ def __init__(self, app):
self.widgets = [CrestWidget('departmentcrest')]
# subnavigation
- self.adminsubnavigation = [('/admin/settings', 'settings.main'), ('/admin/settings/department', 'module.settings.department'), ('/admin/settings/cars', 'module.settings.cars'), ('/admin/settings/start', 'module.settings.start')]
+ self.adminsubnavigation = [('/admin/settings', 'settings.main'), ('/admin/settings/department', 'module.settings.department'), ('/admin/settings/cars', 'module.settings.cars'), ('/admin/settings/communication', 'module.settings.communication'), ('/admin/settings/start', 'module.settings.start')]
# static folders
@app.route('/settings/inc/
')
@@ -38,6 +38,7 @@ def settings_static(filename):
babel.gettext(u'settings.main')
babel.gettext(u'module.settings.department')
babel.gettext(u'module.settings.cars')
+ babel.gettext(u'module.settings.communication')
babel.gettext(u'module.settings.start')
babel.gettext(u'settings.pathtype.pathdone')
@@ -46,6 +47,7 @@ def settings_static(filename):
babel.gettext(u'settings.pathtype.pathincome')
babel.gettext(u'departmentcrest')
+ babel.gettext(u'telegram.default.welcomemsg')
# add default values
if Settings.query.count() == 0: # add default values
diff --git a/emonitor/modules/settings/content_admin.py b/emonitor/modules/settings/content_admin.py
index cd390d5..4a871e7 100644
--- a/emonitor/modules/settings/content_admin.py
+++ b/emonitor/modules/settings/content_admin.py
@@ -88,6 +88,39 @@ def chunks(l, n):
params.update({'cartypes': Settings.getCarTypes()})
return render_template('admin.settings.cars.html', **params)
+ elif module[1] == 'communication':
+ from emonitor.extensions import communication
+ if request.method == 'POST':
+ if request.form.get('action') == 'telegramsettings':
+ vals = Settings.get('telegramsettings')
+ vals['telegramkey'] = request.form.get('telegrambot')
+ vals['welcomemsg'] = request.form.get('welcometext')
+ vals['helpmsg'] = request.form.get('helptext')
+ Settings.set('telegramsettings', vals)
+ db.session.commit()
+ tb = communication.telegram
+ if not tb:
+ communication.init_app(app=communication.app)
+ tb = communication.telegram
+ else:
+ tb.stop()
+ tb.updateToken(vals['telegramkey'])
+
+ elif request.form.get('action') == 'telegramgroups':
+ vals = Settings.get('telegramsettings')
+ g = {}
+ for f in filter(lambda x: x.startswith('groupname_'), request.form):
+ _id = f.split('_')[-1] # fieldname in form
+ if request.form.get('groupname_' + _id) in ['newgroup', '']:
+ continue
+ g[request.form.get('groupname_' + _id)] = request.form.get('members_selectable_' + _id).split(';')
+ vals['groups'] = g
+ Settings.set('telegramsettings', vals)
+ db.session.commit()
+
+ params.update({'bot': communication.telegram, 'settings': Settings.getYaml('telegramsettings'), 'configtelegramkey': current_app.config.get('TELEGRAMKEY', '')})
+ return render_template('admin.settings.communication.html', **params)
+
elif module[1] == 'start':
if request.method == 'POST':
@@ -152,4 +185,9 @@ def getAdminData(self, **params):
elif request.args.get('action') == 'downgradedb':
return alembic.downgrade() or "done"
+ elif request.args.get('action') == 'sendtelegramtest':
+ from emonitor.extensions import communication
+ communication.telegram.sendMessage(addressee=int(request.args.get('user')), message=request.args.get('msg'))
+ return babel.gettext(u'admin.settings.telegramtest.done')
+
return ""
diff --git a/emonitor/modules/translations/de/LC_MESSAGES/modules.mo b/emonitor/modules/translations/de/LC_MESSAGES/modules.mo
index a134a65..34b54d6 100644
Binary files a/emonitor/modules/translations/de/LC_MESSAGES/modules.mo and b/emonitor/modules/translations/de/LC_MESSAGES/modules.mo differ
diff --git a/emonitor/modules/translations/de/LC_MESSAGES/modules.po b/emonitor/modules/translations/de/LC_MESSAGES/modules.po
index b553ce4..0283ac6 100644
--- a/emonitor/modules/translations/de/LC_MESSAGES/modules.po
+++ b/emonitor/modules/translations/de/LC_MESSAGES/modules.po
@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2016-05-04 20:12+0200\n"
-"PO-Revision-Date: 2016-05-04 20:15+0200\n"
+"POT-Creation-Date: 2016-05-17 16:54+0200\n"
+"PO-Revision-Date: 2016-05-17 17:18+0200\n"
"Last-Translator: Arne Seifert \n"
"Language-Team: de \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
@@ -833,49 +833,49 @@ msgid "trigger.alarm_changestate_sub"
msgstr "Einsatz-Status geändert (%(sub)s)"
#: emonitor/modules/alarms/__init__.py:141
-#: emonitor/modules/alarms/alarmutils.py:320
+#: emonitor/modules/alarms/alarmutils.py:372
msgid "alarms.print.slightleft"
msgstr "leicht links"
#: emonitor/modules/alarms/__init__.py:142
-#: emonitor/modules/alarms/alarmutils.py:320
+#: emonitor/modules/alarms/alarmutils.py:372
msgid "alarms.print.slightright"
msgstr "leicht rechts"
#: emonitor/modules/alarms/__init__.py:143
-#: emonitor/modules/alarms/alarmutils.py:320
+#: emonitor/modules/alarms/alarmutils.py:372
msgid "alarms.print.right"
msgstr "rechts"
#: emonitor/modules/alarms/__init__.py:144
-#: emonitor/modules/alarms/alarmutils.py:320
+#: emonitor/modules/alarms/alarmutils.py:372
msgid "alarms.print.left"
msgstr "links"
#: emonitor/modules/alarms/__init__.py:145
-#: emonitor/modules/alarms/alarmutils.py:320
-#: emonitor/modules/alarms/alarmutils.py:335
+#: emonitor/modules/alarms/alarmutils.py:372
+#: emonitor/modules/alarms/alarmutils.py:387
msgid "alarms.print.straight"
msgstr "weiterfahren"
#: emonitor/modules/alarms/__init__.py:146
-#: emonitor/modules/alarms/alarmutils.py:320
-#: emonitor/modules/alarms/alarmutils.py:335
+#: emonitor/modules/alarms/alarmutils.py:372
+#: emonitor/modules/alarms/alarmutils.py:387
msgid "alarms.print.exit"
msgstr "ausfahrt"
#: emonitor/modules/alarms/__init__.py:147
-#: emonitor/modules/alarms/alarmutils.py:319
+#: emonitor/modules/alarms/alarmutils.py:371
msgid "alarms.print.bus"
msgstr "bus"
#: emonitor/modules/alarms/__init__.py:148
-#: emonitor/modules/alarms/alarmutils.py:337
+#: emonitor/modules/alarms/alarmutils.py:389
msgid "alarms.print.positive"
msgstr "Fahrtrichtung SÜD"
#: emonitor/modules/alarms/__init__.py:149
-#: emonitor/modules/alarms/alarmutils.py:338
+#: emonitor/modules/alarms/alarmutils.py:390
msgid "alarms.print.negative"
msgstr "Fahrtrichtung NORD"
@@ -1024,28 +1024,28 @@ msgstr "Uhrzeit"
msgid "list"
msgstr ""
-#: emonitor/modules/alarms/alarmutils.py:329
-#: emonitor/modules/alarms/alarmutils.py:331
+#: emonitor/modules/alarms/alarmutils.py:381
+#: emonitor/modules/alarms/alarmutils.py:383
msgid "alarms.print.highwaylong"
msgstr "Bundesautobahn"
-#: emonitor/modules/alarms/alarmutils.py:331
+#: emonitor/modules/alarms/alarmutils.py:383
msgid "alarms.print.highwayshort"
msgstr "A"
-#: emonitor/modules/alarms/alarmutils.py:335
+#: emonitor/modules/alarms/alarmutils.py:387
msgid "alarms.print.exitstart"
msgstr "Auf"
-#: emonitor/modules/alarms/alarmutils.py:335
+#: emonitor/modules/alarms/alarmutils.py:387
msgid "alarms.print.straightexit"
msgstr "nehmen"
-#: emonitor/modules/alarms/content_admin.py:246
+#: emonitor/modules/alarms/content_admin.py:247
msgid "admin.alarms.checkernotvalid"
msgstr "Datei nicht passend"
-#: emonitor/modules/alarms/content_admin.py:313
+#: emonitor/modules/alarms/content_admin.py:335
msgid "admin.alarms.list"
msgstr "Liste"
@@ -1340,12 +1340,12 @@ msgid "alarms.type.delcheckerquestion"
msgstr "Soll der gewählte Einsatztyp wirklich gelöscht werden?"
#: emonitor/modules/alarms/templates/admin.alarms.type.html:24
-#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:18
+#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:22
msgid "alarms.type.header.overview"
msgstr "Einsatztypen"
#: emonitor/modules/alarms/templates/admin.alarms.type.html:25
-#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:19
+#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:23
msgid "alarms.type.info"
msgstr ""
"Anhand angegebener Stichworte kann die Faxerkennung für verschiedene Faxe "
@@ -1354,12 +1354,12 @@ msgstr ""
"Faxe können abhängig vom Einsatztyp definiert werden."
#: emonitor/modules/alarms/templates/admin.alarms.type.html:30
-#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:32
+#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:36
msgid "alarms.type.name"
msgstr "Typname"
#: emonitor/modules/alarms/templates/admin.alarms.type.html:31
-#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:37
+#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:41
msgid "alarms.type.keywords"
msgstr "Stichwörter"
@@ -1453,31 +1453,37 @@ msgid "alarms.upload.checkerfile"
msgstr "Interpreter-Datei hochladen"
#: emonitor/modules/alarms/templates/admin.alarms.type.html:137
+#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:66
msgid "alarms.test.checkerstart"
msgstr "Datei hochladen"
-#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:23
+#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:27
msgid "alarms.type.interpreter"
msgstr "Interpreter/Auswerter"
-#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:42
+#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:46
msgid "alarms.type.variables"
msgstr "Variablen"
-#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:43
+#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:47
msgid "alarms.type.variableinfo"
msgstr ""
"Für die automatische Faxauswertung werden einige Schlüsselworte verwendet, die "
"als Variable definiert, für jeden Einsatztyp unterschiedlich heißen können."
-#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:49
+#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:53
msgid "alarms.type.save"
msgstr "Speichern"
-#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:50
+#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:54
msgid "alarms.type.cancel"
msgstr "Abbrechen"
+#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:62
+#, fuzzy
+msgid "alarms.upload.definitionfile"
+msgstr "Einsatz-Felddefinition"
+
#: emonitor/modules/alarms/templates/admin.alarms_alarm.html:13
#: emonitor/modules/alarms/templates/frontend.alarms_alarm.html:45
msgid "alarms.showfax"
@@ -3836,9 +3842,8 @@ msgid "module.settings.cars"
msgstr "Fahrzeuge/Material"
#: emonitor/modules/settings/__init__.py:41
-#, fuzzy
msgid "module.settings.communication"
-msgstr "Fahrzeuge/Material"
+msgstr "Messenger/Mail"
#: emonitor/modules/settings/__init__.py:42
msgid "module.settings.start"
@@ -3864,14 +3869,19 @@ msgstr "Pfad Eingang"
msgid "departmentcrest"
msgstr "Wappen"
-#: emonitor/modules/settings/content_admin.py:168
+#: emonitor/modules/settings/__init__.py:50
+msgid "telegram.default.welcomemsg"
+msgstr ""
+"Hi {vorname} {nachname}\n"
+"Du wurdest zum Telegram-Alarmgeber der Feuerwehr Haar hinzugefügt"
+
+#: emonitor/modules/settings/content_admin.py:183
msgid "admin.settings.updatedberror"
msgstr "Aktualisierung fehlgeschlagen!"
-#: emonitor/modules/settings/content_admin.py:176
-#, fuzzy
+#: emonitor/modules/settings/content_admin.py:191
msgid "admin.settings.telegramtest.done"
-msgstr "Aktualisierung fehlgeschlagen!"
+msgstr "Telegram Mitteilung gesendet."
#: emonitor/modules/settings/templates/admin.settings.cars.html:19
msgid "settings.cars.listtitle"
@@ -3895,69 +3905,107 @@ msgstr "Hintergrundfarbe"
msgid "settings.cars.save"
msgstr "Speichern"
-#: emonitor/modules/settings/templates/admin.settings.communication.html:28
-#, fuzzy
-msgid "settings.communication.mail.title"
-msgstr "Karte bearbeiten"
-
-#: emonitor/modules/settings/templates/admin.settings.communication.html:29
-#, fuzzy
-msgid "settings.communication.mail.info"
-msgstr ""
-"Wenn für eine Kartenanzeige keine Koordinaten definiert worden sind, wird die "
-"Standardposition verwendet. Richten Sie die Mitte der Karte auf den gewünschten "
-"Punkt aus und bestätigen Sie mit 'Position speichern'."
-
-#: emonitor/modules/settings/templates/admin.settings.communication.html:31
-#, fuzzy
-msgid "settings.communiaction.mail.server"
-msgstr "Kartenserver"
-
-#: emonitor/modules/settings/templates/admin.settings.communication.html:34
-#: emonitor/modules/settings/templates/admin.settings.communication.html:55
-#: emonitor/modules/settings/templates/admin.settings.html:51
-#: emonitor/modules/settings/templates/admin.settings.html:62
-msgid "settings.save"
-msgstr "Speichern"
+#: emonitor/modules/settings/templates/admin.settings.communication.html:5
+msgid "settings.communication.telegram.groupname"
+msgstr "Name"
-#: emonitor/modules/settings/templates/admin.settings.communication.html:40
-#, fuzzy
+#: emonitor/modules/settings/templates/admin.settings.communication.html:72
+#: emonitor/modules/settings/templates/admin.settings.communication.html:82
msgid "settings.communication.telegram.title"
-msgstr "Karte löschen"
+msgstr "Telegram Einstellungen"
-#: emonitor/modules/settings/templates/admin.settings.communication.html:41
-#, fuzzy
+#: emonitor/modules/settings/templates/admin.settings.communication.html:75
+#: emonitor/modules/settings/templates/admin.settings.communication.html:158
+msgid "settings.communication.mail.title"
+msgstr "E-Mail Einstellungen"
+
+#: emonitor/modules/settings/templates/admin.settings.communication.html:83
msgid "settings.communication.telegram.info"
msgstr ""
-"Der Kartenserver kann entweder ein lokaler Server sein oder online die Kacheln "
-"laden.
Beispiele:
lokal: /tileserver/osm/{z}/{x}/{y}
Bing: //ak.t2.tiles.virtualearth.net/tiles/a{q}?g=1236
Google:"
-" //khm2.googleapis.com/kh?v=142&x={x}&y={y}&z={z}"
+"Der Telegram Messenger kann eingebunden werden. Dafür muss ein BOT in "
+"Telegram erstellt werden, der Mitteilungen der Applikation übermitteln kann. "
+"Jeder Bot besitzt eine Identifikations-Kennung, die gespeichert werden muss, um "
+"eine Kommunikation zu starten."
-#: emonitor/modules/settings/templates/admin.settings.communication.html:43
+#: emonitor/modules/settings/templates/admin.settings.communication.html:89
msgid "settings.communication.telegram.botname"
-msgstr ""
+msgstr "Telegram Bot Identifikator"
-#: emonitor/modules/settings/templates/admin.settings.communication.html:50
+#: emonitor/modules/settings/templates/admin.settings.communication.html:96
msgid "settings.communication.telegram.boterror"
msgstr ""
+"Telegram Bot nicht verfügbar: Entweder steht das Python-Modul nicht zur "
+"Verfügung oder der angegebene Bot-Schlüssel ist falsch"
-#: emonitor/modules/settings/templates/admin.settings.communication.html:58
-#: emonitor/modules/settings/templates/admin.settings.communication.html:70
-msgid "settings.communication.telegram.testmessage"
+#: emonitor/modules/settings/templates/admin.settings.communication.html:101
+msgid "settings.communication.telegram.welcometext"
+msgstr "Bot Willkommensnachricht"
+
+#: emonitor/modules/settings/templates/admin.settings.communication.html:103
+msgid "settings.communication.telegram.welcomeinfo"
msgstr ""
+"Der Text wird dem Benutzer geschickt, der sich am Bot anmeldet. Dabei können "
+"folgende Variablen genutzt werden:
\n"
+"- {vorname}
- {nachname}
- /hilfe"
+
+#: emonitor/modules/settings/templates/admin.settings.communication.html:106
+msgid "settings.communication.telegram.helptext"
+msgstr "Bot Hilfenachricht"
+
+#: emonitor/modules/settings/templates/admin.settings.communication.html:109
+#: emonitor/modules/settings/templates/admin.settings.communication.html:150
+#: emonitor/modules/settings/templates/admin.settings.communication.html:164
+#: emonitor/modules/settings/templates/admin.settings.html:51
+#: emonitor/modules/settings/templates/admin.settings.html:62
+msgid "settings.save"
+msgstr "Speichern"
+
+#: emonitor/modules/settings/templates/admin.settings.communication.html:115
+msgid "settings.communication.telegram.testmessage"
+msgstr "Telegram Testmitteilung senden"
-#: emonitor/modules/settings/templates/admin.settings.communication.html:60
+#: emonitor/modules/settings/templates/admin.settings.communication.html:117
msgid "settings.communication.telegram.testuser"
-msgstr ""
+msgstr "Benutzer"
-#: emonitor/modules/settings/templates/admin.settings.communication.html:62
+#: emonitor/modules/settings/templates/admin.settings.communication.html:119
msgid "settings.communication.telegram.userselection"
-msgstr ""
+msgstr "- Empfänger auswählen -"
+
+#: emonitor/modules/settings/templates/admin.settings.communication.html:128
+msgid "settings.communication.telegram.testtext"
+msgstr "Test-Mitteilung"
-#: emonitor/modules/settings/templates/admin.settings.communication.html:73
+#: emonitor/modules/settings/templates/admin.settings.communication.html:132
msgid "settings.communication.telegram.sendtest"
+msgstr "Testnachricht senden"
+
+#: emonitor/modules/settings/templates/admin.settings.communication.html:141
+msgid "settings.communication.telegram.grouptitle"
+msgstr "Telegram Gruppen"
+
+#: emonitor/modules/settings/templates/admin.settings.communication.html:142
+msgid "settings.communication.telegram.groupinfo"
+msgstr ""
+"Es können beliebig viele Gruppen aus Telegram Benutzern gebildet werden, die "
+"bei bestimmten Events benachrichtigt werden. Die Namen der Gruppen dürfen nur "
+"aus Buchstaben ohne Leerzeichen bestehen. Gruppen können gelöscht werden, indem "
+"der Name leer gelassen wird. Durch markieren der Namen in den Kästen wird der "
+"Benutzer zur Gruppe hinzugefügt, grau hinterlegte Benutzer sind Mitglieder der "
+"Gruppe."
+
+#: emonitor/modules/settings/templates/admin.settings.communication.html:159
+#, fuzzy
+msgid "settings.communication.mail.info"
msgstr ""
+"Wenn für eine Kartenanzeige keine Koordinaten definiert worden sind, wird die "
+"Standardposition verwendet. Richten Sie die Mitte der Karte auf den gewünschten "
+"Punkt aus und bestätigen Sie mit 'Position speichern'."
+
+#: emonitor/modules/settings/templates/admin.settings.communication.html:161
+#, fuzzy
+msgid "settings.communiaction.mail.server"
+msgstr "Kartenserver"
#: emonitor/modules/settings/templates/admin.settings.department.html:16
msgid "settings.department.listtitle"
diff --git a/emonitor/modules/translations/modules.pot b/emonitor/modules/translations/modules.pot
index e6191fc..7b76b28 100644
--- a/emonitor/modules/translations/modules.pot
+++ b/emonitor/modules/translations/modules.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2016-05-04 20:12+0200\n"
+"POT-Creation-Date: 2016-05-17 16:54+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -802,49 +802,49 @@ msgid "trigger.alarm_changestate_sub"
msgstr ""
#: emonitor/modules/alarms/__init__.py:141
-#: emonitor/modules/alarms/alarmutils.py:320
+#: emonitor/modules/alarms/alarmutils.py:372
msgid "alarms.print.slightleft"
msgstr ""
#: emonitor/modules/alarms/__init__.py:142
-#: emonitor/modules/alarms/alarmutils.py:320
+#: emonitor/modules/alarms/alarmutils.py:372
msgid "alarms.print.slightright"
msgstr ""
#: emonitor/modules/alarms/__init__.py:143
-#: emonitor/modules/alarms/alarmutils.py:320
+#: emonitor/modules/alarms/alarmutils.py:372
msgid "alarms.print.right"
msgstr ""
#: emonitor/modules/alarms/__init__.py:144
-#: emonitor/modules/alarms/alarmutils.py:320
+#: emonitor/modules/alarms/alarmutils.py:372
msgid "alarms.print.left"
msgstr ""
#: emonitor/modules/alarms/__init__.py:145
-#: emonitor/modules/alarms/alarmutils.py:320
-#: emonitor/modules/alarms/alarmutils.py:335
+#: emonitor/modules/alarms/alarmutils.py:372
+#: emonitor/modules/alarms/alarmutils.py:387
msgid "alarms.print.straight"
msgstr ""
#: emonitor/modules/alarms/__init__.py:146
-#: emonitor/modules/alarms/alarmutils.py:320
-#: emonitor/modules/alarms/alarmutils.py:335
+#: emonitor/modules/alarms/alarmutils.py:372
+#: emonitor/modules/alarms/alarmutils.py:387
msgid "alarms.print.exit"
msgstr ""
#: emonitor/modules/alarms/__init__.py:147
-#: emonitor/modules/alarms/alarmutils.py:319
+#: emonitor/modules/alarms/alarmutils.py:371
msgid "alarms.print.bus"
msgstr ""
#: emonitor/modules/alarms/__init__.py:148
-#: emonitor/modules/alarms/alarmutils.py:337
+#: emonitor/modules/alarms/alarmutils.py:389
msgid "alarms.print.positive"
msgstr ""
#: emonitor/modules/alarms/__init__.py:149
-#: emonitor/modules/alarms/alarmutils.py:338
+#: emonitor/modules/alarms/alarmutils.py:390
msgid "alarms.print.negative"
msgstr ""
@@ -993,28 +993,28 @@ msgstr ""
msgid "list"
msgstr ""
-#: emonitor/modules/alarms/alarmutils.py:329
-#: emonitor/modules/alarms/alarmutils.py:331
+#: emonitor/modules/alarms/alarmutils.py:381
+#: emonitor/modules/alarms/alarmutils.py:383
msgid "alarms.print.highwaylong"
msgstr ""
-#: emonitor/modules/alarms/alarmutils.py:331
+#: emonitor/modules/alarms/alarmutils.py:383
msgid "alarms.print.highwayshort"
msgstr ""
-#: emonitor/modules/alarms/alarmutils.py:335
+#: emonitor/modules/alarms/alarmutils.py:387
msgid "alarms.print.exitstart"
msgstr ""
-#: emonitor/modules/alarms/alarmutils.py:335
+#: emonitor/modules/alarms/alarmutils.py:387
msgid "alarms.print.straightexit"
msgstr ""
-#: emonitor/modules/alarms/content_admin.py:246
+#: emonitor/modules/alarms/content_admin.py:247
msgid "admin.alarms.checkernotvalid"
msgstr ""
-#: emonitor/modules/alarms/content_admin.py:313
+#: emonitor/modules/alarms/content_admin.py:335
msgid "admin.alarms.list"
msgstr ""
@@ -1275,22 +1275,22 @@ msgid "alarms.type.delcheckerquestion"
msgstr ""
#: emonitor/modules/alarms/templates/admin.alarms.type.html:24
-#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:18
+#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:22
msgid "alarms.type.header.overview"
msgstr ""
#: emonitor/modules/alarms/templates/admin.alarms.type.html:25
-#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:19
+#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:23
msgid "alarms.type.info"
msgstr ""
#: emonitor/modules/alarms/templates/admin.alarms.type.html:30
-#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:32
+#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:36
msgid "alarms.type.name"
msgstr ""
#: emonitor/modules/alarms/templates/admin.alarms.type.html:31
-#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:37
+#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:41
msgid "alarms.type.keywords"
msgstr ""
@@ -1376,29 +1376,34 @@ msgid "alarms.upload.checkerfile"
msgstr ""
#: emonitor/modules/alarms/templates/admin.alarms.type.html:137
+#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:66
msgid "alarms.test.checkerstart"
msgstr ""
-#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:23
+#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:27
msgid "alarms.type.interpreter"
msgstr ""
-#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:42
+#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:46
msgid "alarms.type.variables"
msgstr ""
-#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:43
+#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:47
msgid "alarms.type.variableinfo"
msgstr ""
-#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:49
+#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:53
msgid "alarms.type.save"
msgstr ""
-#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:50
+#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:54
msgid "alarms.type.cancel"
msgstr ""
+#: emonitor/modules/alarms/templates/admin.alarms.type_actions.html:62
+msgid "alarms.upload.definitionfile"
+msgstr ""
+
#: emonitor/modules/alarms/templates/admin.alarms_alarm.html:13
#: emonitor/modules/alarms/templates/frontend.alarms_alarm.html:45
msgid "alarms.showfax"
@@ -3646,11 +3651,15 @@ msgstr ""
msgid "departmentcrest"
msgstr ""
-#: emonitor/modules/settings/content_admin.py:168
+#: emonitor/modules/settings/__init__.py:50
+msgid "telegram.default.welcomemsg"
+msgstr ""
+
+#: emonitor/modules/settings/content_admin.py:183
msgid "admin.settings.updatedberror"
msgstr ""
-#: emonitor/modules/settings/content_admin.py:176
+#: emonitor/modules/settings/content_admin.py:191
msgid "admin.settings.telegramtest.done"
msgstr ""
@@ -3674,58 +3683,88 @@ msgstr ""
msgid "settings.cars.save"
msgstr ""
-#: emonitor/modules/settings/templates/admin.settings.communication.html:28
+#: emonitor/modules/settings/templates/admin.settings.communication.html:5
+msgid "settings.communication.telegram.groupname"
+msgstr ""
+
+#: emonitor/modules/settings/templates/admin.settings.communication.html:72
+#: emonitor/modules/settings/templates/admin.settings.communication.html:82
+msgid "settings.communication.telegram.title"
+msgstr ""
+
+#: emonitor/modules/settings/templates/admin.settings.communication.html:75
+#: emonitor/modules/settings/templates/admin.settings.communication.html:158
msgid "settings.communication.mail.title"
msgstr ""
-#: emonitor/modules/settings/templates/admin.settings.communication.html:29
-msgid "settings.communication.mail.info"
+#: emonitor/modules/settings/templates/admin.settings.communication.html:83
+msgid "settings.communication.telegram.info"
msgstr ""
-#: emonitor/modules/settings/templates/admin.settings.communication.html:31
-msgid "settings.communiaction.mail.server"
+#: emonitor/modules/settings/templates/admin.settings.communication.html:89
+msgid "settings.communication.telegram.botname"
msgstr ""
-#: emonitor/modules/settings/templates/admin.settings.communication.html:34
-#: emonitor/modules/settings/templates/admin.settings.communication.html:55
-#: emonitor/modules/settings/templates/admin.settings.html:51
-#: emonitor/modules/settings/templates/admin.settings.html:62
-msgid "settings.save"
+#: emonitor/modules/settings/templates/admin.settings.communication.html:96
+msgid "settings.communication.telegram.boterror"
msgstr ""
-#: emonitor/modules/settings/templates/admin.settings.communication.html:40
-msgid "settings.communication.telegram.title"
+#: emonitor/modules/settings/templates/admin.settings.communication.html:101
+msgid "settings.communication.telegram.welcometext"
msgstr ""
-#: emonitor/modules/settings/templates/admin.settings.communication.html:41
-msgid "settings.communication.telegram.info"
+#: emonitor/modules/settings/templates/admin.settings.communication.html:103
+msgid "settings.communication.telegram.welcomeinfo"
msgstr ""
-#: emonitor/modules/settings/templates/admin.settings.communication.html:43
-msgid "settings.communication.telegram.botname"
+#: emonitor/modules/settings/templates/admin.settings.communication.html:106
+msgid "settings.communication.telegram.helptext"
msgstr ""
-#: emonitor/modules/settings/templates/admin.settings.communication.html:50
-msgid "settings.communication.telegram.boterror"
+#: emonitor/modules/settings/templates/admin.settings.communication.html:109
+#: emonitor/modules/settings/templates/admin.settings.communication.html:150
+#: emonitor/modules/settings/templates/admin.settings.communication.html:164
+#: emonitor/modules/settings/templates/admin.settings.html:51
+#: emonitor/modules/settings/templates/admin.settings.html:62
+msgid "settings.save"
msgstr ""
-#: emonitor/modules/settings/templates/admin.settings.communication.html:58
-#: emonitor/modules/settings/templates/admin.settings.communication.html:70
+#: emonitor/modules/settings/templates/admin.settings.communication.html:115
msgid "settings.communication.telegram.testmessage"
msgstr ""
-#: emonitor/modules/settings/templates/admin.settings.communication.html:60
+#: emonitor/modules/settings/templates/admin.settings.communication.html:117
msgid "settings.communication.telegram.testuser"
msgstr ""
-#: emonitor/modules/settings/templates/admin.settings.communication.html:62
+#: emonitor/modules/settings/templates/admin.settings.communication.html:119
msgid "settings.communication.telegram.userselection"
msgstr ""
-#: emonitor/modules/settings/templates/admin.settings.communication.html:73
+#: emonitor/modules/settings/templates/admin.settings.communication.html:128
+msgid "settings.communication.telegram.testtext"
+msgstr ""
+
+#: emonitor/modules/settings/templates/admin.settings.communication.html:132
msgid "settings.communication.telegram.sendtest"
msgstr ""
+#: emonitor/modules/settings/templates/admin.settings.communication.html:141
+msgid "settings.communication.telegram.grouptitle"
+msgstr ""
+
+#: emonitor/modules/settings/templates/admin.settings.communication.html:142
+msgid "settings.communication.telegram.groupinfo"
+msgstr ""
+
+#: emonitor/modules/settings/templates/admin.settings.communication.html:159
+msgid "settings.communication.mail.info"
+msgstr ""
+
+#: emonitor/modules/settings/templates/admin.settings.communication.html:161
+msgid "settings.communiaction.mail.server"
+msgstr ""
+
#: emonitor/modules/settings/templates/admin.settings.department.html:16
msgid "settings.department.listtitle"
msgstr ""