how to save recurring events as individual events?


#61

Hello,

The problem has to do with the event_pid field, but I don’t know how timeline.js and minical.js work to know why they would ignore events that include the event_pid. I noticed that the events loaded as with the first two never pose a problem. The first is a non-recurring event, the second is a non-editable event, and the third is a recurring event.

scheduler.addEvent("17-02-2011 04:00","17-02-2011 07:00","changed single event in series",127, 
                                {person_id: 20191,
                                name: "Lengchu Shi",
                                instrument_id: "20",
                                instrument_name:"Deltavision Deconvolution Microscope  ---- test",
                                discount:"0",
                                is_assisted:"N",
                                status: "existing",
                                cost:37.5}

scheduler.addEvent("15-12-2010 03:00","15-12-2010 03:30","test",6, 
                                {instrument_id: "13",
                                instrument_name:"Zeiss 2-photon Confocal ---- test",
                                status: "existing"} 

scheduler.addEvent("15-02-2011 04:00","15-02-2011 07:00","sub: New event",125, 
                                {person_id: 20191,
                                name: "Lengchu Shi",
                                instrument_id:"19",
                                instrument_name:"Spinning Disk Confocal ---- test",
                                discount:"2",
                                is_assisted:"N",
                                status:"existing", 
                                cost:36.75,
                                event_pid:124}

#62

Both minical and timeline ( updated version ) uses the same logic for event list building as month view.
Basically all events checked, if end and start dates are in valid range - event will be rendered.
Events with rec_type = “none” ignored
Events with non-empty rec_type are processed according rec_type rules

So if your event has event_pid, but has not rec_type - it must be rendered just as any other normal event.


#63

Stanislav,

I’ve attached files to create a static view of my calendar so you can see my issue…this is the best I can do since our environment is password protected.

Thanks.
scheduler.zip (171 KB)


#64

Problem confirmed and fixed.
Update existing dhtmlxscheduler_timeline.js with the attached one.
dhtmlxscheduler_timeline.zip (5.54 KB)


#65

Thanks, Stanislav. That fixed the timeline view, but my minical in the navline is still not highlighting days that only have those “recurring” events in yellow as it does with other days that have events on them. Would that be an easy fix in the minical js file?


#66

Problem caused by the missed parent events. You have records event_pid - but the parent event itself is absent, which causes the issue.
As workaourn you can try to locate the next line in the dhtmlxscheduler_recurring.js

} else if (!ev.event_pid || ev.event_pid==0){
result.push(ev);
}

and replace it with

} else {
result.push(ev);
}


#67

I need to do that in recurring.js, not minical.js?

Thanks.


#68

Yep, in recurring js, problem is in core method, which returns list of event for some date range.