Merge branch 'master' of ssh://git.kolabsys.com/git/roundcube

This commit is contained in:
Thomas Bruederli 2011-05-23 19:46:18 +02:00
commit d0032ff05a
4 changed files with 57 additions and 30 deletions

View file

@ -98,8 +98,8 @@ class calendar extends rcube_plugin
$driver_name = $this->rc->config->get('calendar_driver', 'database'); $driver_name = $this->rc->config->get('calendar_driver', 'database');
$driver_class = $driver_name . '_driver'; $driver_class = $driver_name . '_driver';
require_once('drivers/calendar_driver.php'); require_once($this->home . '/drivers/calendar_driver.php');
require_once('drivers/' . $driver_name . '/' . $driver_class . '.php'); require_once($this->home . '/drivers/' . $driver_name . '/' . $driver_class . '.php');
switch ($driver_name) { switch ($driver_name) {
case "kolab": case "kolab":

View file

@ -19,10 +19,7 @@ CREATE TABLE `calendars` (
`color` varchar(8) NOT NULL, `color` varchar(8) NOT NULL,
PRIMARY KEY(`calendar_id`), PRIMARY KEY(`calendar_id`),
CONSTRAINT `fk_calendars_user_id` FOREIGN KEY (`user_id`) CONSTRAINT `fk_calendars_user_id` FOREIGN KEY (`user_id`)
REFERENCES `users`(`user_id`) REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
/*!40008
ON DELETE CASCADE
ON UPDATE CASCADE */
) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */; ) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
CREATE TABLE `events` ( CREATE TABLE `events` (
@ -46,10 +43,7 @@ CREATE TABLE `events` (
`attendees` text DEFAULT NULL, `attendees` text DEFAULT NULL,
PRIMARY KEY(`event_id`), PRIMARY KEY(`event_id`),
CONSTRAINT `fk_events_calendar_id` FOREIGN KEY (`calendar_id`) CONSTRAINT `fk_events_calendar_id` FOREIGN KEY (`calendar_id`)
REFERENCES `calendars`(`calendar_id`) REFERENCES `calendars`(`calendar_id`) ON DELETE CASCADE ON UPDATE CASCADE
/*!40008
ON DELETE CASCADE
ON UPDATE CASCADE */
) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */; ) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
CREATE TABLE `attachments` ( CREATE TABLE `attachments` (
@ -61,10 +55,5 @@ CREATE TABLE `attachments` (
`data` longtext NOT NULL DEFAULT '', `data` longtext NOT NULL DEFAULT '',
PRIMARY KEY(`attachment_id`), PRIMARY KEY(`attachment_id`),
CONSTRAINT `fk_attachments_event_id` FOREIGN KEY (`event_id`) CONSTRAINT `fk_attachments_event_id` FOREIGN KEY (`event_id`)
REFERENCES `events`(`event_id`) REFERENCES `events`(`event_id`) ON DELETE CASCADE ON UPDATE CASCADE
/*!40008
ON DELETE CASCADE
ON UPDATE CASCADE */
) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */; ) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;

View file

@ -3,15 +3,33 @@
* *
* Plugin to add a calendar to RoundCube. * Plugin to add a calendar to RoundCube.
* *
* @version 0.2 BETA 2 * @version 0.3 beta
* @author Lazlo Westerhof * @author Lazlo Westerhof
* @author Albert Lee * @author Albert Lee
* @author Aleksander Machniak <machniak@kolabsys.com>
* @url http://rc-calendar.lazlo.me * @url http://rc-calendar.lazlo.me
* @licence GNU GPL * @licence GNU GPL
* @copyright (c) 2010 Lazlo Westerhof - Netherlands * @copyright (c) 2010 Lazlo Westerhof - Netherlands
* *
**/ **/
CREATE SEQUENCE calendar_ids
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
CREATE TABLE calendars (
calendar_id integer DEFAULT nextval('calendar_ids'::regclass) NOT NULL,
user_id integer NOT NULL
REFERENCES users (user_id) ON UPDATE CASCADE ON DELETE CASCADE,
name varchar(255) NOT NULL,
color varchar(8) NOT NULL,
PRIMARY KEY (calendar_id)
);
CREATE SEQUENCE event_ids CREATE SEQUENCE event_ids
INCREMENT BY 1 INCREMENT BY 1
NO MAXVALUE NO MAXVALUE
@ -20,21 +38,41 @@ CREATE SEQUENCE event_ids
CREATE TABLE events ( CREATE TABLE events (
event_id integer DEFAULT nextval('event_ids'::regclass) NOT NULL, event_id integer DEFAULT nextval('event_ids'::regclass) NOT NULL,
user_id integer NOT NULL, calendar_id integer NOT NULL
REFERENCES calendars (calendar_id) ON UPDATE CASCADE ON DELETE CASCADE,
recurence_id integer NOT NULL DEFAULT 0,
uid varchar(255) NOT NULL DEFAULT '',
created timestamp without time zone DEFAULT now() NOT NULL,
changed timestamp without time zone DEFAULT now(),
"start" timestamp without time zone DEFAULT now() NOT NULL, "start" timestamp without time zone DEFAULT now() NOT NULL,
"end" timestamp without time zone DEFAULT now() NOT NULL, "end" timestamp without time zone DEFAULT now() NOT NULL,
"title" character varying(255) NOT NULL, recurrence varchar(255) DEFAULT NULL,
"description" text NOT NULL, title character varying(255) NOT NULL,
"location" character varying(255) NOT NULL, description text NOT NULL,
"categories" character varying(255) NOT NULL, location character varying(255) NOT NULL,
"all_day" smallint NOT NULL DEFAULT 0 categories character varying(255) NOT NULL,
all_day smallint NOT NULL DEFAULT 0,
free_busy smallint NOT NULL DEFAULT 0,
priority smallint NOT NULL DEFAULT 1,
alarms varchar(255) DEFAULT NULL,
attendees text DEFAULT NULL
PRIMARY KEY (event_id)
); );
CREATE INDEX events_event_id_idx ON events USING btree (event_id);
CREATE SEQUENCE attachment_ids
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
-- CREATE TABLE attachments (
-- Constraints Table `events` attachment_id integer DEFAULT nextval('attachment_ids'::regclass) NOT NULL,
-- event_id integer NOT NULL
ALTER TABLE ONLY events REFERENCES events (event_id) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT events_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(user_id) ON UPDATE CASCADE ON DELETE CASCADE; filename varchar(255) NOT NULL DEFAULT '',
mimetype varchar(255) NOT NULL DEFAULT '',
size integer NOT NULL DEFAULT 0,
data text NOT NULL DEFAULT '',
PRIMARY KEY (attachment_id)
);

View file

@ -15,7 +15,7 @@
+-------------------------------------------------------------------------+ +-------------------------------------------------------------------------+
*/ */
class Kolab_calendar class kolab_calendar
{ {
public $id; public $id;
public $ready = false; public $ready = false;