diff --git a/calendar/inc/class.calendar_ajax.inc.php b/calendar/inc/class.calendar_ajax.inc.php index 967052abf7..e996974336 100644 --- a/calendar/inc/class.calendar_ajax.inc.php +++ b/calendar/inc/class.calendar_ajax.inc.php @@ -34,9 +34,10 @@ class calendar_ajax { * @param string $calendarOwner the owner of the calendar the event is in * @param string $targetDateTime the datetime where the event should be moved to, format: YYYYMMDD * @param string $targetOwner the owner of the target calendar + * @param string $durationT the duration to support resizable calendar event * @return string XML response if no error occurs */ - function moveEvent($eventId,$calendarOwner,$targetDateTime,$targetOwner) + function moveEvent($eventId,$calendarOwner,$targetDateTime,$targetOwner,$durationT=null) { // we do not allow dragging into another users calendar ATM if(!$calendarOwner == $targetOwner) @@ -45,7 +46,14 @@ class calendar_ajax { } $old_event=$event=$this->calendar->read($eventId); - $duration=$event['end']-$event['start']; + if (!$durationT) + { + $duration=$event['end']-$event['start']; + } + else + { + $duration = $durationT; + } $event['start'] = $this->calendar->date2ts($targetDateTime); $event['end'] = $event['start']+$duration; @@ -65,7 +73,7 @@ class calendar_ajax { case 'startday': if ($sameday) break; default: - $status_reset_to_unknown = true; + $status_reset_to_unknown = true; $event['participants'][$uid] = calendar_so::combine_status('U',$q,$r); // todo: report reset status to user } diff --git a/calendar/inc/class.calendar_uiviews.inc.php b/calendar/inc/class.calendar_uiviews.inc.php index 0e69ec9a70..131a07e780 100644 --- a/calendar/inc/class.calendar_uiviews.inc.php +++ b/calendar/inc/class.calendar_uiviews.inc.php @@ -1864,8 +1864,8 @@ class calendar_uiviews extends calendar_ui .'onmousemove="event.cancelBubble=true;"'; } } - - $html = $indent.'
'.$prefix_icon."\n".$ie_fix.$html."\n". diff --git a/calendar/js/app.js b/calendar/js/app.js index 609b031c6d..7dc2bdf356 100644 --- a/calendar/js/app.js +++ b/calendar/js/app.js @@ -137,7 +137,23 @@ app.classes.calendar = AppJS.extend( event.helper.width(jQuery("#calColumn").width()); }, - }); + }).resizable({ + handles: "s", + start:function(ui,event){ + + }, + stop:function(ui,event){ + var resizeHelper = ui.target.getAttribute('data-resize'); + var dataResize = resizeHelper.split("|"); + var time = dataResize[1].split(":"); + var dropDate = dataResize[0]+"T"+time[0]+time[1]; + + var drop = jQuery("div[id^='drop_"+dropDate+"']"); + var newDuration = Math.round(this.clientHeight/drop[0].clientHeight)* parseInt(dataResize[2]) * 60; + that.dropEvent(this.getAttribute('id'),dropDate,newDuration); + }, + + });; //Droppable @@ -168,7 +184,7 @@ app.classes.calendar = AppJS.extend( if (dpOwner == null) dpOwner = dgOwner; if (dpOwner == dgOwner ) { - that.dropEvent(event.draggable[0].id, id.target.getAttribute('id').substring(id.target.getAttribute('id').lastIndexOf("drop_")+5, id.target.getAttribute('id').lastIndexOf("_O"))); + that.dropEvent(event.draggable[0].id, id.target.getAttribute('id').substring(id.target.getAttribute('id').lastIndexOf("drop_")+5, id.target.getAttribute('id').lastIndexOf("_O")),null); } else { @@ -222,9 +238,10 @@ app.classes.calendar = AppJS.extend( * * @param {string} _id dragged event id * @param {array} _date array of date,hour, and minute of dropped cell + * @param {string} _duration description * */ - dropEvent : function(_id, _date) + dropEvent : function(_id, _date, _duration) { var eventId = _id.substring(_id.lastIndexOf("drag_")+5,_id.lastIndexOf("_O")); var calOwner = _id.substring(_id.lastIndexOf("_O")+2,_id.lastIndexOf("_C")); @@ -235,7 +252,8 @@ app.classes.calendar = AppJS.extend( eventId, calOwner, date, - eventOwner + eventOwner, + _duration ); }, /**