diff -aburN --exclude='CVS*' phpgroupware/autologin.php htdocs/autologin.php --- phpgroupware/autologin.php 1970-01-01 01:00:00.000000000 +0100 +++ htdocs/autologin.php 2005-08-31 08:47:18.000000000 +0200 @@ -0,0 +1,71 @@ + + + + + TBWB Agenda Autologin + + + +

TBWB Agenda Auto-login

+
+ + + + + + + + + + + + + +
Gebruikersnaam: +
Wachtwoord: +
+ +
+

+Dit form is gemaakt voor het automatisch verzenden van gebruikersnaam en +wachtwoord naar de agenda. Als dit om wat voor reden niet automatisch +gebeurt (JavaScript uitgeschakeld of niet ondersteund), kun je op de 'OK' +knop boven drukken om in te loggen. +

+
+ + diff -aburN --exclude='CVS*' phpgroupware/autologin.php~ htdocs/autologin.php~ --- phpgroupware/autologin.php~ 1970-01-01 01:00:00.000000000 +0100 +++ htdocs/autologin.php~ 2005-08-31 08:36:39.000000000 +0200 @@ -0,0 +1,28 @@ + + + + + TBWB Agenda Autologin + + +
+ + +
+ + diff -aburN --exclude='CVS*' phpgroupware/calendar/ical.php htdocs/calendar/ical.php --- phpgroupware/calendar/ical.php 2003-10-31 01:44:16.000000000 +0100 +++ htdocs/calendar/ical.php 2005-09-05 09:35:27.000000000 +0200 @@ -18,6 +18,7 @@ * NOTES: * * This code is experimental - use it at your own risk + * Edited for use in TBWB by BF * * Configuration * Change only the following 3 lines @@ -28,10 +29,6 @@ * passwd * - change this password to match what you have setup for this account * - * domain - * - change this if you want to only allow access to this script from a single domain - * for single domains and hostname based domain detection leave as is. - * * prev & adv * - change these at your own risk * @@ -44,45 +41,40 @@ * As the password is sent in the url, it should only be run using HTTPS */ - $login = 'user'; - $passwd = 'changeme'; - $domain = $_SERVER['SERVER_NAME']; //'default'; - - $prev = 1; // number of previous months - $adv = 3; // number of months in advance - exit; - - // ** DO NOT EDIT BELOW THIS LINE ** // - if(!$_SERVER['PHP_AUTH_USER']) - { - header('WWW-Authenticate: Basic realm="phpGW-iCal"'); - header('HTTP/1.0 401 Unauthorized'); - echo '

You must call this script using '; - list($ignore, $url) = explode('//', $_SERVER['PHP_SELF']); - echo '"webcal://phpgw_user:password@' . $url . '"

'; - exit; - } - @set_time_limit(0); +$phpgw_flags = Array( + 'currentapp' => 'calendar', + 'noheader' => False, + 'nonavbar' => False, + 'noappheader' => False, + 'noappfooter' => False, + 'nofooter' => False +); - //multiple domain support hack - $_GET['domain'] = $domain; +$GLOBALS['phpgw_info']['flags'] = $phpgw_flags; +include ("../header.inc.php"); - $GLOBALS['phpgw_info']['flags'] = array( - 'disable_Template_class' => True, - 'login' => True, - 'currentapp' => 'login', - 'noheader' => True - ); - include('../header.inc.php'); - header('Content-type: text/calendar'); +/* header.inc.php makes sure we have a good sessionid and shows a loginform if something is wrong, + * so we can just pretend everything is allright + */ - $login = $_SERVER['PHP_AUTH_USER']; - $passwd = $_SERVER['PHP_AUTH_PW']; - $uid = $GLOBALS['phpgw']->accounts->name2id($login); +$uid = $phpgw_info['user']['account_id']; - $sessionid = $GLOBALS['phpgw']->session->create($login,$passwd,'text'); +if (intval(@$_POST['prev']) == 0 && intval(@$_POST['adv'] == 0)) { + /* we did not get any range, show a form to ask it */ + echo "
link('/calendar/ical.php'); + echo "\" method=\"POST\">\n"; + echo "Prev: \n"; + echo "Adv: \n"; + echo "\n"; + echo "
\n"; + +} else { + $prev = intval(@$_POST['prev']); + $adv = intval(@$_POST['adv']); - $params = array('owner' => $GLOBALS['phpgw']->accounts->name2id($login)); + header('Content-type: text/calendar'); + header('Content-Disposition: filename=tbwbcalendar.ics'); $so = createObject('calendar.socalendar', array('owner' => $uid) ); $export = createObject('calendar.boicalendar'); @@ -96,4 +88,5 @@ { echo $export->export( array('l_event_id' => $id) ); } +} ?> diff -aburN --exclude='CVS*' phpgroupware/calendar/ical.php~ htdocs/calendar/ical.php~ --- phpgroupware/calendar/ical.php~ 1970-01-01 01:00:00.000000000 +0100 +++ htdocs/calendar/ical.php~ 2005-09-05 09:35:27.000000000 +0200 @@ -0,0 +1,93 @@ +* + * -------------------------------------------- * + * This program is free software; you can redistribute it and/or modify it * + * under the terms of the GNU General Public License as published by the * + * Free Software Foundation; either version 2 of the License, or (at your * + * option) any later version. * + \**************************************************************************/ + + /* $Id: ical.php,v 1.1.2.1 2003/10/31 00:44:16 skwashd Exp $ */ + + /** + * NOTES: + * + * This code is experimental - use it at your own risk + * Edited for use in TBWB by BF + * + * Configuration + * Change only the following 3 lines + * login + * - the login you want to use for the iCal script to establish a session + * - make sure the user exists and has access to NO apps! this user just establishes a session + * + * passwd + * - change this password to match what you have setup for this account + * + * prev & adv + * - change these at your own risk + * + * exit; comment this line below (so it reads //exit;) to enable this script + * + * If you don't understand these instructions, you should not use this script + * + * Usage + * Call this script using a url similar to https://phpgw_user:password@server.com/phpgroupware/calendar/ical.php + * As the password is sent in the url, it should only be run using HTTPS + */ + +$phpgw_flags = Array( + 'currentapp' => 'calendar', + 'noheader' => False, + 'nonavbar' => False, + 'noappheader' => False, + 'noappfooter' => False, + 'nofooter' => False +); + +$GLOBALS['phpgw_info']['flags'] = $phpgw_flags; +include ("../header.inc.php"); + +/* header.inc.php makes sure we have a good sessionid and shows a loginform if something is wrong, + * so we can just pretend everything is allright + */ + +$uid = $phpgw_info['user']['account_id']; + +if (intval(@$_POST['prev']) == 0 && intval(@$_POST['adv'] == 0)) { + /* we did not get any range, show a form to ask it */ + echo "
link('/calendar/ical.php'); + echo "\" method=\"POST\">\n"; + echo "Prev: \n"; + echo "Adv: \n"; + echo "\n"; + echo "
\n"; + + $GLOBALS['phpgw']->common->phpgw_exit(); +} else { + $prev = intval(@$_POST['prev']); + $adv = intval(@$_POST['adv']); + + header('Content-type: text/calendar'); + header('Content-Disposition: filename=tbwbcalendar.ics'); + + $so = createObject('calendar.socalendar', array('owner' => $uid) ); + $export = createObject('calendar.boicalendar'); + + list($start['d'], $start['m'], $start['y']) = explode('-', date('d-n-Y', strtotime("-$prev months"))); + list($end['d'], $end['m'], $end['y']) = explode('-', date('d-n-Y', strtotime("+$adv months"))); + $ids = $so->list_events($start['y'], $start['m'], $start['d'], $end['y'], $end['m'], $end['d']); + + //this is done so there is streaming output + foreach($ids as $id) + { + echo $export->export( array('l_event_id' => $id) ); + } +} +?> diff -aburN --exclude='CVS*' phpgroupware/calendar/ical.php.bak htdocs/calendar/ical.php.bak --- phpgroupware/calendar/ical.php.bak 1970-01-01 01:00:00.000000000 +0100 +++ htdocs/calendar/ical.php.bak 2005-09-02 14:50:32.000000000 +0200 @@ -0,0 +1,103 @@ +* + * -------------------------------------------- * + * This program is free software; you can redistribute it and/or modify it * + * under the terms of the GNU General Public License as published by the * + * Free Software Foundation; either version 2 of the License, or (at your * + * option) any later version. * + \**************************************************************************/ + + /* $Id: ical.php,v 1.1.2.1 2003/10/31 00:44:16 skwashd Exp $ */ + + /** + * NOTES: + * + * This code is experimental - use it at your own risk + * + * Configuration + * Change only the following 3 lines + * login + * - the login you want to use for the iCal script to establish a session + * - make sure the user exists and has access to NO apps! this user just establishes a session + * + * passwd + * - change this password to match what you have setup for this account + * + * domain + * - change this if you want to only allow access to this script from a single domain + * for single domains and hostname based domain detection leave as is. + * + * prev & adv + * - change these at your own risk + * + * exit; comment this line below (so it reads //exit;) to enable this script + * + * If you don't understand these instructions, you should not use this script + * + * Usage + * Call this script using a url similar to https://phpgw_user:password@server.com/phpgroupware/calendar/ical.php + * As the password is sent in the url, it should only be run using HTTPS + */ + +// $login = 'kalexport'; +// $passwd = 'changeme12'; + $domain = $_SERVER['SERVER_NAME']; //'default'; + +// $login = 'bf'; +// $passwd = 'bf'; + + $prev = 3; // number of previous months + $adv = 1; // number of months in advance +// exit; + + // ** DO NOT EDIT BELOW THIS LINE ** // + if(!$_SERVER['PHP_AUTH_USER']) + { + header('WWW-Authenticate: Basic realm="phpGW-iCal"'); + header('HTTP/1.0 401 Unauthorized'); + echo '

You must call this script using '; + list($ignore, $url) = explode('//', $_SERVER['PHP_SELF']); + echo '"webcal://phpgw_user:password@' . $url . '"

