diff options
author | Georg Ehrke <dev@georgswebsite.de> | 2012-04-13 16:42:10 -0400 |
---|---|---|
committer | Georg Ehrke <dev@georgswebsite.de> | 2012-04-13 16:42:10 -0400 |
commit | 77a9e343aae4fc19a1e6fbf71b73e171640ac02a (patch) | |
tree | 3d110503a333595b1d7c233ae903dcc79e5f664e /apps/calendar/lib/object.php | |
parent | 613e15035e3f02a212c9f3ec11ae98fc3ef682c8 (diff) | |
parent | b9f9228a22944184803a8835282862e468812c1d (diff) | |
download | nextcloud-server-77a9e343aae4fc19a1e6fbf71b73e171640ac02a.tar.gz nextcloud-server-77a9e343aae4fc19a1e6fbf71b73e171640ac02a.zip |
Merge branch 'master' into sabredav_1.6
Diffstat (limited to 'apps/calendar/lib/object.php')
-rw-r--r-- | apps/calendar/lib/object.php | 31 |
1 files changed, 4 insertions, 27 deletions
diff --git a/apps/calendar/lib/object.php b/apps/calendar/lib/object.php index a471aa84034..9b6554a3e25 100644 --- a/apps/calendar/lib/object.php +++ b/apps/calendar/lib/object.php @@ -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 = ?' ); @@ -320,27 +322,6 @@ class OC_Calendar_Object{ return $dtend; } - public static function getCategoryOptions($l10n) - { - return array( - $l10n->t('Birthday'), - $l10n->t('Business'), - $l10n->t('Call'), - $l10n->t('Clients'), - $l10n->t('Deliverer'), - $l10n->t('Holidays'), - $l10n->t('Ideas'), - $l10n->t('Journey'), - $l10n->t('Jubilee'), - $l10n->t('Meeting'), - $l10n->t('Other'), - $l10n->t('Personal'), - $l10n->t('Projects'), - $l10n->t('Questions'), - $l10n->t('Work'), - ); - } - public static function getRepeatOptions($l10n) { return array( @@ -457,10 +438,6 @@ class OC_Calendar_Object{ $errnum++; } - if(isset($request['categories']) && !is_array($request['categories'])){ - $errors['categories'] = $l10n->t('Not an array'); - } - $fromday = substr($request['from'], 0, 2); $frommonth = substr($request['from'], 3, 2); $fromyear = substr($request['from'], 6, 4); @@ -628,7 +605,7 @@ class OC_Calendar_Object{ { $title = $request["title"]; $location = $request["location"]; - $categories = isset($request["categories"]) ? $request["categories"] : array(); + $categories = $request["categories"]; $allday = isset($request["allday"]); $from = $request["from"]; $to = $request["to"]; @@ -802,7 +779,7 @@ class OC_Calendar_Object{ $vevent->setString('LOCATION', $location); $vevent->setString('DESCRIPTION', $description); - $vevent->setString('CATEGORIES', join(',', $categories)); + $vevent->setString('CATEGORIES', $categories); /*if($repeat == "true"){ $vevent->RRULE = $repeat; |