Commit 63241ca3 authored by mose's avatar mose

added a calendar feature. be careful with that pre-alpha version. developers version only.

parent bfa81ee9
......@@ -1875,6 +1875,15 @@ tiki/lib/ban/banlib.php -text
tiki/lib/banners/bannerlib.php -text
tiki/lib/blogs/bloglib.php -text
tiki/lib/bookmarks/bookmarklib.php -text
tiki/lib/calendar/calendarlib.php -text
tiki/lib/calendar/iCal/class.iCal.inc.php -text
tiki/lib/calendar/iCal/class.iCalAlarm.inc.php -text
tiki/lib/calendar/iCal/class.iCalBase.inc.php -text
tiki/lib/calendar/iCal/class.iCalEvent.inc.php -text
tiki/lib/calendar/iCal/class.iCalFreeBusy.inc.php -text
tiki/lib/calendar/iCal/class.iCalJournal.inc.php -text
tiki/lib/calendar/iCal/class.iCalToDo.inc.php -text
tiki/lib/calendar/iCal/index.php -text
tiki/lib/categories/categlib.php -text
tiki/lib/charts/chartlib.php -text
tiki/lib/chat/chatlib.php -text
......@@ -2306,6 +2315,7 @@ tiki/styles/jalist2/grad.jpg -text
tiki/styles/jalist2/grad.png -text
tiki/styles/jalist2/maincap.png -text
tiki/styles/jalist2/menucap.png -text
tiki/styles/mose.css -text
tiki/styles/mozilla.css -text
tiki/styles/mozilla/mozilla-menubar.png -text
tiki/styles/neat.css -text svneol=unset#application/octet-stream
......@@ -2522,6 +2532,7 @@ tiki/templates/tiki-admin-include-wiki-history.tpl -text
tiki/templates/tiki-admin-include-wiki.tpl -text
tiki/templates/tiki-admin.tpl -text
tiki/templates/tiki-admin_banning.tpl -text
tiki/templates/tiki-admin_calendars.tpl -text
tiki/templates/tiki-admin_categories.tpl -text
tiki/templates/tiki-admin_chart_items.tpl -text
tiki/templates/tiki-admin_charts.tpl -text
......@@ -2565,6 +2576,7 @@ tiki/templates/tiki-bot_bar.tpl -text
tiki/templates/tiki-browse_categories.tpl -text
tiki/templates/tiki-browse_gallery.tpl -text
tiki/templates/tiki-browse_image.tpl -text
tiki/templates/tiki-calendar.tpl -text
tiki/templates/tiki-change_password.tpl -text
tiki/templates/tiki-charts.tpl -text
tiki/templates/tiki-chat.tpl -text
......@@ -2795,6 +2807,7 @@ tiki/tests/parse_data/test9.output -text
tiki/tiki-admin.php -text
tiki/tiki-admin_banners.php -text
tiki/tiki-admin_banning.php -text
tiki/tiki-admin_calendars.php -text
tiki/tiki-admin_categories.php -text
tiki/tiki-admin_chart_items.php -text
tiki/tiki-admin_charts.php -text
......@@ -2841,6 +2854,7 @@ tiki/tiki-blogs_rss.php -text
tiki/tiki-browse_categories.php -text
tiki/tiki-browse_gallery.php -text
tiki/tiki-browse_image.php -text
tiki/tiki-calendar.php -text
tiki/tiki-change_password.php -text
tiki/tiki-charts.php -text
tiki/tiki-chat.php -text
......
......@@ -607,3 +607,71 @@ create table tiki_copyrights(
INSERT INTO users_permissions(permName,type,permDesc,level) VALUES ('tiki_p_edit_copyrights','wiki','Can edit copyright notices','admin');
#### Workflow schema ends
#### Calendar tables
DROP TABLE IF EXISTS tiki_calendars;
CREATE TABLE tiki_calendars (
calendarId int(14) NOT NULL auto_increment,
groupname varchar(30) NOT NULL default '',
user varchar(40) NOT NULL default '',
name varchar(80) NOT NULL default '',
description varchar(255) default NULL,
created int(14) NOT NULL default '0',
lastmodif int(14) NOT NULL default '0',
public enum('n','y') NOT NULL default 'n',
visible enum('y','n') NOT NULL default 'y',
PRIMARY KEY (calendarId),
KEY groupname (groupname)
);
DROP TABLE IF EXISTS tiki_calendar_roles;
CREATE TABLE tiki_calendar_roles (
calitemId int(14) NOT NULL default '0',
username varchar(40) NOT NULL default '',
role enum('0','1','2','3') NOT NULL default '0',
PRIMARY KEY (calitemId,username(10))
);
DROP TABLE IF EXISTS tiki_calendar_locations;
CREATE TABLE tiki_calendar_locations (
callocId int(14) NOT NULL auto_increment,
calendarId int(14) NOT NULL default '0',
name varchar(255) NOT NULL default '',
description blob,
PRIMARY KEY (callocId)
);
DROP TABLE IF EXISTS tiki_calendar_categories;
CREATE TABLE tiki_calendar_categories (
calcatId int(11) NOT NULL auto_increment,
calendarId int(14) NOT NULL default '0',
name varchar(255) NOT NULL default '',
PRIMARY KEY (calcatId)
);
DROP TABLE IF EXISTS tiki_calendar_items;
CREATE TABLE tiki_calendar_items (
calitemId int(14) NOT NULL auto_increment,
calendarId int(14) NOT NULL default '0',
organizer varchar(40) default NULL,
start int(14) NOT NULL default '0',
end int(14) NOT NULL default '0',
locationId int(14) default NULL,
categoryId int(14) default NULL,
public enum('y','n') NOT NULL default 'y',
priority tinyint(1) NOT NULL default '5',
status enum('0','1','2') NOT NULL default '0',
url varchar(255) default NULL,
lang char(2) NOT NULL default 'en',
name varchar(255) NOT NULL default '',
description blob,
created int(14) NOT NULL default '0',
lastmodif int(14) NOT NULL default '0',
PRIMARY KEY (calitemId),
KEY calendarId (calendarId)
);
INSERT INTO users_permissions(permName,type,permDesc,level) VALUES ('tiki_p_view_calendar','calendar','Can browse the calendar','basic');
INSERT INTO users_permissions(permName,type,permDesc,level) VALUES ('tiki_p_admin_calendar','calendar','Can create/admin calendars','admin');
This diff is collapsed.
This diff is collapsed.
<?php
/**
* @package iCalendar Everything to generate simple iCal files
*/
/**
* We need the base class
*/
include_once('class.iCalBase.inc.php');
/**
* Container for an alarm (used in event and todo)
*
* Tested with WAMP (XP-SP1/1.3.24/4.0.4/4.3.0)
* Last Change: 2003-03-29
*
* @desc Container for an alarm (used in event and todo)
* @access private
* @author Michael Wimmer <flaimo@gmx.net>
* @copyright Michael Wimmer
* @link http://www.flaimo.com/
* @package iCalendar
* @version 1.031
*/
class iCalAlarm extends iCalBase {
/*-------------------*/
/* V A R I A B L E S */
/*-------------------*/
/**
* Kind of alarm (0 = DISPLAY, 1 = EMAIL, (not supported: 2 = AUDIO, 3 = PROCEDURE))
*
* @desc Kind of alarm (0 = DISPLAY, 1 = EMAIL, (not supported: 2 = AUDIO, 3 = PROCEDURE))
* @var int
* @access private
*/
var $action;
/**
* Minutes the alarm goes off before the event/todo
*
* @desc Minutes the alarm goes off before the event/todo
* @var int
* @access private
*/
var $trigger = 0;
/**
* Headline for the alarm (if action = Display)
*
* @desc Headline for the alarm (if action = Display)
* @var string
* @access private
*/
var $summary;
/**
* Duration between the alarms in minutes
*
* @desc Duration between the alarms in minutes
* @var int
* @access private
*/
var $duration;
/**
* How often should the alarm be repeated
*
* @desc How often should the alarm be repeated
* @var int
* @access private
*/
var $repeat;
/*-----------------------*/
/* C O N S T R U C T O R */
/*-----------------------*/
/**
* Constructor
*
* Only job is to set all the variablesnames
*
* @desc Constructor
* @param (int) $action 0 = DISPLAY, 1 = EMAIL, (not supported: 2 = AUDIO, 3 = PROCEDURE)
* @param (int) $trigger Minutes the alarm goes off before the event/todo
* @param (string) $summary Title for the alarm
* @param (string) $description Description
* @param (array) $attendees key = attendee name, value = e-mail, second value = role of the attendee
* [0 = CHAIR | 1 = REQ | 2 = OPT | 3 =NON] (example: array('Michi' => 'flaimo@gmx.net,1'); )
* @param (int) $duration Duration between the alarms in minutes
* @param (int) $repeat How often should the alarm be repeated
* @param (string) $lang Language of the strings used in the event (iso code)
* @return (void)
* @uses setAction(), setTrigger(), setSummary(), iCalBase::setDescription(), setAttendees(), setDuration(), setRepeat(), iCalBase::setLanguage()
* @access private
* @since 1.000 - 2002/10/10
*/
function iCalAlarm($action, $trigger, $summary, $description, $attendees,
$duration, $repeat, $lang) {
parent::iCalBase();
$this->setAction($action);
$this->setTrigger($trigger);
parent::setSummary($summary);
parent::setDescription($description);
parent::setAttendees($attendees);
$this->setDuration($duration);
$this->setRepeat($repeat);
parent::setLanguage($lang);
} // end constructor
/*-------------------*/
/* F U N C T I O N S */
/*-------------------*/
/**
* Set $action variable
*
* @desc Set $action variable
* @param (int) $action 0 = DISPLAY, 1 = EMAIL, (not supported: 2 = AUDIO, 3 = PROCEDURE)
* @return (void)
* @see getAction(), $action
* @access private
* @since 1.021 - 2002/12/24
*/
function setAction($action = 0) {
$this->action = (int) $action;
} // end function
/**
* Get $action variable
*
* @desc Get $action variable
* @return (string) $action
* @see setAction(), $action
* @access public
* @since 1.021 - 2002/12/24
*/
function &getAction() {
$action_status = (array) array('DISPLAY', 'EMAIL', 'AUDIO', 'PROCEDURE');
return (string) ((array_key_exists($this->action, $action_status)) ? $action_status[$this->action] : $action_status[0]);
} // end function
/**
* Set $trigger variable
*
* @desc Set $trigger variable
* @param (int) $minutes
* @return (void)
* @see getTrigger(), $minutes
* @access private
* @since 1.021 - 2002/12/24
*/
function setTrigger($minutes = 0) {
$this->trigger = (int) $minutes;
} // end function
/**
* Get $trigger variable
*
* @desc Get $trigger variable
* @return (int) $trigger
* @see setTrigger(), $trigger
* @access public
* @since 1.021 - 2002/12/24
*/
function &getTrigger() {
return (int) $this->trigger;
} // end function
/**
* Set $duration variable
*
* @desc Set $duration variable
* @param (int) $int
* @return (void)
* @see getDuration(), $duration
* @access private
* @since 1.020 - 2002/12/24
*/
function setDuration($int = 0) {
$this->duration = (int) $int;
} // end function
/**
* Get $duration variable
*
* @desc Get $duration variable
* @return (int) $duration
* @see setDuration(), $duration
* @access private
* @since 1.020 - 2002/12/24
*/
function &getDuration() {
return (int) $this->duration;
} // end function
/**
* Set $repeat variable
*
* @desc Set $repeat variable
* @param (int) $int in minutes
* @return (void)
* @see getRepeat(), $repeat
* @access private
* @since 1.020 - 2002/12/24
*/
function setRepeat($int = 0) {
$this->duration = (int) $int;
} // end function
/**
* Get $repeat variable
*
* @desc Get $repeat variable
* @return (int) $repeat
* @see setRepeat(), $repeat
* @access private
* @since 1.020 - 2002/12/24
*/
function &getRepeat() {
return (int) $this->duration;
} // end function
} // end class iCalAlarm
?>
This diff is collapsed.
This diff is collapsed.
<?php
/**
* @package iCalendar Everything to generate simple iCal files
*/
/**
* We need the base class
*/
include_once('class.iCalBase.inc.php');
/**
* Container for a single freebusy
*
* Tested with WAMP (XP-SP1/1.3.24/4.0.4/4.3.0)
* Last Change: 2003-03-29
*
* @desc Container for a single freebusy
* @access private
* @author Michael Wimmer <flaimo@gmx.net>
* @copyright Michael Wimmer
* @link http://www.flaimo.com/
* @package iCalendar
* @version 1.031
*/
class iCalFreeBusy extends iCalBase {
/*-------------------*/
/* V A R I A B L E S */
/*-------------------*/
/**
* Timestamp of the start date
*
* @desc Timestamp of the start date
* @var int
* @access private
*/
var $startdate_ts;
/**
* Timestamp of the end date
*
* @desc Timestamp of the end date
* @var int
* @access private
*/
var $enddate_ts;
/**
* start date in iCal format
*
* @desc start date in iCal format
* @var string
* @access private
*/
var $startdate;
/**
* end date in iCal format
*
* @desc end date in iCal format
* @var string
* @access private
*/
var $enddate;
/**
* Automaticaly created: md5 value of the start date + end date
*
* @desc Automaticaly created: md5 value of the start date + end date
* @var string
* @access private
*/
var $uid;
/**
* Duration of the freebusy in minutes
*
* @desc Duration of the freebusy in minutes
* @var int
* @access private
*/
var $duration;
/**
* Array with all the free busy times
*
* @desc Array with all the free busy times
* @var array
* @access private
*/
var $freebusy_times;
/**
* 0 = FREE, 1 = BUSY, 2 = BUSY-UNAVAILABLE, 3 = BUSY-TENTATIVE
*
* @desc 0 = FREE, 1 = BUSY, 2 = BUSY-UNAVAILABLE, 3 = BUSY-TENTATIVE
* @var array
* @access private
*/
var $fb_status;
/*-----------------------*/
/* C O N S T R U C T O R */
/*-----------------------*/
/**
* Constructor
*
* Only job is to set all the variablesnames
*
* @desc Constructor
* @param (int) $start Start time for fb (timestamp)
* @param (int) $end Start time for fb (timestamp)
* @param (int) $duration Duration of the fb in minutes
* @param (array) $organizer The organizer - use array('Name', 'name@domain.com')
* @param (array) $attendees key = attendee name, value = e-mail, second value = role of the attendee [0 = CHAIR | 1 = REQ | 2 = OPT | 3 =NON] (example: array('Michi' => 'flaimo@gmx.net,1'); )
* @param (array) $fb_times key = timestamp (starting point), value = minutes, secound value = status (0 = FREE, 1 = BUSY, 2 = BUSY-UNAVAILABLE, 3 = BUSY-TENTATIVE)
* @param (string) $url optional URL for that event
* @param (string) $uid Optional UID for the FreeBusy
* @return (void)
* @uses iCalBase::setOrganizer(), setStartDate(), setDuration(), setEndDate(), setUID(), iCalBase::setAttendees(), setFBTimes(), iCalBase::setURL()
* @access private
* @since 1.000 - 2002/10/10
*/
function iCalFreeBusy($start, $end, $duration, $organizer, $attendees, $fb_times, $url, $uid) {
parent::iCalBase();
$this->fb_status = (array) array('FREE','BUSY','BUSY-UNAVAILABLE','BUSY-TENTATIVE');
parent::setOrganizer($organizer);
$this->setStartDate($start);
$this->setDuration($duration);
$this->setEndDate($end);
parent::setAttendees($attendees);
$this->setFBTimes($fb_times);
parent::setURL($url);
$this->setUID($uid);
} // end constructor
/*-------------------*/
/* F U N C T I O N S */
/*-------------------*/
/**
* Set $startdate_ts variable
*
* @desc Set $startdate_ts variable
* @param (int) $timestamp
* @return (void)
* @see getStartDateTS(), $startdate_ts
* @access private
* @since 1.000 - 2002/10/10
*/
function setStartDateTS($timestamp = 0) {
if (is_int($timestamp) && $timestamp > 0) {
$this->startdate_ts = (int) $timestamp;
} else {
$this->startdate_ts = (int) ((isset($this->enddate_ts) && is_numeric($this->enddate_ts) && $this->enddate_ts > 0) ? ($this->enddate_ts - 3600) : time());
} // end if
} // end function
/**
* Get $startdate_ts variable
*
* @desc Get $startdate_ts variable
* @return (int) $startdate_ts
* @see setStartDateTS(), $startdate_ts
* @access public
* @since 1.000 - 2002/10/10
*/
function &getStartDateTS() {
return (int) $this->startdate_ts;
} // end function
/**
* Set $enddate_ts variable
*
* @desc Set $enddate_ts variable
* @param (int) $timestamp
* @return (void)
* @see getEndDateTS(), $enddate_ts
* @access private
* @since 1.000 - 2002/10/10
*/
function setEndDateTS($timestamp = 0) {
if (is_int($timestamp) && $timestamp > 0) {
$this->enddate_ts = (int) $timestamp;
} else {
$this->enddate_ts = (int) ((isset($this->startdate_ts) && is_numeric($this->startdate_ts) && $this->startdate_ts > 0) ? ($this->startdate_ts + 3600) : (time() + 3600));
} // end if
} // end function
/**
* Get $enddate_ts variable
*
* @desc Set $startdate variable
* @return (int) $enddate_ts
* @see setEndDateTS(), $enddate_ts
* @access public
* @since 1.000 - 2002/10/10
*/
function &getEndDateTS() {
return (int) $this->enddate_ts;
} // end function
/**
* Set $startdate variable
*
* @desc Set $startdate variable
* @param (int) $timestamp
* @return (void)
* @see getStartDate(), $startdate
* @uses setStartDateTS()
* @access private
* @since 1.000 - 2002/10/10
*/
function setStartDate($timestamp = 0) {
$this->setStartDateTS($timestamp);
$this->startdate = (string) date('Ymd\THi00\Z',$this->startdate_ts);
} // end function
/**
* Get $startdate variable
*
* @desc Get $startdate variable
* @return (int) $startdate
* @see setStartDate(), $startdate
* @access public
* @since 1.000 - 2002/10/10
*/
function &getStartDate() {
return (string) $this->startdate;
} // end function
/**
* Set $enddate variable
*
* @desc Set $enddate variable
* @param (int) $timestamp
* @return (void)
* @see getEndDate(), $enddate
* @uses setEndDateTS()
* @access private
* @since 1.000 - 2002/10/10
*/
function setEndDate($timestamp = 0) {
$this->setEndDateTS($timestamp);
$this->enddate = (string) date('Ymd\THi00\Z',$this->enddate_ts);
} // end function
/**
* Get $enddate variable
*
* @desc Get $enddate variable
* @return (string) $enddate
* @see setEndDate(), $enddate
* @access public
* @since 1.000 - 2002/10/10
*/
function &getEndDate() {
return (string) $this->enddate;
} // end function
/**
* Set $uid variable
*
* @desc Set $uid variable
* @param (int) $uid
* @return (void)
* @see getUID(), $uid
* @access private
* @since 1.000 - 2002/10/10
*/
function setUID($uid = 0) {
if (strlen(trim($uid)) > 0) {
$this->uid = (string) $uid;
} else {
$rawid = (string) $this->startdate . 'plus' . $this->enddate;
$this->uid = (string) md5($rawid);
}
} // end function
/**
* Get $uid variable
*
* @desc Get $uid variable
* @return (string) $uid
* @see setUID(), $uid
* @access public
* @since 1.000 - 2002/10/10
*/
function &getUID() {
return (string) $this->uid;
} // end function
/**
* Set $duration variable
*
* @desc Set $duration variable
* @param (int) $int
* @return (void)
* @see getDuration(), $duration
* @access private
* @since 1.020 - 2002/12/24
*/
function setDuration($int) {
$this->duration = (int) $int;
} // end function
/**
* Get $duration variable
*
* @desc Get $duration variable
* @return (int) $duration
* @see setDuration(), $duration
* @access private
* @since 1.020 - 2002/12/24
*/
function &getDuration() {
return (int) $this->duration;
} // end function
/**
* Set $freebusy_times variable
*
* @desc Set $freebusy_times variable
* @param (array) $times
* @return (void)
* @see getFBTimes(), $freebusy_times
* @uses getFBStatus()
* @access private
* @since 1.020 - 2002/12/24
*/
function setFBTimes($times = '') {
if (is_array($times)) {
foreach ($times as $timestamp => $data) {
$values = (array) explode(',',$data);
$minutes = (int) $values[0];
$status = (string) $this->getFBStatus($values[1]);
unset($values);
$this->freebusy_times[date('Ymd\THi00\Z',$timestamp)] = date('Ymd\THi00\Z',$minutes) . ',' . $status;
} // end foreach
} // end if
} // end function
/**
* Get $freebusy_times variable
*
* @desc Get $freebusy_times variable
* @return (int) $freebusy_times
* @see setFBTimes(), $freebusy_times
* @access private
* @since 1.020 - 2002/12/24
*/
function &getFBTimes() {
return (array) $this->freebusy_times;
} // end function
/**
* Get $Status for a FreeBusy statuscode
*
* @desc Get $Status for a FreeBusy statuscode
* @return (string) $fb_status
* @see setFreeBusy(), $freebusy_times
* @access private
* @since 1.020 - 2002/12/24
*/