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 cc77e68341
commit 45c89a7930
6 changed files with 14 additions and 21 deletions

View File

@ -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);

View File

@ -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(

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' => '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 {

View File

@ -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');

View File

@ -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;

View File

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