aboutsummaryrefslogtreecommitdiffstats
path: root/apps/calendar/lib
diff options
context:
space:
mode:
authorGeorg Ehrke <dev@georgswebsite.de>2012-06-27 20:56:58 +0200
committerGeorg Ehrke <dev@georgswebsite.de>2012-06-27 20:56:58 +0200
commit25a50f00bd70a3bbb209ff20938aed358b7ffd7c (patch)
tree5b12e19693d99a6e14538ba62da50fdfc2a7f452 /apps/calendar/lib
parentb7f86cf282723049842b014883d28301781c413f (diff)
downloadnextcloud-server-25a50f00bd70a3bbb209ff20938aed358b7ffd7c.tar.gz
nextcloud-server-25a50f00bd70a3bbb209ff20938aed358b7ffd7c.zip
add merge calendar function and add some documentation to OC_Calendar_Calendar
Diffstat (limited to 'apps/calendar/lib')
-rw-r--r--apps/calendar/lib/calendar.php25
1 files changed, 24 insertions, 1 deletions
diff --git a/apps/calendar/lib/calendar.php b/apps/calendar/lib/calendar.php
index 1bfab5cd645..521bf944d91 100644
--- a/apps/calendar/lib/calendar.php
+++ b/apps/calendar/lib/calendar.php
@@ -212,7 +212,20 @@ class OC_Calendar_Calendar{
return true;
}
-
+
+ /*
+ * @brief merges two calendars
+ * @param integer $id1
+ * @param integer $id2
+ * @return boolean
+ */
+ public static function mergeCalendar($id1, $id2){
+ $stmt = OCP\DB::prepare('UPDATE *PREFIX*calendar_objects SET calendarid = ? WHERE calendarid = ?');
+ $stmt->execute(array($id1, $id2));
+ self::touchCalendar($id1);
+ self::deleteCalendar($id2);
+ }
+
/**
* @brief Creates a URI for Calendar
* @param string $name name of the calendar
@@ -238,6 +251,11 @@ class OC_Calendar_Calendar{
list($prefix,$userid) = Sabre_DAV_URLUtil::splitPath($principaluri);
return $userid;
}
+
+ /*
+ * @brief returns the possible color for calendars
+ * @return array
+ */
public static function getCalendarColorOptions(){
return array(
'#ff0000', // "Red"
@@ -251,6 +269,11 @@ class OC_Calendar_Calendar{
);
}
+ /*
+ * @brief generates the Event Source Info for our JS
+ * @param array $calendar calendar data
+ * @return array
+ */
public static function getEventSourceInfo($calendar){
return array(
'url' => OCP\Util::linkTo('calendar', 'ajax/events.php').'?calendar_id='.$calendar['id'],