mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-05 05:29:13 +01:00
Moving egwical classes to the icalsrv app. Reworked icalsrv.php to use these. Verified that all .ics files are working now even with no tasks (output empty file instead of nothing).
Format cleanup on existing files.
This commit is contained in:
parent
21287627ea
commit
9c855b7383
16
icalsrv.php
16
icalsrv.php
@ -123,15 +123,15 @@
|
|||||||
// Ok! We have a session and access to icalsrv!
|
// Ok! We have a session and access to icalsrv!
|
||||||
|
|
||||||
// now set the variables that will control the working mode of icalvircal
|
// now set the variables that will control the working mode of icalvircal
|
||||||
// the defines are in the egwical_resourcehandler sourcefile
|
// the defines are in the icalsrv_resourcehandler sourcefile
|
||||||
require_once EGW_SERVER_ROOT. '/egwical/inc/class.egwical_resourcehandler.inc.php' ;
|
require_once EGW_SERVER_ROOT. '/icalsrv/inc/class.icalsrv_resourcehandler.inc.php' ;
|
||||||
|
|
||||||
/** uid mapping export configuration switch
|
/** uid mapping export configuration switch
|
||||||
* @var int
|
* @var int
|
||||||
* Parameter that determines, a the time of export from Egw (aka dowload by client), how
|
* Parameter that determines, a the time of export from Egw (aka dowload by client), how
|
||||||
* ical elements (like VEVENT's) get their uid fields filled, from data in
|
* ical elements (like VEVENT's) get their uid fields filled, from data in
|
||||||
* the related Egroupware element.
|
* the related Egroupware element.
|
||||||
* See further in @ref secuidmapping in the egwical_resourcehandler documentation.
|
* See further in @ref secuidmapping in the icalsrv_resourcehandler documentation.
|
||||||
*/
|
*/
|
||||||
$uid_export_mode = UMM_ID2UID;
|
$uid_export_mode = UMM_ID2UID;
|
||||||
|
|
||||||
@ -140,7 +140,7 @@
|
|||||||
* Parameter that determines, at the time of import into Egw (aka publish by client), how
|
* Parameter that determines, at the time of import into Egw (aka publish by client), how
|
||||||
* ical elements (like VEVENT's) will find, based on their uid fields, related egw
|
* ical elements (like VEVENT's) will find, based on their uid fields, related egw
|
||||||
* elements, that are then updated with the ical info.
|
* elements, that are then updated with the ical info.
|
||||||
* See further in @ref secuidmapping in the egwical_resourcehandler documentation.
|
* See further in @ref secuidmapping in the icalsrv_resourcehandler documentation.
|
||||||
*/
|
*/
|
||||||
$uid_import_mode = UMM_UID2ID;
|
$uid_import_mode = UMM_UID2ID;
|
||||||
|
|
||||||
@ -327,7 +327,7 @@
|
|||||||
// build a virtual calendar with ical facilities from the found vircal
|
// build a virtual calendar with ical facilities from the found vircal
|
||||||
// array_storage data
|
// array_storage data
|
||||||
$icalvc =& CreateObject('icalsrv.icalvircal');
|
$icalvc =& CreateObject('icalsrv.icalvircal');
|
||||||
if(! $icalvc->fromArray($vircal_arstore))
|
if(!$icalvc->fromArray($vircal_arstore))
|
||||||
{
|
{
|
||||||
error_log('icalsrv.php: ' . $cnmsg . ' couldnot restore from repository.' );
|
error_log('icalsrv.php: ' . $cnmsg . ' couldnot restore from repository.' );
|
||||||
fail_exit($cnmsg . ' internal problem ' , '403');
|
fail_exit($cnmsg . ' internal problem ' , '403');
|
||||||
@ -477,7 +477,7 @@
|
|||||||
// *** GET (or POST?) Request so do an export
|
// *** GET (or POST?) Request so do an export
|
||||||
$logmsg = 'EXPORTING';
|
$logmsg = 'EXPORTING';
|
||||||
// derive a ProductType from our http Agent and set it in icalvc
|
// derive a ProductType from our http Agent and set it in icalvc
|
||||||
$icalvc->deviceType = egwical_resourcehandler::httpUserAgent2deviceType($reqagent);
|
$icalvc->deviceType = icalsrv_resourcehandler::httpUserAgent2deviceType($reqagent);
|
||||||
|
|
||||||
// export the data from the virtual calendar
|
// export the data from the virtual calendar
|
||||||
$vcalstr = $icalvc->export_vcal();
|
$vcalstr = $icalvc->export_vcal();
|
||||||
@ -496,7 +496,7 @@
|
|||||||
|
|
||||||
if($logdir) log_ical($logmsg,"export",$vcalstr);
|
if($logdir) log_ical($logmsg,"export",$vcalstr);
|
||||||
// handle response ...
|
// handle response ...
|
||||||
$content_type = egwical_resourcehandler::deviceType2contentType($icalvc->deviceType);
|
$content_type = icalsrv_resourcehandler::deviceType2contentType($icalvc->deviceType);
|
||||||
if($content_type)
|
if($content_type)
|
||||||
{
|
{
|
||||||
header($content_type);
|
header($content_type);
|
||||||
@ -519,6 +519,8 @@
|
|||||||
// return http error $errno can this be done this way?
|
// return http error $errno can this be done this way?
|
||||||
header('HTTP/1.1 '. $errno . ' ' . $msg);
|
header('HTTP/1.1 '. $errno . ' ' . $msg);
|
||||||
# header('HTTP/1.1 403 ' . $msg);
|
# header('HTTP/1.1 403 ' . $msg);
|
||||||
|
ob_flush();
|
||||||
|
flush();
|
||||||
$GLOBALS['egw']->common->egw_exit();
|
$GLOBALS['egw']->common->egw_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user