Skip to content
Snippets Groups Projects
Commit 25a50f00 authored by Georg Ehrke's avatar Georg Ehrke
Browse files

add merge calendar function and add some documentation to OC_Calendar_Calendar

parent b7f86cf2
Branches
No related tags found
No related merge requests found
...@@ -213,6 +213,19 @@ class OC_Calendar_Calendar{ ...@@ -213,6 +213,19 @@ class OC_Calendar_Calendar{
return true; 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 * @brief Creates a URI for Calendar
* @param string $name name of the calendar * @param string $name name of the calendar
...@@ -238,6 +251,11 @@ class OC_Calendar_Calendar{ ...@@ -238,6 +251,11 @@ class OC_Calendar_Calendar{
list($prefix,$userid) = Sabre_DAV_URLUtil::splitPath($principaluri); list($prefix,$userid) = Sabre_DAV_URLUtil::splitPath($principaluri);
return $userid; return $userid;
} }
/*
* @brief returns the possible color for calendars
* @return array
*/
public static function getCalendarColorOptions(){ public static function getCalendarColorOptions(){
return array( return array(
'#ff0000', // "Red" '#ff0000', // "Red"
...@@ -251,6 +269,11 @@ class OC_Calendar_Calendar{ ...@@ -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){ public static function getEventSourceInfo($calendar){
return array( return array(
'url' => OCP\Util::linkTo('calendar', 'ajax/events.php').'?calendar_id='.$calendar['id'], 'url' => OCP\Util::linkTo('calendar', 'ajax/events.php').'?calendar_id='.$calendar['id'],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment