diff --git a/calendar/inc/class.calendar_ui.inc.php b/calendar/inc/class.calendar_ui.inc.php index d792cc828f..85048f33f5 100644 --- a/calendar/inc/class.calendar_ui.inc.php +++ b/calendar/inc/class.calendar_ui.inc.php @@ -179,10 +179,10 @@ class calendar_ui * * @return boolean/string false if there's no error or string with error-message */ - function check_owners_access() + function check_owners_access($users = null, &$no_access = array()) { $no_access = $no_access_group = array(); - $owner_array = explode(',',$this->owner); + $owner_array = $users ? $users : explode(',',$this->owner); foreach($owner_array as $idx => $owner) { $owner = trim($owner); @@ -205,8 +205,10 @@ class calendar_ui } if (count($no_access)) { - egw_framework::message(lang('Access denied to the calendar of %1 !!!',implode(', ',$no_access)),'error'); + $message = lang('Access denied to the calendar of %1 !!!',implode(', ',$no_access)); + egw_framework::message($message,'error'); $this->owner = implode(',',$owner_array); + return $message; } if (count($no_access_group)) { diff --git a/calendar/inc/class.calendar_uilist.inc.php b/calendar/inc/class.calendar_uilist.inc.php index 2e55680df6..977559560e 100644 --- a/calendar/inc/class.calendar_uilist.inc.php +++ b/calendar/inc/class.calendar_uilist.inc.php @@ -480,9 +480,15 @@ class calendar_uilist extends calendar_ui $wv=0; $dv=0; - + // Add in some select options $users = is_array($search_params['users']) ? $search_params['users'] : explode(',',$search_params['users']); + + if($message = $this->check_owners_access($users,$no_access)) + { + egw_json_response::get()->error($message); + } + foreach($users as $owner) { if(!is_int($owner) && $this->bo->resources[$owner[0]]) diff --git a/calendar/js/app.js b/calendar/js/app.js index d3e1c58134..3baf590144 100644 --- a/calendar/js/app.js +++ b/calendar/js/app.js @@ -199,6 +199,9 @@ app.classes.calendar = AppJS.extend( * * App is responsible for only reacting to "messages" it is interested in! * + * Calendar binds listeners to the data cache, so if the data is updated, the widget + * will automatically update itself. + * * @param {string} _msg message (already translated) to show, eg. 'Entry deleted' * @param {string} _app application name * @param {(string|number)} _id id of entry to refresh or null