Update OC_VObject

This commit is contained in:
Bart Visscher 2011-12-09 21:56:03 +01:00
parent 2e951c0ce5
commit a3cb04013e
2 changed files with 9 additions and 14 deletions

View File

@ -460,7 +460,7 @@ class OC_Calendar_Object{
{ {
$title = $request["title"]; $title = $request["title"];
$location = $request["location"]; $location = $request["location"];
$categories = isset($request["categories"]) ? $request["categories"] : null; $categories = isset($request["categories"]) ? $request["categories"] : array();
$allday = isset($request["allday"]); $allday = isset($request["allday"]);
$from = $request["from"]; $from = $request["from"];
$to = $request["to"]; $to = $request["to"];
@ -511,20 +511,9 @@ class OC_Calendar_Object{
} }
unset($vevent->DURATION); unset($vevent->DURATION);
$vevent->setString('LOCATION', $location); $vevent->setString('LOCATION', $location);
$vevent->setString('DESCRIPTION', $description);
if($description != ""){ $vevent->setString('CATEGORIES', join(',', $categories));
$vevent->DESCRIPTION = $description;
}else{
unset($vevent->DESCRIPTION);
}
if(!empty($categories)){
$vevent->CATEGORIES = join(',', $categories);
}else{
unset($vevent->CATEGORIES);
}
/*if($repeat == "true"){ /*if($repeat == "true"){
$vevent->RRULE = $repeat; $vevent->RRULE = $repeat;

View File

@ -48,6 +48,7 @@ class OC_VObject{
} }
return $vobject; return $vobject;
} catch (Exception $e) { } catch (Exception $e) {
OC_Log::write('vobject', $e->getMessage(), OC_Log::ERROR);
return null; return null;
} }
} }
@ -132,6 +133,7 @@ class OC_VObject{
public function setString($name, $string){ public function setString($name, $string){
if ($string != ''){ if ($string != ''){
$string = strtr($string, array("\r\n"=>"\n"));
$this->vobject->__set($name, $string); $this->vobject->__set($name, $string);
}else{ }else{
$this->vobject->__unset($name); $this->vobject->__unset($name);
@ -195,6 +197,10 @@ class OC_VObject{
return $this->vobject->__unset($name); return $this->vobject->__unset($name);
} }
public function __isset($name){
return $this->vobject->__isset($name);
}
public function __call($function,$arguments){ public function __call($function,$arguments){
return call_user_func_array(array($this->vobject, $function), $arguments); return call_user_func_array(array($this->vobject, $function), $arguments);
} }