'; + exit; + } + @set_time_limit(0); + + //multiple domain support hack + $_GET['domain'] = $domain; + + $GLOBALS['phpgw_info']['flags'] = array( + 'disable_Template_class' => True, + 'login' => True, + 'currentapp' => 'login', + 'noheader' => True + ); + include('../header.inc.php'); + header('Content-type: text/plain'); +// header('Content-type: text/calendar'); + + $login = $_SERVER['PHP_AUTH_USER']; + $passwd = $_SERVER['PHP_AUTH_PW']; + $uid = $GLOBALS['phpgw']->accounts->name2id($login); + + $sessionid = $GLOBALS['phpgw']->session->create($login,$passwd,'text'); + + $params = array('owner' => $GLOBALS['phpgw']->accounts->name2id($login)); + + $so = createObject('calendar.socalendar', array('owner' => $uid) ); + $export = createObject('calendar.boicalendar'); + + list($start['d'], $start['m'], $start['y']) = explode('-', date('d-n-Y', strtotime("-$prev months"))); + list($end['d'], $end['m'], $end['y']) = explode('-', date('d-n-Y', strtotime("+$adv months"))); + $ids = $so->list_events($start['y'], $start['m'], $start['d'], $end['y'], $end['m'], $end['d']); + + //this is done so there is streaming output + foreach($ids as $id) + { + echo $export->export( array('l_event_id' => $id) ); + } +?> diff -aburN --exclude='CVS*' phpgroupware/calendar/inc/class.boicalendar.inc.php htdocs/calendar/inc/class.boicalendar.inc.php --- phpgroupware/calendar/inc/class.boicalendar.inc.php 2005-01-03 06:56:22.000000000 +0100 +++ htdocs/calendar/inc/class.boicalendar.inc.php 2005-09-05 12:02:49.000000000 +0200 @@ -3268,6 +3268,8 @@ $so_event = $GLOBALS['uicalendar']->bo->so; } + $profile = false; + if ($profile) echo "3271: ".time()."\n"; while(list($key,$value) = each($ids)) { $ical_event = Array(); @@ -3275,6 +3277,7 @@ if($event['alarm']) { + if ($profile) echo "3279: ".time()."\n"; while(list($dummy,$alarm) = each($event['alarm'])) { $ical_temp = Array(); @@ -3305,6 +3308,7 @@ $mod_mktime = $so_event->maketime($event['modtime']); $this->parse_value($ical_event,'last_modified',date('Ymd\THis\Z',$mod_mktime),'vevent'); @reset($string_array); + if ($profile) echo "3310: ".time()."\n"; while(list($ical_value,$event_value) = each($string_array)) { if($event[$event_value]) @@ -3318,6 +3322,7 @@ $cats->categories(0,'calendar'); $category = explode(',',$event['category']); @reset($category); + if ($profile) echo "3324: ".time()."\n"; while(list($key,$cat) = each($category)) { $_cat = $cats->return_single($cat); @@ -3334,15 +3339,18 @@ $db = $GLOBALS['phpgw']->db; } @reset($event['participants']); + if ($profile) echo "3341: ".time()." ".count($event['participants'])."\n"; while(list($part,$status) = each($event['participants'])) { $GLOBALS['phpgw']->accounts->get_account_name($part,$lid,$fname,$lname); $name = $fname.' '.$lname; - $owner_status = $this->switch_partstat(intval($this->switch_phpgw_status($event['participants'][$part]))); - - $mail_prefs = $GLOBALS['phpgw']->preferences->create_email_preferences($part); - $mailto = $mail_prefs['email']['address']; + /* This seriously slows down the exporting process and all it does is adding some contact info + * that we don't need anyway. + */ + //$owner_status = $this->switch_partstat(intval($this->switch_phpgw_status($event['participants'][$part]))); + //$mail_prefs = $GLOBALS['phpgw']->preferences->create_email_preferences($part); + //$mailto = $mail_prefs['email']['address']; $str = 'CN="'.$name.'";PARTSTAT='.$owner_status.':'.$mailto; if($part == $event['owner']) @@ -3432,6 +3440,7 @@ if(is_array($exceptions)) { @reset($exceptions); + if ($profile) echo "3440: ".time()."\n"; while(list($key,$except_datetime) = each($exceptions)) { $ical_event['exdate'][] = $this->switch_date(date('Ymd\THis\Z',$except_datetime)); @@ -3442,7 +3451,8 @@ } $ical['event'] = $ical_events; - return $this->build_ical($ical); + if ($profile) return "".time()."\n"; + else return $this->build_ical($ical); } function debug($str='') diff -aburN --exclude='CVS*' phpgroupware/calendar/inc/class.boicalendar.inc.php~ htdocs/calendar/inc/class.boicalendar.inc.php~ --- phpgroupware/calendar/inc/class.boicalendar.inc.php~ 1970-01-01 01:00:00.000000000 +0100 +++ htdocs/calendar/inc/class.boicalendar.inc.php~ 2005-09-05 12:02:49.000000000 +0200 @@ -0,0 +1,3466 @@ + * + * -------------------------------------------- * + * This program is free software; you can redistribute it and/or modify it * + * under the terms of the GNU General Public License as published by the * + * Free Software Foundation; either version 2 of the License, or (at your * + * option) any later version. * + \**************************************************************************/ + + /* $Id: class.boicalendar.inc.php,v 1.16.2.4.2.6 2004/11/06 16:13:42 powerstat Exp $ */ + +define('FOLD_LENGTH',75); + +define('VEVENT',1); +define('VTODO',2); + +define('NONE',0); +define('CHAIR',1); +define('REQ_PARTICIPANT',2); +define('OPT_PARTICIPANT',3); +define('NON_PARTICIPANT',4); + +define('INDIVIDUAL',1); +define('GROUP',2); +define('RESOURCE',4); +define('ROOM',8); +define('UNKNOWN',16); + +define('NEEDS_ACTION',0); +define('ACCEPTED',1); +define('DECLINED',2); +define('TENTATIVE',3); +define('DELEGATED',4); +define('COMPLETED',5); +define('IN_PROCESS',6); + + /* + * Class + */ +define('PRIVATE',0); +define('PUBLIC',1); +define('CONFIDENTIAL',3); + + /* + * Transparency + */ +define('TRANSPARENT',0); +define('OPAQUE',1); + + /* + * Frequency + */ +define('SECONDLY',1); +define('MINUTELY',2); +define('HOURLY',3); +define('DAILY',4); +define('WEEKLY',5); +define('MONTHLY',6); +define('YEARLY',7); + +define('FREE',0); +define('BUSY',1); +define('BUSY_UNAVAILABLE',2); +define('BUSY_TENTATIVE',3); + +define('THISANDPRIOR',0); +define('THISANDFUTURE',1); + +define('START',0); +define('END',1); + +define('_8BIT',0); +define('_BASE64',1); + +define('OTHER',99); + +class boicalendar +{ + + var $public_functions = array( + 'import' => True, + 'export' => True + ); + + + var $ical; + var $line = 0; + var $event = Array(); + var $todo = Array(); + var $journal = Array(); + var $freebusy = Array(); + var $timezone = Array(); + var $property = Array(); + var $parameter = Array(); + var $debug_str = False; + var $api = True; + var $chunk_split = True; + + /* + * Base Functions + */ + + function boicalendar() + { + $this->property = Array( + 'action' => Array( + 'type' => 'text', + 'to_text' => True, + 'valarm' => Array( + 'state' => 'required', + 'multiples' => False + ) + ), + 'attach' => Array( + 'type' => 'uri', + 'to_text' => True, + 'vevent' => Array( + 'state' => 'optional', + 'multiples' => True + ), + 'vtodo' => Array( + 'state' => 'optional', + 'multiples' => True + ), + 'vjournal' => Array( + 'state' => 'optional', + 'multiples' => True + ), + 'valarm' => Array( + 'state' => 'optional', + 'multiples' => True + ) + ), + 'attendee' => Array( + 'type' => 'cal-address', + 'to_text' => False, + 'vevent' => Array( + 'state' => 'optional', + 'multiples' => True + ), + 'vtodo' => Array( + 'state' => 'optional', + 'multiples' => True + ), + 'vjournal' => Array( + 'state' => 'optional', + 'multiples' => True + ), + 'valarm' => Array( + 'state' => 'optional', + 'multiples' => True + ), + 'vfreebusy' => Array( + 'state' => 'optional', + 'multiples' => True + ) + ), + 'categories' => Array( + 'type' => 'text', + 'to_text' => True, + 'vevent' => Array( + 'state' => 'optional', + 'multiples' => True + ), + 'vtodo' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vjournal' => Array( + 'state' => 'optional', + 'multiples' => True + ) + ), + 'class' => Array( + 'type' => 'text', + 'to_text' => True, + 'vevent' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vtodo' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vjournal' => Array( + 'state' => 'optional', + 'multiples' => False + ) + ), + 'comment' => Array( + 'type' => 'text', + 'to_text' => True, + 'daylight' => Array( + 'state' => 'optional', + 'multiples' => True + ), + 'standard' => Array( + 'state' => 'optional', + 'multiples' => True + ), + 'valarm' => Array( + 'state' => 'optional', + 'multiples' => True + ), + 'vevent' => Array( + 'state' => 'optional', + 'multiples' => True + ), + 'vfreebusy' => Array( + 'state' => 'optional', + 'multiples' => True + ), + 'vjournal' => Array( + 'state' => 'optional', + 'multiples' => True + ), + 'vtodo' => Array( + 'state' => 'optional', + 'multiples' => True + ) + ), + 'completed' => Array( + 'type' => 'date-time', + 'to_text' => False, + 'vtodo' => Array( + 'state' => 'optional', + 'multiples' => False + ) + ), + 'contact' => Array( + 'type' => 'text', + 'to_text' => True, + 'vevent' => Array( + 'state' => 'optional', + 'multiples' => True + ), + 'vfreebusy' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vjournal' => Array( + 'state' => 'optional', + 'multiples' => True + ) + ), + 'created' => Array( + 'type' => 'date-time', + 'to_text' => False, + 'vevent' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vtodo' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vjournal' => Array( + 'state' => 'optional', + 'multiples' => False + ) + ), + 'description' => Array( + 'type' => 'text', + 'to_text' => True, + 'vevent' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vtodo' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vjournal' => Array( + 'state' => 'optional', + 'multiples' => True + ), + 'valarm' => Array( + 'state' => 'optional', + 'multiples' => False + ) + ), + 'dtend' => Array( + 'type' => 'date-time', + 'to_text' => False, + 'vevent' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vfreebusy' => Array( + 'state' => 'optional', + 'multiples' => False + ) + ), + 'dtstamp' => Array( + 'type' => 'date-time', + 'to_text' => False, + 'vevent' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vtodo' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vjournal' => Array( + 'state' => 'optional', + 'multiples' => True + ), + 'vfreebusy' => Array( + 'state' => 'optional', + 'multiples' => False + ) + ), + 'dtstart' => Array( + 'type' => 'date-time', + 'to_text' => False, + 'daylight' => Array( + 'state' => 'required', + 'multiples' => False + ), + 'standard' => Array( + 'state' => 'required', + 'multiples' => False + ), + 'vevent' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vfreebusy' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vjournal' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vtodo' => Array( + 'state' => 'optional', + 'multiples' => False + ) + ), + 'due' => Array( + 'type' => 'date-time', + 'to_text' => False, + 'vtodo' => Array( + 'state' => 'optional', + 'multiples' => False + ) + ), + 'duration' => Array( + 'type' => 'duration', + 'to_text' => False, + 'valarm' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vevent' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vfreebusy' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vtodo' => Array( + 'state' => 'optional', + 'multiples' => False + ) + ), + 'exdate' => Array( + 'type' => 'date-time', + 'to_text' => False, + 'vevent' => Array( + 'state' => 'optional', + 'multiples' => True + ), + 'vjournal' => Array( + 'state' => 'optional', + 'multiples' => True + ), + 'vtodo' => Array( + 'state' => 'optional', + 'multiples' => True + ) + ), + 'exrule' => Array( + 'type' => 'recur', + 'to_text' => False, + 'vevent' => Array( + 'state' => 'optional', + 'multiples' => True + ), + 'vjournal' => Array( + 'state' => 'optional', + 'multiples' => True + ), + 'vtodo' => Array( + 'state' => 'optional', + 'multiples' => True + ) + ), + 'freebusy' => Array( + 'type' => 'freebusy', + 'to_text' => False, + 'vfreebusy' => Array( + 'state' => 'optional', + 'multiples' => True + ) + ), + 'geo' => Array( + 'type' => 'float', + 'to_text' => True, + 'vevent' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vtodo' => Array( + 'state' => 'optional', + 'multiples' => False + ) + ), + 'last_modified' => Array( + 'type' => 'date-time', + 'to_text' => False, + 'vevent' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vtodo' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vjournal' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vtimezone' => Array( + 'state' => 'optional', + 'multiples' => False + ) + ), + 'location' => Array( + 'type' => 'text', + 'to_text' => True, + 'vevent' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vtodo' => Array( + 'state' => 'optional', + 'multiples' => False + ) + ), + 'method' => Array( + 'type' => 'text', + 'to_text' => True, + 'ical' => Array( + 'state' => 'required', + 'multiples' => False + ) + ), + 'organizer' => Array( + 'type' => 'cal-address', + 'to_text' => False, + 'vevent' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vtodo' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vjournal' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vfreebusy' => Array( + 'state' => 'optional', + 'multiples' => False + ) + ), + 'percent_complete' => Array( + 'type' => 'integer', + 'to_text' => False, + 'vtodo' => Array( + 'state' => 'optional', + 'multiples' => False + ) + ), + 'priority' => Array( + 'type' => 'integer', + 'to_text' => True, + 'vevent' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vtodo' => Array( + 'state' => 'optional', + 'multiples' => False + ) + ), + 'prodid' => Array( + 'type' => 'text', + 'to_text' => True, + 'ical' => Array( + 'state' => 'required', + 'multiples' => False + ) + ), + 'rdate' => Array( + 'type' => 'date-time', + 'to_text' => False, + 'daylight' => Array( + 'state' => 'optional', + 'multiples' => True + ), + 'standard' => Array( + 'state' => 'optional', + 'multiples' => True + ), + 'vevent' => Array( + 'state' => 'optional', + 'multiples' => True + ), + 'vtodo' => Array( + 'state' => 'optional', + 'multiples' => True + ), + 'vjournal' => Array( + 'state' => 'optional', + 'multiples' => True + ) + ), + 'recurrence_id' => Array( + 'type' => 'date-time', + 'to_text' => False, + 'vevent' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vjournal' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vtodo' => Array( + 'state' => 'optional', + 'multiples' => False + ) + ), + 'related_to' => Array( + 'type' => 'text', + 'to_text' => False, + 'vevent' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vjournal' => Array( + 'state' => 'optional', + 'multiples' => True + ), + 'vtodo' => Array( + 'state' => 'optional', + 'multiples' => True + ) + ), + 'request_status' => Array( + 'type' => 'text', + 'to_text' => True, + 'vevent' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vtodo' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vjournal' => Array( + 'state' => 'optional', + 'multiples' => True + ), + 'vfreebusy' => Array( + 'state' => 'optional', + 'multiples' => True + ) + ), + 'resources' => Array( + 'type' => 'text', + 'to_text' => False, + 'vevent' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vtodo' => Array( + 'state' => 'optional', + 'multiples' => False + ) + ), + 'rrule' => Array( + 'type' => 'recur', + 'to_text' => False, + 'daylight' => Array( + 'state' => 'optional', + 'multiples' => True + ), + 'standard' => Array( + 'state' => 'optional', + 'multiples' => True + ), + 'vevent' => Array( + 'state' => 'optional', + 'multiples' => True + ), + 'vtodo' => Array( + 'state' => 'optional', + 'multiples' => True + ), + 'vjournal' => Array( + 'state' => 'optional', + 'multiples' => True + ) + ), + 'sequence' => Array( + 'type' => 'integer', + 'to_text' => True, + 'vevent' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vjournal' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vtodo' => Array( + 'state' => 'optional', + 'multiples' => False + ) + ), + 'status' => Array( + 'type' => 'text', + 'to_text' => True, + 'vevent' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vjournal' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vtodo' => Array( + 'state' => 'optional', + 'multiples' => False + ) + ), + 'summary' => Array( + 'type' => 'text', + 'to_text' => True, + 'vevent' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vtodo' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vjournal' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'valarm' => Array( + 'state' => 'optional', + 'multiples' => False + ) + ), + 'transp' => Array( + 'type' => 'text', + 'to_text' => True, + 'vevent' => Array( + 'state' => 'optional', + 'multiples' => False + ) + ), + 'trigger' => Array( + 'type' => 'text', + 'to_text' => True, + 'valarm' => Array( + 'state' => 'optional', + 'multiples' => False + ) + ), + 'tzid' => Array( + 'type' => 'text', + 'to_text' => True, + 'vtimezone' => Array( + 'state' => 'required', + 'multiples' => False + ) + ), + 'tzname' => Array( + 'type' => 'text', + 'to_text' => True, + 'daylight' => Array( + 'state' => 'optional', + 'multiples' => True + ), + 'standard' => Array( + 'state' => 'optional', + 'multiples' => True + ) + ), + 'tzoffsetfrom' => Array( + 'type' => 'utc-offset', + 'to_text' => True, + 'daylight' => Array( + 'state' => 'required', + 'multiples' => False + ), + 'standard' => Array( + 'state' => 'required', + 'multiples' => False + ) + ), + 'tzoffsetto' => Array( + 'type' => 'utc-offset', + 'to_text' => True, + 'daylight' => Array( + 'state' => 'required', + 'multiples' => False + ), + 'standard' => Array( + 'state' => 'required', + 'multiples' => False + ) + ), + 'tzurl' => Array( + 'type' => 'uri', + 'to_text' => True, + 'vtimezone' => Array( + 'state' => 'optional', + 'multiples' => False + ) + ), + 'uid' => Array( + 'type' => 'text', + 'to_text' => True, + 'vevent' => Array( + 'state' => 'required', + 'multiples' => False + ), + 'vfreebusy' => Array( + 'state' => 'required', + 'multiples' => False + ), + 'vjournal' => Array( + 'state' => 'required', + 'multiples' => False + ), + 'vtodo' => Array( + 'state' => 'required', + 'multiples' => False + ) + ), + 'url' => Array( + 'type' => 'text', + 'to_text' => True, + 'vevent' => Array( + 'state' => 'required', + 'multiples' => False + ), + 'vfreebusy' => Array( + 'state' => 'required', + 'multiples' => False + ), + 'vjournal' => Array( + 'state' => 'optional', + 'multiples' => False + ), + 'vtodo' => Array( + 'state' => 'required', + 'multiples' => False + ) + ), + 'version' => Array( + 'type' => 'text', + 'to_text' => True, + 'ical' => Array( + 'state' => 'required', + 'multiples' => False + ) + ) + ); + $this->parameter = Array( + 'altrep' => Array( + 'type' => 'uri', + 'quoted' => True, + 'to_text' => True, + 'properties' => Array( + 'comment' => True, + 'description' => True, + 'location' => True, + 'prodid' => True, + 'resources' => True, + 'summary' => True, + 'contact' => True + ) + ), + 'byday' => Array( + 'type' => 'text', + 'quoted' => False, + 'to_text' => False, + 'properties' => Array( + 'rrule' => True + ) + ), + 'byhour' => Array( + 'type' => 'text', + 'quoted' => False, + 'to_text' => False, + 'properties' => Array( + 'rrule' => True + ) + ), + 'byminute' => Array( + 'type' => 'text', + 'quoted' => False, + 'to_text' => False, + 'properties' => Array( + 'rrule' => True + ) + ), + 'bymonth' => Array( + 'type' => 'text', + 'quoted' => False, + 'to_text' => False, + 'properties' => Array( + 'rrule' => True + ) + ), + 'bymonthday' => Array( + 'type' => 'text', + 'quoted' => False, + 'to_text' => False, + 'properties' => Array( + 'rrule' => True + ) + ), + 'bysecond' => Array( + 'type' => 'text', + 'quoted' => False, + 'to_text' => False, + 'properties' => Array( + 'rrule' => True + ) + ), + 'bysetpos' => Array( + 'type' => 'text', + 'quoted' => False, + 'to_text' => False, + 'properties' => Array( + 'rrule' => True + ) + ), + 'byweekno' => Array( + 'type' => 'text', + 'quoted' => False, + 'to_text' => False, + 'properties' => Array( + 'rrule' => True + ) + ), + 'byyearday' => Array( + 'type' => 'text', + 'quoted' => False, + 'to_text' => False, + 'properties' => Array( + 'rrule' => True + ) + ), + 'class' => Array( + 'type' => 'function', + 'function' => 'switch_class', + 'quoted' => False, + 'to_text' => False, + 'properties' => Array( + 'class' => True + ) + ), + 'cn' => Array( + 'type' => 'text', + 'quoted' => True, + 'to_text' => False, + 'properties' => Array( + 'attendee' => True, + 'organizer' => True + ) + ), + 'count' => Array( + 'type' => 'integer', + 'quoted' => False, + 'to_text' => False, + 'properties' => Array( + 'rrule' => True + ) + ), + 'cu' => Array( + 'type' => 'function', + 'function' => 'switch_cu', + 'quoted' => False, + 'to_text' => False, + 'properties' => Array( + 'attendee' => True + ) + ), + 'delegated_from' => Array( + 'type' => 'function', + 'function' => 'switch_mailto', + 'quoted' => True, + 'to_text' => False, + 'properties' => Array( + 'attendee' => True + ) + ), + 'delegated_to' => Array( + 'type' => 'function', + 'function' => 'switch_mailto', + 'quoted' => True, + 'to_text' => False, + 'properties' => Array( + 'attendee' => True + ) + ), + 'dir' => Array( + 'type' => 'dir', + 'quoted' => True, + 'to_text' => True, + 'properties' => Array( + 'attendee' => True, + 'organizer' => True + ) + ), + 'dtend' => Array( + 'type' => 'function', + 'function' => 'switch_date', + 'quoted' => False, + 'to_text' => False, + 'properties' => Array( + 'dtend' => True + ) + ), + 'dtstamp' => Array( + 'type' => 'function', + 'function' => 'switch_date', + 'quoted' => False, + 'to_text' => False, + 'properties' => Array( + 'dtstamp' => True + ) + ), + 'dtstart' => Array( + 'type' => 'function', + 'function' => 'switch_date', + 'quoted' => False, + 'to_text' => False, + 'properties' => Array( + 'dtstart' => True + ) + ), + 'encoding' => Array( // "future bug" fix + 'type' => 'function', + 'function' => 'switch_encoding', + 'quoted' => False, + 'to_text' => False, + 'properties' => Array( + 'attach' => True + ) + ), + 'fmttype' => Array( + 'type' => 'text', + 'quoted' => False, + 'to_text' => False, + 'properties' => Array( + 'attach' => True + ) + ), + 'fbtype' => Array( + 'type' => 'function', + 'function' => 'switch_fbtype', + 'quoted' => False, + 'to_text' => False, + 'properties' => Array( + 'attach' => True + ) + ), + 'freq' => Array( + 'type' => 'function', + 'function' => 'switch_freq', + 'quoted' => False, + 'to_text' => False, + 'properties' => Array( + 'rrule' => True + ) + ), + 'interval' => Array( + 'type' => 'integer', + 'quoted' => False, + 'to_text' => False, + 'properties' => Array( + 'rrule' => True + ) + ), + 'language' => Array( + 'type' => 'text', + 'quoted' => False, + 'to_text' => False, + 'properties' => Array( + 'categories' => True, + 'comment' => True, + 'description' => True, + 'location' => True, + 'resources' => True, + 'summary' => True, + 'tzname' => True, + 'attendee' => True, + 'contact' => True, + 'organizer' => True, + 'x-type' => True + ) + ), + 'last_modified' => Array( + 'type' => 'function', + 'function' => 'switch_date', + 'quoted' => False, + 'to_text' => False, + 'properties' => Array( + 'last_modified' => True + ) + ), + 'mailto' => Array( + 'type' => 'function', + 'function' => 'switch_mailto', + 'quoted' => False, + 'to_text' => False, + 'properties' => Array( + 'attendee' => True, + 'organizer' => True + ) + ), + 'member' => Array( + 'type' => 'function', + 'function' => 'switch_mailto', + 'quoted' => True, + 'to_text' => False, + 'properties' => Array( + 'attendee' => True + ) + ), + 'partstat' => Array( + 'type' => 'function', + 'function' => 'switch_partstat', + 'quoted' => False, + 'to_text' => False, + 'properties' => Array( + 'attendee' => True, + 'organizer' => True + ) + ), + 'range' => Array( + 'type' => 'function', + 'function' => 'switch_range', + 'quoted' => False, + 'to_text' => False, + 'properties' => Array( + 'recurrence_id' => True + ) + ), + 'related' => Array( + 'type' => 'function', + 'function' => 'switch_related', + 'quoted' => False, + 'to_text' => False, + 'properties' => Array( + 'related_to' => True + ) + ), + 'role' => Array( + 'type' => 'function', + 'function' => 'switch_role', + 'quoted' => False, + 'to_text' => False, + 'properties' => Array( + 'attendee' => True, + 'organizer' => True + ) + ), + 'rsvp' => Array( + 'type' => 'function', + 'function' => 'switch_rsvp', + 'quoted' => False, + 'to_text' => False, + 'properties' => Array( + 'attendee' => True + ) + ), + 'sent_by' => Array( + 'type' => 'function', + 'function' => 'parse_user_host', + 'quoted' => True, + 'to_text' => False, + 'properties' => Array( + 'attendee' => True, + 'organizer' => True + ) + ), + 'tzid' => Array( + 'type' => 'text', + 'quoted' => False, + 'to_text' => False, + 'properties' => Array( + 'dtend' => True, + 'due' => True, + 'dtstart' => True, + 'exdate' => True, + 'rdate' => True, + 'recurrence_id' => True + ) + ), + 'until' => Array( + 'type' => 'function', + 'function' => 'switch_date', + 'quoted' => False, + 'to_text' => False, + 'properties' => Array( + 'rrule' => True + ) + ), + 'value' => Array( + 'type' => 'value', + 'quoted' => False, + 'to_text' => False, + 'properties' => Array( + 'calscale' => True, + 'prodid' => True, + 'method' => True, + 'version' => True, + 'attach' => True, + 'categories' => True, + 'class' => True, + 'comment' => True, + 'description' => True, + 'geo' => True, + 'location' => True, + 'percent' => True, + 'priority' => True, + 'resources' => True, + 'status' => True, + 'summary' => True, + 'completed' => True, + 'dtend' => True, + 'due' => True, + 'dtstart' => True, + 'duration' => True, + 'freebusy' => True, + 'transp' => True, + 'tzid' => True, + 'tzname' => True, + 'tzoffsetfrom' => True, + 'tzoffsetto' => True, + 'tzurl' => True, + 'attendee' => True, + 'contact' => True, + 'organizer' => True, + 'recurrence_id' => True, + 'url' => True, + 'uid' => True, + 'exdate' => True, + 'exrule' => True, + 'rdate' => True, + 'rrule' => True, + 'action' => True, + 'repeat' => True, + 'trigger' => True, + 'created' => True, + 'dtstamp' => True, + 'last_modified' => True, + 'sequence' => True, + 'x_type' => True, + 'request_status' => True + ) + ), + 'wkst' => Array( + 'type' => 'string', + 'quoted' => False, + 'to_text' => False, + 'properties' => Array( + 'rrule' => True + ) + ), + 'x_type' => Array( + 'type' => 'x_type', + 'quoted' => False, + 'to_text' => False, + 'properties' => Array( + 'calscale' => True, + 'method' => True, + 'prodid' => True, + 'version' => True, + 'attach' => True, + 'categories' => True, + 'class' => True, + 'comment' => True, + 'description' => True, + 'geo' => True, + 'location' => True, + 'percent' => True, + 'priority' => True, + 'resources' => True, + 'status' => True, + 'summary' => True, + 'completed' => True, + 'dtend' => True, + 'due' => True, + 'dtstart' => True, + 'duration' => True, + 'freebusy' => True, + 'transp' => True, + 'tzid' => True, + 'tzname' => True, + 'tzoffsetfrom' => True, + 'tzoffsetto' => True, + 'tzurl' => True, + 'attendee' => True, + 'contact' => True, + 'organizer' => True, + 'recurrence_id' => True, + 'url' => True, + 'uid' => True, + 'exdate' => True, + 'exrule' => True, + 'rdate' => True, + 'rrule' => True, + 'action' => True, + 'repeat' => True, + 'trigger' => True, + 'created' => True, + 'dtstamp' => True, + 'last_modified' => True, + 'sequence' => True, + 'x_type' => True, + 'request_status' => True + ) + ) + ); + if(!is_object($GLOBALS['phpgw']->datetime)) + { + $GLOBALS['phpgw']->datetime = createobject('phpgwapi.datetime'); + } + } + + function set_var(&$event,$type,$value) + { + $type = strtolower(str_replace('-','_',$type)); + $event[$type] = $value; + if(is_string($value)) + { + $this->debug("Setting ".$type." = ".$value); + } + else + { + $this->debug("Setting ".$type." = "._debug_array($value,False)); + } + } + + function read_line_unfold($ical_text) + { + if($this->line < count($ical_text)) + { + $str = str_replace("\r\n",'',$ical_text[$this->line]); + $this->line = $this->line + 1; + while(ereg("^[[:space:]]",$ical_text[$this->line])) + { + $str .= substr(str_replace("\r\n",'',$ical_text[$this->line]),1); + $this->line = $this->line + 1; + } + $this->debug("LINE : ".$str); + return $str; + } + else + { + return False; + } + } + + function fold($str) + { + return $this->chunk_split==True ? chunk_split($str,FOLD_LENGTH,"\r\n") : $str."\r\n"; + } + + function strip_quotes($str) + { + return str_replace('"','',$str); + } + + function from_text($str) + { + $str = str_replace("\\,",",",$str); + $str = str_replace("\\;",";",$str); + $str = str_replace("\\N","\n",$str); + $str = str_replace("\\n","\n",$str); + $str = str_replace("\\\\","\\",$str); + return "$str"; + } + + function to_text($str) + { + $str = str_replace("\\","\\\\",$str); + $str = str_replace(",","\\,",$str); + $str = str_replace(";","\\;",$str); + $str = str_replace("\n","\\n",$str); + return "$str"; + } + + function from_dir($str) + { + return str_replace('=3D','=',str_replace('%20',' ',$str)); + } + + function to_dir($str) + { + return str_replace('=','=3D',str_replace(' ','%20',$str)); + } + + function find_parameters($property) + { + static $cached_returns; + + if(isset($cached_returns[$property])) + { + reset($cached_returns[$property]); + return $cached_returns[$property]; + } + + reset($this->parameter); + while(list($key,$param_array) = each($this->parameter)) + { + if($param_array['properties'][$property]) + { + $param[] = $key; + $this->debug('Property : '.$property.' = Parameter : '.$key); + } + } + reset($param); + $cached_returns[$property] = $param; + return $param; + } + + function find_properties($ical_type) + { + static $cached_returns; + + if(isset($cached_returns[$ical_type])) + { + reset($cached_returns[$ical_type]); + return $cached_returns[$ical_type]; + } + + reset($this->property); + while(list($key,$param_array) = each($this->property)) + { + if($param_array[$ical_type]) + { + $prop[] = $key; + } + } + reset($prop); + $cached_returns[$ical_type] = $prop; + return $prop; + } + + function new_ical() + { + return Array(); + } + + /* + * Parse Functions + */ + + function parse_geo(&$event,$value) + { +// $return_value = $this->explode_param($value,True); + if(count($return_value) == 2) + { + $event['lat'] = $return_value[0]; + $event['lon'] = $return_value[1]; + } + } + + function parse_xtype(&$event,$majortype,$value) + { + $temp_x_type['name'] = strtoupper(substr($majortype,2)); + $temp_x_type['value'] = $value; + $event['x_type'][] = $temp_x_type; + } + + function parse_parameters(&$event,$majortype,$value) + { + if(!ereg('[\=\;]',$value)) + { + $return_value[] = Array( + 'param' => $majortype, + 'value' => $value + ); + $value = ''; + } + elseif(ereg('(.*(\:\\\\)?.*):(.*)',$value,$temp)) + { + $this->debug('Value : '._debug_array($temp,False)); + $this->debug('Param '.$majortype.' Value : '.$temp[3]); + if($temp[3]) + { + $return_value[] = Array( + 'param' => $majortype, + 'value' => $temp[3] + ); + $value = str_replace(':MAILTO','',$temp[1]); + } + while(ereg('(([A-Z\-]*)[=]([[:alnum:] \_\)\(\/\$\.\,\:\\\|\*\&\^\%\#\!\~\"\?\&\@\<\>\-]*))([\;]?)(.*)',$value,$temp)) + { + $this->debug('Value : '._debug_array($temp,False)); + $this->debug('Param '.$temp[2].' Value : '.$temp[3]); + $return_value[] = Array( + 'param' => $temp[2], + 'value' => $temp[3] + ); + $value = chop($temp[5]); + $this->debug('Value would be = '.$value); + flush(); + } + } + else + { + while(ereg('(([A-Z\-]*)[=]([[:alnum:] \_\)\(\/\$\.\,\:\\\|\*\&\^\%\#\!\~\"\?\&\@\<\>\-]*))([\;]?)(.*)',$value,$temp)) + { + $this->debug('Value : '._debug_array($temp,False)); + $this->debug('Param '.$temp[2].' Value : '.$temp[3]); + $return_value[] = Array( + 'param' => $temp[2], + 'value' => $temp[3] + ); + $value = chop($temp[5]); + $this->debug('Value would be = '.$value); + flush(); + } + } + + for($i=0;$istrip_quotes($return_value[$i]['value']); + if(substr($name,0,2) == 'x-') + { + $param = 'x_type'; + $name = str_replace('-','_',$return_value[$i]['param']); + } + else + { + $param = str_replace('-','_',strtolower($name)); + if(!isset($this->parameter[$param]) || $majortype == 'tzid') + { + if($majortype == 'attendee' || $majortype == 'organizer') + { + $param = 'mailto'; + $name = $param; + } + else + { + $param = 'value'; + } + } + } + $this->debug('name : '.$name.' : Param = '.$param); + if(@$this->parameter[$param]['properties'][$majortype]) + { + switch(@$this->parameter[$param]['type']) + { + case 'dir': + $this->set_var($event,$name,$this->from_dir($value)); + break; + case 'text': + $this->set_var($event,$name,$value); + break; + case 'x_type': + $this->parse_xtype($event,$name,$value); + break; + case 'function': + $function = $this->parameter[$param]['function']; + $this->set_var($event,$name,$this->$function($value)); + break; + case 'uri': + if(@$this->parameter[$param]['to_text']) + { + $value = $this->to_text($value); + } + $this->set_var($event,$name,$value); + break; + case 'integer': + $this->set_var($event,$name,intval($value)); + break; + case 'value': + if(@$this->property[$majortype]['type'] == 'date-time') + { + $this->set_var($event,$param,$this->switch_date($name)); + } + elseif($value <> "\\n" && $value) + { + $this->set_var($event[$majortype],$param,$value); + } + $this->debug('Event : '._debug_array($event,False)); + break; + } + } + } + } + + function parse_value(&$event,$majortype,$value,$mode) + { + $var = Array(); + $this->debug('Mode : '.$mode.' Majortype : '.$majortype); + $this->parse_parameters($var,$majortype,$value); + if($this->property[$majortype][$mode]['multiples']) + { + $this->debug(_debug_array($var,False)); + $event[$majortype][] = $var; + } + else + { + $this->debug('Majortype : '.$majortype); + $this->debug('Property : '.$this->property[$majortype]['type']); + if($this->property[$majortype]['type'] == 'date-time') + { + $this->debug('Got a DATE-TIME type!'); + $t_var = $var[$majortype]; + unset($var[$majortype]); + reset($t_var); + while(list($key,$val) = each($t_var)) + { + $var[$key] = $val; + } + $this->debug($majortype.' : '._debug_array($var,False)); + } + $this->set_var($event,$majortype,$var); + } + } + + + /* + * Build-Card Functions + */ + + function build_xtype($x_type,$seperator='=') + { + $quote = ''; + if($seperator == '=') + { + $quote = '"'; + } + + $return_value = $this->fold('X-'.$x_type['name'].$seperator.$quote.$x_type['value'].$quote); + if($seperator == '=') + { + return str_replace("\r\n",'',$return_value); + } + else + { + return $return_value; + } + } + + function build_parameters($event,$property) + { + $str = ''; + $include_mailto = False; + $include_datetime = False; + $param = $this->find_parameters($property); + + if($property == 'exdate') + { + while(list($key,$value) = each($event)) + { + $exdates[] = $this->switch_date($value); + } + return ':'.implode($exdates,','); + } + else + { + while(list($dumb_key,$key) = each($param)) + { + if($key == 'value') + { + continue; + } + if($key == 'mailto') + { + $include_mailto = True; + continue; + } + $param_array = @$this->parameter[$key]; + $type = @$this->parameter[$key]['type']; + if($type == 'date-time') + { + $include_datetime = True; + continue; + } + $quote = (@$this->parameter[$key]['quoted']?'"':''); + if(isset($event[$key]) && @$this->parameter[$key]['properties'][$property]) + { + $change_text = @$this->parameter[$key]['to_text']; + $value = $event[$key]; + if($change_text && $type == 'text') + { + $value = $this->to_text($value); + } + switch($type) + { + case 'dir': + $str .= ';'.str_replace('_','-',strtoupper($key)).'='.$quote.$this->to_dir($value).$quote; + break; + case 'function': + $str .= ';'.str_replace('_','-',strtoupper($key)).'='; + $function = $this->parameter[$key]['function']; + $this->debug($key.' Function Param : '.$value); + $str .= $quote.$this->$function($value).$quote; + break; + case 'text': + case 'string': + $str .= ';'.strtoupper($key).'='.$quote.$value.$quote; + break; + case 'date-time': + $str .= ($key=='until'?':':';UNTIL=').date('Ymd\THis',mktime($event['hour'],$event['min'],$event['sec'],$event['month'],$event['mday'],$event['year'])).(!@isset($event['tzid'])?'Z':''); + break; + } + unset($value); + } + } + + if(!empty($event['x_type'])) + { + $c_x_type = count($event['x_type']); + for($j=0;$j<$c_x_type;$j++) + { + $str .= ';'.$this->build_xtype($event['x_type'][$j],'='); + } + } + if(!empty($event['value'])) + { + if($property == 'trigger') + { + $seperator = ';'; + } + else + { + $seperator = ':'; + } + $str .= $seperator.($this->parameter['value']['to_text']?$this->to_text($event['value']):$event['value']); + } + if($include_mailto == True) + { + $key = 'mailto'; + $function = $this->parameter[$key]['function']; + $ret_value = $this->$function($event[$key]); + $str .= ($ret_value?':'.$ret_value:''); + } + if($include_datetime == True || @$this->property[$property]['type'] == 'date-time') + { + $str .= ':'.date('Ymd\THis',mktime($event['hour'],$event['min'],$event['sec'],$event['month'],$event['mday'],$event['year'])).(!@isset($event['tzid'])?'Z':''); + } + return ($property=='rrule'?':'.substr($str,1):$str); + } + } + + function build_text($event,$property) + { + $str = ''; + $param = $this->find_parameters($property); + while(list($dumb_key,$key) = each($param)) + { + if(!empty($event[$key]) && $key != 'value') + { + $type = @$this->parameter[$key]['type']; + $quote = @$this->parameter[$key]['quote']; + if(@$this->parameter[$key]['to_text'] == True) + { + $value = $this->to_text($event[$key]); + } + else + { + $value = $event[$key]; + } + switch($type) + { + case 'text': + $str .= ';'.strtoupper($key).'='.$quote.$value.$quote; + break; + } + } + } + if(!empty($event['x_type'])) + { + $c_x_type = count($event['x_type']); + for($j=0;$j<$c_x_type;$j++) + { + $str .= ';'.$this->build_xtype($event['x_type'][$j],'='); + } + } + if(!empty($event['value'])) + { + $str .= ':'.($this->parameter['value']['to_text']?$this->to_text($event['value']):$event['value']); + } + return $str; + } + + function build_card_internals($ical_item,$event) + { + $prop = $this->find_properties($ical_item); + reset($prop); + while(list($dumb_key,$key) = each($prop)) + { + $value = $key; + $varray = $this->property[$key]; + $type = $varray['type']; + $to_text = $varray['to_text']; + $state = @$varray[$ical_item]['state']; + $multiples = @$varray[$ical_item]['multiples']; + switch($type) + { + case 'date-time': + if(!empty($event[$value])) + { + if($multiples && $value != 'exdate') + { + for($i=0;$ifold(strtoupper(str_replace('_','-',$value)).$this->build_parameters($event[$value][$i],$value)); + } + } + else + { + $str .= $this->fold(strtoupper(str_replace('_','-',$value)).$this->build_parameters($event[$value],$value)); + } + } + elseif($value == 'dtstamp' || $value == 'created') + { + $str .= $this->fold(strtoupper(str_replace('_','-',$value)).':'.gmdate('Ymd\THis\Z')); + } + break; + case 'uri': + if(!empty($event[$value])) + { + for($i=0;$ifold(strtoupper(str_replace('_','-',$value)).$this->build_parameters($event[$value][$i],$to_text)); + } + } + break; + case 'recur': + if(!empty($event[$value])) + { + if($multiples) + { + for($i=0;$ifold(strtoupper(str_replace('_','-',$value)).$this->build_parameters($event[$value][$i],$value)); + } + } + else + { + $str .= $this->fold(strtoupper(str_replace('_','-',$value)).$this->build_parameters($event[$value],$value)); + } + } + break; + case 'integer': + if(!empty($event[$value])) + { + $str .= $this->fold(strtoupper(str_replace('_','-',$value)).':'.$event[$value]); + } + elseif($value == 'sequence' || $value == 'percent_complete') + { + $str .= $this->fold(strtoupper(str_replace('_','-',$value)).':0'); + } + break; + case 'function': + $str .= ';'.str_replace('_','-',strtoupper($value)).'='; + $function = @$this->parameter[$key]['function']; + $str .= (@$this->parameter[$key]['quoted']?'"':'').$this->$function($event[$key]).(@$this->parameter[$key]['quoted']?'"':''); + break; + case 'float': + if(!empty($event[$value])) + { + $str .= $this->fold(strtoupper(str_replace('_','-',$value)).':'.$event[$value]['lat'].';'.$event[$value]['lon']); + } + break; + case 'text': + if(isset($event[$value])) + { + if(@$this->parameter[$key]['type'] != 'function') + { + if($multiples && count($event[$value]) > 1) + { + for($i=0;$ifold(strtoupper(str_replace('_','-',$value)).$this->build_parameters($event[$value][$i],$value)); + } + } + else + { + $str .= $this->fold(strtoupper(str_replace('_','-',$value)).$this->build_parameters($event[$value],$value)); + } + } + else + { + $function = $this->parameter[$value]['function']; + if($multiples) + { + for($i=0;$ifold(strtoupper(str_replace('_','-',$value)).':'.$this->$function($event[$value][$i])); + } + } + else + { + $str .= $this->fold(strtoupper(str_replace('_','-',$value)).':'.$this->$function($event[$value])); + } + } + } + break; + case 'cal-address': + if(is_array($event[$value][0])) + { + for($j=0;$jbuild_parameters($event[$value][$j],$value); + if($temp_output) + { + $str .= $this->fold(strtoupper(str_replace('_','-',$value)).$temp_output); + } + } + } + else + { + $temp_output = $this->build_parameters($event[$value],$value); + if($temp_output) + { + $str .= $this->fold(strtoupper(str_replace('_','-',$value)).$temp_output); + } + } + break; + } + } + if(!empty($event['x_type'])) + { + for($i=0;$ibuild_xtype($event['x_type'][$i],':'); + } + } + + if($ical_item == 'vtimezone') + { + if($event['tzdata']) + { + for($k=0;$kbuild_card_internals(strtolower($event['tzdata'][$k]['type']),$event['tzdata'][$k]); + $str .= 'END:'.strtoupper($event['tzdata'][$k]['type'])."\r\n"; + } + } + } + elseif($event['alarm']) + { + for($k=0;$kbuild_card_internals('valarm',$event['alarm'][$k]); + $str .= 'END:VALARM'."\r\n"; + } + } + return $str; + } + + /* + * Switching Functions + */ + + function switch_class($var) + { + if(is_string($var)) + { + switch($var) + { + case 'PRIVATE': + return PRIVATE; + break; + case 'PUBLIC': + return PUBLIC; + break; + case 'CONFIDENTIAL': + return CONFIDENTIAL; + break; + } + } + elseif(is_int($var)) + { + switch(intval($var)) + { + case PRIVATE: + return 'PRIVATE'; + break; + case PUBLIC: + return 'PUBLIC'; + break; + case CONFIDENTIAL: + return 'CONFIDENTIAL'; + break; + } + } + else + { + return $var; + } + } + + function switch_cu($var) + { + if(gettype($var) == 'string') + { + switch($var) + { + case 'INDIVIDUAL': + return INDIVIDUAL; + break; + case 'GROUP': + return GROUP; + break; + case 'RESOURCE': + return RESOURCE; + break; + case 'ROOM': + return ROOM; + break; + case 'UNKNOWN': + return UNKNOWN; + break; + default: + return OTHER; + break; + } + } + elseif(gettype($var) == 'integer') + { + switch($var) + { + case INDIVIDUAL: + return 'INDIVIDUAL'; + break; + case GROUP: + return 'GROUP'; + break; + case RESOURCE: + return 'RESOURCE'; + break; + case ROOM: + return 'ROOM'; + break; + case UNKNOWN: + return 'UNKNOWN'; + break; + default: + return 'X-OTHER'; + break; + } + } + else + { + return $var; + } + } + + function switch_date($var) + { + $this->debug('SWITCH_DATE: gettype = '.gettype($var)); + if(is_string($var)) + { + $dtime = Array(); + if(strpos($var,':')) + { + $pos = explode(':',$var); + $var = $pos[1]; + } + $this->set_var($dtime,'year',intval(substr($var,0,4))); + $this->set_var($dtime,'month',intval(substr($var,4,2))); + $this->set_var($dtime,'mday',intval(substr($var,6,2))); + if(substr($var,8,1) == 'T') + { + $this->set_var($dtime,'hour',intval(substr($var,9,2))); + $this->set_var($dtime,'min',intval(substr($var,11,2))); + $this->set_var($dtime,'sec',intval(substr($var,13,2))); + if(strlen($var) > 14) + { + if(substr($var,14,1) != 'Z') + { + if($this->api) + { + $dtime['hour'] -= $GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset']; + if($dtime['hour'] < 0) + { + $dtime['mday'] -= 1; + $dtime['hour'] = 24 - $dtime['hour']; + } + elseif($dtime['hour'] >= 24) + { + $dtime['mday'] += 1; + $dtime['hour'] = $dtime['hour'] - 24; + } + } + } + } + else + { + /* + * The time provided by the iCal is considered local time. + * + * The implementor will need to consider how to convert that time to UTC. + */ +// if($this->api) +// { +// $dtime['hour'] -= $GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset']; +// if($dtime['hour'] < 0) +// { +// $dtime['mday'] -= 1; +// $dtime['hour'] = 24 - $dtime['hour']; +// } +// elseif($dtime['hour'] >= 24) +// { +// $dtime['mday'] += 1; +// $dtime['hour'] = $dtime['hour'] - 24; +// } +// } + } + } + else + { + $this->set_var($dtime,'hour',0); + $this->set_var($dtime,'min',0); + $this->set_var($dtime,'sec',0); + if($this->api) + { + $dtime['hour'] -= $GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset']; + if($dtime['hour'] < 0) + { + $dtime['mday'] -= 1; + $dtime['hour'] = 24 - $dtime['hour']; + } + elseif($dtime['hour'] >= 24) + { + $dtime['mday'] += 1; + $dtime['hour'] = $dtime['hour'] - 24; + } + } + } + $this->debug('DATETIME : '._debug_array($dtime,False)); + return $dtime; + } + elseif(is_array($var)) + { + return date('Ymd\THis\Z',mktime($var['hour'],$var['min'],$var['sec'],$var['month'],$var['mday'],$var['year'])); + } + else + { + return $var; + } + } + + function switch_encoding($var) + { + if(is_string($var)) + { + switch($var) + { + case '8BIT': + return _8BIT; + break; + case 'BASE64': + return _BASE64; + break; + default: + return OTHER; + break; + } + } + elseif(is_int($var)) + { + switch($var) + { + case _8BIT: + return '8BIT'; + break; + case _BASE64: + return 'BASE64'; + break; + case OTHER: + return 'OTHER'; + break; + } + } + else + { + return $var; + } + } + + function switch_fbtype($var) + { + if(is_string($var)) + { + switch($var) + { + case 'FREE': + return FREE; + break; + case 'BUSY': + return BUSY; + break; + case 'BUSY-UNAVAILABLE': + return BUSY_UNAVAILABLE; + break; + case 'BUSY-TENTATIVE': + return BUSY_TENTATIVE; + break; + default: + return OTHER; + break; + } + } + elseif(is_int($var)) + { + switch($var) + { + case FREE: + return 'FREE'; + break; + case BUSY: + return 'BUSY'; + break; + case BUSY_UNAVAILABLE: + return 'BUSY-UNAVAILABLE'; + break; + case BUSY_TENTATIVE: + return 'BUSY-TENTATIVE'; + break; + default: + return 'OTHER'; + break; + } + } + else + { + return $var; + } + } + + function switch_freq($var) + { + if(is_string($var)) + { + switch($var) + { + case 'SECONDLY': + return SECONDLY; + break; + case 'MINUTELY': + return MINUTELY; + break; + case 'HOURLY': + return HOURLY; + break; + case 'DAILY': + return DAILY; + break; + case 'WEEKLY': + return WEEKLY; + break; + case 'MONTHLY': + return MONTHLY; + break; + case 'YEARLY': + return YEARLY; + break; + } + } + elseif(is_int($var)) + { + switch($var) + { + case SECONDLY: + return 'SECONDLY'; + break; + case MINUTELY: + return 'MINUTELY'; + break; + case HOURLY: + return 'HOURLY'; + break; + case DAILY: + return 'DAILY'; + break; + case WEEKLY: + return 'WEEKLY'; + break; + case MONTHLY: + return 'MONTHLY'; + break; + case YEARLY: + return 'YEARLY'; + break; + } + } + else + { + return $var; + } + } + + function switch_mailto($var) + { + if(is_string($var)) + { + if(strpos(' '.$var,':')) + { + $parts = explode(':',$var); + $var = $parts[1]; + } + + $parts = explode('@',$var); + $this->debug("Count of mailto parts : ".count($parts)); + if(count($parts) == 2) + { + $this->debug("Splitting ".$parts[0]." @ ".$parts[1]); + $temp_address = Array(); + $temp_address['user'] = $parts[0]; + $temp_address['host'] = $parts[1]; + return $temp_address; + } + else + { + return False; + } + } + elseif(is_array($var)) + { +// return 'MAILTO:'.$var['user'].'@'.$var['host']; + return $var['user'].'@'.$var['host']; + } + } + + function switch_partstat($var) + { +// $this->debug_str = True; + $this->debug('PARTSTAT = '.$var); +// $this->debug_str = False; + if(is_string($var)) + { + switch($var) + { + case 'NEEDS-ACTION': + return 0; // NEEDS_ACTION; + break; + case 'ACCEPTED': + return 1; // ACCEPTED; + break; + case 'DECLINED': + return 2; // DECLINED; + break; + case 'TENTATIVE': + return 3; // TENTATIVE; + break; + case 'DELEGATED': + return 4; // DELEGATED; + break; + case 'COMPLETED': + return 5; // COMPLETED; + break; + case 'IN-PROCESS': + return 6; // IN_PROCESS; + break; + default: + return 99; // OTHER; + break; + } + } + elseif(is_int($var)) + { + switch(intval($var)) + { + case 0: // NEEDS_ACTION: + return 'NEEDS-ACTION'; + break; + case 1: // ACCEPTED: + return 'ACCEPTED'; + break; + case 2: // DECLINED: + return 'DECLINED'; + break; + case 3: // TENTATIVE: + return 'TENTATIVE'; + break; + case 4: // DELEGATED: + return 'DELEGATED'; + break; + case 5: // COMPLETED: + return 'COMPLETED'; + break; + case 6: // IN_PROCESS: + return 'IN-PROCESS'; + break; + default: + return 'X-OTHER'; + break; + } + } + else + { + return $var; + } + } + + function switch_range($var) + { + if(is_string($var)) + { + switch($var) + { + case 'THISANDPRIOR': + return THISANDPRIOR; + break; + case 'THISANDFUTURE': + return THISANDFUTURE; + break; + } + } + elseif(is_int($var)) + { + switch($var) + { + case THISANDPRIOR: + return 'THISANDPRIOR'; + break; + case THISANDFUTURE: + return 'THISANDFUTURE'; + break; + } + } + else + { + return $var; + } + } + + function switch_related($var) + { + if(is_string($var)) + { + switch($var) + { + case 'START': + return START; + break; + case 'END': + return END; + break; + } + } + elseif(is_int($var)) + { + switch($var) + { + case START: + return 'START'; + break; + case END: + return 'END'; + break; + } + } + else + { + return $var; + } + } + + function switch_reltype($var) + { + if(is_string($var)) + { + switch($var) + { + case 'PARENT': + return PARENT; + break; + case 'CHILD': + return CHILD; + break; + case 'SIBLING': + return SIBLING; + break; + } + } + elseif(is_int($var)) + { + switch($var) + { + case PARENT: + return 'PARENT'; + break; + case CHILD: + return 'CHILD'; + break; + case SIBLING: + return 'SIBLING'; + break; + } + } + else + { + return $var; + } + } + + function switch_role($var) + { + if(is_string($var)) + { + switch($var) + { + case 'NONE': + return NONE; + break; + case 'CHAIR': + return CHAIR; + break; + case 'REQ-PARTICIPANT': + return REQ_PARTICIPANT; + break; + case 'OPT-PARTICIPANT': + return OPT_PARTICIPANT; + break; + case 'NON-PARTICIPANT': + return NON_PARTICIPANT; + break; + } + } + elseif(is_int($var)) + { + switch($var) + { + case NONE: + return 'NONE'; + break; + case CHAIR: + return 'CHAIR'; + break; + case REQ_PARTICIPANT: + return 'REQ-PARTICIPANT'; + break; + case OPT_PARTICIPANT: + return 'OPT-PARTICIPANT'; + break; + case NON_PARTICIPANT: + return 'NON-PARTICIPANT'; + break; + } + } + else + { + return $var; + } + } + + function switch_rsvp($var) + { + if(is_string($var)) + { + if($var == 'TRUE') + { + return 1; + } + elseif($var == 'FALSE') + { + return 0; + } + } + elseif(is_int($var) || $var == False) + { + if($var == 1) + { + return 'TRUE'; + } + elseif($var == 0) + { + return 'FALSE'; + } + } + else + { + return $var; + } + } + + function switch_transp($var) + { + if(is_string($var)) + { + switch($var) + { + case 'TRANSPARENT': + return TRANSPARENT; + break; + case 'OPAQUE': + return OPAQUE; + break; + } + } + elseif(is_int($var)) + { + switch($var) + { + case TRANSPARENT: + return 'TRANSPARENT'; + break; + case OPAQUE: + return 'OPAQUE'; + break; + } + } + else + { + return $var; + } + } + + /* + * The brunt of the class + */ + + function parse($ical_text) + { + + $begin_regexp = '^'; + $semi_colon_regexp = '[\;\:]'; + $colon_regexp = '[\:]'; + $catch_all_regexp = '(.*)'; + $end_regexp = '$'; + $property_regexp = $begin_regexp.'([A-Z\-]*)'.$semi_colon_regexp.$catch_all_regexp.$end_regexp; + $param_regexp = $begin_regexp.$catch_all_regexp.':'.$catch_all_regexp.$end_regexp; + + $mode = 'none'; + $text = $this->read_line_unfold($ical_text); + while($text) + { +// if(strlen($ical_text[$i]) > 75) +// { +// continue; +// } + + ereg($property_regexp,$text,$temp); + $majortype = str_replace('-','_',strtolower($temp[1])); + $value = chop($temp[2]); + + if($mode != 'none' && ($majortype != 'begin' && $majortype != 'end')) + { + $this->debug('PARSE:MAJORTYPE : '.$majortype); + if(isset($this->property[$majortype])) + { + $state = @$this->property[$majortype]["$mode"]['state']; + $type = @$this->property[$majortype]['type']; + $multiples = @$this->property[$majortype]["$mode"]['multiples']; + $do_to_text = @$this->property[$majortype]['to_text']; + } + elseif(substr($majortype,0,2) == 'x_') + { + $state = 'optional'; + $type = 'xtype'; + $multiples = True; + $do_to_test = True; + } + else + { + $state = ''; + } + } + else + { + $state = 'required'; + } + + if($majortype == 'begin') + { + $tmode = $mode; + $mode = strtolower($value); + switch(strtolower($value)) + { + case 'daylight': + case 'standard': + $t_event = Array(); + $t_event = $event; + $event = Array(); + break; + case 'valarm': + if($tmode == 'vevent' || $tmode == 'vtodo') + { + $t_event = $event; + unset($event); + $event = Array(); + } + else + { + $mode = $tmode; + } + break; + case 'vcalendar': + $ical = $this->new_ical(); + break; + case 'vevent': + case 'vfreebusy': + case 'vjournal': + case 'vtimezone': + case 'vtodo': + $event = Array(); + break; + } + $event['type'] = strtolower($value); + } + elseif($majortype == 'end') + { + $mode = 'none'; + switch(strtolower($value)) + { + case 'daylight': + case 'standard': + $tzdata[] = $event; + unset($event); + $event = $t_event; + unset($t_event); + $mode = 'vtimezone'; + break; + case 'valarm': + $alarm[] = $event; + unset($event); + $event = $t_event; + unset($t_event); + $mode = $tmode; + break; + case 'vevent': + if(!empty($alarm)) + { + $event['alarm'] = $alarm; + unset($alarm); + } + $this->event[] = $event; + unset($event); + break; + case 'vfreebusy': + $this->freebusy[] = $event; + unset($event); + break; + case 'vjournal': + $this->journal[] = $event; + unset($event); + break; + case 'vtimezone': + if(!empty($tzdata)) + { + $event['tzdata'] = $tzdata; + unset($tzdata); + } + $this->timezone[] = $event; + unset($event); + break; + case 'vtodo': + if(!empty($alarm)) + { + $event['alarm'] = $alarm; + unset($alarm); + } + $this->todo[] = $event['alarm']; + unset($event); + break; + case 'vcalendar': + $this->ical = $ical; + $this->ical['event'] = $this->event; + $this->ical['freebusy'] = $this->freebusy; + $this->ical['journal'] = $this->journal; + $this->ical['timezone'] = $this->timezone; + $this->ical['todo'] = $this->todo; + break 2; + } + } + elseif($majortype == 'prodid' || $majortype == 'version' || $majortype == 'method' || $majortype == 'calscale') + { + $this->parse_parameters($ical,$majortype,$this->from_text($value)); + } + elseif($state == 'optional' || $state == 'required') + { + $this->debug('Mode : '.$mode.' Majortype : '.$majortype); + if($do_to_text) + { + $value = $this->from_text($value); + } + switch($type) + { + case 'text': + $this->parse_parameters($event,$majortype,$value); + break; + case 'recur': + case 'date-time': + case 'cal-address': + $this->parse_value($event,$majortype,$value,$mode); + break; + case 'integer': + if($multiples) + { + $event[$majortype][] = intval($value); + } + else + { + $this->set_var($event,$majortype,intval($value)); + } + break; + case 'float': + $event->$majortype = new class_geo; + $this->parse_geo($event->$majortype,$value); + break; + case 'utc-offset': + $this->set_var($event,$majortype,intval($value)); + break; + case 'uri': + $new_var = Array(); + $this->parse_parameters($new_var,$majortype,$value); + if($multiples) + { + switch($mode) + { + case 'valarm': + $alarm['attach'][] = $new_var; + break; + default: + $event[$majortype][] = $new_var; + break; + } + } + else + { + $event[$majortype] = $new_var; + } + unset($new_var); + break; + case 'xtype': + $this->parse_xtype($event,$majortype,$value); + break; + } + } + $text = $this->read_line_unfold($ical_text); + } + return $this->ical; + } + + function build_ical($ical) + { + $var = Array( + 'timezone', + 'event', + 'todo', + 'journal', + 'freebusy' + ); + + $str = 'BEGIN:VCALENDAR'."\r\n"; + $str .= $this->fold('PRODID'.$this->build_text($ical['prodid'],'prodid')); + $str .= $this->fold('VERSION'.$this->build_text($ical['version'],'version')); + $str .= $this->fold('METHOD'.$this->build_text($ical['method'],'method')); + while(list($key,$vtype) = each($var)) + { + if($ical[$vtype]) + { + for($i=0;$ibuild_card_internals('v'.$vtype,$ical[$vtype][$i]); + $str .= 'END:V'.strtoupper($vtype)."\r\n"; + } + } + } + $str .= 'END:VCALENDAR'."\r\n"; + + return $str; + } + + function switch_to_phpgw_status($partstat) + { + switch($partstat) + { + case 0: + return 'U'; + break; + case 1: + return 'A'; + break; + case 2: + return 'R'; + break; + case 3: + return 'T'; + break; + default: + return 'U'; + break; + } + } + + function switch_phpgw_status($status) + { + switch($status) + { + case 'U': + return 0; + break; + case 'A': + return 1; + break; + case 'R': + return 2; + break; + case 'T': + return 3; + break; + } + } + + function is_owner($part_record) + { + if(($part_record['user'].'@'.$part_record['host'] == $GLOBALS['phpgw_info']['user']['preferences']['email']['address']) || + ($part_record['cn'] == $GLOBALS['phpgw_info']['user']['account_lid'])) + { + return True; + } + else + { + return False; + } + } + + function check_owner(&$event,$ical,$so_event) + { + if(!isset($event['participant'][$GLOBALS['phpgw_info']['user']['account_id']])) + { + if(isset($ical['organizer'])) + { + if($this->is_owner($ical['organizer'])) + { + $so_event->add_attribute('owner',$GLOBALS['phpgw_info']['user']['account_id']); + $so_event->add_attribute('participants',$this->switch_to_phpgw_status($ical['organizer']['partstat']),$GLOBALS['phpgw_info']['user']['account_id']); + } + } + elseif(isset($ical['attendee'])) + { + $attendee_count = count($ical['attendee']); + + for($j=0;$j<$attendee_count;$j++) + { + if($this->is_owner($ical['attendee'][$j])) + { + $so_event->add_attribute('participants',$this->switch_to_phpgw_status($ical['attendee'][$j]['partstat']),intval($GLOBALS['phpgw_info']['user']['account_id'])); + } + } + } + else + { + $so_event->add_attribute('owner',$GLOBALS['phpgw_info']['user']['account_id']); + $so_event->add_attribute('participants','A',$GLOBALS['phpgw_info']['user']['account_id']); + } + } + } + + function import_file() + { + if( ! is_array($_FILES['uploadedfile']) || $_FILES['uploadedfile']['tmp_name'] == '' /*|| $_FILES['uploadedfile']['tmp_name'] = 'none'*/) + { + Header('Location: ' . $GLOBALS['phpgw']->link('/index.php', + Array( + 'menuaction' => 'calendar.uiicalendar.import', + 'action' => 'GetFile' + ) + ) + ); + $GLOBALS['phpgw']->common->phpgw_exit(); + } + $uploaddir = $GLOBALS['phpgw_info']['server']['temp_dir'] . SEP; + + srand((double)microtime()*1000000); + $random_number = rand(100000000,999999999); + $newfilename = md5($_FILES['uploadedfile']['name'].", ".$uploadedfile_name.", " + . time() . getenv("REMOTE_ADDR") . $random_number ); + + $filename = $uploaddir . $newfilename; + if ( !move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $filename) ) + { + Header('Location: ' . $GLOBALS['phpgw']->link('/index.php', + Array( + 'menuaction' => 'calendar.uiicalendar.import', + 'action' => 'GetFile' + ) + ) + ); + $GLOBALS['phpgw']->common->phpgw_exit(); + } +// $ftp = fopen($uploaddir . $newfilename . '.info','wb'); +// fputs($ftp,$uploadedfile_type."\n".$uploadedfile_name."\n"); +// fclose($ftp); + return $filename; + } + + function import($mime_msg='') + { + if( is_array($_FILES['uploadedfile']) && $_FILES['uploadedfile']['name'] != '') + { + $filename = $this->import_file(); + $fp=fopen($filename,'rt'); + $mime_msg = explode("\n",fread($fp, filesize($filename))); + fclose($fp); + unlink($filename); + } + elseif(!$mime_msg) + { + Header('Location: ' . $GLOBALS['phpgw']->link('/index.php', + Array( + 'menuaction' => 'calendar.uiicalendar.import', + 'action' => 'GetFile' + ) + ) + ); + $GLOBALS['phpgw']->common->phpgw_exit(); + } + + if(!is_object($GLOBALS['uicalendar'])) + { + $so_event = createobject('calendar.socalendar', + Array( + 'owner' => 0, + 'filter' => '', + 'category' => '' + ) + ); + } + else + { + $so_event = $GLOBALS['uicalendar']->bo->so; + } + + $datetime_vars = Array( + 'start' => 'dtstart', + 'end' => 'dtend', + 'modtime' => 'dtstamp', + 'modtime' => 'last_modified' + ); + + $date_array = Array( + 'Y' => 'year', + 'm' => 'month', + 'd' => 'mday', + 'H' => 'hour', + 'i' => 'min', + 's' => 'sec' + ); + + // time limit should be controlled elsewhere + @set_time_limit(0); + + $GLOBALS['phpgw_info']['user']['preferences'] = $GLOBALS['phpgw']->preferences->create_email_preferences(); + $users_email = $GLOBALS['phpgw_info']['user']['preferences']['email']['address']; + $cats = CreateObject('phpgwapi.categories'); + $ical = $this->parse($mime_msg); + switch($ical['version']['value']) + { + case '1.0': + $cat_sep = ';'; + break; + case '2.0': + default: + $cat_sep = ','; + break; + } + $c_events = count($ical['event']); + for($i=0;$i<$c_events;$i++) + { + if($ical['event'][$i]['uid']['value']) + { + $uid_exists = $so_event->find_uid($ical['event'][$i]['uid']['value']); + } + else + { + $uid_exists = False; + } + if($uid_exists) + { + $event = $so_event->read_entry($uid_exists); + $this->check_owner($event,$ical['event'][$i],$so_event); + $event = $so_event->get_cached_event(); + $so_event->add_entry($event); +// $event = $so_event->get_cached_event(); + } + else + { + $so_event->event_init(); + $so_event->add_attribute('id',0); + $so_event->add_attribute('reference',0); + if($ical['event'][$i]['uid']['value']) + { + $so_event->add_attribute('uid',$ical['event'][$i]['uid']['value']); + } + if($ical['event'][$i]['summary']['value']) + { + $so_event->set_title($ical['event'][$i]['summary']['value']); + } + if($ical['event'][$i]['description']['value']) + { + $so_event->set_description($ical['event'][$i]['description']['value']); + } + if($ical['event'][$i]['location']['value']) + { + $so_event->add_attribute('location',$ical['event'][$i]['location']['value']); + } + if(isset($ical['event'][$i]['priority'])) + { + $so_event->add_attribute('priority',$ical['event'][$i]['priority']); + } + else + { + $so_event->add_attribute('priority',2); + } + if(!isset($ical['event'][$i]['class'])) + { + $ical['event'][$i]['class'] = 1; + } + $so_event->set_class($ical['event'][$i]['class']); + + @reset($datetime_vars); + while(list($e_datevar,$i_datevar) = each($datetime_vars)) + { + if(isset($ical['event'][$i][$i_datevar])) + { + $temp_time = $so_event->maketime($ical['event'][$i][$i_datevar]) + $GLOBALS['phpgw']->datetime->tz_offset; + @reset($date_array); + while(list($key,$var) = each($date_array)) + { + $event[$e_datevar][$var] = intval(date($key,$temp_time)); + } + $so_event->set_date($e_datevar,$event[$e_datevar]['year'],$event[$e_datevar]['month'],$event[$e_datevar]['mday'],$event[$e_datevar]['hour'],$event[$e_datevar]['min'],$event[$e_datevar]['sec']); + } + } + if(!isset($ical['event'][$i]['categories']['value']) || !$ical['event'][$i]['categories']['value']) + { + $so_event->set_category(0); + } + else + { + $ical_cats = Array(); + if(strpos($ical['event'][$i]['categories']['value'],$cat_sep)) + { + $ical_cats = explode($cat_sep,$ical['event'][$i]['categories']['value']); + } + else + { + $ical_cats[] = $ical['event'][$i]['categories']['value']; + } + + @reset($ical_cats); + $cat_id_nums = Array(); + while(list($key,$cat) = each($ical_cats)) + { + if(!$cats->exists('appandmains',$cat)) + { + $cats->add( + Array( + 'name' => $cat, + 'descr' => $cat, + 'parent' => '', + 'access' => 'private', + 'data' => '' + ) + ); + } +// $temp_id = $cats->name2id($cat); +// echo 'Category Name : '.$cat.' : Category ID :'.$temp_id."
\n"; +// $cat_id_nums[] = $temp_id; + $cat_id_nums[] = $cats->name2id($cat); + } + @reset($cat_id_nums); + if(count($cat_id_nums) > 1) + { + $so_event->set_category(implode($cat_id_nums,',')); + } + else + { + $so_event->set_category($cat_id_nums[0]); + } + } + +//rrule + if(isset($ical['event'][$i]['rrule'])) + { +// recur_enddate + if(isset($ical['event'][$i]['rrule']['until'])) + { + $recur_enddate['year'] = intval($ical['event'][$i]['rrule']['until']['year']); + $recur_enddate['month'] = intval($ical['event'][$i]['rrule']['until']['month']); + $recur_enddate['mday'] = intval($ical['event'][$i]['rrule']['until']['mday']); + } + else + { + $recur_enddate['year'] = 0; + $recur_enddate['month'] = 0; + $recur_enddate['mday'] = 0; + } + +// recur_data + $recur_data = 0; + if(isset($ical['event'][$i]['rrule']['byday'])) + { + $week_days = Array( + MCAL_M_SUNDAY => 'SU', + MCAL_M_MONDAY => 'MO', + MCAL_M_TUESDAY => 'TU', + MCAL_M_WEDNESDAY => 'WE', + MCAL_M_THURSDAY => 'TH', + MCAL_M_FRIDAY => 'FR', + MCAL_M_SATURDAY => 'SA' + ); + @reset($week_days); + while(list($key,$val) = each($week_days)) + { + if(strpos(' '.$ical['event'][$i]['rrule']['byday'],$val)) + { + $recur_data += $key; + } + } + } + +// interval + if(!isset($ical['event'][$i]['rrule']['interval'])) + { + $interval = 1; + } + else + { + $interval = intval($ical['event'][$i]['rrule']['interval']); + } +// recur_type + switch($ical['event'][$i]['rrule']['freq']) + { + case DAILY: + $recur_type = MCAL_RECUR_DAILY; + break; + case WEEKLY: + $so_event->set_recur_weekly($recur_enddate['year'],$recur_enddate['month'],$recur_enddate['mday'],$interval,$recur_data); + break; + case MONTHLY: +// Still need to determine if this is by day or by week for the month.. +// $recur_type = MCAL_RECUR_M??????; + break; + case YEARLY: + $so_event->set_recur_yearly($recur_enddate['year'],$recur_enddate['month'],$recur_enddate['mday'],$interval); + break; + } + } + else + { + $so_event->set_recur_none(); + } + +// Owner + if(!isset($ical['event'][$i]['organizer']) || (isset($ical['event'][$i]['organizer']) && $this->is_owner($ical['event'][$i]['organizer']))) + { + $so_event->add_attribute('owner',$GLOBALS['phpgw_info']['user']['account_id']); + $so_event->add_attribute('participants','A',intval($GLOBALS['phpgw_info']['user']['account_id'])); + } + else + { +//owner + } + + $event = $so_event->get_cached_event(); + $so_event->add_entry($event); +// $event = $so_event->get_cached_event(); + } + } + Header('Location: '.$GLOBALS['phpgw']->link('/index.php', + Array( + 'menuaction' => 'calendar.uicalendar.view', + 'cal_id' => $event['id'] + ) + ) + ); + $GLOBALS['phpgw']->common->phpgw_exit(); + } + + function export($params) + { + $event_id = get_var('cal_id',Array('GET','DEFAULT'),$params['l_event_id']); + $this->chunk_split = $params['chunk_split']; + $method = ($params['method']?$params['method']:"publish"); + + $string_array = Array( + 'summary' => 'description', + 'location' => 'location', + 'description' => 'title', + 'uid' => 'uid' + ); + + $cats = CreateObject('phpgwapi.categories'); + + include(PHPGW_SERVER_ROOT.'/calendar/setup/setup.inc.php'); + if(!is_array($event_id)) + { + $ids[] = $event_id; + } + else + { + $ids = $event_id; + } + + $ical = $this->new_ical(); + + $this->set_var($ical['prodid'],'value','-//phpGroupWare//phpGroupWare '.$setup_info['calendar']['version'].' MIMEDIR//'.strtoupper($GLOBALS['phpgw_info']['user']['preferences']['common']['lang'])); + $this->set_var($ical['version'],'value','2.0'); + $this->set_var($ical['method'],'value',strtoupper($method)); + + if(!$GLOBALS['phpgw_info']['flags']['included_classes']['uicalendar']) + { + if(!$GLOBALS['phpgw_info']['flags']['included_classes']['bocalendar']) + { + $so_event = createobject('calendar.socalendar', + Array( + 'owner' => 0, + 'filter' => '', + 'category' => '' + ) + ); + } + else + { + $so_event = $GLOBALS['bocalendar']->so; + } + } + else + { + $so_event = $GLOBALS['uicalendar']->bo->so; + } + + $profile = false; + if ($profile) echo "3271: ".time()."\n"; + while(list($key,$value) = each($ids)) + { + $ical_event = Array(); + $event = $so_event->read_entry($value); + + if($event['alarm']) + { + if ($profile) echo "3279: ".time()."\n"; + while(list($dummy,$alarm) = each($event['alarm'])) + { + $ical_temp = Array(); + $ical_temp['action']['value'] = 'DISPLAY'; + $ical_temp['description']['value'] = $alarm['text']; + $this->set_var($ical_temp['trigger'],'value','VALUE=DATE-TIME:'.date('Ymd\THis\Z',$alarm['time']),'valarm'); + $ical_event['alarm'][] = $ical_temp; + } + } + + // use system's date info for caluculating local timezone's offset in minutes + // + $gmt_offset = date('O',$GLOBALS['phpgw']->datetime->users_localtime); // offset to GMT + $offset = intval(substr($gmt_offset, 1, 2)) * 60 + intval(substr($gmt_offset, 3, 2)); + if ($offset > 0) + { + $event['start']['min'] -= $offset; + $event['end']['min'] -= $offset; + $event['modtime']['min'] -= $offset; + } + + $ical_event['priority'] = $event['priority']; + $ical_event['class'] = intval($event['public']); + $dtstart_mktime = $so_event->maketime($event['start']); + $this->parse_value($ical_event,'dtstart',date('Ymd\THis\Z',$dtstart_mktime),'vevent'); + $dtend_mktime = $so_event->maketime($event['end']); + $this->parse_value($ical_event,'dtend',date('Ymd\THis\Z',$dtend_mktime),'vevent'); + $mod_mktime = $so_event->maketime($event['modtime']); + $this->parse_value($ical_event,'last_modified',date('Ymd\THis\Z',$mod_mktime),'vevent'); + @reset($string_array); + if ($profile) echo "3310: ".time()."\n"; + while(list($ical_value,$event_value) = each($string_array)) + { + if($event[$event_value]) + { + $this->set_var($ical_event[$ical_value],'value',$event[$event_value]); + } + } + + if ($event['category']) + { + $cats->categories(0,'calendar'); + $category = explode(',',$event['category']); + @reset($category); + if ($profile) echo "3324: ".time()."\n"; + while(list($key,$cat) = each($category)) + { + $_cat = $cats->return_single($cat); + $cat_string[] = $_cat[0]['name']; + } + @reset($cat_string); + $this->set_var($ical_event['categories'],'value',implode($cat_string,',')); + } + + if(count($event['participants']) > 1) + { + if(!is_object($db)) + { + $db = $GLOBALS['phpgw']->db; + } + @reset($event['participants']); + if ($profile) echo "3341: ".time()." ".count($event['participants'])."\n"; + while(list($part,$status) = each($event['participants'])) + { + $GLOBALS['phpgw']->accounts->get_account_name($part,$lid,$fname,$lname); + $name = $fname.' '.$lname; + + /* This seriously slows down the exporting process and all it does is adding some contact info + * that we don't need anyway. + */ + $owner_status = $this->switch_partstat(intval($this->switch_phpgw_status($event['participants'][$part]))); + $mail_prefs = $GLOBALS['phpgw']->preferences->create_email_preferences($part); + $mailto = $mail_prefs['email']['address']; + + $str = 'CN="'.$name.'";PARTSTAT='.$owner_status.':'.$mailto; + if($part == $event['owner']) + { + $str = 'ROLE=CHAIR;'.$str; + } + else + { + $str = 'ROLE=REQ-PARTICIPANT;'.$str; + } + if ($method != 'reply' || $part == $GLOBALS['phpgw_info']['user']['account_id']) + { + $this->parse_value($ical_event,'attendee',$str,'vevent'); + } + if($part == $event['owner']) + { + $this->parse_value($ical_event,'organizer',$str,'vevent'); + } + } + } + if($event['recur_type']) + { + $str = ''; + switch($event['recur_type']) + { + case MCAL_RECUR_DAILY: + $str .= 'FREQ=DAILY'; + break; + case MCAL_RECUR_WEEKLY: + $str .= 'FREQ=WEEKLY'; + if($event['recur_data']) + { + $str .= ';BYDAY='; + for($i=1;$imaketime($event['recur_enddate']) - $GLOBALS['phpgw']->datetime->tz_offset; + $str .= ';UNTIL='.date('Ymd\THis\Z',$recur_mktime); + } + $this->parse_value($ical_event,'rrule',$str,'vevent'); + + $exceptions = $event['recur_exception']; + if(is_array($exceptions)) + { + @reset($exceptions); + if ($profile) echo "3440: ".time()."\n"; + while(list($key,$except_datetime) = each($exceptions)) + { + $ical_event['exdate'][] = $this->switch_date(date('Ymd\THis\Z',$except_datetime)); + } + } + } + $ical_events[] = $ical_event; + } + + $ical['event'] = $ical_events; + if ($profile) return "".time()."\n"; + else return $this->build_ical($ical); + } + + function debug($str='') + { + if($this->debug_str) + { + echo $str."
\n"; + } + } + } +?> diff -aburN --exclude='CVS*' phpgroupware/calendar/inc/class.uiicalendar.inc.php htdocs/calendar/inc/class.uiicalendar.inc.php --- phpgroupware/calendar/inc/class.uiicalendar.inc.php 2005-01-03 06:56:23.000000000 +0100 +++ htdocs/calendar/inc/class.uiicalendar.inc.php 2005-09-05 12:07:00.000000000 +0200 @@ -21,7 +21,8 @@ var $public_functions = array( 'test' => True, - 'import' => True + 'import' => True, + 'export' => True ); @@ -30,7 +31,7 @@ { $this->bo = CreateObject('calendar.boicalendar'); $this->template = $GLOBALS['phpgw']->template; - $GLOBALS['phpgw_info']['flags']['app_header'] = lang('Calendar - [iv]Cal Importer'); + } function print_test($val,$title,$x_pre='') @@ -164,8 +165,56 @@ echo "End Time : ".$GLOBALS['phpgw']->common->show_date()."
\n"; } + /* this function is made based on the 'ical.php' script by Dave Hall */ + function export() { + if (intval(@$_POST['prev']) == 0 && intval(@$_POST['adv']) == 0) { + $GLOBALS['phpgw_info']['flags']['app_header'] = lang('Calendar - iCal Exporter'); + unset($GLOBALS['phpgw_info']['flags']['noheader']); + unset($GLOBALS['phpgw_info']['flags']['nonavbar']); + $GLOBALS['phpgw']->common->phpgw_header(); + + $this->template->set_file( + Array( + 'icalexport' => 'ical_export.tpl' + ) + ); + $var = Array( + 'action_url' => $GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uiicalendar.export'), + 'prev' => lang('months back:'), + 'adv' => lang('months forward:'), + 'export' => lang('export') + ); + $this->template->set_var($var); + $this->template->pparse('out','icalexport'); + } else { + $prev = intval(@$_POST['prev']); + $adv = intval(@$_POST['adv']); + $uid = $phpgw_info['user']['account_id']; + + header('Content-type: text/calendar'); + header('Content-Disposition: filename=calendar.ics'); + + $so = createObject('calendar.socalendar', array('owner' => $uid) ); + $export = createObject('calendar.boicalendar'); + + list($start['d'], $start['m'], $start['y']) = explode('-', date('d-n-Y', strtotime("-$prev months"))); + list($end['d'], $end['m'], $end['y']) = explode('-', date('d-n-Y', strtotime("+$adv months"))); + $ids = $so->list_events($start['y'], $start['m'], $start['d'], $end['y'], $end['m'], $end['d']); + + //this is done so there is streaming output + foreach($ids as $id) + { + echo $export->export( array('l_event_id' => $id) ); + } + + // so that the file doesn't end with + exit(0); + } + } + function import() { + $GLOBALS['phpgw_info']['flags']['app_header'] = lang('Calendar - [iv]Cal Importer'); unset($GLOBALS['phpgw_info']['flags']['noheader']); unset($GLOBALS['phpgw_info']['flags']['nonavbar']); $GLOBALS['phpgw_info']['flags']['nonappheader'] = True; diff -aburN --exclude='CVS*' phpgroupware/calendar/inc/class.uiicalendar.inc.php~ htdocs/calendar/inc/class.uiicalendar.inc.php~ --- phpgroupware/calendar/inc/class.uiicalendar.inc.php~ 1970-01-01 01:00:00.000000000 +0100 +++ htdocs/calendar/inc/class.uiicalendar.inc.php~ 2005-09-05 12:07:00.000000000 +0200 @@ -0,0 +1,257 @@ + * + * http://www.radix.net/~cknudsen * + * Modified by Mark Peters * + * -------------------------------------------- * + * This program is free software; you can redistribute it and/or modify it * + * under the terms of the GNU General Public License as published by the * + * Free Software Foundation; either version 2 of the License, or (at your * + * option) any later version. * + \**************************************************************************/ + + /* $Id: class.uiicalendar.inc.php,v 1.3.2.2.2.3 2004/11/06 16:13:42 powerstat Exp $ */ + + class uiicalendar + { + var $bo; + var $template; + + var $public_functions = array( + 'test' => True, + 'import' => True, + 'export' => True + ); + + + + function uiicalendar() + { + $this->bo = CreateObject('calendar.boicalendar'); + $this->template = $GLOBALS['phpgw']->template; + + } + + function print_test($val,$title,$x_pre='') + { +// echo 'VAL = '._debug_array($val,False)."
\n"; + if(is_array($val)) + { + @reset($val); + while(list($key,$value) = each($val)) + { + if(is_array($key)) + { + $this->print_test($key,$title,$x_pre); + } + elseif(is_array($value)) + { + $this->print_test($value,$title,$x_pre); + } + else + { + if($x_pre && $key == 'name') + { + $x_key = $x_pre.$value; + list($key,$value) = each($val); + $key=$x_key; + } + if($this->bo->parameter[$key]['type'] == 'function') + { + $function = $this->bo->parameter[$key]['function']; + $v_value = $this->bo->$function($value); + } + else + { + $v_value = $value; + } + echo $title.' ('.$key.') = '.$v_value."
\n"; + } + } + } + elseif($val != '') + { + echo $title.' = '.$val."
\n"; + } + } + + function test() + { + $print_events = True; + + unset($GLOBALS['phpgw_info']['flags']['noheader']); + unset($GLOBALS['phpgw_info']['flags']['nonavbar']); + $GLOBALS['phpgw']->common->phpgw_header(); + + echo "Start Time : ".$GLOBALS['phpgw']->common->show_date()."
\n"; + @set_time_limit(0); + + $icsfile=PHPGW_APP_INC.'/events.ics'; + $fp=fopen($icsfile,'rt'); + $contents = explode("\n",fread($fp, filesize($icsfile))); + fclose($fp); + + $vcalendar = $this->bo->parse($contents); + + if($print_events) + { + $this->print_test($vcalendar['prodid'],'Product ID'); + $this->print_test($vcalendar['method'],'Method'); + $this->print_test($vcalendar['version'],'Version'); + + for($i=0;$i\nEVENT
\n"; +// echo 'TEST Debug : '._debug_array($event,False)."
\n"; + $this->print_test($event['uid'],'UID','X-'); + $this->print_test($event['valscale'],'Calscale','X-'); + $this->print_test($event['description'],'Description','X-'); + $this->print_test($event['summary'],'Summary','X-'); + $this->print_test($event['comment'],'Comment','X-'); + $this->print_test($event['location'],'Location','X-'); + $this->print_test($event['sequence'],'Sequence','X-'); + $this->print_test($event['priority'],'Priority','X-'); + $this->print_test($event['categories'],'Categories','X-'); + $this->print_test($event['dtstart'],'Date Start','X-'); + $this->print_test($event['dtstamp'],'Date Stamp','X-'); + $this->print_test($event['rrule'],'Recurrence','X-'); + + echo "Class = ".$this->bo->switch_class($event['class'])."
\n"; + + $this->print_test($event['organizer'],'Organizer','X-'); + $this->print_test($event['attendee'],'Attendee','X-'); + $this->print_test($event['x_type'],'X-Type','X-'); + $this->print_test($event['alarm'],'Alarm','X-'); + } + } + +/* + for($i=0;$itodo);$i++) + { + echo "
\nTODO
\n"; + if($vcalendar['todo'][$i]['summary']['value']) + { + echo "Summary = ".$vcalendar['todo'][$i]['summary']['value']."
\n"; + } + if($vcalendar['todo'][$i]['description']['value']) + { + echo "Description (Value) = ".$vcalendar['todo'][$i]['description']['value']."
\n"; + } + if($vcalendar['todo'][$i]['description']['altrep']) + { + echo "Description (Alt Rep) = ".$vcalendar['todo'][$i]['description']['altrep']."
\n"; + } + if($vcalendar['todo'][$i]['location']['value']) + { + echo "Location = ".$vcalendar['todo'][$i]['location']['value']."
\n"; + } + echo "Sequence = ".$vcalendar['todo'][$i]['sequence']."
\n"; + echo "Date Start : ".$GLOBALS['phpgw']->common->show_date(mktime($vcalendar['todo'][$i]['dtstart']['hour'],$vcalendar['todo'][$i]['dtstart']['min'],$vcalendar['todo'][$i]['dtstart']['sec'],$vcalendar['todo'][$i]['dtstart']['month'],$vcalendar['todo'][$i]['dtstart']['mday'],$vcalendar['todo'][$i]['dtstart']['year']) - $this->datatime->tz_offset)."
\n"; + echo "Class = ".$vcalendar['todo'][$i]['class']['value']."
\n"; + } + +*/ + include(PHPGW_APP_INC.'/../setup/setup.inc.php'); + + $this->bo->set_var($vcalendar['prodid'],'value','-//phpGroupWare//phpGroupWare '.$setup_info['calendar']['version'].' MIMEDIR//'.strtoupper($GLOBALS['phpgw_info']['user']['preferences']['common']['lang'])); + $this->bo->set_var($vcalendar['version'],'value','2.0'); + $this->bo->set_var($vcalendar['method'],'value',strtoupper('publish')); + echo "


