From 45c89a7930a78dd5d95155a3cbf8b477a52fd8b2 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 18 May 2021 13:11:14 +0200 Subject: [PATCH] remove config allowing to immediately delete events (as it's required for sync) --- calendar/inc/class.calendar_boupdate.inc.php | 2 +- calendar/inc/class.calendar_groupdav.inc.php | 2 +- calendar/inc/class.calendar_ui.inc.php | 5 +---- calendar/inc/class.calendar_uiforms.inc.php | 2 +- calendar/inc/class.calendar_uilist.inc.php | 21 +++++++++----------- calendar/templates/default/config.xet | 3 +-- 6 files changed, 14 insertions(+), 21 deletions(-) diff --git a/calendar/inc/class.calendar_boupdate.inc.php b/calendar/inc/class.calendar_boupdate.inc.php index 12b788184e..14f8f99f43 100644 --- a/calendar/inc/class.calendar_boupdate.inc.php +++ b/calendar/inc/class.calendar_boupdate.inc.php @@ -1906,7 +1906,7 @@ class calendar_boupdate extends calendar_bo if (!$recur_date || $event['recur_type'] == MCAL_RECUR_NONE) { $config = Api\Config::read('phpgwapi'); - if(!$config['calendar_delete_history'] || $event['deleted']) + if ($event['deleted']) { $this->so->delete($cal_id); diff --git a/calendar/inc/class.calendar_groupdav.inc.php b/calendar/inc/class.calendar_groupdav.inc.php index bbba7a310d..5922d45310 100644 --- a/calendar/inc/class.calendar_groupdav.inc.php +++ b/calendar/inc/class.calendar_groupdav.inc.php @@ -1621,7 +1621,7 @@ class calendar_groupdav extends Api\CalDAV\Handler ); // rfc 6578 sync-collection report for everything but outbox // only if "delete-prevention" is switched on (deleted entries get marked deleted but not actualy deleted - if (strpos($path, '/outbox/') === false && $GLOBALS['egw_info']['server']['calendar_delete_history']) + if (strpos($path, '/outbox/') === false) { $props['supported-report-set']['sync-collection'] = Api\CalDAV::mkprop('supported-report',array( Api\CalDAV::mkprop('report',array( diff --git a/calendar/inc/class.calendar_ui.inc.php b/calendar/inc/class.calendar_ui.inc.php index a545d8a247..5446573d60 100644 --- a/calendar/inc/class.calendar_ui.inc.php +++ b/calendar/inc/class.calendar_ui.inc.php @@ -583,10 +583,7 @@ class calendar_ui array('value' => 'no-enum-groups', 'label' => lang('only group-events'),'title' => lang('Do not include events of group members')), array('value' => 'not-unknown', 'label' => lang('No meeting requests'),'title' => lang('Show all status, but unknown')), ); - if($GLOBALS['egw_info']['server']['calendar_delete_history']) - { - $sel_options['status_filter'][] = array('value' => 'deleted', 'label' => lang('Deleted'), 'title' => lang('Show events that have been deleted')); - } + $sel_options['status_filter'][] = array('value' => 'deleted', 'label' => lang('Deleted'), 'title' => lang('Show events that have been deleted')); // Merge print try { diff --git a/calendar/inc/class.calendar_uiforms.inc.php b/calendar/inc/class.calendar_uiforms.inc.php index 4e790c7e74..f7297a382b 100644 --- a/calendar/inc/class.calendar_uiforms.inc.php +++ b/calendar/inc/class.calendar_uiforms.inc.php @@ -1935,7 +1935,7 @@ class calendar_uiforms extends calendar_ui } // Allow admins to restore deleted events - if($GLOBALS['egw_info']['server']['calendar_delete_history'] && $event['deleted'] ) + if ($event['deleted']) { $content['deleted'] = $preserved['deleted'] = null; $etpl->set_cell_attribute('button[save]', 'label', 'Recover'); diff --git a/calendar/inc/class.calendar_uilist.inc.php b/calendar/inc/class.calendar_uilist.inc.php index 6e014f2bfa..f154ed6753 100644 --- a/calendar/inc/class.calendar_uilist.inc.php +++ b/calendar/inc/class.calendar_uilist.inc.php @@ -1123,18 +1123,15 @@ class calendar_uilist extends calendar_ui 'confirm' => lang('Delete this entry') ); // Add in deleted for admins - if($GLOBALS['egw_info']['server']['calendar_delete_history']) - { - $actions['undelete'] = array( - 'caption' => 'Un-delete', - 'onExecute' => 'javaScript:app.calendar.cal_delete', - 'icon' => 'revert', - 'hint' => 'Recover this event', - 'group' => $group, - 'enableClass' => 'rowDeleted', - 'hideOnDisabled' => true, - ); - } + $actions['undelete'] = array( + 'caption' => 'Un-delete', + 'onExecute' => 'javaScript:app.calendar.cal_delete', + 'icon' => 'revert', + 'hint' => 'Recover this event', + 'group' => $group, + 'enableClass' => 'rowDeleted', + 'hideOnDisabled' => true, + ); //_debug_array($actions); return $actions; diff --git a/calendar/templates/default/config.xet b/calendar/templates/default/config.xet index 18249cabe6..9e3917cdea 100644 --- a/calendar/templates/default/config.xet +++ b/calendar/templates/default/config.xet @@ -65,8 +65,7 @@