FullCalendar library is providing dragging and resizing support for events. FullCalendar View module is also providing this feature.

Smartdate is already providing support for viewing events with FullCalendar #3101524: Provide FullcalendarViewProcessor plugin to support Fullcalendar View

Now Smartdate should also support drag and resizing editing of events in the FullCalendar views plugin.

Trying to provide this with a patch.

Regarding recurring events my current proposal would be that drag and resize editing of recurring events in the FullCalendar view always results in overriding instances and not in changing the rule. This seams to be reasonable, but can be discussed and maybe solved different.

Info: This patch is about 3.x-dev of FullCalendar View

Comments

stefan.korn created an issue. See original summary.

mandclu’s picture

I would agree that changing/dragging a specific instance should not change the rule. I have also opened #3117719: On Instance override, prompt for "only this instance" or "change all from here" to track a possible approach of prompting the user if they want to change only the once instance or all instance from the specified one forward. If that gets implemented then potentially it would ideally be implemented here too, but I wouldn't say it's high priority.

stefan.korn’s picture

So this is my first version of the patch. This seams to work out fine for:

  • non-recurring dates
  • recurring dates (always creating an override)
  • all day events
  • default events (not all day)
  • switching between all day and default
  • dragging events (moving without changing duration)
  • resizing events (changing duration)

#3114128: Adding rrule_index to smart date field schema and #3117745: Make csrftoken protected class member is needed for this to work

I will do some more testing on this (considering this somewhat "alpha" at this stage). But if someone is eager on also doing some testing on this, I am surely curious about any results.

I have not considered yet:
- changing recurring events rule by drag and drop
- external event dropping as featured by FullCalendar, did not look into how this works in general
- using smart date and core date fields in combination (either in one view or different views). In theory this should work, because I am passing to the CalendarEventController from FullCalendar View module if field is not from type smartdate. But I did not test this yet.

mandclu’s picture

Is there a recommended version of Fullcalendar View to use/test this against?

stefan.korn’s picture

I just discovered that there is also a small patch necessary for FullCalendar View (against version 3.x-dev). Obviously I had changed that in my setup and forgot about that ...

I just created an issue at FullCalendar #3117745: Make csrftoken protected class member. So this patch is necessary too (I am also amending #3 about that)

stefan.korn’s picture

Issue summary: View changes
mandclu’s picture

This looks great! Everything appears to work as expected. I checked the error log and everything looks clean, even after editing events.

Is there anything you're still working on with this?

stefan.korn’s picture

I think it would be good to go. Especially as Mingsong has already accepted #3117745: Make csrftoken protected class member and therefore no patch of FullCalendar View is needed anymore.

I probably will do some more testing and maybe (later) have a look in the things I mentioned in #3 that have not been considered yet.

mandclu’s picture

OK looking at the code I wanted to change how some of the conditions were handled, to make the code more readable. Also cleaned up some comments to meet Drupal coding standards. Overall it could probably use a few more comments, but as long as we don't see any functional issues (e.g. I haven't broken anything with my changes) I think this is ready to merge. Please test and let me know.

stefan.korn’s picture

Thanks, that code is truly nicer.

There is just one issue that breaks resizing of Allday events.

This is amended patch to fix this and interdiff to your last patch

stefan.korn’s picture

Status: Needs review » Postponed

Ahm ... Just currently asking myself why I have put the controller in the smart_date_recur submodule. Think it should be in the smart_date main module ... I will check and see if there is a reason for having it in smart_date_recur submodule.

stefan.korn’s picture

Okay, there was something weird going on with my git. As I have applied the patch from #9 against origin/8.x-2.x my git put the FullCalendarController.php in the smart_date_recur submodule. Only if I first created an empty Controller directory in the main smart_date module the FullCalendarController was put in the correct directory. Strange behavior from git ...

So now I provide once more the slightly amended patch and the interdiff (against patch from #9). Please completely ignore the patch and interdiff from #10. Sorry for the confusion.

stefan.korn’s picture

Status: Postponed » Needs review

  • mandclu committed 18fbba1 on 8.x-2.x authored by stefan.korn
    Issue #3117690 by stefan.korn, mandclu: Provide drag and resize editing...
mandclu’s picture

Status: Needs review » Fixed

Thanks so much for your work on this! It's fantastic to have this functionality available. Merged in, and will likely get out a fresh release to make this available.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.