From d3e241988b0dafd8324eb3a822d8f30d9b5ff771 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 16 Jul 2015 09:37:08 +0000 Subject: [PATCH] * Mail/Kalendar: remove iCal from alarms and correctly display canceled events in mail --- calendar/inc/class.calendar_boupdate.inc.php | 6 +- calendar/inc/class.calendar_uiforms.inc.php | 31 +++++++- calendar/lang/egw_de.lang | 3 + calendar/lang/egw_en.lang | 3 + calendar/templates/default/meeting.xet | 7 ++ .../inc/class.emailadmin_imapbase.inc.php | 79 ------------------- mail/inc/class.mail_ui.inc.php | 1 - 7 files changed, 43 insertions(+), 87 deletions(-) diff --git a/calendar/inc/class.calendar_boupdate.inc.php b/calendar/inc/class.calendar_boupdate.inc.php index f333de2e1c..a0868d77c3 100644 --- a/calendar/inc/class.calendar_boupdate.inc.php +++ b/calendar/inc/class.calendar_boupdate.inc.php @@ -691,7 +691,6 @@ class calendar_boupdate extends calendar_bo case MSG_ALARM: $action = 'Alarm'; $pref = 'Alarm'; - $method = 'PUBLISH'; // duno if thats right break; default: $method = 'PUBLISH'; @@ -902,7 +901,8 @@ class calendar_boupdate extends calendar_bo //error_log(__METHOD__."() userid=$userid, timezone=".$timezone->getName().", startdate=$details[startdate], enddate=$details[enddate], updated=$details[updated], olddate=$details[olddate]"); list($subject,$notify_body) = explode("\n",$GLOBALS['egw']->preferences->parse_notify($notify_msg,$details),2); - switch($part_prefs['calendar']['update_format']) + // alarm is NOT an iCal method, therefore we have to use extened (no iCal) + switch($msg_type == MSG_ALARM ? 'extended' : $part_prefs['calendar']['update_format']) { case 'ical': if (is_null($ics) || $m_type != $msg_type) // need different ical for organizer notification @@ -955,7 +955,7 @@ class calendar_boupdate extends calendar_bo $notification->set_receivers(array($userid)); $notification->set_sender($senderid); $notification->set_subject($subject); - // as we want ical body to be just describtion, we can NOT set links, as they get appended to body + // as we want ical body to be just description, we can NOT set links, as they get appended to body if ($part_prefs['calendar']['update_format'] != 'ical') { $notification->set_message($notify_body."\n\n".$details['description']."\n\n".$details_body); diff --git a/calendar/inc/class.calendar_uiforms.inc.php b/calendar/inc/class.calendar_uiforms.inc.php index ae7035ac04..29791ef131 100644 --- a/calendar/inc/class.calendar_uiforms.inc.php +++ b/calendar/inc/class.calendar_uiforms.inc.php @@ -1780,6 +1780,10 @@ class calendar_uiforms extends calendar_ui } $event['id'] = $existing_event['id']; } + else // event not in calendar + { + $readonlys['button[cancel]'] = true; // no way to remove a canceled event not in calendar + } $event['participant_types'] = array(); foreach($event['participants'] as $uid => $status) { @@ -1799,7 +1803,8 @@ class calendar_uiforms extends calendar_ui $msg .= ($msg ? "\n" : '').lang('You are not invited to that event!'); if ($event['id']) { - $readonlys['button[accept]'] = $readonlys['button[tentativ]'] = $readonlys['button[reject]'] = true; + $readonlys['button[accept]'] = $readonlys['button[tentativ]'] = + $readonlys['button[reject]'] = $readonlys['button[cancel]'] = true; } } // ignore events in the past (for recurring events check enddate!) @@ -1807,7 +1812,8 @@ class calendar_uiforms extends calendar_ui (!$event['recur_type'] || $event['recur_enddate'] && $event['recur_enddate'] < $this->bo->now_su)) { $msg = lang('Requested meeting is in the past!'); - $readonlys['button[accept]'] = $readonlys['button[tentativ]'] = $readonlys['button[reject]'] = true; + $readonlys['button[accept]'] = $readonlys['button[tentativ]'] = + $readonlys['button[reject]'] = $readonlys['button[cancel]'] = true; } } else @@ -1868,6 +1874,12 @@ class calendar_uiforms extends calendar_ui } break; + case 'cancel': + if ($event['id'] && $this->bo->set_status($event['id'], $user, 'R')) + { + $msg = lang('Status changed'); + } + break; } // add notification-errors, if we have some $msg = array_merge((array)$msg, notifications::errors(true)); @@ -1875,8 +1887,19 @@ class calendar_uiforms extends calendar_ui $event['msg'] = implode("\n",(array)$msg); $readonlys['button[edit]'] = !$event['id']; $event['ics_method'] = $readonlys['ics_method'] = strtolower($ical_method); - $event['ics_method_label'] = strtolower($ical_method) == 'request' ? - lang('Meeting request') : lang('Reply to meeting request'); + switch(strtolower($ical_method)) + { + case 'reply': + $event['ics_method_label'] = lang('Reply to meeting request'); + break; + case 'cancel': + $event['ics_method_label'] = lang('Meeting canceled'); + break; + case 'request': + default: + $event['ics_method_label'] = lang('Meeting request'); + break; + } $tpl = new etemplate_new('calendar.meeting'); $tpl->exec('calendar.calendar_uiforms.meeting', $event, array(), $readonlys, $event, 2); } diff --git a/calendar/lang/egw_de.lang b/calendar/lang/egw_de.lang index d27d3a6049..84b65569c5 100644 --- a/calendar/lang/egw_de.lang +++ b/calendar/lang/egw_de.lang @@ -173,6 +173,7 @@ download calendar de Herunterladen download this event as ical calendar de Termin als iCal herunterladen duration calendar de Dauer duration of the meeting calendar de Dauer des Termins +edit event in calendar calendar de Termin im Kalender bearbeiten edit exception calendar de Ausnahme bearbeiten edit series calendar de Serie bearbeiten edit status or alarms for this particular day calendar de Bearbeite Status oder Alarme für diesen speziellen Tag @@ -323,6 +324,7 @@ make freebusy information available to not loged in persons? calendar de Die fre manage mapping calendar de Feldzuordnungen verwalten max. number of entries to show (leave empty for no restriction) calendar de Max. Anzahl von Einträgen die angezeigt werden sollen (Kein Eintrag = Keine Beschränkung) maximum available quantity of %1 exceeded! calendar de Maximale Anzahl von %1 erreicht! +meeting canceled calendar de Termin abgesagt meeting request calendar de Terminanfrage meetingrequest to all participants calendar de Terminanforderung an alle Teilnehmer merge document... calendar de Dokument einfügen... @@ -521,6 +523,7 @@ this entry is opened by user: calendar de Dieser Eintrag ist von einem anderen B this event is part of a series calendar de Dieser Termin ist Teil einer Serie this group that is preselected when you enter the planner. you can change it in the planner anytime you want. calendar de Diese Gruppe wird als Vorauswahl ausgewählt wenn Sie den Planer öffnen. Sie können die Gruppe jederzeit wechseln wenn Sie möchten. this is a recurring event. do you want to delete just this recurrence or the whole series? calendar de Das ist ein wiederholender Termin. Wollen Sie nur diese Wiederholung oder die ganze Serie löschen? +this mail cancels a meeting calendar de Diese Nachricht sagt einen Termin ab this mail contains a meeting request calendar de Diese Nachricht enthält eine Terminanfrage this mail contains a reply to a meeting request calendar de Diese Nachricht enthält eine Antwort auf eine Terminanfrage this message is sent for canceled or deleted events. calendar de Diese Benachrichtigung wird für stornierte oder gelöschte Termine versendet. diff --git a/calendar/lang/egw_en.lang b/calendar/lang/egw_en.lang index e221c4eb67..edc76a71b0 100644 --- a/calendar/lang/egw_en.lang +++ b/calendar/lang/egw_en.lang @@ -173,6 +173,7 @@ download calendar en Download download this event as ical calendar en Download this event as iCal duration calendar en Duration duration of the meeting calendar en Duration of the meeting +edit event in calendar calendar en Edit event in calendar edit exception calendar en Edit exception edit series calendar en Edit series edit status or alarms for this particular day calendar en Edit status or alarms for this particular day @@ -323,6 +324,7 @@ make freebusy information available to not loged in persons? calendar en Make Fr manage mapping calendar en Manage mapping max. number of entries to show (leave empty for no restriction) calendar en Max. number of entries to show. Leave empty for no restriction. maximum available quantity of %1 exceeded! calendar en Maximum available quantity of %1 exceeded! +meeting canceled calendar en Meeting canceled meeting request calendar en Meeting request meetingrequest to all participants calendar en Meetingrequest to all participants merge document... calendar en Merge document... @@ -521,6 +523,7 @@ this entry is opened by user: calendar en This entry was opened within the confi this event is part of a series calendar en This event is part of a series this group that is preselected when you enter the planner. you can change it in the planner anytime you want. calendar en This group that is preselected when you enter the planner. You can change it in the planner at any time. this is a recurring event. do you want to delete just this recurrence or the whole series? calendar en This is a recurring event. Do you want to delete just this recurrence or the whole series? +this mail cancels a meeting calendar en This mail cancels a meeting this mail contains a meeting request calendar en This mail contains a meeting request this mail contains a reply to a meeting request calendar en This mail contains a reply to a meeting request this message is sent for canceled or deleted events. calendar en This message is sent for canceled or deleted events. diff --git a/calendar/templates/default/meeting.xet b/calendar/templates/default/meeting.xet index 3c57e91371..7e8696906a 100644 --- a/calendar/templates/default/meeting.xet +++ b/calendar/templates/default/meeting.xet @@ -27,6 +27,13 @@ + + +