Finally, though, we need a way to cancel the events altogether. (Let's say lunch has become too expensive to buy.)
We will do this the same way as we did the original "Delete Event" functionality. The only difference is that this method will delete all events from the selected one onwards that were created from the same original event.
We are going to add a new control to the edit form, below the delete link.
In calendar.js
, edit the calendar_new_entry
function, and add the highlighted code as shown here:
$.getJSON('./calendar.php?action=get_event&id='+calEvent.id,function(eventdata){
var controls='<a href="javascript:calendar_delete_entry('+eventdata.id+');">'+'[delete]</a>';
if(+eventdata.recurring)controls+='<br />
'+'<a href="javascript:calendar_delete_recurrences('+eventdata.id+')">
'+' [stop recurring]</a>';
$('<div id="calendar_edit_entry_form"
This code will add a second link, stop recurring,...