Calendar: Update category list when updating/adding event
This commit is contained in:
parent
471e735b0c
commit
4c52007996
|
@ -116,6 +116,14 @@ class OC_Calendar_App{
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* check VEvent for new categories.
|
||||
* @see OC_VCategories::loadFromVObject
|
||||
*/
|
||||
public static function loadCategoriesFromVCalendar(OC_VObject $calendar) {
|
||||
self::getVCategories()->loadFromVObject($calendar->VEVENT, true);
|
||||
}
|
||||
|
||||
public static function getRepeatOptions(){
|
||||
return OC_Calendar_Object::getRepeatOptions(self::$l10n);
|
||||
}
|
||||
|
|
|
@ -93,6 +93,7 @@ class OC_Calendar_Object{
|
|||
*/
|
||||
public static function add($id,$data){
|
||||
$object = OC_VObject::parse($data);
|
||||
OC_Calendar_App::loadCategoriesFromVCalendar($object);
|
||||
list($type,$startdate,$enddate,$summary,$repeating,$uid) = self::extractData($object);
|
||||
|
||||
if(is_null($uid)){
|
||||
|
@ -139,6 +140,7 @@ class OC_Calendar_Object{
|
|||
$oldobject = self::find($id);
|
||||
|
||||
$object = OC_VObject::parse($data);
|
||||
OC_Calendar_App::loadCategoriesFromVCalendar($object);
|
||||
list($type,$startdate,$enddate,$summary,$repeating,$uid) = self::extractData($object);
|
||||
|
||||
$stmt = OC_DB::prepare( 'UPDATE *PREFIX*calendar_objects SET objecttype=?,startdate=?,enddate=?,repeating=?,summary=?,calendardata=?, lastmodified = ? WHERE id = ?' );
|
||||
|
|
Loading…
Reference in New Issue