Create a calendar object, can display bookings in calendar format
-
SimpleDate
$start: start time to display bookings from
-
SimpleDate
$stop: stop time to display bookings until
-
mixed
$instrument: what instrument number (or list of instrumets) to display bookings for
Display the booking details in a list
void
display
()
Display the booking details in a list
void
displayAsTable
()
Display the booking details in a table with rowspan based on the duration of the booking
string
displayDayAsTable
(
SimpleTime $daystart,
SimpleTime $daystop,
integer $granularity,
integer $reportPeriod)
-
SimpleTime
$daystart: time from which bookings should be displayed
-
SimpleTime
$daystop: time up until which bookings should be displayed
-
integer
$granularity: seconds per row in display
-
integer
$reportPeriod: seconds between reporting the time in a column down the side
Generate html for the booking details in a table with rowspan based on the duration of the booking
string
displayMonthAsTable
(
SimpleTime $daystart,
SimpleTime $daystop,
integer $granularity,
integer $reportPeriod)
-
SimpleTime
$daystart: time from which bookings should be displayed
-
SimpleTime
$daystop: time up until which bookings should be displayed
-
integer
$granularity: seconds per row in display
-
integer
$reportPeriod: seconds between reporting the time in a column down the side
logging function -- logs debug info to stdout
The higher $priority, the more verbose (in the debugging sense) the output.
void
log
(string $string, [integer $priority = 10])
-
string
$string: text to be logged
-
integer
$priority: (optional, default value 10) debug level of the message
set the CSS style names by which
void
setOutputStyles
(string $dayClass, string $today, mixed $day, [string $dayrotate = 'm'])
-
string
$dayClass: class to use in every day header
-
string
$today: class to use on today's date
-
mixed
$day: string for class on each day, or array to rotate through
-
string
$dayrotate: time-part ('m', 'd', 'y' etc) on which day CDD should be rotated
set the time slot picture (passed straight to a TimeSlotRule object) to apply
void
setTimeSlotPicture
(string $pic)
-
string
$pic: timeslot picture for this instrument and this calendar
time logging function -- logs the start and stop time of a booking or slot
void
slotlog
(
string $string,
TimeSlot $slot, [
boolean $display =
false])
-
string
$string: prefix to text to be logged
-
TimeSlot
$slot: the slot whose start/stop is to be logged
-
boolean
$display:
(optional ) use the displayStart rather than the start data in $slot
The higher $prio, the more verbose (in the debugging sense) the output.
time logging function
void
timelog
(
string $string,
$time,
SimpleDate $slot)
-
string
$string: prefix to text to be logged
-
SimpleDate
$slot:
the time to be logged
The higher $prio, the more verbose (in the debugging sense) the output.
-
$time
Break up bookings that span elements of a defined list (e.g. allowable times or days). A TimeSlotRule ($list) is used to define how the times should be broken up
$keepTimes(Vacant|Book) are set to CAL_TIME_BOOKING, CAL_TIME_SLOTRULE
CAL_TIME_BOOKING: start|stop are set according to the timeslotrule and will be used to display the timeslot in a graphica display (i.e. calculating height of boxes) display(Start|Stop) are set to the values of the original vacancy or booking being examined.
CAL_TIME_SLOTRULE: display(Start|Stop) variables are set to the values of the timeslot rule that breaks up the slots with the exception of slots that overlap a booking, where min() or max() is used start|stop are set to the same as the start/stop vars Note: vacancies that are at the start or end of the booking list are a corner case that is handled respectively as: start = slotrule->stop and stop = slotrule->stop
void
_breakAccordingToList
($list $list, $keepTimesVacant $keepTimesVacant, $keepTimesBook $keepTimesBook)
-
$list
$list: TimeSlotRule Object set of rules used to break up booking stream
-
$keepTimesVacant
$keepTimesVacant: enum how should the display(Start|Stop) and (start|stop)
-
$keepTimesBook
$keepTimesBook: enum .. variables be set for Vacancy and Booking slots
Break up bookings that span days (for display purposes only)
For example, if we had a vacancy pseudo-bookings from 2004-01-01-11:00 to 2004-01-02-24:00, then we would break it up into two bookings as follows:
- 2004-01-01-11:00 to 2004-01-01-24:00 and
- 2004-01-02-00:00 to 2004-01-02-24:00.
void
_breakAcrossDays
()
Generate a booking matrix for all the days we are interested in
void
_collectMatrix
( $daystart, $daystop, $granularity)
-
$daystart
-
$daystop
-
$granularity
Obtain the booking data for this time period
void
_fill
()
void
_getBookingData
( $instrument)
work out what html/css class this date should be rendered as
Create pseudo-bookings for all vacancies between the start of this calendar and the end.
For example, if we were constructing a calendar from 00:00 on 2004-01-01 to 23:59 on 2004-01-02, but there was only a booking from 10:00 to 11:00 on 2004-01-01, then we should create vacancy pseudo-bookings from:
- 2004-01-01-00:00 to 2004-01-01-10:00 and from
- 2004-01-01-11:00 to 2004-01-01-24:00 and from
- 2004-01-02-00:00 to 2004-01-02-24:00.
Bookings are NOT restricted to remaining on one day (i.e. a booking from 20:00:00 until 10:00:00 the next day is OK.
void
_insertVacancies
()
void
_makeRefreshScript
()
void
_reduceList
( $list)