\n"; + echo nl2br($this->bo->build_ical($vcalendar)); + echo "End Time : ".$GLOBALS['phpgw']->common->show_date()."
\n"; + } + + /* this function is made based on the 'ical.php' script by Dave Hall */ + function export() { + if (intval(@$_POST['prev']) == 0 && intval(@$_POST['adv']) == 0) { + $GLOBALS['phpgw_info']['flags']['app_header'] = lang('Calendar - iCal Exporter'); + unset($GLOBALS['phpgw_info']['flags']['noheader']); + unset($GLOBALS['phpgw_info']['flags']['nonavbar']); + $GLOBALS['phpgw']->common->phpgw_header(); + + $this->template->set_file( + Array( + 'icalexport' => 'ical_export.tpl' + ) + ); + $var = Array( + 'action_url' => $GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uiicalendar.export'), + 'prev' => lang('months back:'), + 'adv' => lang('months forward:'), + 'export' => lang('export') + ); + $this->template->set_var($var); + $this->template->pparse('out','icalexport'); + } else { + $prev = intval(@$_POST['prev']); + $adv = intval(@$_POST['adv']); + $uid = $phpgw_info['user']['account_id']; + + header('Content-type: text/calendar'); + header('Content-Disposition: filename=tbwbcalendar.ics'); + + $so = createObject('calendar.socalendar', array('owner' => $uid) ); + $export = createObject('calendar.boicalendar'); + + list($start['d'], $start['m'], $start['y']) = explode('-', date('d-n-Y', strtotime("-$prev months"))); + list($end['d'], $end['m'], $end['y']) = explode('-', date('d-n-Y', strtotime("+$adv months"))); + $ids = $so->list_events($start['y'], $start['m'], $start['d'], $end['y'], $end['m'], $end['d']); + + //this is done so there is streaming output + foreach($ids as $id) + { + echo $export->export( array('l_event_id' => $id) ); + } + + // so that the file doesn't end with + exit(0); + } + } + + function import() + { + $GLOBALS['phpgw_info']['flags']['app_header'] = lang('Calendar - [iv]Cal Importer'); + unset($GLOBALS['phpgw_info']['flags']['noheader']); + unset($GLOBALS['phpgw_info']['flags']['nonavbar']); + $GLOBALS['phpgw_info']['flags']['nonappheader'] = True; + $GLOBALS['phpgw_info']['flags']['nonappfooter'] = True; + $GLOBALS['phpgw']->common->phpgw_header(); + + if(!@is_dir($GLOBALS['phpgw_info']['server']['temp_dir'])) + { + mkdir($GLOBALS['phpgw_info']['server']['temp_dir'],0700); + } + + echo ''; + + $action = strtoupper(get_var('action', Array('GET'))); + if ($action == 'GETFILE') + { + echo '
' . lang('You must select a [iv]Cal. (*.[iv]cs)') . '


