From 22e4fc038f1700eb857a710f12d001edd91fe9fd Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 17 Nov 2015 21:32:46 +0000 Subject: [PATCH] Send some refresh commands when deleting --- calendar/inc/class.calendar_uilist.inc.php | 15 +++++++++++++++ calendar/js/app.js | 1 + calendar/js/et2_widget_event.js | 4 ++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/calendar/inc/class.calendar_uilist.inc.php b/calendar/inc/class.calendar_uilist.inc.php index fab78a57fc..c8bdb80146 100644 --- a/calendar/inc/class.calendar_uilist.inc.php +++ b/calendar/inc/class.calendar_uilist.inc.php @@ -670,6 +670,11 @@ class calendar_uilist extends calendar_ui } } } + + if(egw_json_response::isJSONResponse()) + { + egw_json_response::get()->call('egw.refresh','','calendar',$id,'delete'); + } } else { @@ -690,6 +695,12 @@ class calendar_uilist extends calendar_ui if($this->bo->save($event)) { $success++; + + if(egw_json_response::isJSONResponse()) + { + egw_json_response::get()->call('egw.dataStoreUID','calendar::'.$id,$this->to_client($this->bo->read($id,$recur_date))); + egw_json_response::get()->call('egw.refresh','','calendar',$id,'edit'); + } break; } } @@ -708,6 +719,10 @@ class calendar_uilist extends calendar_ui if ($this->bo->set_status($event,$GLOBALS['egw_info']['user']['account_id'],$new_status,$recur_date, false,true,$skip_notification)) { + if(egw_json_response::isJSONResponse()) + { + egw_json_response::get()->call('egw.dataStoreUID','calendar::'.$id,$this->to_client($this->bo->read($id,$recur_date))); + } $success++; //$msg = lang('Status changed'); } diff --git a/calendar/js/app.js b/calendar/js/app.js index 18753b986e..1d4364bfb4 100644 --- a/calendar/js/app.js +++ b/calendar/js/app.js @@ -270,6 +270,7 @@ app.classes.calendar = AppJS.extend( if(_type === 'delete') { daywise.splice(daywise.indexOf(_id),1); + egw.dataStoreUID('calendar::'+_id, null); } else if (daywise.indexOf(_id) < 0) { diff --git a/calendar/js/et2_widget_event.js b/calendar/js/et2_widget_event.js index 5fc9841072..13a6decb40 100644 --- a/calendar/js/et2_widget_event.js +++ b/calendar/js/et2_widget_event.js @@ -488,8 +488,8 @@ var et2_calendar_event = et2_valueWidget.extend([et2_IDetachedDOM], _sameday_check: function(event) { - // Event somehow got orphaned - if(!this._parent) + // Event somehow got orphaned, or deleted + if(!this._parent || event === null) { return false; }