From 10f70d9410d499c3da18a5a89720a608d6c1bada Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 16 Jun 2020 16:53:43 +0200 Subject: [PATCH] * Calendar/Email: show additional [Delete] and [Edit] buttons for a meeting canceled message --- calendar/inc/class.calendar_boupdate.inc.php | 8 +++++--- calendar/inc/class.calendar_uiforms.inc.php | 20 +++++++++++++++++++- calendar/lang/egw_de.lang | 2 ++ calendar/lang/egw_en.lang | 2 ++ calendar/templates/default/meeting.xet | 8 +++++--- 5 files changed, 33 insertions(+), 7 deletions(-) diff --git a/calendar/inc/class.calendar_boupdate.inc.php b/calendar/inc/class.calendar_boupdate.inc.php index 772870b772..f0e28e4960 100644 --- a/calendar/inc/class.calendar_boupdate.inc.php +++ b/calendar/inc/class.calendar_boupdate.inc.php @@ -1778,7 +1778,7 @@ class calendar_boupdate extends calendar_bo * @param int $cal_id id of the event to delete * @param int $recur_date =0 if a single event from a series should be deleted, its date * @param boolean $ignore_acl =false true for no ACL check, default do ACL check - * @param boolean $skip_notification =false + * @param boolean|array $skip_notification =false or array with uid to skip eg. [5,'eemail@example.org'] * @param boolean $delete_exceptions =true true: delete, false: keep exceptions (with new UID) * @param int &$exceptions_kept=null on return number of kept exceptions * @return boolean true on success, false on error (usually permission denied) @@ -1794,9 +1794,11 @@ class calendar_boupdate extends calendar_bo } // Don't send notification if the event has already been deleted - if(!$event['deleted'] && !$skip_notification) + if (!$event['deleted'] && (!$skip_notification || is_array($skip_notification))) { - $this->send_update(MSG_DELETED,$event['participants'],$event); + $to_notify = !is_array($skip_notification) ? $event['participants'] : + array_diff_key($event['participants'], array_flip($skip_notification)); + $this->send_update(MSG_DELETED, $to_notify, $event); } if (!$recur_date || $event['recur_type'] == MCAL_RECUR_NONE) diff --git a/calendar/inc/class.calendar_uiforms.inc.php b/calendar/inc/class.calendar_uiforms.inc.php index f750212c20..02a1e39ab2 100644 --- a/calendar/inc/class.calendar_uiforms.inc.php +++ b/calendar/inc/class.calendar_uiforms.inc.php @@ -2148,6 +2148,15 @@ class calendar_uiforms extends calendar_ui } } break; + case 'cancel': + // first participant is the (external) organizer (our iCal parser adds owner first!) + $parts = $event['participants']; + unset($parts[$existing_event['owner']]); + $event['ical_sender_uid'] = key($parts); + if (empty($existing_event['id']) || !$this->bo->check_perms(Acl::DELETE, $existing_event['id'])) + { + $readonlys['button[delete]'] = true; + } } $event['id'] = $existing_event['id']; } @@ -2303,11 +2312,20 @@ class calendar_uiforms extends calendar_ui break; case 'cancel': - if ($event['id'] && $this->bo->set_status($event['id'], $user, 'R', $event['recurrence'])) + if ($event['id'] && $this->bo->set_status($event['id'], $user, 'R', $event['recurrence'], + false, true, true)) // no reply to organizer { $msg = lang('Status changed'); } break; + + case 'delete': + if ($event['id'] && $this->bo->delete($event['id'], $event['recurrence'], + false, [$event['ical_sender_uid']])) // no reply to organizer + { + $msg = lang('Event deleted.'); + } + break; } // add notification-errors, if we have some $msg = array_merge((array)$msg, notifications::errors(true)); diff --git a/calendar/lang/egw_de.lang b/calendar/lang/egw_de.lang index 7eb14d932a..d50944d723 100644 --- a/calendar/lang/egw_de.lang +++ b/calendar/lang/egw_de.lang @@ -159,6 +159,7 @@ delete series calendar de Serie löschen delete this alarm calendar de Diesen Alarm löschen delete this event calendar de Diesen Termin löschen delete this exception calendar de Diese Ausnahme löschen +delete this meeting for all participants calendar de Löscht diesen Termin für alle Teilnehmer delete this recurrence calendar de Diese Wiederholung löschen delete this series of recurring events calendar de Diese Serie von wiederholenden Terminen löschen deleted calendar de Gelöscht @@ -461,6 +462,7 @@ recurring event calendar de Wiederholender Termin regular edit calendar de reguläres Bearbeiten reject calendar de Absagen rejected calendar de Abgesagt +removes the event from my calendar calendar de Entfernt diesen Termin aus meinem Kalender repeat days calendar de Wiederholungstage repeat the event until which date (empty means unlimited) calendar de Bis zu welchen Datum soll der Termin wiederholt werden (leer bedeutet unbegrenzt) repeat type calendar de Wiederholungstyp diff --git a/calendar/lang/egw_en.lang b/calendar/lang/egw_en.lang index 689116a6ab..f0b04d0387 100644 --- a/calendar/lang/egw_en.lang +++ b/calendar/lang/egw_en.lang @@ -159,6 +159,7 @@ delete series calendar en Delete series delete this alarm calendar en Delete this alarm delete this event calendar en Delete this event delete this exception calendar en Delete this exception +delete this meeting for all participants calendar en Delete this meeting for all participants delete this recurrence calendar en Delete this recurrence delete this series of recurring events calendar en Delete this series of recurring events deleted calendar en Deleted. @@ -461,6 +462,7 @@ recurring event calendar en Recurring event regular edit calendar en Regular edit reject calendar en Reject rejected calendar en Rejected +removes the event from my calendar calendar en Removes the event from my calendar repeat days calendar en Repeat days repeat the event until which date (empty means unlimited) calendar en Repeat the event until which date. Empty for unlimited. repeat type calendar en Repeat type diff --git a/calendar/templates/default/meeting.xet b/calendar/templates/default/meeting.xet index 1cfa1ced31..5d91852ec3 100644 --- a/calendar/templates/default/meeting.xet +++ b/calendar/templates/default/meeting.xet @@ -1,6 +1,5 @@ -