From 79f807915080c4ae14124f28f50f8ca0b7347c9c Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Tue, 28 Apr 2020 18:35:25 +0200 Subject: [PATCH] Add "Invite to call" action for inviting users into an existing call --- addressbook/inc/class.addressbook_ui.inc.php | 7 +++++++ addressbook/js/app.js | 10 +++++++++- addressbook/js/app.ts | 14 +++++++++++++- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/addressbook/inc/class.addressbook_ui.inc.php b/addressbook/inc/class.addressbook_ui.inc.php index 0878cf2d09..23d98d0869 100644 --- a/addressbook/inc/class.addressbook_ui.inc.php +++ b/addressbook/inc/class.addressbook_ui.inc.php @@ -592,6 +592,13 @@ class addressbook_ui extends addressbook_bo 'onExecute' => 'javaScript:app.addressbook.videoconference_actionCall', 'enabled' => 'javaScript:app.addressbook.videoconference_isUserOnline' ], + 'invite' => [ + 'caption' => lang('Invite to Call'), + 'icon' => 'status/videoconference_join', + 'allowOnMultiple' => true, + 'onExecute' => 'javaScript:app.addressbook.videoconference_actionCall', + 'enabled' => 'javaScript:app.addressbook.videoconference_isThereAnyCall' + ], 'schedule_call' => [ 'caption' => lang('Schedule a video conference'), 'icon' => 'calendar', diff --git a/addressbook/js/app.js b/addressbook/js/app.js index c4b50d7d70..180e04a78d 100644 --- a/addressbook/js/app.js +++ b/addressbook/js/app.js @@ -1104,6 +1104,9 @@ var AddressbookApp = /** @class */ (function (_super) { } return true; }; + AddressbookApp.prototype.videoconference_isThereAnyCall = function (_action, _selected) { + return this.videoconference_isUserOnline(_action, _selected) && egw.getSessionItem('status', 'videoconference-session'); + }; /** * Call action * @param _action @@ -1119,7 +1122,12 @@ var AddressbookApp = /** @class */ (function (_super) { avatar: "account:" + row.data.account_id }); } - app.status.makeCall(data); + if (_action.id == 'invite') { + app.status.inviteToCall(data, egw.getSessionItem('status', 'videoconference-session')); + } + else { + app.status.makeCall(data); + } }; return AddressbookApp; }(egw_app_1.EgwApp)); diff --git a/addressbook/js/app.ts b/addressbook/js/app.ts index e6110f7139..584d5955fb 100644 --- a/addressbook/js/app.ts +++ b/addressbook/js/app.ts @@ -1343,6 +1343,11 @@ class AddressbookApp extends EgwApp return true; } + private videoconference_isThereAnyCall(_action, _selected) + { + return this.videoconference_isUserOnline(_action, _selected) && egw.getSessionItem('status', 'videoconference-session'); + } + /** * Call action * @param _action @@ -1360,7 +1365,14 @@ class AddressbookApp extends EgwApp avatar: "account:"+row.data.account_id }); } - app.status.makeCall(data); + if (_action.id == 'invite') + { + app.status.inviteToCall(data, egw.getSessionItem('status', 'videoconference-session')); + } + else + { + app.status.makeCall(data); + } } }