Inheritance diagram for boinfolog_vtodos:
$binf =& CreateObject('infolog.boinfolog'); $tsk1 = $binf->read(1233); // get 3 tasks $tsk2 = $binf->read(4011); $tsk3 = $binf->read(4012); $binfhnd =& CreateObject('egwical.boinfolog_vtodos',$binf);
// alternative 1 $vtodo1 = $binfhnd->export_vtodo($ev1,UMM_ID2UID); $vcalstr1 = egwical_resourcehandler::render_velt2vcal($vtodo1); // alternative 2 (generic for all resourcehandlers) $binfhnd->uid_mapping_export = UMM_ID2UID; $vtodo2 = $binfhnd->export_ncvelt($tsk2); $vcalstr2 = egwical_resourcehandler::render_velt2vcal($vtodo2); // alternative 3 (via baseclass, without intermediate vtodo) $vcalstr3 = $binfhnd->export_vcal($tsk3);
// alternative 1 (via the concrete method) $vtodo1 = ..... a good vtodo $tsk_id1 = $binfhnd->import_vtodo($vtodo1, UMM_UID2ID,1); if ($tsk_id1 > 0) { echo "imported vtodo1 as task with id $tsk_id1"; } // alternative 2 (generic for all resourcehandlers) $binfhnd->uid_mapping_import = UMM_UID2ID; $tsk_id2 = $binfhnd->import_ncvelt($vtodo2); if ($tsk_id2 > 0) { echo "imported vtodo2 as task with id $tsk_id2"; } // alternative 3 (via base class, easier for multiple vtodos) $my_vtodos = array($vtodo1, $vtodo2,..); $binfhnd->uid_mapping_import = UMM_UID2ID; $tids = $binfhnd->import_velts($my_vtodos); echo "we imported" . count($tids) . "vtodos";
// alternative 1 $vcalstr = .. an vcalendar format string with multiple vtodos $compvelt = egwical_resourcehandler::parse_vcal2velt($vcalstr); if($compvelt === false) exit; $tids = $binfhnd->import_velts($compvelt); if ($tids) { echo "we imported" . count($tids) . "tasks"; } // alternative 2 (using the baseclass its methods) $tids = $binfhnd->import_vcal($vcalstr); if ($tids) echo "we imported" . count($tids) . "tasks";
Lars Kneschke <lkneschke@egroupware.org> (parts from boical that are reused here)
Ralf Becker <RalfBecker-AT-outdoor-training.de> (parts from boical that are reused here)
0.9.36 first version for napi3.1 (with rsc_owner_id parameter)
0.9.30 first version for napi3
Public Member Functions | |
boinfolog_vtodos (egwobj $egwrsc=null, ProductType $devicetype='all', string $rscownid='0') | |
Our Constructor, if given it sets the egw resource $egwrsc is set as so called bound egw resource. | |
VTODO | export_ncvelt (TaskId-I-TaskData &$tid) |
Wrapper around export_vtodo() with simplified parameters. | |
VTODO I false | export_vtodo (TaskId-I-TaskData &$task, int $uid_mapping_export=ID2UID) |
Export infolog task from bound boinfolog resource as VTODO. | |
TaskId I errorstring | import_ncvelt (&$velt, int $tid=-1) |
Wrapper around import_vtodo() with simplified set of call parameters. | |
TaskId I Errorstring | import_vtodo (VTODO &$vtodo, int $uid_mapping_import, boolean $reimport_missing_tasks=false, int $cal_id=0) |
Import a VTODO as a task into the Egw infolog. | |
boolean | set_rsc (egwobj $egw_rsc) |
Set the egw infolog 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. | |
Private Member Functions | |
array | _provided_vtodo2taskFields () |
Deliver the implemented vtodo to task mapping as provided by this class. | |
Private Attributes | |
boinfolog | $rsc = null |
The Bound Egw (Infolog) Resource that we handle. | |
array | $status_task2vtodo |
conversion of infologtask status to vtodo status | |
array | $status_vtodo2task |
conversion of vtodo status to infolog status | |
boolean | $tsdebug = true |
Switch to print extra debugging about imported and exported todos to the httpd errorlog stream. | |
array | $vtodo2taskFields = array() |
mapping from iCalendar VTODO fields to egw infolog task 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 vtodo to task mapping as provided by this class.
|
|
Wrapper around export_vtodo() with simplified parameters.
|
|
Export infolog task from bound boinfolog resource as VTODO. The eGW task in $task is exported to iCalendar VTODO (of type Horde_iCalendar_vtodo) Note that only the set of supported Fields, as indicated by the $supportedFields member variable, are exported into the VTODO. The uid field of the generated VTODO will be filled according to the setting of the $uid_mapping_export parameter. Either with the task id encoded (ID2UID) or with the task uid field copied (UID2UID) or with a completey new generated string (NEWUID). For more info see UID to ID Mapping and Matching. The mapping is inspired on rfc 2445 -sec 4.6.2
|
|
Wrapper around import_vtodo() with simplified set of call parameters.
The value of the member variable $uid_mapping_import is used to control the set of iCalendar fields that are imported.
|
|
Import a VTODO as a task into the Egw infolog. The ical VTODO component is converted to an eGW task for the infolog resource in $rsc and then imported into this eGW infolog resource. Depending on the value of $uid_mapping_import, the conversion will either:
Default the mode $supportedFields determines the VTODOS that will be used for import
|
|
Set the egw infolog resource that this worker will handle. This worker is only capable of handling boinfolog task 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 'vtodo'. 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 VTODOS 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.
|
|
The Bound Egw (Infolog) Resource that we handle. Registry for the egw resource object (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. |
|
Initial value: array( 'offer' => 'NEEDS-ACTION', 'not-started' => 'NEEDS-ACTION', 'ongoing' => 'IN-PROCESS', 'done' => 'COMPLETED', 'cancelled' => 'CANCELLED', 'billed' => 'DONE', 'call' => 'NEEDS-ACTION', 'will-call' => 'IN-PROCESS', )
|
|
Initial value: array( 'NEEDS-ACTION' => 'not-started', 'IN-PROCESS' => 'ongoing', 'COMPLETED' => 'done', 'CANCELLED' => 'cancelled', )
|
|
Switch to print extra debugging about imported and exported todos to the httpd errorlog stream.
|
|
mapping from iCalendar VTODO fields to egw infolog task 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'),Here rn stands for "Resourced Name", to indicate the name of the related related field in the bound egw resource
|