From 39759eb2676a4cb26d37a35a515f58f70a5c892e Mon Sep 17 00:00:00 2001 From: nathangray Date: Tue, 5 Sep 2017 11:01:48 -0600 Subject: [PATCH] * Calendar - fix bug where private events for multiple users in week view only showed for one user --- calendar/inc/class.calendar_bo.inc.php | 4 +++- calendar/inc/class.calendar_uilist.inc.php | 3 +++ calendar/js/app.js | 5 +++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/calendar/inc/class.calendar_bo.inc.php b/calendar/inc/class.calendar_bo.inc.php index 4d5d6a06f5..318160c2de 100644 --- a/calendar/inc/class.calendar_bo.inc.php +++ b/calendar/inc/class.calendar_bo.inc.php @@ -572,6 +572,8 @@ class calendar_bo * otherwise the original recuring event (with the first start- + enddate) is returned * num_rows int number of entries to return, default or if 0, max_entries from the prefs * order column-names plus optional DESC|ASC separted by comma + * private_allowed array Array of user IDs that are allowed when clearing private + * info, defaults to users * ignore_acl if set and true no check_perms for a general Acl::READ grants is performed * enum_groups boolean if set and true, group-members will be added as participants with status 'G' * cols string|array columns to select, if set an iterator will be returned @@ -681,7 +683,7 @@ class calendar_bo } if (!$params['ignore_acl'] && ($is_private || (!$event['public'] && $filter == 'hideprivate'))) { - $this->clear_private_infos($events[$id],$users); + $this->clear_private_infos($events[$id],$params['private_allowed'] ? $params['private_allowed'] : $users); } } diff --git a/calendar/inc/class.calendar_uilist.inc.php b/calendar/inc/class.calendar_uilist.inc.php index 2d3b54ff4c..346475b870 100644 --- a/calendar/inc/class.calendar_uilist.inc.php +++ b/calendar/inc/class.calendar_uilist.inc.php @@ -383,6 +383,9 @@ class calendar_uilist extends calendar_ui { $search_params['users'] = $params['owner'] ? $params['owner'] : explode(',',$this->owner); } + // Allow private to stay for all viewed owners, even if in separate calendars + $search_params['private_allowed'] = (array)$params['selected_owners'] + (array)$search_params['users']; + if ($params['col_filter']) { $col_filter = array(); diff --git a/calendar/js/app.js b/calendar/js/app.js index 55fa3376f1..aaa2a7d51f 100644 --- a/calendar/js/app.js +++ b/calendar/js/app.js @@ -2813,7 +2813,7 @@ app.classes.calendar = (function(){ "use strict"; return AppJS.extend( if(need_data && seperate_owners) { this._fetch_data( - jQuery.extend({}, state, {owner: value[i].owner}), + jQuery.extend({}, state, {owner: value[i].owner, selected_owners: state.owner}), this.sidebox_et2 ? null : this.et2.getInstanceManager() ); need_data = false; @@ -2875,7 +2875,8 @@ app.classes.calendar = (function(){ "use strict"; return AppJS.extend( filter:'custom', // Must be custom to get start & end dates status_filter: state.status_filter, cat_id: cat_id, - csv_export: false + csv_export: false, + selected_owners: state.selected_owners }); // Show ajax loader if(typeof framework !== 'undefined')