'; + } + + $this->template->set_file( + Array( + 'vcalimport' => 'vcal_import.tpl' + ) + ); + + $var = Array( + 'vcal_header' => '

', + 'ical_lang' => lang('(i/v)Cal'), + 'action_url' => $GLOBALS['phpgw']->link('/index.php','menuaction=calendar.boicalendar.import'), + 'lang_access' => lang('Access'), + 'lang_groups' => lang('Which groups'), + 'access_option'=> $access_option, + 'group_option' => $group_option, + 'load_vcal' => lang('Load [iv]Cal') + ); + $this->template->set_var($var); + $this->template->pparse('out','vcalimport'); + } + } +?> diff -aburN --exclude='CVS*' phpgroupware/calendar/inc/class.uiicalendar.inc.php.bak htdocs/calendar/inc/class.uiicalendar.inc.php.bak --- phpgroupware/calendar/inc/class.uiicalendar.inc.php.bak 1970-01-01 01:00:00.000000000 +0100 +++ htdocs/calendar/inc/class.uiicalendar.inc.php.bak 2005-09-02 14:35:07.000000000 +0200 @@ -0,0 +1,208 @@ + * + * http://www.radix.net/~cknudsen * + * Modified by Mark Peters * + * -------------------------------------------- * + * This program is free software; you can redistribute it and/or modify it * + * under the terms of the GNU General Public License as published by the * + * Free Software Foundation; either version 2 of the License, or (at your * + * option) any later version. * + \**************************************************************************/ + + /* $Id: class.uiicalendar.inc.php,v 1.3.2.2.2.3 2004/11/06 16:13:42 powerstat Exp $ */ + + class uiicalendar + { + var $bo; + var $template; + + var $public_functions = array( + 'test' => True, + 'import' => True + ); + + + + function uiicalendar() + { + $this->bo = CreateObject('calendar.boicalendar'); + $this->template = $GLOBALS['phpgw']->template; + $GLOBALS['phpgw_info']['flags']['app_header'] = lang('Calendar - [iv]Cal Importer'); + } + + function print_test($val,$title,$x_pre='') + { +// echo 'VAL = '._debug_array($val,False)."
\n"; + if(is_array($val)) + { + @reset($val); + while(list($key,$value) = each($val)) + { + if(is_array($key)) + { + $this->print_test($key,$title,$x_pre); + } + elseif(is_array($value)) + { + $this->print_test($value,$title,$x_pre); + } + else + { + if($x_pre && $key == 'name') + { + $x_key = $x_pre.$value; + list($key,$value) = each($val); + $key=$x_key; + } + if($this->bo->parameter[$key]['type'] == 'function') + { + $function = $this->bo->parameter[$key]['function']; + $v_value = $this->bo->$function($value); + } + else + { + $v_value = $value; + } + echo $title.' ('.$key.') = '.$v_value."
\n"; + } + } + } + elseif($val != '') + { + echo $title.' = '.$val."
\n"; + } + } + + function test() + { + $print_events = True; + + unset($GLOBALS['phpgw_info']['flags']['noheader']); + unset($GLOBALS['phpgw_info']['flags']['nonavbar']); + $GLOBALS['phpgw']->common->phpgw_header(); + + echo "Start Time : ".$GLOBALS['phpgw']->common->show_date()."
\n"; + @set_time_limit(0); + + $icsfile=PHPGW_APP_INC.'/events.ics'; + $fp=fopen($icsfile,'rt'); + $contents = explode("\n",fread($fp, filesize($icsfile))); + fclose($fp); + + $vcalendar = $this->bo->parse($contents); + + if($print_events) + { + $this->print_test($vcalendar['prodid'],'Product ID'); + $this->print_test($vcalendar['method'],'Method'); + $this->print_test($vcalendar['version'],'Version'); + + for($i=0;$i\nEVENT
\n"; +// echo 'TEST Debug : '._debug_array($event,False)."
\n"; + $this->print_test($event['uid'],'UID','X-'); + $this->print_test($event['valscale'],'Calscale','X-'); + $this->print_test($event['description'],'Description','X-'); + $this->print_test($event['summary'],'Summary','X-'); + $this->print_test($event['comment'],'Comment','X-'); + $this->print_test($event['location'],'Location','X-'); + $this->print_test($event['sequence'],'Sequence','X-'); + $this->print_test($event['priority'],'Priority','X-'); + $this->print_test($event['categories'],'Categories','X-'); + $this->print_test($event['dtstart'],'Date Start','X-'); + $this->print_test($event['dtstamp'],'Date Stamp','X-'); + $this->print_test($event['rrule'],'Recurrence','X-'); + + echo "Class = ".$this->bo->switch_class($event['class'])."
\n"; + + $this->print_test($event['organizer'],'Organizer','X-'); + $this->print_test($event['attendee'],'Attendee','X-'); + $this->print_test($event['x_type'],'X-Type','X-'); + $this->print_test($event['alarm'],'Alarm','X-'); + } + } + +/* + for($i=0;$itodo);$i++) + { + echo "
\nTODO
\n"; + if($vcalendar['todo'][$i]['summary']['value']) + { + echo "Summary = ".$vcalendar['todo'][$i]['summary']['value']."
\n"; + } + if($vcalendar['todo'][$i]['description']['value']) + { + echo "Description (Value) = ".$vcalendar['todo'][$i]['description']['value']."
\n"; + } + if($vcalendar['todo'][$i]['description']['altrep']) + { + echo "Description (Alt Rep) = ".$vcalendar['todo'][$i]['description']['altrep']."
\n"; + } + if($vcalendar['todo'][$i]['location']['value']) + { + echo "Location = ".$vcalendar['todo'][$i]['location']['value']."
\n"; + } + echo "Sequence = ".$vcalendar['todo'][$i]['sequence']."
\n"; + echo "Date Start : ".$GLOBALS['phpgw']->common->show_date(mktime($vcalendar['todo'][$i]['dtstart']['hour'],$vcalendar['todo'][$i]['dtstart']['min'],$vcalendar['todo'][$i]['dtstart']['sec'],$vcalendar['todo'][$i]['dtstart']['month'],$vcalendar['todo'][$i]['dtstart']['mday'],$vcalendar['todo'][$i]['dtstart']['year']) - $this->datatime->tz_offset)."
\n"; + echo "Class = ".$vcalendar['todo'][$i]['class']['value']."
\n"; + } + +*/ + include(PHPGW_APP_INC.'/../setup/setup.inc.php'); + + $this->bo->set_var($vcalendar['prodid'],'value','-//phpGroupWare//phpGroupWare '.$setup_info['calendar']['version'].' MIMEDIR//'.strtoupper($GLOBALS['phpgw_info']['user']['preferences']['common']['lang'])); + $this->bo->set_var($vcalendar['version'],'value','2.0'); + $this->bo->set_var($vcalendar['method'],'value',strtoupper('publish')); + echo "


