From 50b3c77986c79bfe4bf202eb52ab7ff8daf26656 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 9 Sep 2015 21:35:26 +0000 Subject: [PATCH] Calendar et2 bugs: - Add link styling to grid views - Don't fail if loading without access --- calendar/inc/class.calendar_ui.inc.php | 19 +++++-------------- calendar/js/et2_widget_daycol.js | 2 +- calendar/js/et2_widget_timegrid.js | 2 +- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/calendar/inc/class.calendar_ui.inc.php b/calendar/inc/class.calendar_ui.inc.php index f07f860634..6363c5f389 100644 --- a/calendar/inc/class.calendar_ui.inc.php +++ b/calendar/inc/class.calendar_ui.inc.php @@ -182,7 +182,8 @@ class calendar_ui function check_owners_access() { $no_access = $no_access_group = array(); - foreach(explode(',',$this->owner) as $owner) + $owner_array = explode(',',$this->owner); + foreach($owner_array as $idx => $owner) { $owner = trim($owner); if (is_numeric($owner) && $GLOBALS['egw']->accounts->get_type($owner) == 'g') @@ -199,23 +200,13 @@ class calendar_ui elseif (!$this->bo->check_perms(EGW_ACL_READ|EGW_ACL_READ_FOR_PARTICIPANTS|EGW_ACL_FREEBUSY,0,$owner)) { $no_access[$owner] = $this->bo->participant_name($owner); + unset($owner_array[$idx]); } } if (count($no_access)) { - $msg = '

'.htmlspecialchars(lang('Access denied to the calendar of %1 !!!',implode(', ',$no_access)))."

\n"; - - if ($GLOBALS['egw_info']['flags']['currentapp'] == 'home') - { - return $msg; - } - common::egw_header(); - if ($GLOBALS['egw_info']['flags']['nonavbar']) parse_navbar(); - - echo $msg; - - common::egw_footer(); - common::egw_exit(); + egw_framework::message(lang('Access denied to the calendar of %1 !!!',implode(', ',$no_access)),'error'); + $this->owner = implode(',',$owner_array); } if (count($no_access_group)) { diff --git a/calendar/js/et2_widget_daycol.js b/calendar/js/et2_widget_daycol.js index 6581015cf6..6a2a307ece 100644 --- a/calendar/js/et2_widget_daycol.js +++ b/calendar/js/et2_widget_daycol.js @@ -293,7 +293,7 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResizea // Remove all classes this.title.removeClass() // Except this one... - .addClass("et2_clickable calendar_calDayColHeader"); + .addClass("et2_clickable calendar_calDayColHeader et2_link"); // Set today class - note +1 when dealing with today, as months in JS are 0-11 var today = new Date(); diff --git a/calendar/js/et2_widget_timegrid.js b/calendar/js/et2_widget_timegrid.js index 36d3131242..af078aa05d 100644 --- a/calendar/js/et2_widget_timegrid.js +++ b/calendar/js/et2_widget_timegrid.js @@ -109,7 +109,7 @@ var et2_calendar_timegrid = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResiz // Contains times / rows this.gridHeader = $j(document.createElement("div")) - .addClass("calendar_calGridHeader") + .addClass("calendar_calGridHeader et2_link") .appendTo(this.div); // Contains days / columns