CREATE TABLE mgw_calendar (
  id INTEGER NOT NULL default '0',
  date TIMESTAMP NOT NULL,
  userid INTEGER NOT NULL default '0',
  subject TEXT NOT NULL default '',
  location CHARACTER VARYING(100) NOT NULL default '',
  private INTEGER NOT NULL default '0',
  duration INTEGER NOT NULL default '0',
  external CHARACTER VARYING(200) NOT NULL default '',
  inituserid INTEGER NOT NULL default '0',
  day_ind INTEGER NOT NULL default '0',
  repeat INTEGER NOT NULL default '0',
  rep_from TIMESTAMP,
  rep_until TIMESTAMP,
  dategroup_id INTEGER NOT NULL default '0',
  holiday_id INTEGER NOT NULL default '0',
  PRIMARY KEY (id,userid)
);

CREATE TABLE mgw_calendar_tmp (
  id INTEGER NOT NULL default '0',
  date TIMESTAMP NOT NULL,
  userid INTEGER NOT NULL default '0',
  subject TEXT NOT NULL default '',
  location CHARACTER VARYING(100) NOT NULL default '',
  private INTEGER NOT NULL default '0',
  duration INTEGER NOT NULL default '0',
  external CHARACTER VARYING(200) NOT NULL default '',
  inituserid INTEGER NOT NULL default '0',
  day_ind INTEGER NOT NULL default '0',
  repeat INTEGER NOT NULL default '0',
  rep_from TIMESTAMP,
  rep_until TIMESTAMP,
  dategroup_id INTEGER NOT NULL default '0',
  holiday_id INTEGER NOT NULL default '0',
  PRIMARY KEY (id,userid)
);

INSERT INTO mgw_configtags VALUES ('calendar_viewfrom','calendar','daytime from where to display the appointments',0,0,'int',1,'2002-01-01');
INSERT INTO mgw_configtags VALUES ('calendar_viewto','calendar','daytime until appointments should appear',0,0,'int',1,'2002-01-01');
INSERT INTO mgw_configtags VALUES ('calendar_remindermail','calendar','send email reminds in calendar',0,0,'int',1,'2002-01-01');
INSERT INTO mgw_configtags VALUES ('calendar_interval','calendar','time intervalls for calendar in minutes',0,0,'int',1,'2002-01-01');
INSERT INTO mgw_configtags VALUES ('holiday_system','calendar','for which country to evaluate holidays',0,0,'str',1,'2002-01-01');
INSERT INTO mgw_configtags VALUES ('calendar_be_participant','calendar','send email reminds in calendar',0,0,'int',1,'2002-01-01');
INSERT INTO mgw_configtags VALUES ('calendar_show_birthdays','calendar','show birthdays in calendar',0,0,'int',1,'2002-01-01');
INSERT INTO mgw_configtags VALUES ('calendar_defaultview','calendar','default calendar view',0,0,'str',1,'2002-01-01');
INSERT INTO mgw_configtags VALUES ('calendar_vcal_method','calendar','default calendar view',0,0,'str',1,'2002-01-01');

INSERT INTO mgw_config VALUES (0,'calendar_viewfrom',1,'',8,'',1,'2002-01-01');
INSERT INTO mgw_config VALUES (0,'calendar_viewto',1,'',17,'',1,'2002-01-01');
INSERT INTO mgw_config VALUES (0,'calendar_remindermail',1,'',0,'',1,'2002-01-01');
INSERT INTO mgw_config VALUES (0,'calendar_interval',1,'',30,'',1,'2002-01-01');
INSERT INTO mgw_config VALUES (0,'holiday_system',1,'us',0,'',1,'2002-01-01');
INSERT INTO mgw_config VALUES (0,'calendar_be_participant',1,'',1,'',1,'2002-01-01');
INSERT INTO mgw_config VALUES (0,'calendar_show_birthdays',1,'',1,'',1,'2002-01-01');
INSERT INTO mgw_config VALUES (0,'calendar_defaultview',1,'index.php',0,'',1,'2002-01-01');
INSERT INTO mgw_config VALUES (0,'calendar_vcal_method',1,'to_file',0,'',1,'2002-01-01');
