From d9bc278efd781a8b70540f67f37f8d61209d023b 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 bb81208d5d..4304ced334 100644 --- a/calendar/inc/class.calendar_bo.inc.php +++ b/calendar/inc/class.calendar_bo.inc.php @@ -560,6 +560,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 @@ -669,7 +671,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 972c73c6cd..c72cc40733 100644 --- a/calendar/js/app.js +++ b/calendar/js/app.js @@ -2811,7 +2811,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; @@ -2873,7 +2873,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')