remove config allowing to immediately delete events (as it's required for sync)

This commit is contained in:
Ralf Becker 2021-05-18 13:11:14 +02:00
parent 2d24362f8f
commit d8bb858efc
6 changed files with 14 additions and 21 deletions

View File

@ -1899,7 +1899,7 @@ class calendar_boupdate extends calendar_bo
if (!$recur_date || $event['recur_type'] == MCAL_RECUR_NONE) if (!$recur_date || $event['recur_type'] == MCAL_RECUR_NONE)
{ {
$config = Api\Config::read('phpgwapi'); $config = Api\Config::read('phpgwapi');
if(!$config['calendar_delete_history'] || $event['deleted']) if ($event['deleted'])
{ {
$this->so->delete($cal_id); $this->so->delete($cal_id);

View File

@ -1622,7 +1622,7 @@ class calendar_groupdav extends Api\CalDAV\Handler
); );
// rfc 6578 sync-collection report for everything but outbox // 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 // 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( $props['supported-report-set']['sync-collection'] = Api\CalDAV::mkprop('supported-report',array(
Api\CalDAV::mkprop('report',array( Api\CalDAV::mkprop('report',array(

View File

@ -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' => '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')), 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 // Merge print
try { try {

View File

@ -1935,7 +1935,7 @@ class calendar_uiforms extends calendar_ui
} }
// Allow admins to restore deleted events // Allow admins to restore deleted events
if($GLOBALS['egw_info']['server']['calendar_delete_history'] && $event['deleted'] ) if ($event['deleted'])
{ {
$content['deleted'] = $preserved['deleted'] = null; $content['deleted'] = $preserved['deleted'] = null;
$etpl->set_cell_attribute('button[save]', 'label', 'Recover'); $etpl->set_cell_attribute('button[save]', 'label', 'Recover');

View File

@ -1123,18 +1123,15 @@ class calendar_uilist extends calendar_ui
'confirm' => lang('Delete this entry') 'confirm' => lang('Delete this entry')
); );
// Add in deleted for admins // Add in deleted for admins
if($GLOBALS['egw_info']['server']['calendar_delete_history']) $actions['undelete'] = array(
{ 'caption' => 'Un-delete',
$actions['undelete'] = array( 'onExecute' => 'javaScript:app.calendar.cal_delete',
'caption' => 'Un-delete', 'icon' => 'revert',
'onExecute' => 'javaScript:app.calendar.cal_delete', 'hint' => 'Recover this event',
'icon' => 'revert', 'group' => $group,
'hint' => 'Recover this event', 'enableClass' => 'rowDeleted',
'group' => $group, 'hideOnDisabled' => true,
'enableClass' => 'rowDeleted', );
'hideOnDisabled' => true,
);
}
//_debug_array($actions); //_debug_array($actions);
return $actions; return $actions;

View File

@ -65,8 +65,7 @@
<row> <row>
<description value="Prevent deleting of entries"/> <description value="Prevent deleting of entries"/>
<select id="newsettings[calendar_delete_history]"> <select id="newsettings[calendar_delete_history]">
<option value="">No</option> <option value="">Yes, only admins can purge deleted items</option>
<option value="history">Yes, only admins can purge deleted items</option>
<option value="userpurge">Yes, users can purge their deleted items</option> <option value="userpurge">Yes, users can purge their deleted items</option>
</select> </select>
</row> </row>