Calendar Drag & Drop should trigger the onValidate event

Calendar Drag & Drop should trigger the onValidate event so that we can validate if the selected date & time is valide or not.

Then it should go to the onValidateSuccess then onBeforeUpdate and onAfterUpdate or simply go to onValidateFailure

It should also be logged

Thanks

I found out that Drag & Drop and Resizing (change duration) generate a POST call to the calendar that can be extracted in the onScriptInit event.

The information POSTed is
nmgp_opcao with value ā€˜calendar_dropā€™ or ā€˜calendar_resizeā€™
sc_event_id
sc_day_delta
sc_time_delta
sc_all_day
sc_fullcal_end

Itā€™s not what I am looking for, but at least I can log the information and revert it if needed

looking for the same thing. want to update records in another table when an appointment is changed or moved. When you change the details it works fine. when you move or resize the appointment the trigger wonā€™t work.

any workarounds found?

When Move or Resize is used, the calendar app is call back and the nmgp_opcao will be set to ā€œcalendar_dropā€ or ā€œcalendar_resizeā€
sc_event_id will contain the calendar ID of the appointment

if (isset($_POST['nmgp_opcao'])) {
	if ($_POST['nmgp_opcao'] == 'calendar_drop' or $_POST['nmgp_opcao'] == 'calendar_resize') {
                    $id = $_POST['sc_event_id'];
                    $day_delta = $_POST['sc_day_delta']; //+ or - days
                    $time_delta = $_POST['sc_time_delta']; //+ or - minutes
                    $all_day = $_POST['sc_all_day'];
                     .... 
            }
    }

You can put this in onScriptInit

Note that this code will be executed before the appointment is modified by calendar

1 Like