The interface file for our Calendar (CCCalendar.fp5) is designed to be a local file on each user's desktop. This provides a real speed increase over traditional designs as none of the graphics used in the interface file need to come over the network. (A description of how this works can be found in our FAQ.)
However, some sites may wish to serve the interface file along with the other calendar files so that there is no local component to the calendar system.
Doing so requires a modification to the CCCalendar.fp5 file to create a new set of 6 viewing records for each guest. (Why are there 6 records?) Each user will work within their own set of 6 records so that they do not lock each other up by working from the same record(s) in CCCalendar.fp5. (Regular FileMaker record locking can still occur when, for instance, two users seek to edit the same appointment or seek to scroll through the same day's appointments.)
Note. CC Calendar is distributed completely unlocked. This means that users are able to modify the found set in CCCalendar.fp5 and to delete records in CCCalendar.fp5 We strongly recommend that developers add passwords and security to their systems so that users may not manipulate the found set or delete records in CCCalendar.fp5. This is especially important if you make these modifications as they depend upon each user having their own found set of 6 unique records in CCCalendar.fp5.
The Modifications
1. Create two new scripts in CCCalendar.fp5. The first will be called "Opening Create User Records" as follows below. You can get a head start on this script by duplicating the original "Admin Reset" script in CCCalendar.fp5. The new script looks like this:
- Code: Select all
Freeze Window
Enter Browse Mode
Show All Records
Show Omitted
New Record/Request
Set Field [ ThirtyDayRecordNumber, 0 ]
Set Field [ LinkDateGlob, Status(CurrentDate) ]
Set Field [ LinkEmpInitialsGlob, "" ]
New Record/Request
Set Field [ ThirtyDayRecordNumber, 1 ]
New Record/Request
Set Field [ ThirtyDayRecordNumber, 2 ]
New Record/Request
Set Field [ ThirtyDayRecordNumber, 3 ]
New Record/Request
Set Field [ ThirtyDayRecordNumber, 4 ]
New Record/Request
Set Field [ ThirtyDayRecordNumber, 5 ]
Go to Layout [ About ]
Relookup Contents [ COMMONOne ] [ No dialog ]
Go to Record/Request/Page [ First ]
Perform Script [ ìShow Items Startî ] [ Sub-scripts ]
Note. The last step (perform script) is only needed in the Full and Pro Versions.
Your second new script will be called "Closing Delete User Records":
- Code: Select all
If [ Status(CurrentFoundCount)<=6 ]
Delete All Records [ No dialog ]
End If
2. Next you'll modify three existing scripts. Begin by making the "Admin Reset" script much simpler:
- Code: Select all
Perform Script [ ìShrinkî ] [ Sub-scripts ]
Freeze Window
Enter Browse Mode
Delete All Records [ No dialog ]
Perform Script [ ìOpening Create User Recordsî ] [ Sub-scripts ]
Perform Script [ ìGo to 30 Day View: Appointmentî ] [ Sub-scripts ]
Continue to modify "ï SystemOpen" by adding a perform script step:
- Code: Select all
Set Use System Formats [ On ]
Allow User Abort [ Off ]
Perform Script [ ìOpening Create User Records (New)î ] [ Sub-scripts ] Open [ Filename: ìAppointmentsî ] [ Open hidden ]
Open [ Filename: ìCalendarStaffî ] [ Open hidden ]
Open [ Filename: ìCalendarUtilityî ] [ Open hidden ]
Open [ Filename: ìCalendarFAQî ] [ Open hidden ]
Open [ Filename: ìRelatedItemsAî ] [ Open hidden ]
Open [ Filename: ìRelatedItemsBî ] [ Open hidden ]
If [ ByPassAboutScreenGlob=1 ]
Go to Layout [ Daily ]
Else
Go to Layout [ About ]
End If
Toggle Status Area [ Hide, Lock ]
Toggle Window [ Zoom ]
Note that the files RelatedItemsA and B are only used in the Full and Pro Versions.
Modify "ï SystemExit" in a similar manner:
- Code: Select all
Allow User Abort [ Off ]
Set Error Capture [ On ]
Close [ Filename: ìAppointmentsî ]
Close [ Filename: ìCalendarStaffî ]
Close [ Filename: ìCalendarUtilityî ]
Close [ Filename: ìCalendarFAQî ]
Close [ Filename: ìRelatedItemsAî ]
Close [ Filename: ìRelatedItemsBî ]
Perform Script [ ìClosing Delete User Recordsî ] [ Sub-scripts ]
Close [ ]
3. Finally, set the sharing options of CCCalendar.fp5 to multiuser and remove any local copies from your user's workstations.
That's it!
By the way, these modifications set up a simple way to give each user their own 6 records. Systems which use data-driven logins may want to expand upon this and assigned user IDs to each viewing record in CCCalendar.fp5; in tis way you wouldn't need to keep creating a user's viewing records after the first time they logged in.
Enjoy.