\n"; + echo nl2br($this->bo->build_ical($vcalendar)); + echo "End Time : ".$GLOBALS['phpgw']->common->show_date()."
\n"; + } + + function import() + { + unset($GLOBALS['phpgw_info']['flags']['noheader']); + unset($GLOBALS['phpgw_info']['flags']['nonavbar']); + $GLOBALS['phpgw_info']['flags']['nonappheader'] = True; + $GLOBALS['phpgw_info']['flags']['nonappfooter'] = True; + $GLOBALS['phpgw']->common->phpgw_header(); + + if(!@is_dir($GLOBALS['phpgw_info']['server']['temp_dir'])) + { + mkdir($GLOBALS['phpgw_info']['server']['temp_dir'],0700); + } + + echo ''; + + $action = strtoupper(get_var('action', Array('GET'))); + if ($action == 'GETFILE') + { + echo '

' . lang('You must select a [iv]Cal. (*.[iv]cs)') . '


'; + } + + $this->template->set_file( + Array( + 'vcalimport' => 'vcal_import.tpl' + ) + ); + + $var = Array( + 'vcal_header' => '

', + 'ical_lang' => lang('(i/v)Cal'), + 'action_url' => $GLOBALS['phpgw']->link('/index.php','menuaction=calendar.boicalendar.import'), + 'lang_access' => lang('Access'), + 'lang_groups' => lang('Which groups'), + 'access_option'=> $access_option, + 'group_option' => $group_option, + 'load_vcal' => lang('Load [iv]Cal') + ); + $this->template->set_var($var); + $this->template->pparse('out','vcalimport'); + } + } +?> diff -aburN --exclude='CVS*' phpgroupware/calendar/inc/hook_sidebox_menu.inc.php htdocs/calendar/inc/hook_sidebox_menu.inc.php --- phpgroupware/calendar/inc/hook_sidebox_menu.inc.php 2004-01-08 22:58:56.000000000 +0100 +++ htdocs/calendar/inc/hook_sidebox_menu.inc.php 2005-09-05 09:46:57.000000000 +0200 @@ -43,6 +43,9 @@ 'url' => $GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uicalendar.matrixselect')), array('text' => 'Import', 'url' =>$GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uiicalendar.import')), + array('text' => 'Export', + 'url' =>$GLOBALS['phpgw']->link('/index.php', 'menuaction=calendar.uiicalendar.export')) + ); display_sidebox($appname,$menu_title,$file); diff -aburN --exclude='CVS*' phpgroupware/calendar/inc/hook_sidebox_menu.inc.php~ htdocs/calendar/inc/hook_sidebox_menu.inc.php~ --- phpgroupware/calendar/inc/hook_sidebox_menu.inc.php~ 1970-01-01 01:00:00.000000000 +0100 +++ htdocs/calendar/inc/hook_sidebox_menu.inc.php~ 2005-09-05 09:46:57.000000000 +0200 @@ -0,0 +1,82 @@ + * + * -------------------------------------------- * + * This program is free software; you can redistribute it and/or modify it * + * under the terms of the GNU General Public License as published by the * + * Free Software Foundation; either version 2 of the License, or (at your * + * option) any later version. * + \**************************************************************************/ + + /* $Id: hook_sidebox_menu.inc.php,v 1.1.2.6 2004/01/08 21:58:56 skwashd Exp $ */ +{ + + /* + This hookfile is for generating an app-specific side menu used in the idots + template set. + + $menu_title speaks for itself + $file is the array with link to app functions + + display_sidebox can be called as much as you like + */ + + $menu_title = $GLOBALS['phpgw_info']['apps'][$appname]['title'] . ' '. lang('Menu'); + $file = Array( + array('text' => 'New Entry', + 'url' => $GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uicalendar.add')), + array('text' => '_NewLine_'), + array('text' => 'Today', + 'url' => $GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uicalendar.day')), + array('text' => 'This week', + 'url' => $GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uicalendar.week')), + array('text' => 'This month', + 'url' => $GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uicalendar.month')), + array('text' => 'This year', + 'url' => $GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uicalendar.year')), + array('text' => '_NewLine_'), // give a newline + array('text' => 'Group Planner', + 'url' => $GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uicalendar.planner')), + array('text' => 'Daily Matrix View', + 'url' => $GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uicalendar.matrixselect')), + array('text' => 'Import', + 'url' =>$GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uiicalendar.import')), + array('text' => 'Export Function', + 'url' =>$GLOBALS['phpgw']->link('/index.php', 'menuaction=calendar.uiicalendar.export')) + + ); + display_sidebox($appname,$menu_title,$file); + + if ($GLOBALS['phpgw_info']['user']['apps']['preferences']) + { + $menu_title = lang('Preferences'); + $file = Array( + array('text' => 'Calendar preferences', + 'url' =>$GLOBALS['phpgw']->link('/preferences/preferences.php','appname=calendar')), + array('text' => 'Grant Access', + 'url' =>$GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app=calendar')), + array('text' => 'Edit Categories', + 'url' =>$GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uicategories.index&cats_app=calendar&cats_level=True&global_cats=True')), + ); + display_sidebox($appname,$menu_title,$file); + } + + if ($GLOBALS['phpgw_info']['user']['apps']['admin']) + { + $menu_title = lang('Administration'); + $file = Array( + array('text' => 'Configuration', + 'url' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiconfig.index&appname=calendar')), + array('text' => 'Custom Fields', + 'url' =>$GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uicustom_fields.index')), + array('text' => 'Holiday Management', + 'url' =>$GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uiholiday.admin')), + array('text' => 'Global Categories', + 'url' =>$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index&appname=calendar')), + ); + display_sidebox($appname,$menu_title,$file); + } +} +?> diff -aburN --exclude='CVS*' phpgroupware/calendar/setup/phpgw_en.lang htdocs/calendar/setup/phpgw_en.lang --- phpgroupware/calendar/setup/phpgw_en.lang 2005-01-03 06:56:24.000000000 +0100 +++ htdocs/calendar/setup/phpgw_en.lang 2005-09-05 10:57:07.000000000 +0200 @@ -138,6 +138,8 @@ modify list of external participants calendar en Modify List of External Participants mon calendar en Mon month calendar en Month +months back: calendar en Months backward: +months forward: calendar en Months forward: monthly calendar en Monthly monthly (by date) calendar en Monthly (by date) monthly (by day) calendar en Monthly (by day) diff -aburN --exclude='CVS*' phpgroupware/calendar/setup/phpgw_en.lang~ htdocs/calendar/setup/phpgw_en.lang~ --- phpgroupware/calendar/setup/phpgw_en.lang~ 1970-01-01 01:00:00.000000000 +0100 +++ htdocs/calendar/setup/phpgw_en.lang~ 2005-09-05 10:57:07.000000000 +0200 @@ -0,0 +1,306 @@ +%1 %2 in %3 calendar en %1 %2 in %3 +%1 matches found calendar en %1 matches found +%1 records imported calendar en %1 records imported +%1 records read (not yet imported, you may go back and uncheck test import) calendar en %1 records read (not yet imported, you may go back and uncheck Test Import) +(for weekly) calendar en (for Weekly) +(i/v)cal calendar en (i/v)Cal +1 match found calendar en 1 match found +a calendar en a +accept calendar en Accept +accepted calendar en Accepted +action that caused the notify: added, canceled, accepted, rejected, ... calendar en Action that caused the notify: Added, Canceled, Accepted, Rejected, ... +add a single entry by passing the fields. calendar en Add a single entry by passing the fields. +add alarm calendar en Add Alarm +add contact calendar en Add Contact +added calendar en Added +address book calendar en Address Book +alarm calendar en alarm +alarm for %1 at %2 in %3 calendar en Alarm for %1 at %2 in %3 +alarm management calendar en Alarm Management +alarm-management calendar en Alarm-Management +alarms calendar en Alarms +all day calendar en All Day +are you sure you want to delete this country ? calendar en Are you sure you want to delete this Country ? +are you sure you want to delete this holiday ? calendar en Are you sure you want to delete this holiday ? +are you sure\nyou want to\ndelete these alarms? calendar en Are you sure\nyou want to\ndelete these alarms? +are you sure\nyou want to\ndelete this entry ? calendar en Are you sure\nyou want to\ndelete this entry ? +are you sure\nyou want to\ndelete this entry ?\n\nthis will delete\nthis entry for all users. calendar en Are you sure\nyou want to\ndelete this entry ?\n\nThis will delete\nthis entry for all users. +are you sure\nyou want to\ndelete this single occurence ?\n\nthis will delete\nthis entry for all users. calendar en Are you sure\nyou want to\ndelete this single occurence ?\n\nThis will delete\nthis entry for all users. +before the event calendar en before the event +brief description calendar en Brief Description +business calendar en Business +calendar common en Calendar +calendar - add calendar en Calendar - Add +calendar - edit calendar en Calendar - Edit +calendar - [iv]cal importer calendar en Calendar - [iv]Cal Importer +calendar event calendar en Calendar Event +calendar holiday management admin en Calendar Holiday Management +calendar preferences calendar en Calendar Preferences +calendar settings admin en Calendar Settings +calendar-fieldname calendar en Calendar-Fieldname +canceled calendar en Canceled +change all events for $params['old_owner'] to $params['new_owner']. calendar en Change all events for $params['old_owner'] to $params['new_owner']. +change status calendar en Change Status +click %1here%2 to return to the calendar. calendar en Click %1here%2 to return to the calendar. +configuration calendar en Configuration +countries calendar en Countries +country calendar en Country +csv-fieldname calendar en CSV-Fieldname +csv-filename calendar en CSV-Filename +custom fields calendar en Custom Fields +custom fields and sorting common en Custom fields and sorting +daily calendar en Daily +daily matrix view calendar en Daily Matrix View +days calendar en days +days repeated calendar en days repeated +dayview calendar en Dayview +default appointment length (in minutes) calendar en default appointment length (in minutes) +default calendar filter calendar en Default calendar filter +default calendar view calendar en Default calendar view +default length of newly created events. the length is in minutes, eg. 60 for 1 hour. calendar en Default length of newly created events. The length is in minutes, eg. 60 for 1 hour. +defines the size in minutes of the lines in the day view. calendar en Defines the size in minutes of the lines in the day view. +delete a single entry by passing the id. calendar en Delete a single entry by passing the id. +delete an entire users calendar. calendar en Delete an entire users calendar. +delete selected contacts calendar en Delete selected contacts +delete series calendar en Delete Series +delete single calendar en Delete Single +deleted calendar en Deleted +description calendar en DESCRIPTION +display interval in day view calendar en Display interval in Day View +display mini calendars when printing calendar en Display mini calendars when printing +display status of events calendar en Display Status of Events +displays your default calendar view on the startpage (page you get when you enter phpgroupware or click on the homepage icon)? calendar en Displays your default calendar view on the startpage (page you get when you enter phpGroupWare or click on the homepage icon)? +do you want to be notified about new or changed appointments? you be notified about changes you make yourself.
you can limit the notifications to certain changes only. each item includes all the notification listed above it. all modifications include changes of title, description, participants, but no participant responses. if the owner of an event requested any notifcations, he will always get the participant responses like acceptions and rejections too. calendar en Do you want to be notified about new or changed appointments? You be notified about changes you make yourself.
You can limit the notifications to certain changes only. Each item includes all the notification listed above it. All modifications include changes of title, description, participants, but no participant responses. If the owner of an event requested any notifcations, he will always get the participant responses like acceptions and rejections too. +do you want to receive a regulary summary of your appointsments via email?
the summary is sent to your standard email-address on the morning of that day or on monday for weekly summarys.
it is only sent when you have any appointments on that day or week. calendar en Do you want to receive a regulary summary of your appointsments via email?
The summary is sent to your standard email-address on the morning of that day or on Monday for weekly summarys.
It is only sent when you have any appointments on that day or week. +do you wish to autoload calendar holidays files dynamically? admin en Do you wish to autoload calendar holidays files dynamically? +download calendar en Download +duration calendar en Duration +edit series calendar en Edit Series +edit single calendar en Edit Single +email reminder calendar en Email reminder +end date/time calendar en End Date/Time +enddate calendar en Enddate +ends calendar en ends +enter output filename: ( .vcs appended ) calendar en Enter Output Filename: ( .vcs appended ) +event details follow calendar en Event Details Follow +exceptions calendar en Exceptions +export calendar en Export +export a list of entries in ical format. calendar en Export a list of entries in iCal format. +extended calendar en Extended +extended updates always include the complete event-details. ical's can be imported by certain other calendar-applications. calendar en Extended updates always include the complete event-details. iCal's can be imported by certain other calendar-applications. +external participants calendar en External Participants +failed sending message to '%1' #%2 subject='%3', sender='%4' !!! calendar en Failed sending message to '%1' #%2 subject='%3', sender='%4' !!! +fieldseparator calendar en Fieldseparator +firstname of person to notify calendar en Firstname of person to notify +format of event updates calendar en Format of event updates +fr calendar en F +free/busy calendar en Free/Busy +frequency calendar en Frequency +fri calendar en Fri +full description calendar en Full Description +fullname of person to notify calendar en Fullname of person to notify +generate printer-friendly version calendar en Generate printer-friendly version +global categories calendar en Global Categories +global public and group public calendar en Global Public and group public +global public only calendar en Global Public Only +go! calendar en Go! +grant calendar access common en Grant Calendar Access +group planner calendar en Group Planner +group public only calendar en Group Public Only +here is your requested alarm. calendar en Here is your requested alarm. +high priority calendar en high priority +holiday calendar en Holiday +holiday management calendar en Holiday Management +holiday-management calendar en Holiday-Management +holidays calendar en Holidays +hours calendar en hours +i participate calendar en I Participate +ical / rfc2445 calendar en iCal / rfc2445 +if checked holidays falling on a weekend, are taken on the monday after. calendar en If checked holidays falling on a weekend, are taken on the monday after. +ignore conflict calendar en Ignore Conflict +import calendar en Import +import csv-file into calendar calendar en Import CSV-File into Calendar +interval calendar en Interval +intervals in day view calendar en Intervals in day view +intervals per day in planner view calendar en Intervals per day in planner view +invalid entry id. calendar en Invalid entry id. +last calendar en last +lastname of person to notify calendar en Lastname of person to notify +length shown
(emtpy for full length) calendar en Length shown
(emtpy for full length) +length
(<= 255) calendar en Length
(<= 255) +load [iv]cal calendar en Load [iv]Cal +location calendar en Location +location to autoload from admin en Location to autoload from +matrixview calendar en Matrixview +minutes calendar en minutes +mo calendar en M +modified calendar en Modified +modify list of external participants calendar en Modify List of External Participants +mon calendar en Mon +month calendar en Month +months back: calendar en Months backwards: +months forward: calendar en Months forwards: +monthly calendar en Monthly +monthly (by date) calendar en Monthly (by date) +monthly (by day) calendar en Monthly (by day) +monthview calendar en Monthview +new entry calendar en New Entry +new name must not exist and not be empty!!! calendar en New name must not exist and not be empty!!! +no matches found calendar en No matches found +no response calendar en No Response +notification messages for added events calendar en Notification messages for added events +notification messages for canceled events calendar en Notification messages for canceled events +notification messages for modified events calendar en Notification messages for modified events +notification messages for your alarms calendar en Notification messages for your alarms +notification messages for your responses calendar en Notification messages for your responses +number of intervals per day in planner view calendar en Number of Intervals per Day in Planner View +number of months calendar en Number of months +number of records to read (<=200) calendar en Number of records to read (<=200) +observance rule calendar en Observance Rule +occurence calendar en Occurence +old startdate calendar en Old Startdate +olddate calendar en OldDate +on %1 %2 %3 your meeting request for %4 calendar en On %1 %2 %3 your meeting request for %4 +on all changes calendar en on all changes +on all modification, but responses calendar en on all modification, but responses +on any time change too calendar en on any time change too +on invitation / cancelation only calendar en on invitation / cancelation only +on participant responses too calendar en on participant responses too +on time change of more than 4 hours too calendar en on time change of more than 4 hours too +order calendar en Order +overlap holiday calendar en overlap holiday +participant calendar en Participant +participants calendar en Participants +participates calendar en Participates +people holiday calendar en people holiday +permission denied calendar en Permission denied +planner calendar en Planner +planner by category calendar en Planner by category +planner by user calendar en Planner by user +please confirm,accept,reject or examine changes in the corresponding entry in your calendar calendar en Please confirm, accept, reject or examine changes in the corresponding entry in your calendar +preselected group for entering the planner calendar en Preselected group for entering the planner +print calendars in black & white calendar en Print calendars in black & white +print the mini calendars calendar en Print the mini calendars +printer friendly calendar en Printer Friendly +privat calendar en Privat +private and global public calendar en Private and Global Public +private and group public calendar en Private and Group Public +private only calendar en Private Only +re-edit event calendar en Re-Edit Event +read a list of entries. calendar en Read a list of entries. +read a single entry by passing the id and fieldlist. calendar en Read a single entry by passing the id and fieldlist. +read this list of methods. calendar en Read this list of methods. +receive email updates calendar en Receive email updates +receive extra information in event mails calendar en Receive extra information in event mails +receive summary of appointments calendar en Receive summary of appointments +recurring event calendar en recurring event +refresh calendar en Refresh +reinstate calendar en Reinstate +rejected calendar en Rejected +repeat day calendar en Repeat day +repeat end date calendar en Repeat End date +repeat type calendar en Repeat type +repeating event information calendar en Repeating Event Information +repetition calendar en Repetition +repetitiondetails (or empty) calendar en Repetitiondetails (or empty) +reset calendar en Reset +rule calendar en Rule +sa calendar en Sa +sat calendar en Sat +scheduling conflict calendar en Scheduling Conflict +search results calendar en Search Results +selected contacts (%1) calendar en Selected contacts (%1) +send updates via email common en Send updates via EMail +send/receive updates via email calendar en Send/Receive updates via EMail +set a year only for one-time / non-regular holidays. calendar en Set a Year only for one-time / non-regular holidays. +set new events to private calendar en Set new events to private +should invitations you rejected still be shown in your calendar ?
you can only accept them later (eg. when your scheduling conflict is removed), if they are still shown in your calendar! calendar en Should invitations you rejected still be shown in your calendar ?
You can only accept them later (eg. when your scheduling conflict is removed), if they are still shown in your calendar! +should new events created as private by default ? calendar en Should new events created as private by default ? +should the mini calendars by printed / displayed in the printer friendly views ? calendar en Should the mini calendars by printed / displayed in the printer friendly views ? +should the printer friendly view be in black & white or in color (as in normal view)? calendar en Should the printer friendly view be in black & white or in color (as in normal view)? +should the status of the event-participants (accept, reject, ...) be shown in brakets after each participants name ? calendar en Should the status of the event-participants (accept, reject, ...) be shown in brakets after each participants name ? +show day view on main screen calendar en show day view on main screen +show default view on main screen calendar en Show default view on main screen +show high priority events on main screen calendar en Show high priority events on main screen +show invitations you rejected calendar en Show invitations you rejected +single event calendar en single event +sorry, the owner has just deleted this event calendar en Sorry, the owner has just deleted this event +sorry, this event does not exist calendar en Sorry, this event does not exist +sorry, this event does not have exceptions defined calendar en Sorry, this event does not have exceptions defined +sort by calendar en Sort by +specifies the the number of intervals shown in the planner view. calendar en Specifies the the number of intervals shown in the planner view. +start date/time calendar en Start Date/Time +start- and enddates calendar en Start- and Enddates +startdate calendar en Startdate +startrecord calendar en Startrecord +su calendar en Su +submit to repository calendar en Submit to Repository +sun calendar en Sun +tentative calendar en Tentative +test import (show importable records only in browser) calendar en Test Import (show importable records only in browser) +text calendar en Text +th calendar en T +the following conflicts with the suggested time:

    %1
