From 45d3e8d82a40a979c733433f9c46dbc003530232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20St=C3=B6ckel?= Date: Mon, 14 Feb 2011 11:58:43 +0000 Subject: [PATCH] Fixed problem with event stacks for non drag-droppable event objects --- calendar/inc/class.calendar_uiviews.inc.php | 62 ++++++++++++--------- 1 file changed, 36 insertions(+), 26 deletions(-) diff --git a/calendar/inc/class.calendar_uiviews.inc.php b/calendar/inc/class.calendar_uiviews.inc.php index f2ca61a350..c07d3eb42c 100644 --- a/calendar/inc/class.calendar_uiviews.inc.php +++ b/calendar/inc/class.calendar_uiviews.inc.php @@ -1807,37 +1807,47 @@ function open_edit(series) $z_index = is_null($z_index) ? 20 : (int)$z_index; + // ATM we do not support whole day events or recurring events for dragdrop + $dd_emulation = ""; + if (is_object($this->dragdrop) && + $this->use_time_grid && + (int)$event['id'] && $this->bo->check_perms(EGW_ACL_EDIT,$event)) + { + if (!$event['whole_day_on_top'] && + !$event['whole_day'] && + !$event['recur_type']) + { + // register event as draggable + $this->dragdrop->addDraggable( + $draggableID, + array( + 'eventId'=>$event['id'], + 'eventOwner'=>$event['owner'], + 'calendarOwner'=>$owner, + 'errorImage'=>addslashes(html::image('phpgwapi','dialog_error',false,'style="width: 16px;"')), + 'loaderImage'=>addslashes(html::image('phpgwapi','ajax-loader')), + ), + 'calendar.dragDropFunctions.dragEvent', + 'calendar.dragDropFunctions.dropEvent', + 'top center 2' + ); + } + else + { + // If a event isn't drag-dropable, the drag drop event handling has to be fully disabled + // for that object. Clicking on it - however - should still bring it to the foreground. + $dd_emulation = ' onmousedown="dd.z++; this.style.zIndex = dd.z; event.cancelBubble=true;"' + .'onmouseup="event.cancelBubble=true;"' + .'onmousemove="event.cancelBubble=true;"'; + } + } + $html = $indent.'
'.$prefix_icon."\n".$ie_fix.$html."\n". + $dd_emulation.'>'.$prefix_icon."\n".$ie_fix.$html."\n". $indent."
"."\n"; - // ATM we do not support whole day events or recurring events for dragdrop - if (is_object($this->dragdrop) && - $this->use_time_grid && - (int)$event['id'] && $this->bo->check_perms(EGW_ACL_EDIT,$event) && - !$event['whole_day_on_top'] && - !$event['whole_day'] && - !$event['recur_type'] - ) - { - // register event as draggable - $this->dragdrop->addDraggable( - $draggableID, - array( - 'eventId'=>$event['id'], - 'eventOwner'=>$event['owner'], - 'calendarOwner'=>$owner, - 'errorImage'=>addslashes(html::image('phpgwapi','dialog_error',false,'style="width: 16px;"')), - 'loaderImage'=>addslashes(html::image('phpgwapi','ajax-loader')), - ), - 'calendar.dragDropFunctions.dragEvent', - 'calendar.dragDropFunctions.dropEvent', - 'top center 2' - ); - } - return $html; }