install 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <?php
  2. require_once(__DIR__.'/../../common.php');
  3. require_once(__DIR__.'/constant.php');
  4. global $conf;
  5. $endpoint = str_replace('action.php',str_replace(__ROOT__,'',__DIR__).'/calendars.php',$_SERVER['PHP_SELF']);
  6. $endpoint = str_replace(array('\\','//'),'/',$endpoint);
  7. $dbmanager = new Configuration();
  8. $conf->put('WEBDAV_CALENDAR_URL',$endpoint);
  9. Section::add('calendar');
  10. $dbmanager->customExecute("
  11. CREATE TABLE ".ENTITY_PREFIX."plugin_caldav_calendarobjects (
  12. id integer primary key asc,
  13. calendardata blob,
  14. uri text,
  15. calendarid integer,
  16. lastmodified integer,
  17. etag text,
  18. size integer,
  19. componenttype text,
  20. firstoccurence integer,
  21. lastoccurence integer,
  22. uid text
  23. );
  24. CREATE TABLE ".ENTITY_PREFIX."plugin_caldav_calendars (
  25. id integer primary key asc,
  26. principaluri text,
  27. displayname text,
  28. uri text,
  29. synctoken integer,
  30. description text,
  31. calendarorder integer,
  32. calendarcolor text,
  33. timezone text,
  34. components text,
  35. transparent bool
  36. );
  37. CREATE TABLE ".ENTITY_PREFIX."plugin_caldav_calendarchanges (
  38. id integer primary key asc,
  39. uri text,
  40. synctoken integer,
  41. calendarid integer,
  42. operation integer
  43. );
  44. CREATE INDEX calendarid_synctoken ON ".ENTITY_PREFIX."plugin_caldav_calendarchanges (calendarid, synctoken);
  45. CREATE TABLE ".ENTITY_PREFIX."plugin_caldav_calendarsubscriptions (
  46. id integer primary key asc,
  47. uri text,
  48. principaluri text,
  49. source text,
  50. displayname text,
  51. refreshrate text,
  52. calendarorder integer,
  53. calendarcolor text,
  54. striptodos bool,
  55. stripalarms bool,
  56. stripattachments bool,
  57. lastmodified int
  58. );
  59. CREATE TABLE ".ENTITY_PREFIX."plugin_caldav_schedulingobjects (
  60. id integer primary key asc,
  61. principaluri text,
  62. calendardata blob,
  63. uri text,
  64. lastmodified integer,
  65. etag text,
  66. size integer
  67. );
  68. CREATE INDEX principaluri_uri ON ".ENTITY_PREFIX."plugin_caldav_calendarsubscriptions (principaluri, uri);
  69. CREATE TABLE ".ENTITY_PREFIX."plugin_caldav_principals (
  70. id INTEGER PRIMARY KEY ASC,
  71. uri TEXT,
  72. email TEXT,
  73. displayname TEXT,
  74. UNIQUE(uri)
  75. );
  76. CREATE TABLE ".ENTITY_PREFIX."plugin_caldav_groupmembers (
  77. id INTEGER PRIMARY KEY ASC,
  78. principal_id INTEGER,
  79. member_id INTEGER,
  80. UNIQUE(principal_id, member_id)
  81. );
  82. ");
  83. ?>