ResourceCal is part of Calendar Pack 2 CalPack2.html , which comprises DayCal2 DayCal2.html , ResourceCal2, MonthCal2 and NavCal. It is an extended version of the DayCalendar function, allowing bookings to be made for specified resources. Resources need not be people: you can track rooms, vehicles or any other type of resource.
Your layout table occurrence should have a relationship to a table which holds the bookings records. This control automatically filters your relationship by date range, and resource ID's, and any manual filtering (by relationship, or using the WhereFilter override) on these values might have unexpected results.
Info |
---|
ResourceCal2( displayStartDate ; displayNumDays ; resourceIDList ; "dateFieldName" ; "startTimeFieldName" ; "durationFieldName" ; "resourceIDFieldName" {;"descriptionFieldName" ; "colorFieldName"; "titleFieldName" ; "actionOnApptSelect" ; "actionOnApptEnter" ; "actionOnDaySelect" } ) |
Parameters
Parameter Name | Description | |
1 | displayStartDate | The first date to show on the calendar. Can be a date in quotes or the name of a field (on either the home or the bookings table) containing the date, or a calculation producing a date. If a field name is used, it is NOT enclosed in quotes. If left blank, and displayNumDays is left at 0, the first date displayed will be today's date. |
2 | displayNumDays | The number of days to show. The width of each day shown is fixed, so you will see as many days as will fit in the Web Viewer you’ve drawn. Can be a number or the name of a field (on either the home or the bookings table) containing the number of days, or a calculation producing a number. If a field name is used, it is NOT enclosed in quotes. |
3 | resourceIDList | A return-delimited list of resources or a list of resources and IDs. See "Resource List" example below. Note that your list should contain only the resources which you want to be displayed, not the full list of resources. |
4 | "dateFieldName" | The field on the bookings table containing the booking date. Must be of type Date. The field name needs to be enclosed in quotes and be the full TO::FieldName form. Note that the field name parameters should not be calc fields if you want to be able to update records. |
5 | "startTimeFieldName" | The field on the bookings table containing the Start Time of the booking. Must be of type Time. The field name needs to be the full name and enclosed in quotes. |
6 | "durationFieldName" | The field on the bookings table containing the Duration of the booking. The field name needs to be the full name and enclosed in quotes. As an alternative to duration, you can use the 'EndDateFieldName' override to set an end timestamp field. This makes the calendar search for records much quicker and is recommended where possible, especially for databases with larger record sets. In this case, you can simply leave durationFieldName blank. |
7 | "resourceIDFieldname" | The field on the bookings table containing the ResourceID to be used for the booking. The field name needs to be the full name and enclosed in quotes. |
8 | "descriptionFieldName" | The field on the bookings table containing the Description of the appointment. The field name needs to be the full name and enclosed in quotes. |
9 | "colorFieldname" | The field on the bookings table containing the Color to be used for the booking. The field name needs to be the full name and enclosed in quotes. Note that a hex or RGB() value is expected. To associate a color with a resource rather than a booking, create a calculation field on the bookings table, set to the color on the related resource record. For help with colors, refer to the "The Basics: Helpful Information" page |
10 | "titleFieldName" | The field on the bookings table containing the Title to be used as the top line of the booking. The field name needs to be the full name and enclosed in quotes. |
11 | actionOnApptSelect | The name of the script or a command to run on selection of a booking. (useful for obtaining the record number of the record currently being edited). See Action Parameters below. |
12 | actionOnApptEnter | The name of the script or a command to run on entry into a booking. See Action Parameters below. |
13 | actionOnDaySelect | The name of the script or a command to run on selection of a day. No script parameter should be used in this case: a script parameter, set to the date selected in format yyyy-mm-dd, is automatically generated. If a different date format is needed, use a script parameter of DateMask=. e.g. "Script=DaySelected|DateMask=d-m-Y". See Action Parameters below. |
Action Parameters
Each of the functions in the Calendar Pack have optional Action parameters, allowing you to run a script or set a field when a field is selected. See Action Parameters for details.
Resource List
There are 2 alternative syntaxes for the resourceID string:
1. Simple values
In this case the ResourceIDlist is just a return separated list of the resources you want displayed, e.g. "Blue Room¶West Room¶Board Room¶"
2. Values with corresponding Record IDs
Two lists, of Values and Record-IDs, preceded by keywords "Values=" and "IDs=" with a pipe character before the "IDs".
"Values={return delimited list of names}|IDs={return delimited list of record IDs}"
Supposing you have a list of resources such as People or Rooms in a related table called "Resources", e.g.
RecID ResourceName1 Blue Room
2 West Room
3 Board Room
If you do not want all possible resources displayed, but just a selection, you should create a relationship to limit the records e.g.
"Values="& List(ResourcesToDisplay::ResourceName) &"|IDs="& List(ResourcesToDisplay::RecID)
Multi-Line Keys in Calendars
Using a multi-line key on the left side of the relationship (the layout table) is possible, if you want to filter records that way. There are a few 'gotchas' which are explained on the CalPack2 documentation page.
Customization
It's possible to customize the look, layout and behaviour of many aspects of the Calendars by means of built-in "overrides", which are JavaScript and CSS functions. This is powerful but advanced stuff, and will make most sense if you're familiar with those technologies somewhat to begin with. If you don't want to tackle this yourself, but want it done, contact us - we're happy to be contracted to do this work.
To find out what functional overrides are available, you need to use Override Inspector. To make style and layout changes, use CSS Overrides. The best way to determine what CSS overrides are available is to open the Reactor debugger and click the CSS tab. See CSS Overrides for further info.
With some knowledge of Javascript and CSS, you can quickly customize the following... and more!
position of the time panel
width of the time panel.
position of the date panel
time range
definition of non-working days or hours.
actions allowed and disallowed on appointments e.g. ability to create, edit, delete, scroll appointments, resulting in optional read-only calendar.
performing an action when doubleclicking a resource label
performing an action when clicking an appointment record
performing an action after creating an appointment
performing an action after deleting an appointment
performing an action after selecting a day
filtering of displayed appointments
See Relationship Structures for limitations on relationships you can use.
In order to make use of the automatic/multi-user update functionality, you'll need to make use of the zMODid field.