Change handling of new private events created for other users to allow them to show immediately

This commit is contained in:
nathangray 2016-09-15 10:45:45 -06:00
parent b884e014d7
commit c09cfa5a23
2 changed files with 8 additions and 5 deletions

View File

@ -252,8 +252,11 @@ class calendar_boupdate extends calendar_bo
return $cal_id; 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 // 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); // 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) if($old_event['deleted'] && $event['deleted'] == null)
{ {

View File

@ -621,15 +621,15 @@ class calendar_ui
// Directly update stored data. // Directly update stored data.
// Make sure we have the whole event // 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(); $response = Api\Json\Response::get();
// Check filters to see if they still match, may have to remove // Check filters to see if they still match, may have to remove
// the event because it should no longer be displayed // the event because it should no longer be displayed
$filter_match = true; $filter_match = true;
if($this->cal_prefs['saved_states']['status_filter'] != 'all' || if($event && ($this->cal_prefs['saved_states']['status_filter'] != 'all' ||
$this->cal_prefs['saved_states']['cat_id']) $this->cal_prefs['saved_states']['cat_id']))
{ {
$filter_check = array( $filter_check = array(
'start' => $event['start'], 'start' => $event['start'],