From 9cfb1be0853db052b3032349b0502c4272616898 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 14 Feb 2011 12:18:22 +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 f50be69746..a583e5ff87 100644 --- a/calendar/inc/class.calendar_uiviews.inc.php +++ b/calendar/inc/class.calendar_uiviews.inc.php @@ -1719,37 +1719,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.'
'."\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 && - $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; }