From a23abd324b369fa4e788af6ab08daef75df4c652 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 15 Jan 2013 20:06:52 +0000 Subject: [PATCH] - Fix deleting series with multiple events in series selected - Fix un-deleting series only restored after selected event --- calendar/inc/class.calendar_uilist.inc.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/calendar/inc/class.calendar_uilist.inc.php b/calendar/inc/class.calendar_uilist.inc.php index fe71c3bf7a..bd165b3dc6 100644 --- a/calendar/inc/class.calendar_uilist.inc.php +++ b/calendar/inc/class.calendar_uilist.inc.php @@ -559,7 +559,7 @@ class calendar_uilist extends calendar_ui { $timesheet_bo = new timesheet_bo(); } - foreach($checked as $id) + foreach($checked as &$id) { $recur_date = $app = $app_id = null; if(is_array($id) && $id['id']) @@ -588,6 +588,18 @@ class calendar_uilist extends calendar_ui if ($id && $this->bo->delete($id, $recur_date,false,$skip_notification)) { $success++; + if(!$recur_date && $settings == 'series') + { + // If there are multiple events in a series selected, the next one could purge + foreach($checked as $key => $c_id) + { + list($c_id,$recur_date) = explode(':',$c_id); + if($c_id == $id) + { + unset($checked[$key]); + } + } + } } else { @@ -596,6 +608,11 @@ class calendar_uilist extends calendar_ui break; case 'undelete': $action_msg = lang('recovered'); + if($settings == 'series') + { + // unDelete the whole thing + $recur_date = 0; + } if ($id && ($event = $this->bo->read($id, $recur_date)) && $this->bo->check_perms(EGW_ACL_EDIT,$id) && is_array($event) && $event['deleted']) {