We don’t force you to use our events table, or any of our schema for that matter. The soSIMPLE Calendar Add-on was designed to be easily integrated with your own data.
This article describes how to change the table where your calendar events should come from.
- soSIMPLE Calendar Actions script (starting near line 14)
- Change the variable $data_layout_name to match the layout name that you will use for finding and editing your events in the background.
- (optionally) change the variable $entry_layout_name to match the name of the layout you want to see when you open an event. Leave it the way it is if you will only be using one layout for both purposes.
- Change the variable $field_names to match your field names. There are a lot of field names in there – if you don’t use one, just set that field variable to a blank a blank string (“”). You must use the following fields:
- $event_id_field ( must be unique )
- soS Recurrences Create Update script
- The same 3 lines can be copied from the soSIMPLE Calendar Actions script in this script, staring around line 12.
That’s it! Now your calendar will show and edit the events from your events table.
These two scripts use indirection throughout, so that you don’t have to change all the field names and layout names throughout the script. You just change this information at the top of the script, and the rest of the script will use the script steps, “Go to Layout” by name and “Set Field by Name.”
If you change the name of the layout, you will have to change it in these two scripts.
Why two layouts?
We give you the option of using two layouts because your data entry layout may have more information on it than you need, or you may have script triggers that get in the way of doing simple searches.
By default, $data_layout_name is used to (1) find events to show on the calendar and (2) edit existing events when you drag them on the calendar (done off-screen so you don’t see it).
Also by default, $entry_layout_name is used to (1) open events when you double-click them and (2) when creating new events.
When setting $field_names, use the GetFieldName() function as shown, or use a fully-qualified field name in the format TOC::FIELD.
You are also not tied to this mechanism. You can edit this script however you’d like for your purposes. This is just a good starting point.
See article about the soSIMPLE Calendar Actions script for more information.