summaryrefslogtreecommitdiffstats
path: root/apps/calendar
diff options
context:
space:
mode:
authorGeorg Ehrke <dev@georgswebsite.de>2012-06-27 22:24:12 +0200
committerGeorg Ehrke <dev@georgswebsite.de>2012-06-27 22:24:12 +0200
commit1f738d8c9f176d2fe570e96265fe736a03f69a1b (patch)
tree27ac85d4bad7ad3a061d583b3eddf4251485ace0 /apps/calendar
parent90b5cf680fa504dbbcec36daa0b8311887c9fca7 (diff)
parent77c66e8cc4ee69b8d52a25c7cf436f1c0347113a (diff)
downloadnextcloud-server-1f738d8c9f176d2fe570e96265fe736a03f69a1b.tar.gz
nextcloud-server-1f738d8c9f176d2fe570e96265fe736a03f69a1b.zip
Merge branch 'master' into calendar_export
Diffstat (limited to 'apps/calendar')
-rw-r--r--apps/calendar/lib/calendar.php39
-rw-r--r--apps/calendar/lib/object.php19
2 files changed, 44 insertions, 14 deletions
diff --git a/apps/calendar/lib/calendar.php b/apps/calendar/lib/calendar.php
index 1bfab5cd645..5274397c763 100644
--- a/apps/calendar/lib/calendar.php
+++ b/apps/calendar/lib/calendar.php
@@ -10,19 +10,6 @@
* The following SQL statement is just a help for developers and will not be
* executed!
*
- * CREATE TABLE calendar_objects (
- * id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
- * calendarid INTEGER UNSIGNED NOT NULL,
- * objecttype VARCHAR(40) NOT NULL,
- * startdate DATETIME,
- * enddate DATETIME,
- * repeating INT(1),
- * summary VARCHAR(255),
- * calendardata TEXT,
- * uri VARCHAR(100),
- * lastmodified INT(11)
- * );
- *
* CREATE TABLE calendar_calendars (
* id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
* userid VARCHAR(255),
@@ -35,6 +22,7 @@
* timezone TEXT,
* components VARCHAR(20)
* );
+ *
*/
/**
@@ -212,7 +200,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 +239,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 +257,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'],
diff --git a/apps/calendar/lib/object.php b/apps/calendar/lib/object.php
index 0531a56fc50..5d475c89434 100644
--- a/apps/calendar/lib/object.php
+++ b/apps/calendar/lib/object.php
@@ -5,6 +5,25 @@
* later.
* See the COPYING-README file.
*/
+ /*
+ *
+ * The following SQL statement is just a help for developers and will not be
+ * executed!
+ *
+ * CREATE TABLE calendar_objects (
+ * id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
+ * calendarid INTEGER UNSIGNED NOT NULL,
+ * objecttype VARCHAR(40) NOT NULL,
+ * startdate DATETIME,
+ * enddate DATETIME,
+ * repeating INT(1),
+ * summary VARCHAR(255),
+ * calendardata TEXT,
+ * uri VARCHAR(100),
+ * lastmodified INT(11)
+ * );
+ *
+ */
/**
* This class manages our calendar objects