From c09cfa5a2352e958077b3e727a871858da1d889e Mon Sep 17 00:00:00 2001 From: nathangray Date: Thu, 15 Sep 2016 10:45:45 -0600 Subject: [PATCH] Change handling of new private events created for other users to allow them to show immediately --- calendar/inc/class.calendar_boupdate.inc.php | 7 +++++-- calendar/inc/class.calendar_ui.inc.php | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/calendar/inc/class.calendar_boupdate.inc.php b/calendar/inc/class.calendar_boupdate.inc.php index d2f1018f1b..36f000d82d 100644 --- a/calendar/inc/class.calendar_boupdate.inc.php +++ b/calendar/inc/class.calendar_boupdate.inc.php @@ -252,8 +252,11 @@ class calendar_boupdate extends calendar_bo return $cal_id; } - $event = $this->read($cal_id); // we re-read the event, in case only partial information was update and we need the full info for the notifies - //echo "new $cal_id="; _debug_array($event); + // we re-read the event, in case only partial information was update and we need the full info for the notifies + // The check for new private events is to at least show the private version, + // otherwise we get FALSE + $event = $this->read($cal_id, null, $ignore_acl, 'ts', $new_event && !$event['public'] ? $this->user : null); + //error_log("new $cal_id=". array2string($event)); if($old_event['deleted'] && $event['deleted'] == null) { diff --git a/calendar/inc/class.calendar_ui.inc.php b/calendar/inc/class.calendar_ui.inc.php index 46ad9b2440..13bfe5db93 100644 --- a/calendar/inc/class.calendar_ui.inc.php +++ b/calendar/inc/class.calendar_ui.inc.php @@ -621,15 +621,15 @@ class calendar_ui // Directly update stored data. // Make sure we have the whole event - $event = $this->bo->read($event_id, $recurrence_date); + $event = $this->bo->read($event_id, $recurrence_date, false, 'ts', $this->cal_prefs['saved_states']['owner']); $response = Api\Json\Response::get(); // Check filters to see if they still match, may have to remove // the event because it should no longer be displayed $filter_match = true; - if($this->cal_prefs['saved_states']['status_filter'] != 'all' || - $this->cal_prefs['saved_states']['cat_id']) + if($event && ($this->cal_prefs['saved_states']['status_filter'] != 'all' || + $this->cal_prefs['saved_states']['cat_id'])) { $filter_check = array( 'start' => $event['start'],