Add a call notification when receiving an event alarm

This commit is contained in:
Hadi Nategh 2020-04-07 17:16:56 +02:00
parent a6e6393943
commit 7c14d09409
3 changed files with 20 additions and 2 deletions

View File

@ -1159,7 +1159,7 @@ class calendar_boupdate extends calendar_bo
'videoconference' => $details['videoconference'], 'videoconference' => $details['videoconference'],
) + ($alarm ? ['alarm-offset' => (int)$alarm['offset']] : [])); ) + ($alarm ? ['alarm-offset' => (int)$alarm['offset']] : []));
} }
if ($m_type === MSG_ALARM) $notification->set_popupdata('calendar', array('egw_pr_notify' => 1, 'type' => $m_type)); if ($m_type === MSG_ALARM) $notification->set_popupdata('calendar', array('egw_pr_notify' => 1, 'type' => $m_type, 'videoconference' => $details['videoconference']));
$notification->set_popupmessage($subject."\n\n".$notify_body."\n\n".$details['description']."\n\n".$details_body."\n\n"); $notification->set_popupmessage($subject."\n\n".$notify_body."\n\n".$details['description']."\n\n".$details_body."\n\n");
$notification->set_popuplinks(array($details['link_arr']+array('app'=>'calendar'))); $notification->set_popuplinks(array($details['link_arr']+array('app'=>'calendar')));

View File

@ -880,7 +880,21 @@ END:VALARM';
{ {
Api\Translation::add_app('calendar'); Api\Translation::add_app('calendar');
// do not set actions for alarm type // do not set actions for alarm type
if ($params['data']['type'] == 6) return array(); if ($params['data']['type'] == 6)
{
if (!empty($params['data']['videoconference']))
{
return [
array(
'id' => 'J',
'caption' => lang('Join'),
'icon' => 'accept_call',
'onExecute' => 'app.status.openCall("'.$params['data']['videoconference'].'");'
)
];
}
return array();
}
return array( return array(
array( array(
'id' => 'A', 'id' => 'A',

View File

@ -356,6 +356,10 @@
switch (notifymessages[id]['extra_data']['egw_pr_notify']) switch (notifymessages[id]['extra_data']['egw_pr_notify'])
{ {
case EGW_PR_NOTIFY_HEIGH: case EGW_PR_NOTIFY_HEIGH:
if (notifymessages[id]['extra_data']['videoconference'])
{
app.status.notificationPopup(notifymessages[id]['extra_data']['videoconference']);
}
poped.push(id); poped.push(id);
this.toggle(true); this.toggle(true);
break; break;