* Calendar/Email: show additional [Delete] and [Edit] buttons for a meeting canceled message

This commit is contained in:
Ralf Becker 2020-06-16 16:53:43 +02:00
parent 2c489ef5b8
commit 10f70d9410
5 changed files with 33 additions and 7 deletions

View File

@ -1778,7 +1778,7 @@ class calendar_boupdate extends calendar_bo
* @param int $cal_id id of the event to delete * @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 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 $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 boolean $delete_exceptions =true true: delete, false: keep exceptions (with new UID)
* @param int &$exceptions_kept=null on return number of kept exceptions * @param int &$exceptions_kept=null on return number of kept exceptions
* @return boolean true on success, false on error (usually permission denied) * @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 // 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) if (!$recur_date || $event['recur_type'] == MCAL_RECUR_NONE)

View File

@ -2148,6 +2148,15 @@ class calendar_uiforms extends calendar_ui
} }
} }
break; 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']; $event['id'] = $existing_event['id'];
} }
@ -2303,11 +2312,20 @@ class calendar_uiforms extends calendar_ui
break; break;
case 'cancel': 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'); $msg = lang('Status changed');
} }
break; 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 // add notification-errors, if we have some
$msg = array_merge((array)$msg, notifications::errors(true)); $msg = array_merge((array)$msg, notifications::errors(true));

View File

@ -159,6 +159,7 @@ delete series calendar de Serie löschen
delete this alarm calendar de Diesen Alarm löschen delete this alarm calendar de Diesen Alarm löschen
delete this event calendar de Diesen Termin löschen delete this event calendar de Diesen Termin löschen
delete this exception calendar de Diese Ausnahme 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 recurrence calendar de Diese Wiederholung löschen
delete this series of recurring events calendar de Diese Serie von wiederholenden Terminen löschen delete this series of recurring events calendar de Diese Serie von wiederholenden Terminen löschen
deleted calendar de Gelöscht deleted calendar de Gelöscht
@ -461,6 +462,7 @@ recurring event calendar de Wiederholender Termin
regular edit calendar de reguläres Bearbeiten regular edit calendar de reguläres Bearbeiten
reject calendar de Absagen reject calendar de Absagen
rejected calendar de Abgesagt rejected calendar de Abgesagt
removes the event from my calendar calendar de Entfernt diesen Termin aus meinem Kalender
repeat days calendar de Wiederholungstage 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 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 repeat type calendar de Wiederholungstyp

View File

@ -159,6 +159,7 @@ delete series calendar en Delete series
delete this alarm calendar en Delete this alarm delete this alarm calendar en Delete this alarm
delete this event calendar en Delete this event delete this event calendar en Delete this event
delete this exception calendar en Delete this exception 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 recurrence calendar en Delete this recurrence
delete this series of recurring events calendar en Delete this series of recurring events delete this series of recurring events calendar en Delete this series of recurring events
deleted calendar en Deleted. deleted calendar en Deleted.
@ -461,6 +462,7 @@ recurring event calendar en Recurring event
regular edit calendar en Regular edit regular edit calendar en Regular edit
reject calendar en Reject reject calendar en Reject
rejected calendar en Rejected 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 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 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 repeat type calendar en Repeat type

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE overlay PUBLIC "-//EGroupware GmbH//eTemplate 2//EN" "http://www.egroupware.org/etemplate2.dtd"> <!DOCTYPE overlay PUBLIC "-//EGroupware GmbH//eTemplate 2//EN" "http://www.egroupware.org/etemplate2.dtd">
<!-- $Id$ -->
<overlay> <overlay>
<template id="calendar.meeting" template="" lang="" group="0" version="1.9.002"> <template id="calendar.meeting" template="" lang="" group="0" version="1.9.002">
<grid border="0" width="100%"> <grid border="0" width="100%">
@ -31,8 +30,11 @@
</row> </row>
<row disabled="!@ics_method=cancel"> <row disabled="!@ics_method=cancel">
<description value="This mail cancels a meeting" class="meetingRequestMessage"/> <description value="This mail cancels a meeting" class="meetingRequestMessage"/>
<button label="Apply" id="button[cancel]" class="leftPad5"/> <button label="Apply" statustext="Removes the event from my calendar" id="button[cancel]" class="leftPad5"/>
<description/> <button label="Delete" statustext="Delete this meeting for all participants" id="button[delete]" class="leftPad5"
onclick="et2_dialog.confirm(widget,'Delete this meeting for all participants','Delete')"/>
<buttononly statustext="Edit event in calendar" label="Edit" id="button[edit]"
onclick="window.open(egw::link('/index.php','menuaction=calendar.calendar_uiforms.edit&amp;cal_id=$cont[id]'),'_blank','dependent=yes,width=750,height=410,scrollbars=yes,status=yes'); return false;" class="leftPad5"/>
<description/> <description/>
<description/> <description/>
<description id="error" class="meetingRequestError" align="right"/> <description id="error" class="meetingRequestError" align="right"/>