calendar en The following conflicts with the suggested time:
    %1
+the user %1 is not participating in this event! calendar en The user %1 is not participating in this event! +there was an error trying to connect to your news server.
please contact your admin to check the news servername, username or password. calendar en There was an error trying to connect to your news server.
Please contact your admin to check the news servername, username or password. +this day is shown as first day in the week or month view. calendar en This day is shown as first day in the week or month view. +this defines the end of your dayview. events after this time, are shown below the dayview. calendar en This defines the end of your dayview. Events after this time, are shown below the dayview. +this defines the start of your dayview. events before this time, are shown above the dayview.
this time is also used as a default starttime for new events. calendar en This defines the start of your dayview. Events before this time, are shown above the dayview.
This time is also used as a default starttime for new events. +this group that is preselected when you enter the planner. you can change it in the planner anytime you want. calendar en This group that is preselected when you enter the planner. You can change it in the planner anytime you want. +this is mostly caused by a not or wrongly configured smtp server. notify your administrator. calendar en This is mostly caused by a not or wrongly configured SMTP server. Notify your administrator. +this message is sent for canceled or deleted events. calendar en This message is sent for canceled or deleted events. +this message is sent for modified or moved events. calendar en This message is sent for modified or moved events. +this message is sent to every participant of events you own, who has requested notifcations about new events.
you can use certain variables which get substituted with the data of the event. the first line is the subject of the email. calendar en This message is sent to every participant of events you own, who has requested notifcations about new events.
You can use certain variables which get substituted with the data of the event. The first line is the subject of the email. +this message is sent when you accept, tentative accept or reject an event. calendar en This message is sent when you accept, tentative accept or reject an event. +this message is sent when you set an alarm for a certain event. include all information you might need. calendar en This message is sent when you set an Alarm for a certain event. Include all information you might need. +this month calendar en This month +this week calendar en This week +this year calendar en This year +thu calendar en Thu +title calendar en TITLE +title of the event calendar en Title of the event +title-row calendar en Title-row +to-firstname calendar en To-Firstname +to-fullname calendar en To-Fullname +to-lastname calendar en To-Lastname +today calendar en Today +translation calendar en Translation +tu calendar en T +tue calendar en Tue +update a single entry by passing the fields. calendar en Update a single entry by passing the fields. +updated calendar en Updated +use end date calendar en Use End date +view this entry calendar en View this entry +we calendar en W +wed calendar en Wed +week calendar en Week +weekday starts on calendar en Weekday starts on +weekly calendar en Weekly +weekview calendar en Weekview +when creating new events default set to private calendar en When creating new events default set to private +which events do you want to see when you enter the calendar. calendar en Which events do you want to see when you enter the calendar. +which of calendar view do you want to see, when you start calendar ? calendar en Which of calendar view do you want to see, when you start calendar ? +work day ends on calendar en Work day ends on +work day starts on calendar en Work day starts on +workdayends calendar en workdayends +yearly calendar en Yearly +yearview calendar en Yearview +you can either set a year or a occurence, not both !!! calendar en You can either set a Year or a Occurence, not both !!! +you can only set a year or a occurence !!! calendar en You can only set a year or a occurence !!! +you do not have permission to add alarms to this event !!! calendar en You do not have permission to add alarms to this event !!! +you do not have permission to delete this alarm !!! calendar en You do not have permission to delete this alarm !!! +you do not have permission to enable/disable this alarm !!! calendar en You do not have permission to enable/disable this alarm !!! +you do not have permission to read this record! calendar en You do not have permission to read this record! +you have %1 high priority events on your calendar today. common en You have %1 high priority events on your calendar today. +you have 1 high priority event on your calendar today. common en You have 1 high priority event on your calendar today. +you have a meeting scheduled for %1 calendar en You have a meeting scheduled for %1 +you have not entered a title calendar en You have not entered a title +you have not entered a valid date calendar en You have not entered a valid date +you have not entered a valid time of day calendar en You have not entered a valid time of day +you have not entered participants calendar en You have not entered participants +you must enter one or more search keywords calendar en You must enter one or more search keywords +you must select a [iv]cal. (*.[iv]cs) calendar en You must select a [iv]Cal. (*.[iv]cs) +you need to set either a day or a occurence !!! calendar en You need to set either a day or a occurence !!! +your meeting scheduled for %1 has been canceled calendar en Your meeting scheduled for %1 has been canceled +your meeting that had been scheduled for %1 has been rescheduled to %2 calendar en Your meeting that had been scheduled for %1 has been rescheduled to %2 +your suggested time of %1 - %2 conflicts with the following existing calendar entries: calendar en Your suggested time of %1 - %2 conflicts with the following existing calendar entries: diff -aburN --exclude='CVS*' phpgroupware/calendar/setup/phpgw_nl.lang htdocs/calendar/setup/phpgw_nl.lang --- phpgroupware/calendar/setup/phpgw_nl.lang 2003-10-20 22:14:51.000000000 +0200 +++ htdocs/calendar/setup/phpgw_nl.lang 2005-09-05 10:57:33.000000000 +0200 @@ -8,8 +8,8 @@ a calendar nl een accept calendar nl Accepteren accepted calendar nl Geaccepteerd -action that caused the notify: added, canceled, accepted, rejected, ... calendar nl -add a single entry by passing the fields. calendar nl +action that caused the notify: added, canceled, accepted, rejected, ... calendar nl Acties die deze melding veroorzaken: toegevoegd, geannuleerd, geaccepteerd, verworpen, ... +add a single entry by passing the fields. calendar nl Voeg een enkele regel toe door de velden door te passen. add alarm calendar nl Alarm toevoegen add contact calendar nl Contact toevoegen added calendar nl Toegevoegd @@ -39,16 +39,16 @@ calendar settings admin nl Kalender instellingen calendar-fieldname calendar nl Kalender veldnaam canceled calendar nl Afgezegd -change all events for $params['old_owner'] to $params['new_owner']. calendar nl +change all events for $params['old_owner'] to $params['new_owner']. calendar nl Wijzig alle gebeurtenissen voor $params['old_owner'] naar $params['new_owner']. change status calendar nl Wijzig status click %1here%2 to return to the calendar. calendar nl Klik %1hier%2 om terug naar de kalender te gaan. configuration calendar nl Configuratie countries calendar nl Landen country calendar nl Land -csv-fieldname calendar nl -csv-filename calendar nl +csv-fieldname calendar nl CSV-veldnaam +csv-filename calendar nl CVS-bestandsnaam custom fields calendar nl Eigen Velden -custom fields and sorting common nl +custom fields and sorting common nl Eigen velden en sorteren daily calendar nl Dagelijks daily matrix view calendar nl Dagelijks matrix overzicht days calendar nl dagen @@ -57,9 +57,9 @@ default appointment length (in minutes) calendar nl standaard afspraak lengte (minuten) default calendar filter calendar nl Standaard kalender filter default calendar view calendar nl Standaard kalender overzicht -default length of newly created events. the length is in minutes, eg. 60 for 1 hour. calendar nl -defines the size in minutes of the lines in the day view. calendar nl -delete a single entry by passing the id. calendar nl +default length of newly created events. the length is in minutes, eg. 60 for 1 hour. calendar nl Standaard lengte van nieuwe gebeurtenissen, in minuten. +defines the size in minutes of the lines in the day view. calendar nl Bepaalt de grootte in minuten van de regel in de dag view. +delete a single entry by passing the id. calendar nl Verwijder een enkele entry door het ID door te geven. delete an entire users calendar. calendar nl Volledig verwijderen van gebruikerskalender delete selected contacts calendar nl Verwijder geselecteerde contacten delete series calendar nl Verwijder serie @@ -82,18 +82,18 @@ end date/time calendar nl Einddatum/-tijd enddate calendar nl Einddatum ends calendar nl Einde -enter output filename: ( .vcs appended ) calendar nl +enter output filename: ( .vcs appended ) calendar nl Geef output bestandsnaam: (.vcs toegevoegd) event details follow calendar nl Afspraak details volgen exceptions calendar nl Uitzonderingen export calendar nl Exporteren -export a list of entries in ical format. calendar nl +export a list of entries in ical format. calendar nl Exporteer een lijst in iCal formaat. extended calendar nl Uitgebreid extended updates always include the complete event-details. ical's can be imported by certain other calendar-applications. calendar nl -external participants calendar nl -failed sending message to '%1' #%2 subject='%3', sender='%4' !!! calendar nl +external participants calendar nl Buitenstaande deelnemers +failed sending message to '%1' #%2 subject='%3', sender='%4' !!! calendar nl Zenden bericht niet gelukt naar '%1' #%2 onderwerp='%2' ! fieldseparator calendar nl Veldscheiding firstname of person to notify calendar nl Voornaam van te verwittigen persoon -format of event updates common nl +format of event updates common nl Formaat van gebeurtenis updates fr calendar nl Vr free/busy calendar nl Vrij/Bezet frequency calendar nl Frequentie @@ -119,10 +119,10 @@ hours calendar nl uren i participate calendar nl Ik doe mee ical / rfc2445 calendar nl -if checked holidays falling on a weekend, are taken on the monday after. calendar nl +if checked holidays falling on a weekend, are taken on the monday after. calendar nl Als geselecteerd, worden feestdagen die in het weekend vallen op maandag gevierd. ignore conflict calendar nl Conflict negeren import calendar nl Importeren -import csv-file into calendar calendar nl +import csv-file into calendar calendar nl Importeer CSV bestand in agenda interval calendar nl Interval intervals in day view calendar nl Intervallen in dagelijksovezicht intervals per day in planner view calendar nl Intervallen per dag in planneroverzicht @@ -141,6 +141,8 @@ modify list of external participants calendar nl Lijst van externe deelnemers aanpassen mon calendar nl Maa month calendar nl Maand +months back: calendar nl Maanden terug: +months forward: calendar nl Maanden vooruit: monthly calendar nl Maandelijks monthly (by date) calendar nl Maandelijks (op datum) monthly (by day) calendar nl Maandelijks (op dag) diff -aburN --exclude='CVS*' phpgroupware/calendar/setup/phpgw_nl.lang~ htdocs/calendar/setup/phpgw_nl.lang~ --- phpgroupware/calendar/setup/phpgw_nl.lang~ 1970-01-01 01:00:00.000000000 +0100 +++ htdocs/calendar/setup/phpgw_nl.lang~ 2005-09-05 10:57:33.000000000 +0200 @@ -0,0 +1,316 @@ +%1 %2 in %3 calendar nl %1 %2 in %3 +%1 matches found calendar nl %1 resultaten gevonden +%1 records imported calendar nl %1 records geimporteerd +%1 records read (not yet imported, you may go back and uncheck test import) calendar nl +(for weekly) calendar nl (voor wekelijks) +(i/v)cal calendar nl (i/v)Cal +1 match found calendar nl 1 resultaat gevonden +a calendar nl een +accept calendar nl Accepteren +accepted calendar nl Geaccepteerd +action that caused the notify: added, canceled, accepted, rejected, ... calendar nl Acties die deze melding veroorzaken: toegevoegd, geannuleerd, geaccepteerd, verworpen, ... +add a single entry by passing the fields. calendar nl Voeg een enkele regel toe door de velden door te passen. +add alarm calendar nl Alarm toevoegen +add contact calendar nl Contact toevoegen +added calendar nl Toegevoegd +address book calendar nl Adresboek +alarm calendar nl alarm +alarm for %1 at %2 in %3 calendar nl Waarschuwing vor %1 om %2 te %3 +alarm management calendar nl Alarmbeheer +alarm-management calendar nl Alarmbeheer +alarms calendar nl Alarms +all day calendar nl Hele dag +are you sure you want to delete this country ? calendar nl Weet u zeker dat u dit land wilt verwijderen? +are you sure you want to delete this holiday ? calendar nl Weet u zeker dat u deze feestdag wilt verwijderen? +are you sure\nyou want to\ndelete these alarms? calendar nl Weer u zeker dat u deze alarms wilt verwijderen? +are you sure\nyou want to\ndelete this entry ? calendar nl Weet u zeker\n dat u deze\nafspraak wilt verwijderen? +are you sure\nyou want to\ndelete this entry ?\n\nthis will delete\nthis entry for all users. calendar nl Weet u zeker\n dat u deze\nafspraak wilt verwijderen?\nDit zal de afspraak bij\nalle gebruikers verwijderen. +are you sure\nyou want to\ndelete this single occurence ?\n\nthis will delete\nthis entry for all users. calendar nl Weet u zeker\n dat u deze\n ene gebeurtenis wilt verwijderen?\n\nDit zal deze gebeurtenis\nvoor alle gebruikers verwijderen. +before the event calendar nl voor de gebeurtenis +brief description calendar nl Korte omschrijving +business calendar nl Zakelijk +calendar common nl Kalender +calendar - [iv]cal importer calendar nl Kalender - [iv]Cal Importeren +calendar - add calendar nl Kalender - toevoegen +calendar - edit calendar nl Kalender - Bewerken +calendar event calendar nl Kalender - Afspraak +calendar holiday management admin nl Kalender feestdagen beheer +calendar preferences calendar nl Kalender voorkeuren +calendar settings admin nl Kalender instellingen +calendar-fieldname calendar nl Kalender veldnaam +canceled calendar nl Afgezegd +change all events for $params['old_owner'] to $params['new_owner']. calendar nl Wijzig alle gebeurtenissen voor $params['old_owner'] naar $params['new_owner']. +change status calendar nl Wijzig status +click %1here%2 to return to the calendar. calendar nl Klik %1hier%2 om terug naar de kalender te gaan. +configuration calendar nl Configuratie +countries calendar nl Landen +country calendar nl Land +csv-fieldname calendar nl CSV-veldnaam +csv-filename calendar nl CVS-bestandsnaam +custom fields calendar nl Eigen Velden +custom fields and sorting common nl Eigen velden en sorteren +daily calendar nl Dagelijks +daily matrix view calendar nl Dagelijks matrix overzicht +days calendar nl dagen +days repeated calendar nl dagen herhaald +dayview calendar nl Dagelijks overzicht +default appointment length (in minutes) calendar nl standaard afspraak lengte (minuten) +default calendar filter calendar nl Standaard kalender filter +default calendar view calendar nl Standaard kalender overzicht +default length of newly created events. the length is in minutes, eg. 60 for 1 hour. calendar nl Standaard lengte van nieuwe gebeurtenissen, in minuten. +defines the size in minutes of the lines in the day view. calendar nl Bepaalt de grootte in minuten van de regel in de dag view. +delete a single entry by passing the id. calendar nl Verwijder een enkele entry door het ID door te geven. +delete an entire users calendar. calendar nl Volledig verwijderen van gebruikerskalender +delete selected contacts calendar nl Verwijder geselecteerde contacten +delete series calendar nl Verwijder serie +delete single calendar nl Verwijder enkele +delete this entry ? calendar nl Weet u zeker +deleted calendar nl Verwijderd +description calendar nl Omschrijving +display interval in day view calendar nl Verdelingen in dagelijks overzicht +display mini calendars when printing calendar nl Mini kalenders tijdens het afdrukken +display status of events calendar nl Status van afspraken weergeven +displays your default calendar view on the startpage (page you get when you enter phpgroupware or click on the homepage icon)? calendar nl +do you want to be notified about new or changed appointments? you be notified about changes you make yourself.<br>you can limit the notifications to certain changes only. each item includes all the notification listed above it. all modifications include changes of title, description, participants, but no participant responses. if the owner of an event requested any notifcations, he will always get the participant responses like acceptions and rejections too. calendar nl +do you want to receive a regulary summary of your appointsments via email?<br>the summary is sent to your standard email-address on the morning of that day or on monday for weekly summarys.<br>it is only sent when you have any appointments on that day or week. calendar nl +do you wish to autoload calendar holidays files dynamically? admin nl Wilt u de feestdagen automatisch downloaden +download calendar nl Download +duration calendar nl Duur +edit series calendar nl Alles bewerken +edit single calendar nl Een bewerken +email reminder calendar nl Email herinnering +end date/time calendar nl Einddatum/-tijd +enddate calendar nl Einddatum +ends calendar nl Einde +enter output filename: ( .vcs appended ) calendar nl Geef output bestandsnaam: (.vcs toegevoegd) +event details follow calendar nl Afspraak details volgen +exceptions calendar nl Uitzonderingen +export calendar nl Exporteren +export a list of entries in ical format. calendar nl Exporteer een lijst in iCal formaat. +extended calendar nl Uitgebreid +extended updates always include the complete event-details. ical's can be imported by certain other calendar-applications. calendar nl +external participants calendar nl Buitenstaande deelnemers +failed sending message to '%1' #%2 subject='%3', sender='%4' !!! calendar nl Zenden bericht niet gelukt naar '%1' #%2 onderwerp='%2' ! +fieldseparator calendar nl Veldscheiding +firstname of person to notify calendar nl Voornaam van te verwittigen persoon +format of event updates common nl Formaat van gebeurtenis updates +fr calendar nl Vr +free/busy calendar nl Vrij/Bezet +frequency calendar nl Frequentie +fri calendar nl Vri +full description calendar nl Volledige omschrijving +fullname of person to notify calendar nl Volledige naam van te verwittigen persoon +generate printer-friendly version calendar nl Genereer printervriendelijke versie +global categories calendar nl Globale Categorieen +global public and group public calendar nl Globaal publiek en group publiek +global public only calendar nl Alleen globaal publiek +go! calendar nl Uitvoeren! +grant calendar access common nl Geef kalender toegang +group planner calendar nl Groep planner +group public only calendar nl Alleen group publiek +has been canceled calendar nl is geanulleerd +has been rescheduled to calendar nl is verplaats naar +here is your requested alarm. calendar nl Hier is uw aangevraagd alarm +high priority calendar nl hoge prioriteit +holiday calendar nl Feestdag +holiday management calendar nl Feestdagen beheer +holiday-management calendar nl Feestdagen beheer +holidays calendar nl Feestdagen +hours calendar nl uren +i participate calendar nl Ik doe mee +ical / rfc2445 calendar nl +if checked holidays falling on a weekend, are taken on the monday after. calendar nl Als geselecteerd, worden feestdagen die in het weekend vallen op maandag gevierd. +ignore conflict calendar nl Conflict negeren +import calendar nl Importeren +import csv-file into calendar calendar nl Importeer CSV bestand in agenda +interval calendar nl Interval +intervals in day view calendar nl Intervallen in dagelijksovezicht +intervals per day in planner view calendar nl Intervallen per dag in planneroverzicht +invalid entry id. calendar nl +last calendar nl laatste +lastname of person to notify calendar nl Achternaam van te verwittigen persoon +length shown<br>(emtpy for full length) calendar nl Getoonde lengte<b>(leeg voor volledige lengte) +length<br>(<= 255) calendar nl Lengte<br>(<= 255) +load [iv]cal calendar nl [iv]Cal laden +location calendar nl Plaats +location to autoload from admin nl Plaats om van te laden +matrixview calendar nl Matrixoverzicht +minutes calendar nl minuten +mo calendar nl Ma +modified calendar nl Gewijzigd +modify list of external participants calendar nl Lijst van externe deelnemers aanpassen +mon calendar nl Maa +month calendar nl Maand +months in the past: calendar nl Maanden in het verleden: +months in the future: calendar nl Maanden in de toekomst: +monthly calendar nl Maandelijks +monthly (by date) calendar nl Maandelijks (op datum) +monthly (by day) calendar nl Maandelijks (op dag) +monthview calendar nl Maandelijksoverzicht +new entry calendar nl Nieuwe afspraak +new name must not exist and not be empty!!! calendar nl +no matches found calendar nl Geen treffers gevonden +no matches found. calendar nl Geen resultaten gevonden +no response calendar nl Geen Antwoord +notification messages for added events calendar nl +notification messages for canceled events calendar nl +notification messages for modified events calendar nl +notification messages for your alarms calendar nl +notification messages for your responses calendar nl +number of intervals per day in planner view calendar nl Aantal items per dag in planner overzicht +number of months calendar nl Aantal maanden +number of records to read (<=200) calendar nl +observance rule calendar nl +occurence calendar nl +old startdate calendar nl Oude Aanvangstdatum +olddate calendar nl Oude datum +on %1 %2 %3 your meeting request for %4 calendar nl Op %1 %2 %3 uw afspraak aanvraag voor %4 +on all changes calendar nl bij alle veranderingen +on all modification, but responses calendar nl bij alle veranderingen, behalve reacties +on any time change too calendar nl +on invitation / cancelation only calendar nl +on participant responses too calendar nl +on time change of more than 4 hours too calendar nl +order calendar nl Volgorde +overlap holiday calendar nl +participant calendar nl Deelnemer +participants calendar nl Deelnemers +participates calendar nl Deelnemen +people holiday calendar nl +permission denied calendar nl Toestemming geweigerd +planner calendar nl Planner +planner by category calendar nl +planner by user calendar nl +please confirm,accept,reject or examine changes in the corresponding entry in your calendar calendar nl Wilt u de afspraak in uw kalender bevestigen, accepteren, weigeren of bijken. +preselected group for entering the planner calendar nl Geselecteerde groep bij het openen van de planner +print calendars in black & white calendar nl Kalenders in zwart/wit afdrukken +print the mini calendars calendar nl +printer friendly calendar nl Afdrukvriendelijk +privat calendar nl Prive +private and global public calendar nl Prive en globaal publiek +private and group public calendar nl Prive en groep publiek +private only calendar nl Alleen prive +re-edit event calendar nl Afspraak opnieuw bewerken +read a list of entries. calendar nl +read a single entry by passing the id and fieldlist. calendar nl +read this list of methods. calendar nl +receive email updates calendar nl +receive extra information in event mails calendar nl Ontvang extra informatie in afspraak berichten +receive summary of appointments calendar nl +recurring event calendar nl +refresh calendar nl Verversen +reinstate calendar nl +rejected calendar nl Afgewezen +repeat day calendar nl Dag herhalen +repeat end date calendar nl Einddatum herhalingspatroon +repeat type calendar nl Herhalingstype +repeating event information calendar nl Afspraak herhalings informatie +repetition calendar nl Herhalingspatroon +repetitiondetails (or empty) calendar nl +reset calendar nl +rule calendar nl Regel +sa calendar nl Za +sat calendar nl Zat +scheduling conflict calendar nl Afspraak conflict +search results calendar nl Zoekresultaten +selected contacts (%1) calendar nl +send updates via email common nl Zend aanpassingen via e-mail +send/receive updates via email calendar nl Zend/ontvang aanpassingen via e-mail +set a year only for one-time / non-regular holidays. calendar nl +set new events to private calendar nl +should invitations you rejected still be shown in your calendar ?<br>you can only accept them later (eg. when your scheduling conflict is removed), if they are still shown in your calendar! calendar nl +should new events created as private by default ? calendar nl +should the mini calendars by printed / displayed in the printer friendly views ? calendar nl +should the printer friendly view be in black & white or in color (as in normal view)? calendar nl +should the status of the event-participants (accept, reject, ...) be shown in brakets after each participants name ? calendar nl +show day view on main screen calendar nl +show default view on main screen calendar nl Geeft standaard overzicht weer op beginscherm +show high priority events on main screen calendar nl Evenementen met hoge prioriteit weergeven op hoofdscherm +show invitations you rejected calendar nl +single event calendar nl +sorry, the owner has just deleted this event calendar nl Sorry, de eigenaar heeft deze afspraak zojuist verwijderd +sorry, this event does not exist calendar nl +sorry, this event does not have exceptions defined calendar nl +sort by calendar nl Sorteren op +specifies the the number of intervals shown in the planner view. calendar nl +start date/time calendar nl Start Datum/Tijd +start- and enddates calendar nl Aanvangs- en Einddata +startdate calendar nl Aanvangsdatum +startrecord calendar nl Aanvangsrecord +su calendar nl Zo +submit to repository calendar nl +sun calendar nl Zon +tentative calendar nl +test import (show importable records <u>only</u> in browser) calendar nl +text calendar nl Tekst +th calendar nl Do +the following conflicts with the suggested time:<ul>%1</ul> calendar nl Het volgende levert een confilct op met de voorgestelde tijd:<ul>%1</ul> +the user %1 is not participating in this event! calendar nl +there was an error trying to connect to your news server.<br>please contact your admin to check the news servername, username or password. calendar nl Er was een probleem tijdens de verbinding met de news server.<br>Neem contact op met de beheerder om de servernaam, gebruikersnaam en wachtwoord te controleren. +this day is shown as first day in the week or month view. calendar nl +this defines the end of your dayview. events after this time, are shown below the dayview. calendar nl +this defines the start of your dayview. events before this time, are shown above the dayview.<br>this time is also used as a default starttime for new events. calendar nl +this group that is preselected when you enter the planner. you can change it in the planner anytime you want. calendar nl +this is mostly caused by a not or wrongly configured smtp server. notify your administrator. calendar nl +this message is sent for canceled or deleted events. calendar nl +this message is sent for modified or moved events. calendar nl +this message is sent to every participant of events you own, who has requested notifcations about new events.<br>you can use certain variables which get substituted with the data of the event. the first line is the subject of the email. calendar nl +this message is sent when you accept, tentative accept or reject an event. calendar nl +this message is sent when you set an alarm for a certain event. include all information you might need. calendar nl +this month calendar nl Deze maand +this week calendar nl Deze week +this year calendar nl Dit jaar +thu calendar nl Don +title calendar nl Titel +title of the event calendar nl +title-row calendar nl +to-firstname calendar nl +to-fullname calendar nl +to-lastname calendar nl +today calendar nl Vandaag +translation calendar nl Vertaling +tu calendar nl Di +tue calendar nl Din +update a single entry by passing the fields. calendar nl +updated calendar nl Aangepast +use end date calendar nl Gebruik einddatum +view this entry calendar nl Deze afspraak bekijken +we calendar nl Wo +wed calendar nl Woe +week calendar nl Week +weekday starts on calendar nl De week begint op +weekly calendar nl wekelijks +weekview calendar nl Weekoverzicht +when creating new events default set to private calendar nl Nieuwe afspraken standaard op prive zetten +which events do you want to see when you enter the calendar. calendar nl +which of calendar view do you want to see, when you start calendar ? calendar nl +work day ends on calendar nl Werkdag eindigt om +work day starts on calendar nl Werkdag begint om +workdayends calendar nl +year calendar nl Jaar +yearly calendar nl Jaarlijks +yearview calendar nl Jaarlijksoverzicht +you can either set a year or a occurence, not both !!! calendar nl +you can only set a year or a occurence !!! calendar nl +you do not have permission to add alarms to this event !!! calendar nl +you do not have permission to delete this alarm !!! calendar nl +you do not have permission to enable/disable this alarm !!! calendar nl +you do not have permission to read this record! calendar nl +you have %1 high priority events on your calendar today. common nl U hebt vandaag %1 afspraken met hoge prioriteit op uw agenda staan. +you have 1 high priority event on your calendar today. common nl U hebt vandaag 1 afspraak met hoge prioriteit op uw agenda staan. +you have a meeting scheduled for calendar nl U heeft een afspraak om +you have a meeting scheduled for %1 calendar nl +you have not entered a title calendar nl U heeft geen titel opgegeven +you have not entered a valid date calendar nl U heeft geen geldige datum opgegeven +you have not entered a valid time of day calendar nl U heeft geen geldige tijd opgegeven +you have not entered a\nbrief description calendar nl U hebt geen korte\nomschrijving ingevoerd +you have not entered a\nvalid time of day. calendar nl U hebt geen geldige\n tijd ingevoerd +you have not entered participants calendar nl U heeft geen deelnemers opgegeven +you must enter one or more search keywords calendar nl U moet een of meer zoektermen invoeren +you must select a [iv]cal. (*.[iv]cs) calendar nl +you need to set either a day or a occurence !!! calendar nl +your meeting scheduled for calendar nl Uw afspraak op +your meeting scheduled for %1 has been canceled calendar nl +your meeting that had been scheduled for calendar nl Uw afspraak die was op +your meeting that had been scheduled for %1 has been rescheduled to %2 calendar nl +your suggested time of <b> %1 - %2 </b> conflicts with the following existing calendar entries: calendar nl Uw opgegeven tijd (%1 - %2) levert een conflict op met de volgende afspraken: diff -aburN --exclude='CVS*' phpgroupware/calendar/templates/default/ical_export.tpl htdocs/calendar/templates/default/ical_export.tpl --- phpgroupware/calendar/templates/default/ical_export.tpl 1970-01-01 01:00:00.000000000 +0100 +++ htdocs/calendar/templates/default/ical_export.tpl 2005-09-05 10:51:33.000000000 +0200 @@ -0,0 +1,19 @@ + +
+
+ + + + + + + + + + +
{prev}
{adv}
+ + +
+
+
\ No newline at end of file diff -aburN --exclude='CVS*' phpgroupware/calendar/templates/default/ical_export.tpl~ htdocs/calendar/templates/default/ical_export.tpl~ --- phpgroupware/calendar/templates/default/ical_export.tpl~ 1970-01-01 01:00:00.000000000 +0100 +++ htdocs/calendar/templates/default/ical_export.tpl~ 2005-09-05 10:51:33.000000000 +0200 @@ -0,0 +1,19 @@ + +
+
+ + + + + + + + + + +
{prev}
{adv}
+ + +
+
+
\ No newline at end of file diff -aburN --exclude='CVS*' phpgroupware/calendar/templates/default/vcal_export.tpl~ htdocs/calendar/templates/default/vcal_export.tpl~ --- phpgroupware/calendar/templates/default/vcal_export.tpl~ 1970-01-01 01:00:00.000000000 +0100 +++ htdocs/calendar/templates/default/vcal_export.tpl~ 2005-09-05 09:53:08.000000000 +0200 @@ -0,0 +1,6 @@ + +
+prev: +adv: + +
\ No newline at end of file diff -aburN --exclude='CVS*' phpgroupware/header.inc.php htdocs/header.inc.php --- phpgroupware/header.inc.php 1970-01-01 01:00:00.000000000 +0100 +++ htdocs/header.inc.php 2005-08-30 16:06:09.000000000 +0200 @@ -0,0 +1,124 @@ + * + * -------------------------------------------- * + * This program is free software; you can redistribute it and/or modify it * + * under the terms of the GNU General Public License as published by the * + * Free Software Foundation; either version 2 of the License, or (at your * + * option) any later version. * + \**************************************************************************/ + /* $Id: header.inc.php.template,v 1.35.2.5.2.2 2003/09/08 01:27:44 skwashd Exp $ */ + + /**************************************************************************\ + * !!!!!!! EDIT THESE LINES !!!!!!!! * + * This setting allows you to easily move the include directory and the * + * base of the phpGroupWare install. Simple edit the following 2 lines with * + * the absolute path to fit your site, and you should be up and running. * + \**************************************************************************/ + + define('PHPGW_SERVER_ROOT','/var/www/agenda/htdocs'); + define('PHPGW_INCLUDE_ROOT','/var/www/agenda/htdocs'); + $GLOBALS['phpgw_info']['server']['header_admin_password'] = 'tbwb1916'; + + /* phpGroupWare domain-specific db settings */ + $GLOBALS['phpgw_domain']['default'] = array ( + 'db_host' => 'localhost', + 'db_name' => 'phpgroupware', + 'db_user' => 'phpgroupware', + 'db_pass' => 'tbwb1916', + // Look at the README file + 'db_type' => 'mysql', + // This will limit who is allowed to make configuration modifications + 'config_passwd' => 'tbwb1916' + ); + + /* + ** If you want to have your domains in a select box, change to True + ** If not, users will have to login as user@domain + ** Note: This is only for virtual domain support, default domain users can login only using + ** there loginid. + */ + $GLOBALS['phpgw_info']['server']['show_domain_selectbox'] = False; + + /* + ** As an alternative to the domain select box, set this option to True + ** to use the domain name from the browser provided hostname ($_SERVER['HTTP_HOST']) + */ + $GLOBALS['phpgw_info']['server']['domain_from_host'] = False; + + $GLOBALS['phpgw_info']['server']['db_persistent'] = True; + + /* + ** phpGroupWare can handle session management using the database, but if + ** you are using PHP4 you can usually get better performance by having phpGroupWare + ** use the session support built into PHP4. PHP3 users will have to use the database. + ** Your choices are 'db' or 'php4' + */ + $GLOBALS['phpgw_info']['server']['sessions_type'] = 'db'; + + /* Select which login template set you want, most people will use default */ + $GLOBALS['phpgw_info']['login_template_set'] = 'default'; + + /* This is used to control mcrypt's use */ + $GLOBALS['phpgw_info']['server']['mcrypt_enabled'] = False; + /* Set this to 'old' for versions < 2.4, otherwise the exact mcrypt version you use. */ + $GLOBALS['phpgw_info']['server']['versions']['mcrypt'] = ''; + + /* + ** This is a random string used as the initialization vector for mcrypt + ** feel free to change it when setting up phpgroupware on a clean database, + ** but you must not change it after that point! + ** It should be around 30 bytes in length. + */ + $GLOBALS['phpgw_info']['server']['mcrypt_iv'] = 'WHAPRE8bkvndo3hm7kA6jScpqCNgWx'; + + /* If you want phpGroupWare to be cached by proxy servers, uncomment the following */ + /* This is NOT recommended, but phpGroupWare should still work fine. */ + if(!isset($GLOBALS['phpgw_info']['flags']['nocachecontrol']) || !$GLOBALS['phpgw_info']['flags']['nocachecontrol'] == True) + { + header('Cache-Control: no-cache, must-revalidate'); // HTTP/1.1 + header('Pragma: no-cache'); // HTTP/1.0 + } + + /* debugging settings */ + define('DEBUG_APP', False); + define('DEBUG_API', False); + define('DEBUG_DATATYPES', True); + define('DEBUG_LEVEL', 3); + define('DEBUG_OUTPUT', 2); /* 1 = screen, 2 = DB (not supported with PHP3). For both use 3. */ + define('DEBUG_TIMER', False); + + function perfgetmicrotime() + { + list($usec, $sec) = explode(' ',microtime()); + return ((float)$usec + (float)$sec); + } + + if (DEBUG_TIMER) + { + $GLOBALS['debug_timer_start'] = perfgetmicrotime(); + } + + /**************************************************************************\ + * Do not edit these lines * + \**************************************************************************/ + define('PHPGW_API_INC',PHPGW_INCLUDE_ROOT.'/phpgwapi/inc'); + include(PHPGW_SERVER_ROOT.'/phpgwapi/setup/setup.inc.php'); + $GLOBALS['phpgw_info']['server']['versions']['phpgwapi'] = $setup_info['phpgwapi']['version']; + $GLOBALS['phpgw_info']['server']['versions']['current_header'] = $setup_info['phpgwapi']['versions']['current_header']; + unset($setup_info); + $GLOBALS['phpgw_info']['server']['versions']['header'] = '1.24'; + /* This is a fix for NT */ + if(!isset($GLOBALS['phpgw_info']['flags']['noapi']) || $GLOBALS['phpgw_info']['flags']['noapi'] != True) + { + include(PHPGW_API_INC . '/functions.inc.php'); + include(PHPGW_API_INC . '/xml_functions.inc.php'); + include(PHPGW_API_INC . '/soap_functions.inc.php'); + } + + /* + Leave off the final php closing tag, some editors will add + a \n or space after which will mess up cookies later on + */ diff -aburN --exclude='CVS*' phpgroupware/login.php htdocs/login.php --- phpgroupware/login.php 2005-01-03 06:56:04.000000000 +0100 +++ htdocs/login.php 2005-09-05 11:05:42.000000000 +0200 @@ -286,7 +286,7 @@ } $GLOBALS['phpgw']->translation->add_app('login'); $GLOBALS['phpgw']->translation->add_app('loginscreen'); - if (lang('loginscreen_message') != 'loginscreen_message*') + if (lang('loginscreen_message') != 'loginscreen_message') { $tmpl->set_var('lang_message',stripslashes(lang('loginscreen_message'))); } diff -aburN --exclude='CVS*' phpgroupware/login.php~ htdocs/login.php~ --- phpgroupware/login.php~ 1970-01-01 01:00:00.000000000 +0100 +++ htdocs/login.php~ 2005-09-05 11:05:42.000000000 +0200 @@ -0,0 +1,361 @@ + * + * Joseph Engo * + * -------------------------------------------- * + * This program is free software; you can redistribute it and/or modify it * + * under the terms of the GNU General Public License as published by the * + * Free Software Foundation; either version 2 of the License, or (at your * + * option) any later version. * + \**************************************************************************/ + + /* $Id: login.php,v 1.76.2.4.2.19 2004/11/06 16:13:46 powerstat Exp $ */ + + $phpgw_info = array(); + $GLOBALS['phpgw_info']['flags'] = array( + 'disable_template_class' => True, + 'login' => True, + 'currentapp' => 'login', + 'noheader' => True + ); + if(file_exists('./header.inc.php')) + { + include('./header.inc.php'); + $GLOBALS['phpgw']->sessions = createObject('phpgwapi.sessions'); + } + else + { + Header('Location: setup/index.php'); + exit; + } + + $GLOBALS['phpgw_info']['server']['template_dir'] = PHPGW_SERVER_ROOT + . '/phpgwapi/templates/' + . $GLOBALS['phpgw_info']['login_template_set']; + + $tmpl = CreateObject('phpgwapi.Template', $GLOBALS['phpgw_info']['server']['template_dir']); + + // This is used for system downtime, to prevent new logins. + if ($GLOBALS['phpgw_info']['server']['deny_all_logins']) + { + $tmpl->set_file(array( + 'login_form' => 'login_denylogin.tpl' + )); + $tmpl->set_var('template_set','default'); + $tmpl->pfp('loginout','login_form'); + exit; + } + + // !! NOTE !! + // Do NOT and I repeat, do NOT touch ANYTHING to do with lang in this file. + // If there is a problem, tell me and I will fix it. (jengo) + +/* + if ($_GET['cd'] != 10 && $GLOBALS['phpgw_info']['server']['usecookies'] == False) + { + $GLOBALS['phpgw']->sessions->setcookie('sessionid'); + $GLOBALS['phpgw']->sessions->setcookie('kp3'); + $GLOBALS['phpgw']->sessions->setcookie('domain'); + } +*/ + +/* This is not working yet because I need to figure out a way to clear the $cd =1 + if (isset($_SERVER['PHP_AUTH_USER']) && $_GET['cd'] == '1') + { + Header('HTTP/1.0 401 Unauthorized'); + Header('WWW-Authenticate: Basic realm="phpGroupWare"'); + echo 'You have to re-authentificate yourself'; + exit; + } +*/ + + if (! $deny_login && ! $GLOBALS['phpgw_info']['server']['show_domain_selectbox']) + { + $tmpl->set_file(array('login_form' => 'login.tpl')); + $tmpl->set_var('charset',lang('charset')); + } + elseif ($GLOBALS['phpgw_info']['server']['show_domain_selectbox']) + { + $tmpl->set_file(array('login_form' => 'login_selectdomain.tpl')); + $tmpl->set_var('charset',lang('charset')); + } + + if(@$GLOBALS['phpgw_info']['server']['domain_from_host'] + && !@$GLOBALS['phpgw_info']['server']['show_domain_selectbox']) + { + $tmpl->set_var('logindomain', '@' . $_SERVER['SERVER_NAME'] + . ''); + } + + + function check_logoutcode($code) + { + switch($code) + { + case 1: + return lang('You have been successfully logged out'); + break; + case 2: + return lang('Sorry, your login has expired'); + break; + case 5: + return '' . lang('Bad login or password') . ''; + break; + case 99: + return '' . lang('Blocked, too many attempts') . ''; + break; + case 10: + $GLOBALS['phpgw']->sessions->phpgw_setcookie('sessionid'); + $GLOBALS['phpgw']->sessions->phpgw_setcookie('kp3'); + $GLOBALS['phpgw']->sessions->phpgw_setcookie('domain'); + + //fix for bug php4 expired sessions bug + if($GLOBALS['phpgw_info']['server']['sessions_type'] == 'php4') + { + $GLOBALS['phpgw']->sessions->phpgw_setcookie(PHPGW_PHPSESSID); + } + + return '' . lang('Your session could not be verified.') . ''; + break; + default: + return ' '; + } + } + + function check_langs() + { + //echo "

check_langs()

\n"; + if ($GLOBALS['phpgw_info']['server']['lang_ctimes'] && !is_array($GLOBALS['phpgw_info']['server']['lang_ctimes'])) + { + $GLOBALS['phpgw_info']['server']['lang_ctimes'] = unserialize($GLOBALS['phpgw_info']['server']['lang_ctimes']); + } + //_debug_array($GLOBALS['phpgw_info']['server']['lang_ctimes']); + + $lang = $GLOBALS['phpgw_info']['user']['preferences']['common']['lang']; + $apps = $GLOBALS['phpgw_info']['user']['apps']; + $apps['phpgwapi'] = true; // check the api too + while (list($app,$data) = each($apps)) + { + $fname = PHPGW_SERVER_ROOT . "/$app/setup/phpgw_$lang.lang"; + + if (file_exists($fname)) + { + $ctime = filectime($fname); + $ltime = intval($GLOBALS['phpgw_info']['server']['lang_ctimes'][$lang][$app]); + //echo "checking lang='$lang', app='$app', ctime='$ctime', ltime='$ltime'
\n"; + + if ($ctime != $ltime) + { + update_langs(); // update all langs + break; + } + } + } + } + + function update_langs() + { + $GLOBALS['phpgw_setup'] = CreateObject('phpgwapi.setup'); + $GLOBALS['phpgw_setup']->db = $GLOBALS['phpgw']->db; + + $GLOBALS['phpgw_setup']->detection->check_lang(false); // get installed langs + $langs = $GLOBALS['phpgw_info']['setup']['installed_langs']; + while (list($lang) = @each($langs)) + { + $langs[$lang] = $lang; + } + $_POST['submit'] = true; + $_POST['lang_selected'] = $langs; + $_POST['upgrademethod'] = 'dumpold'; + $included = 'from_login'; + + include(PHPGW_SERVER_ROOT . '/setup/lang.php'); + } + + /* Program starts here */ + + if ($GLOBALS['phpgw_info']['server']['auth_type'] == 'http' && isset($_SERVER['PHP_AUTH_USER'])) + { + $submit = True; + $login = $_SERVER['PHP_AUTH_USER']; + $passwd = $_SERVER['PHP_AUTH_PW']; + } + + # Apache + mod_ssl style SSL certificate authentication + # Certificate (chain) verification occurs inside mod_ssl + if ($GLOBALS['phpgw_info']['server']['auth_type'] == 'sqlssl' && isset($_SERVER['SSL_CLIENT_S_DN']) && !isset($_GET['cd'])) + { + # an X.509 subject looks like: + # /CN=john.doe/OU=Department/O=Company/C=xx/Email=john@comapy.tld/L=City/ + # the username is deliberately lowercase, to ease LDAP integration + $sslattribs = explode('/',$_SERVER['SSL_CLIENT_S_DN']); + # skip the part in front of the first '/' (nothing) + while ($sslattrib = next($sslattribs)) + { + list($key,$val) = explode('=',$sslattrib); + $sslattributes[$key] = $val; + } + + if (isset($sslattributes['Email'])) + { + $submit = True; + + # login will be set here if the user logged out and uses a different username with + # the same SSL-certificate. + if (!isset($_POST['login'])&&isset($sslattributes['Email'])) { + $login = $sslattributes['Email']; + # not checked against the database, but delivered to authentication module + $passwd = $_SERVER['SSL_CLIENT_S_DN']; + } + } + unset($key); + unset($val); + unset($sslattributes); + } + + if (isset($_POST['passwd_type']) || $_POST['submit'] || $_POST['submit_x'] || $_POST['submit_y']) + { + if (getenv(REQUEST_METHOD) != 'POST' && $_SERVER['REQUEST_METHOD'] != 'POST' + && !isset($_SERVER['PHP_AUTH_USER']) && !isset($_SERVER['SSL_CLIENT_S_DN'])) + { + $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/login.php','code=5')); + } + $login = $_POST['login']; + if (strstr($login,'@') === False && isset($_POST['logindomain'])) + { + $login .= '@' . $_POST['logindomain']; + } + $GLOBALS['sessionid'] = $GLOBALS['phpgw']->session->create($login,$_POST['passwd'],$_POST['passwd_type']); + + if (! isset($GLOBALS['sessionid']) || ! $GLOBALS['sessionid']) + { + $GLOBALS['phpgw']->redirect($GLOBALS['phpgw_info']['server']['webserver_url'] . '/login.php?cd=' . $GLOBALS['phpgw']->session->cd_reason); + } + else + { + $forward = get_var('phpgw_forward', array('GET', 'POST'), 0); + if($forward) + { + $extra_vars['phpgw_forward'] = $forward; + foreach($_GET as $name => $value) + { + if (ereg('phpgw_',$name)) + { + $extra_vars[$name] = $value; + } + } + } + if (!$GLOBALS['phpgw_info']['server']['disable_autoload_langfiles']) + { + check_langs(); + } + $extra_vars['cd'] = 'yes'; + + $GLOBALS['phpgw']->hooks->process('login'); + $GLOBALS['phpgw']->redirect_link('/home.php', $extra_vars); + } + } + else + { + // !!! DONT CHANGE THESE LINES !!! + // If there is something wrong with this code TELL ME! + // Commenting out the code will not fix it. (jengo) + if (isset($_COOKIE['last_loginid'])) + { + $accounts = CreateObject('phpgwapi.accounts'); + $prefs = CreateObject('phpgwapi.preferences', $accounts->name2id($_COOKIE['last_loginid'])); + + if (! $prefs->account_id) + { + $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] = 'en'; + } + else + { + $GLOBALS['phpgw_info']['user']['preferences'] = $prefs->read_repository(); + } + #print 'LANG:' . $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] . '
'; + } + else + { + // If the lastloginid cookies isn't set, we will default to english. + // Change this if you need. + $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] = 'en'; + } + $GLOBALS['phpgw']->translation->add_app('login'); + $GLOBALS['phpgw']->translation->add_app('loginscreen'); + if (lang('loginscreen_message') != 'loginscreen_message*') + { + $tmpl->set_var('lang_message',stripslashes(lang('loginscreen_message'))); + } + } + + if( (!@$GLOBALS['phpgw_info']['server']['usecookies']) && @is_array($_COOKIE) ) + { + unset($_COOKIE['last_loginid']); + unset($_COOKIE['last_domain']); + } + + $last_loginid = $_COOKIE['last_loginid']; + if ($GLOBALS['phpgw_info']['server']['show_domain_selectbox']) + { + $domain_select = ''; // For security ... just in case + foreach($GLOBALS['phpgw_domain'] as $domain_name => $domain_vars) + { + $domain_select .= '