From ed4884655f289399d0aab542e9fc5710f1804dd6 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Wed, 8 Apr 2020 20:42:57 +0200 Subject: [PATCH] Fix videoconference actions --- calendar/js/app.js | 15 +++++++++++++-- calendar/js/app.ts | 19 +++++++++++++++++-- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/calendar/js/app.js b/calendar/js/app.js index f10cafaf4a..afc0cd034e 100644 --- a/calendar/js/app.js +++ b/calendar/js/app.js @@ -3364,8 +3364,19 @@ var CalendarApp = /** @class */ (function (_super) { } }; CalendarApp.prototype.isVideoConference = function (_action, _selected) { - var data = egw.dataGetUIDdata(_selected[0].id)['data']; - return data['##videoconference']; + var data = egw.dataGetUIDdata(_selected[0].id); + return data && data.data ? data.data['##videoconference'] : false; + }; + CalendarApp.prototype.joinVideoConference = function (_action, _sender) { + var data = egw.dataGetUIDdata(_sender[0].id)['data']; + egw.json("EGroupware\\Status\\Videoconference\\Call::ajax_genMeetingUrl", [data['##videoconference'], + { + name: egw.user('account_fullname'), + account_id: egw.user('account_id'), + email: egw.user('account_email') + }], function (_url) { + app.status.openCall(_url); + }).sendRequest(); }; /** * These are the keys we keep to set & remember the status, others are discarded diff --git a/calendar/js/app.ts b/calendar/js/app.ts index b766bed58a..c2e8a6b3b7 100644 --- a/calendar/js/app.ts +++ b/calendar/js/app.ts @@ -4164,8 +4164,23 @@ class CalendarApp extends EgwApp public isVideoConference(_action, _selected) { - let data = egw.dataGetUIDdata(_selected[0].id)['data']; - return data['##videoconference']; + let data = egw.dataGetUIDdata(_selected[0].id); + return data && data.data ? data.data['##videoconference'] : false; + } + + public joinVideoConference(_action, _sender) + { + let data = egw.dataGetUIDdata(_sender[0].id)['data']; + egw.json( + "EGroupware\\Status\\Videoconference\\Call::ajax_genMeetingUrl", + [data['##videoconference'], + { + name:egw.user('account_fullname'), + account_id:egw.user('account_id'), + email:egw.user('account_email') + }], function(_url){ + app.status.openCall(_url); + }).sendRequest(); } }