Mod: Serving CCCalendar.fp5

Questions and suggestions for the CC Calendar product.
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Wed Feb 11, 2004 5:40 am
Introduction

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.
John Sindelar
SeedCode
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Sun Mar 21, 2004 5:58 am
Part 2

The mod posted above presents each user with their own set of 6 calendar records. So, any scripts that manipulate the found set have the opportunity to disrupt a users 6 records: there are two such scripts in CCCalendar.

Modify "Blink 30 Days" to remove the first line, changing it from this:
Code: Select all
Show All Records
Unsort
Enter  Browse  Mode
Go to Layout [ 30 Day Screen Size ]
Toggle  Status  Area [ Hide, Lock ]
Toggle  Window [ Zoom ]
Go to Layout [ original layout ]
Refresh  Window [ Bring to front ]

To this:
Code: Select all
Unsort
Enter  Browse  Mode
Go to Layout [ 30 Day Screen Size ]
Toggle  Status  Area [ Hide, Lock ]
Toggle  Window [ Zoom ]
Go to Layout [ original layout ]
Refresh  Window [ Bring to front ]


Next, modify the "Print Week" script as shown below. There is a slight inconvenience to this change. With the modification in place the "Print Week" script will always preview a 6 page print job beginning with the first week of the selected month. Users would need to print page 2-2 to print just the second week of the month, for instance.

Change the script "Print Week" from:
Code: Select all
Show All Records
Omit  Record
Show  Omitted
Page  Setup [ Restore setup options, No dialog ]
Allow User Abort [ Off ]
Toggle  Status  Area [ Show ]
Toggle  Window [ Maximize ]
Enter  Preview  Mode [ Pause ]
Show Message [ Buttons: ìPrintî, ìCancelî, ìî; Data: ìPrint this Calendar?î ]
If [ Status(CurrentMessageChoice)=1 ]
     Print
End  If Enter 
Browse  Mode
Show All Records
Perform Script [ ìLocate Selected Weekî ] [ Sub-scripts ]
Perform Script [ ìBlink 30 Daysî ] [ Sub-scripts ]

To this:
Code: Select all
 
Page  Setup [ Restore setup options, No dialog ]
Allow User Abort [ Off ]
Toggle  Status  Area [ Show ]
Toggle  Window [ Maximize ]
Enter  Preview  Mode [ Pause ]
Show Message [ Buttons: ìPrintî, ìCancelî, ìî; Data: ìPrint this Calendar?î ]
If [ Status(CurrentMessageChoice)=1 ]
     Print
End  If Enter 
Browse  Mode
Perform Script [ ìLocate Selected Weekî ] [ Sub-scripts ]
Perform Script [ ìBlink 30 Daysî ] [ Sub-scripts ]


That's it.
John Sindelar
SeedCode
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Wed Apr 14, 2004 9:01 am
Part 3

You'll also want to make sure you've exited all your "day" records to prevent additional record lock. Simple place an "Exit Record/Request" script step at the end of the following scripts:

Add it to the end of the following scripts in CCCalendar:

Clear Employee Pop up
Clear Appt Type Pop Up

Move Month to Right
Move Month to Left
Select Date Today

Go to Daily from Day 1-8

Show Items Start
Show Items Due

Locate Selected Week
Locate Selected Week on Week View

Select Day from Day 1

That's it.
John Sindelar
SeedCode

Return to CC Calendar (FM6)

Who is online

Users browsing this forum: No registered users and 3 guests

(855) SEEDCODE
[email protected]
Follow us: