* Calendar: Fix notifications show actions for alarm notify messages

This commit is contained in:
Hadi Nategh 2018-06-27 16:25:10 +02:00
parent 9148b4665d
commit b64d96f3de
3 changed files with 6 additions and 3 deletions

View File

@ -1095,10 +1095,11 @@ class calendar_boupdate extends calendar_bo
// Add ACCEPT|REHECT|TENTATIVE actions
$notification->set_popupdata('calendar', array(
'event_id' => $event['id'],
'user_id' => $userid
'user_id' => $userid,
'type' => $m_type
));
}
if ($m_type === MSG_ALARM) $notification->set_popupdata('calendar', array('egw_pr_notify' => 1));
if ($m_type === MSG_ALARM) $notification->set_popupdata('calendar', array('egw_pr_notify' => 1, 'type' => $m_type));
$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')));

View File

@ -895,6 +895,8 @@ END:VALARM';
public static function notifications_actions ($params)
{
Api\Translation::add_app('calendar');
// do not set actions for alarm type
if ($params['data']['type'] == 6) return array();
return array(
array(
'id' => 'A',

View File

@ -186,7 +186,7 @@ class notifications_ajax {
foreach ($rs as $notification) {
$actions = null;
$data = json_decode($notification['notify_data'], true);
if ($data['appname'])
if ($data['appname'] && $data['data'])
{
$_actions = Api\Hooks::process (array(
'location' => 'notifications_actions',