Add an action for deleted recurring events to delete the whole series

This commit is contained in:
Nathan Gray 2012-11-09 18:04:08 +00:00
parent 5057d1735e
commit 2ecd33725d

View File

@ -368,7 +368,7 @@ class calendar_uilist extends calendar_ui
// would put it back, which you do from the series, not purge it // would put it back, which you do from the series, not purge it
if($search_params['filter'] == 'deleted' && $event['recur_type']) if($search_params['filter'] == 'deleted' && $event['recur_type'])
{ {
$event['class'] .= ' rowDeleted rowNoDelete'; $event['class'] .= ' rowSeriesDeleted rowDeleted rowNoDelete';
} }
// Filemanager disabled for other applications // Filemanager disabled for other applications
@ -585,6 +585,12 @@ class calendar_uilist extends calendar_ui
} }
switch($action) switch($action)
{ {
case 'purgeseries':
// Delete an already deleted series
$recur_date = null;
// Make sure entire series is gone
$this->bo->delete($id, $recur_date,false,$skip_notification);
// fall through
case 'delete': case 'delete':
$action_msg = lang('deleted'); $action_msg = lang('deleted');
if ($id && $this->bo->delete($id, $recur_date,false,$skip_notification)) if ($id && $this->bo->delete($id, $recur_date,false,$skip_notification))
@ -857,16 +863,25 @@ class calendar_uilist extends calendar_ui
'confirm_multiple' => 'Delete these entries', 'confirm_multiple' => 'Delete these entries',
'group' => $group, 'group' => $group,
'disableClass' => 'rowNoDelete', 'disableClass' => 'rowNoDelete',
'hideOnDisabled' => true,
); );
// Add in deleted for admins // Add in deleted for admins
if($GLOBALS['egw_info']['server']['calendar_delete_history']) if($GLOBALS['egw_info']['server']['calendar_delete_history'])
{ {
$actions['purgeseries'] = array(
'caption' => 'Delete series',
'confirm' => 'Delete series',
'icon' => 'delete',
'group' => $group,
'enableClass' => 'rowSeriesDeleted',
'disableClass' => 'rowNoDelete',
'hideOnDisabled' => true,
);
$actions['undelete'] = array( $actions['undelete'] = array(
'caption' => 'Un-delete', 'caption' => 'Un-delete',
'hint' => 'Recover this event', 'hint' => 'Recover this event',
'icon' => 'revert', 'icon' => 'revert',
'group' => $group, 'group' => $group,
'enabled' => 'javaScript:nm_enableClass',
'enableClass' => 'rowDeleted', 'enableClass' => 'rowDeleted',
'hideOnDisabled' => true, 'hideOnDisabled' => true,
); );