Inheritance diagram for bocalupdate_vfreebusy:
$boc =& CreateObject('calendar.bocalupdate'); $ev1 = $boc->read(1233); // get two events $ev2 = $boc->read(4011); $fbreq = array('url'=> '/myfreebusy.vfb', 'start' => '20060201', 'end' => '20061231' ); $devicetype = 'all'; $calhnd =& CreateObject( 'egwical.bocalupdate_vfreebusy', $boc, $devicetype, $fbreq );
// alternative 1 $events = array($ev1, $ev2); $vfreebusies =& $calhnd->export_velts($events); if($vfreebusies === false) exit; $vcalstr1 = egwical_resourcehandler::render_velt2vcal($vfreebusies);
$vfreebusies
in the example may be a bit misleading.
get import of freebusy working.... Inpackage: egwical
Public Member Functions | |
bocalupdate_vfreebusy (egwobj $egwrsc=null, ProductType $devicetype='all', string $rscownid, array &$fb_req=null) | |
Our Constructor, if given it sets the egw resource $egwrsc is set as so called bound egw resource. | |
VcalStr | export_vcal (array_of_EventId-I-array_of_EventData &$eids, array $attribs=null) |
Export events from bocal as vfreebusy iCalendar string. | |
VFREEBUSY | export_velts (array_of_EventId-I-array_of_EventData &$eids) |
Export all events as a VFREEBUSY element --overwrites baseclass method--. | |
VFREEBUSY I false | export_vfreebusy (&$events) |
Export calendar events from bound bocalupdate resource as FREEBUSY field. | |
VFREEBUSY I False | import_vfreebusy (&$vfreebusy) |
Import a VFREEBUSY element, i.e. | |
boolean | set_rsc (egwobj $egw_rsc) |
Set the egw calendar resource that this worker will handle. | |
void | setSupportedFields (ProductType $devicetype= 'all') |
Set the list of ical fields that are supported during the next imports and exports. | |
Public Attributes | |
array | $fb_req = array() |
Request Info hash - some of the fields from the request This is to be set by the constructor of this handler. | |
Private Member Functions | |
array | _provided_vfreebusy2eventFields () |
Deliver the implemented vfreebusy to event mapping as provided by this class. | |
Private Attributes | |
bocalupdate | $rsc = null |
The Bound Egw Resource that we handle. | |
boolean | $vfdebug = false |
Switch to print extra debugging about imported and exported elements to the httpd errorlog stream. | |
array | $vfreebusy2eventFields = array() |
mapping from iCalendar VFREEBUSY fields to egw calendar fields |
|
Our Constructor, if given it sets the egw resource $egwrsc is set as so called bound egw resource. And $prodid, the product id of the client that will use or produce ical data is set to determine which fields to use in coming import and exportd conversions between vcalendar and egw data.
|
|
Deliver the implemented vfreebusy to event mapping as provided by this class. Produce the array of vfreebusy to event field mappings that this class implements. These are stored on instantiation in the variable $vfreebusy2eventFields
|
|
Export events from bocal as vfreebusy iCalendar string. --overwrites base method-- All the egw elements in the bound egw bocalendar resource, refered to by the ids in $eids are exported as Vfreebusy Vcalendar formatted string. Specific global attributes settings for this string are taken from .....
|
|
Export all events as a VFREEBUSY element --overwrites baseclass method--.
|
|
Export calendar events from bound bocalupdate resource as FREEBUSY field. The eGW events in $eids are exported to a iCalendar FREEBUSY (of type Horde_iCalendar_vfreebusyd). For each event a FREEBUSY field is set. Note that only the set of supported Fields, as indicated by the $supportedFields member variable, are considered for the VFREEBUSY. The end and start of the freebusy period are set from the member variables $fb_start and $fb-end.
|
|
Import a VFREEBUSY element, i.e. : respond to the freebusy request-periods with an exported VFREEBUSY element. The ical VFREEBUSY component is converted to an set of dtstart, dtend pairs. On the calendar resource in $rsc is then and export_vfreebusy() done for these periods and this is return as result. $supportedFields determines the VFREEBUSY fields that will be used considered
|
|
Set the egw calendar resource that this worker will handle. This worker is only capable of handling bocalupdate calendar objects, so it should be of that class. The $egw_rsc is registered in the $rsc variable and the supported ical element is set to be 'vevent'. This is registered in $rsc_vtypes.
|
|
Set the list of ical fields that are supported during the next imports and exports. The list of iCal fields that should be converted during the following imports and exports of VFREEBUSY s is set. This is done according to a given ProductType as mostly set in the $deviceType field of the egwical_resourcehandler. See there for a further description. In a small lookup table the set of currently supported fields is searched for and then and then these are set accordingly in the class member $supportedFields.
|
|
Request Info hash - some of the fields from the request This is to be set by the constructor of this handler. Fields that can be set in this hash are: $fb_req = array('start' => <Start time of the request period for the freebusies>, 'end' => <End time of the request period for the freebusies>, 'requestor' => <Requestor of the freebusy output (by egw id)>, 'cal_owner' => <Owner of the calendar (by egw id)>, ); |
|
The Bound Egw Resource that we handle. Registry for the egw resource object (calendar, infolog,..) that will be used to transport ical elements from and to: The socalled Bound Resource This can be set by the constructor or later by set_rsc(). Reimplemented from egwical_resourcehandler. |
|
Switch to print extra debugging about imported and exported elements to the httpd errorlog stream.
|
|
mapping from iCalendar VFREEBUSY fields to egw calendar fields An array containing roughly the mapping from iCalendar to egw fields. Set by constructor. example entry (rn stands for "Resourced_Name"): 'SUMMARY' => array('rn' => 'title'),
|