source layering, conflict resolution in day view

Support for our integrated Contact Manager, Calendar, and Project Tracker.
Posts: 60
Joined: Wed Jun 23, 2010 9:21 pm
PostPosted: Thu May 12, 2011 3:06 pm
I have two sources loading for a client's solution, one for sessions (source 1) and the other for their employee's schedules (source 2). this is so they know when a particular employee is available for a session and can see when the two conflict.

I would like to always display source 1 on top of source 2 because the session info is much more important to see at all times. also, when clicking on a time slot for which there is a conflict between the two sources, you only get one of the items, and usually the one that you cannot see.

any ideas?
SeedCode Staff
SeedCode Staff
Posts: 691
Joined: Mon Feb 28, 2011 2:47 pm
PostPosted: Fri May 13, 2011 8:41 am
Hi Eugene,

Changing the way we sort through the sources and events in our scripts would be pretty ambitious. I think the easiest thing to do would be to "swap" the sources on the field mapping layouts, i.e. map Source No 1 to the employee schedule and map Source No 2 to the sessions. This would be much easier than rewriting the scripts to consider the sources in descending order.

By default we only support opening conflicting events from one source. The script:

Click in / Drag Event

does return a list of event ids to the variable $sc_UID, but it only checks the source of the 1st id in the list. The script would need to be taught to repeat the process in additional sources. This all happens at the bottom of the Click in / Drag Event script, but its alsp[code][/code] pretty tricky. If you're going to tackle this, make sure you've a got a good backup to revert to in case you get into trouble. This is also a mod we could do for you, if you some budget set aside.

Let me know if that helps,
Jason
Posts: 60
Joined: Wed Jun 23, 2010 9:21 pm
PostPosted: Fri May 13, 2011 12:59 pm
Hi Jason,

Thanks for the quick reply. The funny thing is, sometimes the session is on top, sometimes the schedule item is on top. So, swapping the Sources doesn't sound like it's gonna work. Also, no matter which source is being displayed on top, clicking on the time slot gets you the object that is on the bottom. If there is a conflict between two sessions AND and schedule item, you get two session windows, but one of them is always from some other date and for some other resource. Strange.
SeedCode Staff
SeedCode Staff
Posts: 691
Joined: Mon Feb 28, 2011 2:47 pm
PostPosted: Fri May 13, 2011 3:33 pm
Hi Eugene,

eugenet wrote:The funny thing is, sometimes the session is on top, sometimes the schedule item is on top. So, swapping the Sources doesn't sound like it's gonna work. Also, no matter which source is being displayed on top, clicking on the time slot gets you the object that is on the bottom.


The events should be sorting (and stacking) by startdate then startime and the by source. So if the start times are the same then the event from Source No 2 should be on "top."

I'm pretty sure the script to open the events uses the "bottom" event to determine in which source to look for the events, if not it's the "top." So, in places where the start time is the same, it should pull the event from Source No 1, but if there's an overlapping event with an earlier start time, from either source, then that one would be at the "bottom," and determine which source is searched.

Ideally the script for viewing the event(s) detail will need to be taught to repeat the process, of finding the overlapping records and opening them in the different event windows, for each active source.

eugenet wrote:If there is a conflict between two sessions AND and schedule item, you get two session windows, but one of them is always from some other date and for some other resource. Strange.



Usually when we see the unexpected events opening, there's an issue with duplicate ids. The script Click In / Drag Event finds the list of all overlapping events and loads them into the variable $sc_UID and then goes to the source layout (determined by the above logic) and does finds for the events. This means the events in the two different sources will need values that are unique across both tables. I'd check that.

Let me know if that helps,
-Jason
Posts: 60
Joined: Wed Jun 23, 2010 9:21 pm
PostPosted: Fri May 13, 2011 10:59 pm
Hi Jason,

That was it. I revised the schedules table to use an alphanumeric serial number scheme for the records so they don't conflict with the UIDs being pulled up from sessions. That fixes the scenario where there are two conflicting sessions AND one schedule item on the same time slot. i get two windows, one for each session occupying the slot.

The problem remains, however, where if 1 session and 1 schedule item overlap, I only get the one on the bottom. Is there any way to 'ignore' a schedule item when it is involved in a conflict?
Posts: 60
Joined: Wed Jun 23, 2010 9:21 pm
PostPosted: Fri May 13, 2011 11:56 pm
Oh, by the way, I swapped the Sources as you recommended and the problem is the same, but reversed.
SeedCode Staff
SeedCode Staff
Posts: 691
Joined: Mon Feb 28, 2011 2:47 pm
PostPosted: Sat May 14, 2011 3:12 pm
Hi Eugene,

So are you seeing the behavior I described above, i.e. sorting by date, then time and then source?

The event on the bottom will have the earliest start time. If the start times are the same, then the events from Source No 1 will below the events from Source No 2.

If you've swapped the sources, and the events have the same start time then, the events from "sessions" should be on the bottom.

If this is not what you are seeing, then check the script:

Sort FileMaker Records --- Edit Sort Orders Here ---

and make sure you've defined the sort order for Source No 2, as the Calendar does not come with a second FileMaker source, this sort order is not defined, so make sure it is also sorting by start date and end date.

Again, the default way we stack events may not be what you need, but confirming on how it's currently stacking is an important first step to getting it where you want.

hth,
Jason
SeedCode Staff
SeedCode Staff
Posts: 691
Joined: Mon Feb 28, 2011 2:47 pm
PostPosted: Sat May 14, 2011 3:35 pm
Hi Eugene,

Sorry I missed this one.

eugenet wrote:The problem remains, however, where if 1 session and 1 schedule item overlap, I only get the one on the bottom. Is there any way to 'ignore' a schedule item when it is involved in a conflict?


In the script:

Click In / Drag Event the script determines which source to search by which event is on the "bottom."
That part of the script is highlighted here:

ClickIn.png
ClickIn.png (148.67 KiB) Viewed 13444 times


You could add some logic to see if there are both "1s" and "2s" in $sc_SourceNo and if so, then set it to the "session" source number rather than just grabbing the "bottom" one.

something like:

If ( ( PatternCount ( $sc_SourceNo ; "1") and PatternCount ( $sc_SourceNo ; "2" ) ) ;
//variable contains 1s and 2s use the "session" source number
1 ;
//just one source, use the bottom value
GetValue ( $sc_SourceNo ; 1 ) )

hth,
Jason

Return to SeedCode Calendar

Who is online

Users browsing this forum: No registered users and 3 guests

(855) SEEDCODE
[email protected]
Follow us: