From 5057d1735edc8d5d90e9cb8effddda4f5e1299d8 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Fri, 9 Nov 2012 17:14:02 +0000 Subject: [PATCH] Allow viewing / editing deleted exceptions by editing the series --- calendar/inc/class.calendar_uiforms.inc.php | 2 +- calendar/inc/class.calendar_uilist.inc.php | 6 +++--- calendar/js/app.js | 10 +++++++++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/calendar/inc/class.calendar_uiforms.inc.php b/calendar/inc/class.calendar_uiforms.inc.php index 83cfadd5ea..0cbf9c45a5 100644 --- a/calendar/inc/class.calendar_uiforms.inc.php +++ b/calendar/inc/class.calendar_uiforms.inc.php @@ -1496,7 +1496,7 @@ function replace_eTemplate_onsubmit() { $content['alarm'] = false; } - $content['msg'] = $msg; + $content['msg'] = $msg ? $msg : $_GET['msg']; if ($view) { diff --git a/calendar/inc/class.calendar_uilist.inc.php b/calendar/inc/class.calendar_uilist.inc.php index 19430482e4..662b8b2858 100644 --- a/calendar/inc/class.calendar_uilist.inc.php +++ b/calendar/inc/class.calendar_uilist.inc.php @@ -364,11 +364,11 @@ class calendar_uilist extends calendar_ui { $event['class'] .= 'rowDeleted '; } - // Disable everything for 'deleted' exceptions - there's nothing - // logical to do except undelete it + // Disable delete for 'deleted' exceptions - deleting the exception + // would put it back, which you do from the series, not purge it if($search_params['filter'] == 'deleted' && $event['recur_type']) { - $event['class'] .= ' rowNoView rowNoDelete rowDeleted'; + $event['class'] .= ' rowDeleted rowNoDelete'; } // Filemanager disabled for other applications diff --git a/calendar/js/app.js b/calendar/js/app.js index d66702346d..53872cc40b 100644 --- a/calendar/js/app.js +++ b/calendar/js/app.js @@ -53,11 +53,19 @@ function cal_open(_action, _senders) var id = _senders[0].id; var matches = id.match(/^(?:calendar::)?([0-9]+):([0-9]+)$/); var backup = _action.data; - if (matches) + var row = _senders[0].iface.node; + + if (matches && !$j(row).hasClass("rowDeleted")) { edit_series(matches[1],matches[2]); return; } + else if (matches && $j(row).hasClass("rowDeleted") && _action.data.url) + { + // Trying to edit a deleted exception, use original event & add a message + _senders[0].id = matches[1]; + _action.data.url += '&msg='+encodeURIComponent(egw.lang('Editing series')); + } else if (matches = id.match(/^([a-z_-]+)([0-9]+)/i)) { var app = matches[1];