diff --git a/calendar/inc/class.calendar_uiforms.inc.php b/calendar/inc/class.calendar_uiforms.inc.php index cc5cf104b8..12c1250080 100644 --- a/calendar/inc/class.calendar_uiforms.inc.php +++ b/calendar/inc/class.calendar_uiforms.inc.php @@ -2627,7 +2627,7 @@ class calendar_uiforms extends calendar_ui } else { - $duration = $durationT; + $duration = (int)$durationT; } // If we have a recuring event for a particular day, make an exception @@ -2649,9 +2649,18 @@ class calendar_uiforms extends calendar_ui } // Drag a whole day to a time - if($event['whole_day'] && $durationT) + if($duration && $durationT != 'whole_day') { - $event['whole_day'] = false; + $event['whole_day'] = ($duration == DAY_s); + $event['non_blocking'] = false; + // Whole day non blocking with DAY_s would add a day + if($duration==DAY_s) $duration=0; + } + // Drag a normal event to whole day non-blocking + else if ($durationT == 'whole_day') + { + $event['whole_day'] = true; + $event['non_blocking'] = true; } $event['start'] = $this->bo->date2ts($targetDateTime); diff --git a/calendar/js/app.js b/calendar/js/app.js index d74a92a8a5..e48448924b 100644 --- a/calendar/js/app.js +++ b/calendar/js/app.js @@ -2256,7 +2256,8 @@ app.classes.calendar = AppJS.extend( filter:'custom', // Must be custom to get start & end dates status_filter: state.filter, cat_id: state.cat_id, - search: state.keywords + search: state.keywords, + csv_export: false }); // Show ajax loader framework.applications.calendar.sidemenuEntry.showAjaxLoader() diff --git a/calendar/js/et2_widget_daycol.js b/calendar/js/et2_widget_daycol.js index b6d53981d5..8f3a706fda 100644 --- a/calendar/js/et2_widget_daycol.js +++ b/calendar/js/et2_widget_daycol.js @@ -234,6 +234,9 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM], jQuery.datepicker.formatDate('DD dd',formatDate); this.title.text(date_string) .attr("data-date", new_date); + this.header + .attr('data-date',new_date) + .attr('data-whole_day',true); // Avoid redrawing if date is the same if(new_date === this.options.date && !force_redraw) @@ -677,6 +680,7 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM], } else { + columns[c][i].div.appendTo(this.div); top = this._time_to_position(columns[c][i].options.value.start_m,whole_day_counter); height = this._time_to_position(columns[c][i].options.value.end_m,whole_day_counter)-top; } diff --git a/calendar/js/et2_widget_event.js b/calendar/js/et2_widget_event.js index a40755f219..3d12a6146b 100644 --- a/calendar/js/et2_widget_event.js +++ b/calendar/js/et2_widget_event.js @@ -441,7 +441,7 @@ var et2_calendar_event = et2_valueWidget.extend([et2_IDetachedDOM], } else { - timespan = egw.lang('all day'); + timespan = egw.lang('Whole day'); } } else diff --git a/calendar/js/et2_widget_timegrid.js b/calendar/js/et2_widget_timegrid.js index 4040cf6e19..bd3ecf913c 100644 --- a/calendar/js/et2_widget_timegrid.js +++ b/calendar/js/et2_widget_timegrid.js @@ -286,7 +286,8 @@ var et2_calendar_timegrid = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResiz // Customize and override some draggable settings this.div.on('dragcreate','.calendar_calEvent:not(.rowNoEdit)', function(event,ui) { - $j(this).draggable('option','cursorAt',false); + // Act like you clicked the header, makes it easier to position + $j(this).draggable('option','cursorAt', {top: 5, left: 5}); }) .on('dragstart', '.calendar_calEvent', function(event,ui) { $j('.calendar_calEvent',ui.helper).width($j(this).width()) @@ -304,6 +305,8 @@ var et2_calendar_timegrid = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResiz */ _drag_helper: function(element, helper,height) { + if(!element) return; + element.dropEnd = this._get_time_from_position(helper.getBoundingClientRect().left, helper.getBoundingClientRect().top+parseInt(height)); @@ -326,16 +329,24 @@ var et2_calendar_timegrid = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResiz { this.scrolling.scrollTop(element.dropEnd.position().top); } - var time = jQuery.datepicker.formatTime( - egw.preference("timeformat") == 12 ? "h:mmtt" : "HH:mm", - { - hour: element.dropEnd.attr('data-hour'), - minute: element.dropEnd.attr('data-minute'), - seconds: 0, - timezone: 0 - }, - {"ampm": (egw.preference("timeformat") == "12")} - ); + var time = ''; + if(this._drop_data.whole_day) + { + time = this.egw().lang('Whole day'); + } + else + { + time = jQuery.datepicker.formatTime( + egw.preference("timeformat") == 12 ? "h:mmtt" : "HH:mm", + { + hour: element.dropEnd.attr('data-hour'), + minute: element.dropEnd.attr('data-minute'), + seconds: 0, + timezone: 0 + }, + {"ampm": (egw.preference("timeformat") == "12")} + ); + } element.innerHTML = '