new class naming schema

This commit is contained in:
Ralf Becker 2008-06-07 17:45:33 +00:00
parent d85ed846fe
commit ef700b0061
32 changed files with 4170 additions and 4806 deletions

View File

@ -366,7 +366,7 @@ class addressbook_bo extends addressbook_so
if (!$data['freebusy_uri'] && !$data['owner'] && $data['account_id'] && !is_object($GLOBALS['egw_setup']))
{
static $fb_url;
if (!$fb_url && @is_dir(EGW_SERVER_ROOT.'/calendar/inc')) $fb_url = ExecMethod('calendar.bocal.freebusy_url','');
if (!$fb_url && @is_dir(EGW_SERVER_ROOT.'/calendar/inc')) $fb_url = calendar_bo::freebusy_url('');
if ($fb_url) $data['freebusy_uri'] = $fb_url.urlencode($GLOBALS['egw']->accounts->id2name($data['account_id']));
}
return $data;
@ -944,8 +944,7 @@ class addressbook_bo extends addressbook_so
}
if (!$uids) return array();
include_once(EGW_INCLUDE_ROOT.'/calendar/inc/class.bocal.inc.php');
$bocal = new bocal;
$bocal = new calendar_bo();
$events = $bocal->search(array(
'users' => $uids,
'enum_recuring' => true,

View File

@ -37,7 +37,7 @@
$GLOBALS['egw']->redirect_link('/admin/index.php');
}
$GLOBALS['egw_info']['flags']['app_header'] = $GLOBALS['egw_info']['apps']['calendar']['title'].' - '.lang('Import CSV-File');
$cal =& CreateObject('calendar.uical',true);
$cal = new calendar_ui(true);
$GLOBALS['egw']->common->egw_header();
$GLOBALS['egw']->template->set_file(array('import_t' => 'csv_import.tpl'));
@ -62,7 +62,7 @@
function addr_id( $n_family,$n_given,$org_name )
{ // find in Addressbook, at least n_family AND (n_given OR org_name) have to match
$contacts =& CreateObject('phpgwapi.contacts');
$contacts = new contacts();
$addrs = $contacts->read(0,0,array('id'),'',"n_family=$n_family,n_given=$n_given,org_name=$org_name");
if(!count($addrs))
@ -102,7 +102,7 @@
if (is_numeric($cat) && $GLOBALS['egw']->categories->id2name($cat) != '--')
{
$cat2id[$cat] = $ids[$cat] = $cat;
}
}
elseif ($id = $GLOBALS['egw']->categories->name2id( addslashes($cat) ))
{ // cat exists
$cat2id[$cat] = $ids[$cat] = $id;
@ -472,7 +472,7 @@
$action = $values['id'] ? 'updating' : 'adding';
//echo $action.'<pre>'.print_r($values,True)."</pre>\n";
$cal_id = $cal->bo->update($values,true,!$values['modified'],$is_admin); // ignoring conflicts and ACL (for admins) on import
$log .= "\t\t".'<td align="center">'.($cal_id ? $action." cal_id=$cal_id" : 'Error '.$action)."</td>\n\t</tr>\n";
}
else

View File

@ -1,76 +1,74 @@
<?php
/**************************************************************************\
* eGroupWare - freebusy times as iCals *
* http://www.egroupware.org *
* Written by RalfBecker@outdoor-training.de *
* -------------------------------------------- *
* 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. *
\**************************************************************************/
/**
* iCal import and export via Horde iCalendar classes
*
* @link http://www.egroupware.org
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package calendar
* @subpackage export
* @version $Id$
*/
/* $Id$ */
$GLOBALS['egw_info'] = array(
'flags' => array(
'currentapp' => 'calendar',
'noheader' => True,
'nofooter' => True,
),
);
// check if we are loged in, by checking sessionid and kp3, as the sessionid get set automaticaly by php for php4-sessions
if (!($loged_in = @$_REQUEST['sessionid'] && @$_REQUEST['kp3']))
{
$GLOBALS['egw_info']['flags']['currentapp'] = 'login';
$GLOBALS['egw_info']['flags']['noapi'] = True;
}
include ('../header.inc.php');
$GLOBALS['egw_info'] = array(
'flags' => array(
'currentapp' => 'calendar',
'noheader' => True,
'nofooter' => True,
),
);
// check if we are loged in, by checking sessionid and kp3, as the sessionid get set automaticaly by php for php4-sessions
if (!($loged_in = @$_REQUEST['sessionid'] && @$_REQUEST['kp3']))
{
$GLOBALS['egw_info']['flags']['currentapp'] = 'login';
$GLOBALS['egw_info']['flags']['noapi'] = True;
}
include ('../header.inc.php');
function fail_exit($msg)
{
echo "<html>\n<head>\n<title>$msg</title>\n<meta http-equiv=\"content-type\" content=\"text/html; charset=".
$GLOBALS['egw']->translation->charset()."\" />\n</head>\n<body><h1>$msg</h1>\n</body>\n</html>\n";
function fail_exit($msg)
{
echo "<html>\n<head>\n<title>$msg</title>\n<meta http-equiv=\"content-type\" content=\"text/html; charset=".
$GLOBALS['egw']->translation->charset()."\" />\n</head>\n<body><h1>$msg</h1>\n</body>\n</html>\n";
$GLOBALS['egw']->common->egw_exit();
}
$GLOBALS['egw']->common->egw_exit();
}
if (!$loged_in)
{
include ('../phpgwapi/inc/functions.inc.php');
$GLOBALS['egw_info']['flags']['currentapp'] = 'calendar';
}
// fix for SOGo connector, which does not decode the = in our f/b url
if (strpos($_SERVER['QUERY_STRING'],'=3D') !== false && substr($_GET['user'],0,2) == '3D')
{
$_GET['user'] = substr($_GET['user'],2);
if (isset($_GET['password'])) $_GET['password'] = substr($_GET['password'],2);
}
$user = is_numeric($_GET['user']) ? (int) $_GET['user'] : $GLOBALS['egw']->accounts->name2id($_GET['user'],'account_lid','u');
if (!$loged_in)
{
include ('../phpgwapi/inc/functions.inc.php');
$GLOBALS['egw_info']['flags']['currentapp'] = 'calendar';
}
// fix for SOGo connector, which does not decode the = in our f/b url
if (strpos($_SERVER['QUERY_STRING'],'=3D') !== false && substr($_GET['user'],0,2) == '3D')
{
$_GET['user'] = substr($_GET['user'],2);
if (isset($_GET['password'])) $_GET['password'] = substr($_GET['password'],2);
}
$user = is_numeric($_GET['user']) ? (int) $_GET['user'] : $GLOBALS['egw']->accounts->name2id($_GET['user'],'account_lid','u');
if (!($username = $GLOBALS['egw']->accounts->id2name($user)))
{
fail_exit(lang("freebusy: Unknow user '%1', wrong password or not availible to not loged in users !!!"." $username($user)",$_GET['user']));
}
if (!$loged_in)
{
$GLOBALS['egw']->preferences->account_id = $user;
$GLOBALS['egw_info']['user']['preferences'] = $GLOBALS['egw']->preferences->read_repository();
$GLOBALS['egw_info']['user']['account_id'] = $user;
$GLOBALS['egw_info']['user']['account_lid'] = $username;
if (!($username = $GLOBALS['egw']->accounts->id2name($user)))
$cal_prefs = &$GLOBALS['egw_info']['user']['preferences']['calendar'];
if (!$cal_prefs['freebusy'] || !empty($cal_prefs['freebusy_pw']) && $cal_prefs['freebusy_pw'] != $_GET['password'])
{
fail_exit(lang("freebusy: Unknow user '%1', wrong password or not availible to not loged in users !!!"." $username($user)",$_GET['user']));
fail_exit(lang("freebusy: Unknow user '%1', wrong password or not availible to not loged in users !!!",$_GET['user']));
}
if (!$loged_in)
{
$GLOBALS['egw']->preferences->account_id = $user;
$GLOBALS['egw_info']['user']['preferences'] = $GLOBALS['egw']->preferences->read_repository();
$GLOBALS['egw_info']['user']['account_id'] = $user;
$GLOBALS['egw_info']['user']['account_lid'] = $username;
$cal_prefs = &$GLOBALS['egw_info']['user']['preferences']['calendar'];
if (!$cal_prefs['freebusy'] || !empty($cal_prefs['freebusy_pw']) && $cal_prefs['freebusy_pw'] != $_GET['password'])
{
fail_exit(lang("freebusy: Unknow user '%1', wrong password or not availible to not loged in users !!!",$_GET['user']));
}
}
if ($_GET['debug'])
{
echo "<pre>";
}
else
{
ExecMethod2('phpgwapi.browser.content_header','freebusy.ifb','text/calendar');
}
echo ExecMethod2('calendar.boical.freebusy',$user,$_GET['end']);
}
if ($_GET['debug'])
{
echo "<pre>";
}
else
{
ExecMethod2('phpgwapi.browser.content_header','freebusy.ifb','text/calendar');
}
echo ExecMethod2('calendar.calendar_ical.freebusy',$user,$_GET['end']);

View File

@ -18,69 +18,69 @@ require_once(EGW_INCLUDE_ROOT.'/importexport/inc/class.import_csv.inc.php');
* class import_csv for addressbook
*/
class import_events_csv implements iface_import_plugin {
private static $plugin_options = array(
'fieldsep', // char
'charset', // string
'event_owner', // int account_id or -1 for leave untuched
'owner_joins_event', // bool
'update_cats', // string {override|add} overides record
'update_cats', // string {override|add} overides record
// with cat(s) from csv OR add the cat from
// csv file to exeisting cat(s) of record
'num_header_lines', // int number of header lines
'trash_users_records', // trashes all events of events owner before import
'field_conversion', // array( $csv_col_num => conversion)
'field_mapping', // array( $csv_col_num => adb_filed)
'conditions', /* => array containing condition arrays:
'conditions', /* => array containing condition arrays:
'type' => exists, // record['uid'] exists
'true' => array(
'action' => update,
'last' => true,
),
'false' => array(
'action' => insert,
'action' => insert,
'last' => true,
),*/
);
/**
* actions wich could be done to data entries
*/
private static $actions = array( 'none', 'update', 'insert', 'delete', );
/**
* conditions for actions
*
* @var array
*/
private static $conditions = array( 'exists', 'empty', );
/**
* @var definition
*/
private $definition;
/**
* @var bocalupdate
*/
private $bocalupdate;
/**
* @var bool
*/
private $dry_run = false;
/**
* @var bool is current user admin?
*/
private $is_admin = false;
/**
* @var int
*/
private $user = null;
/**
* imports entries according to given definition object.
* @param resource $_stream
@ -92,7 +92,7 @@ class import_events_csv implements iface_import_plugin {
'fieldsep' => $_definition->plugin_options['fieldsep'],
'charset' => $_definition->plugin_options['charset'],
));
$this->definition = $_definition;
// user, is admin ?
@ -100,79 +100,79 @@ class import_events_csv implements iface_import_plugin {
$this->user = $GLOBALS['egw_info']['user']['account_id'];
// dry run?
$this->dry_run = isset( $_definition->plugin_options['dry_run'] ) ? $_definition->plugin_options['dry_run'] : false;
$this->dry_run = isset( $_definition->plugin_options['dry_run'] ) ? $_definition->plugin_options['dry_run'] : false;
// fetch the calendar bo
$this->bocalupdate = CreateObject('calendar.bocalupdate');
$this->bocalupdate = new calendar_boupdate();
// set FieldMapping.
$import_csv->mapping = $_definition->plugin_options['field_mapping'];
// set FieldConversion
$import_csv->conversion = $_definition->plugin_options['field_conversion'];
//check if file has a header lines
if ( isset( $_definition->plugin_options['num_header_lines'] ) ) {
$import_csv->skip_records( $_definition->plugin_options['num_header_lines'] );
}
// set eventOwner
$_definition->plugin_options['events_owner'] = isset( $_definition->plugin_options['events_owner'] ) ?
$_definition->plugin_options['events_owner'] = isset( $_definition->plugin_options['events_owner'] ) ?
$_definition->plugin_options['events_owner'] : $this->user;
// trash_users_records ?
if ( $_definition->plugin_options['trash_users_records'] === true ) {
if ( !$_definition->plugin_options['dry_run'] ) {
$socal = CreateObject( 'calendar.socal' );
$socal->change_delete_user( $_definition->plugin_options['events_owner'], false );
$socal = new calendar_socal();
$this->bocalupdate->so->deleteaccount( $_definition->plugin_options['events_owner']);
unset( $socal );
} else {
$lid = $GLOBALS['egw']->accounts->id2name( $_definition->plugin_options['events_owner'] );
echo "Attension: All Events of '$lid' would be deleted!\n";
}
}
while ( $record = $import_csv->get_record() ) {
// don't import empty events
if( count( array_unique( $record ) ) < 2 ) continue;
if ( $_definition->plugin_options['events_owner'] != -1 ) {
$record['owner'] = $_definition->plugin_options['events_owner'];
} else unset( $record['owner'] );
if ( $_definition->plugin_options['conditions'] ) {
foreach ( $_definition->plugin_options['conditions'] as $condition ) {
switch ( $condition['type'] ) {
// exists
case 'exists' :
if ( is_array( $event = $this->bocalupdate->read( $record['uid'], null, $this->is_admin ) ) ) {
// apply action to event matching this exists condition
$record['id'] = $event['id'];
if ( $_definition->plugin_options['update_cats'] == 'add' ) {
if ( !is_array( $event['cat_id'] ) ) $event['cat_id'] = explode( ',', $event['cat_id'] );
if ( !is_array( $record['cat_id'] ) ) $record['cat_id'] = explode( ',', $record['cat_id'] );
$record['cat_id'] = implode( ',', array_unique( array_merge( $record['cat_id'], $event['cat_id'] ) ) );
}
// check if entry is modiefied
$event = array_intersect_key( $event, $record );
$diff = array_diff( $event, $record );
if( !empty( $diff ) ) $record['modified'] = time();
$action = $condition['true'];
} else $action = $condition['false'];
$this->action( $action['action'], $record );
break;
case 'empty' :
$action = empty( $record[$condition['string']] ) ? $condition['true'] : $condition['false'];
$this->action( $action['action'], $record );
break;
// not supported action
// not supported action
default :
throw new Exception('condition not supported!!!');
break;
@ -185,7 +185,7 @@ class import_events_csv implements iface_import_plugin {
}
}
}
/**
* perform the required action
*
@ -197,10 +197,10 @@ class import_events_csv implements iface_import_plugin {
switch ( $_action ) {
case 'none' :
return true;
case 'update' :
case 'insert' :
// paticipants handling
$participants = $_data['participants'] ? split( '[,;]', $_data['participants'] ) : array();
$_data['participants'] = array();
@ -219,18 +219,18 @@ class import_events_csv implements iface_import_plugin {
if ( empty( $_data['participants'] ) ) {
$_data['participants'][$this->user] = 'A';
}
// are we serious?
if ( $this->dry_run ) {
print_r($_data);
} else {
return $this->bocalupdate->update( $_data, true, !$_data['modified'], $this->is_admin);
return $this->bocalupdate->update( $_data, true, !$_data['modified'], $this->is_admin);
}
case 'delete' :
}
}
/**
* returns translated name of plugin
*
@ -239,7 +239,7 @@ class import_events_csv implements iface_import_plugin {
public static function get_name() {
return lang('Calendar CSV export');
}
/**
* returns translated (user) description of plugin
*
@ -248,7 +248,7 @@ class import_events_csv implements iface_import_plugin {
public static function get_description() {
return lang("Imports events into your Calendar from a CSV File. CSV means 'Comma Seperated Values'. However in the options Tab you can also choose other seperators.");
}
/**
* retruns file suffix(s) plugin can handle (e.g. csv)
*
@ -257,12 +257,12 @@ class import_events_csv implements iface_import_plugin {
public static function get_filesuffix() {
return 'csv';
}
/**
* return etemplate components for options.
* @abstract We can't deal with etemplate objects here, as an uietemplate
* objects itself are scipt orientated and not "dialog objects"
*
*
* @return array (
* name => string,
* content => array,
@ -273,7 +273,7 @@ class import_events_csv implements iface_import_plugin {
public function get_options_etpl() {
// lets do it!
}
/**
* returns etemplate name for slectors of this plugin
*

View File

@ -2,16 +2,16 @@
/**
* eGroupWare - Calendar's XMLRPC or SOAP access
*
* Please note: dont use addressbook_... naming convention, as it would break the existing xmlrpc clients
*
* @link http://www.egroupware.org
* @package calendar
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @copyright (c) 2005-7 by RalfBecker-At-outdoor-training.de
* @copyright (c) 2005-8 by RalfBecker-At-outdoor-training.de
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
require_once(EGW_INCLUDE_ROOT.'/calendar/inc/class.bocalupdate.inc.php');
/**
* Class to access AND manipulate calendar data via XMLRPC or SOAP
*
@ -19,7 +19,7 @@ require_once(EGW_INCLUDE_ROOT.'/calendar/inc/class.bocalupdate.inc.php');
*
* @link http://egroupware.org/wiki/xmlrpc
*/
class bocalendar
class bocalendar
{
var $xmlrpc_date_format = 'Y-m-d\\TH:i:s';
var $debug = false; // log function call to the apache error_log
@ -33,9 +33,9 @@ class bocalendar
'list_methods' => True,
);
function bocalendar()
function __construct()
{
$this->cal =& new bocalupdate();
$this->cal =& new calendar_boupdate();
if (is_object($GLOBALS['server']) && $GLOBALS['server']->simpledate)
{
@ -112,7 +112,7 @@ class bocalendar
'out' => array('array')
),
);
}
}
return array();
}
@ -127,7 +127,7 @@ class bocalendar
if ($this->debug) error_log('bocalendar::read('.print_r($id,true).')');
$events =& $this->cal->read($id,null,true,$this->xmlrpc_date_format); // true = ignore acl!!!
if (!$events) // only id not found, as ignore_acl=true
{
// xmlrpc_error does NOT return
@ -217,7 +217,7 @@ class bocalendar
$user = $GLOBALS['egw']->accounts->name2id($data['email'],'account_email');
}
if (!$user) continue;
$event['participants'][$user] = in_array($data['status'],array('U','A','R','T')) ? $data['status'] : 'U';
}
}
@ -252,7 +252,7 @@ class bocalendar
unset($params['ignore_acl']);
$events =& $this->cal->search($params);
foreach($events as $key => $event)
{
$events[$key] = $this->xmlrpc_prepare($event);
@ -311,7 +311,7 @@ class bocalendar
}
// using access={public|private} in all modules via xmlrpc
$event['access'] = $event['public'] ? 'public' : 'private';
// unset everything not known in version 1.0
foreach(array('public','participant_types') as $key)
{

File diff suppressed because it is too large Load Diff

View File

@ -7,34 +7,26 @@
* @package calendar
* @copyright (c) 2006 by Christian Binder <christian.binder@freakmail.de>
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id: class.ajaxcalendar.inc.php 22777 2006-11-26 20:55:00Z jaytraxx $
* @version $Id: class.ajaxcalendar.inc.php 22777 2006-11-26 20:55:00Z jaytraxx $
*/
require_once(EGW_INCLUDE_ROOT.'/calendar/inc/class.bocalupdate.inc.php');
/**
* General object of the calendar ajax class
*
* @package calendar
* @author Christian Binder <christian.binder@freakmail.de>
* @copyright (c) 2006 by Christian Binder <christian.binder@freakmail.de>
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
*/
class calendar_ajax {
class ajaxcalendar {
/**
* calendar object to handle events
*
* @var bocalupdate
*
* @var calendar_boupdate
*/
var $calendar;
function ajaxcalendar()
function __construct()
{
$this->calendar = new bocalupdate;
$this->calendar = new calendar_boupdate();
}
/**
* moves an event to another date/time
*
@ -54,22 +46,22 @@ class ajaxcalendar {
$event=$this->calendar->read($eventId);
$duration=$event['end']-$event['start'];
$event['start'] = $this->calendar->date2ts($targetDateTime);
$event['end'] = $event['start']+$duration;
$conflicts=$this->calendar->update($event);
$response =& new xajaxResponse();
if(!is_array($conflicts))
{
$response->addRedirect($PHP_SELF);
$response->addRedirect('');
}
else
{
$response->addScriptCall(
'egw_openWindowCentered2',
$GLOBALS['egw_info']['server']['webserver_url'].'/index.php?menuaction=calendar.uiforms.edit
$GLOBALS['egw_info']['server']['webserver_url'].'/index.php?menuaction=calendar.calendar_uiforms.edit
&cal_id='.$event['id']
.'&start='.$event['start']
.'&end='.$event['end']

View File

@ -5,13 +5,11 @@
* @link http://www.egroupware.org
* @package calendar
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @copyright (c) 2004-7 by RalfBecker-At-outdoor-training.de
* @copyright (c) 2004-8 by RalfBecker-At-outdoor-training.de
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
require_once(EGW_INCLUDE_ROOT.'/calendar/inc/class.socal.inc.php');
if (!defined('ACL_TYPE_IDENTIFER')) // used to mark ACL-values for the debug_message methode
{
define('ACL_TYPE_IDENTIFER','***ACL***');
@ -27,8 +25,6 @@ define('WEEK_s',7*DAY_s);
*/
define('EGW_ACL_READ_FOR_PARTICIPANTS',EGW_ACL_CUSTOM_1);
require_once(EGW_INCLUDE_ROOT.'/calendar/inc/class.socal.inc.php');
/**
* Class to access all calendar data
*
@ -47,7 +43,7 @@ require_once(EGW_INCLUDE_ROOT.'/calendar/inc/class.socal.inc.php');
*
* All permanent debug messages of the calendar-code should done via the debug-message method of this class !!!
*/
class bocal
class calendar_bo
{
/**
* @var int $debug name of method to debug or level of debug-messages:
@ -152,11 +148,11 @@ class bocal
/**
* Constructor
*/
function bocal()
function __construct()
{
if ($this->debug > 0) $this->debug_message('bocal::bocal() started',True,$param);
$this->so = new socal();
$this->so = new calendar_so();
$this->datetime = $GLOBALS['egw']->datetime;
$this->common_prefs =& $GLOBALS['egw_info']['user']['preferences']['common'];
@ -1737,31 +1733,6 @@ class bocal
return $result;
}
/**
* Hook called by link-class to include calendar in the appregistry of the linkage
*
* @param array/string $location location and other parameters (not used)
* @return array with method-names
*/
function search_link($location)
{
return array(
'query' => 'calendar.bocal.link_query',
'title' => 'calendar.bocal.link_title',
'view' => array(
'menuaction' => 'calendar.uiforms.edit',
),
'view_id' => 'cal_id',
'view_popup' => '750x400',
'add' => array(
'menuaction' => 'calendar.uiforms.edit',
),
'add_app' => 'link_app',
'add_id' => 'link_id',
'add_popup' => '750x400',
);
}
/**
* sets the default prefs, if they are not already set (on a per pref. basis)
*
@ -1826,7 +1797,7 @@ class bocal
* @param int/string $user account_id or account_lid
* @param string $pw=null password
*/
function freebusy_url($user,$pw=null)
static function freebusy_url($user,$pw=null)
{
if (is_numeric($user)) $user = $GLOBALS['egw']->accounts->id2name($user);
@ -1836,20 +1807,3 @@ class bocal
($pw ? '&password='.urlencode($pw) : '');
}
}
if (!function_exists('array_intersect_key')) // php5.1 function
{
function array_intersect_key($array1,$array2)
{
$intersection = $keys = array();
foreach(func_get_args() as $arr)
{
$keys[] = array_keys((array)$arr);
}
foreach(call_user_func_array('array_intersect',$keys) as $key)
{
$intersection[$key] = $array1[$key];
}
return $intersection;
}
}

View File

@ -5,13 +5,11 @@
* @link http://www.egroupware.org
* @package calendar
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @copyright (c) 2005-7 by RalfBecker-At-outdoor-training.de
* @copyright (c) 2005-8 by RalfBecker-At-outdoor-training.de
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
require_once(EGW_INCLUDE_ROOT.'/calendar/inc/class.bocal.inc.php');
// types of messsages send by bocalupdate::send_update
define('MSG_DELETED',0);
define('MSG_MODIFIED',1);
@ -39,7 +37,7 @@ define('MSG_DISINVITE',7);
* All permanent debug messages of the calendar-code should done via the debug-message method of the bocal class !!!
*/
class bocalupdate extends bocal
class calendar_boupdate extends calendar_bo
{
/**
* name of method to debug or level of debug-messages:
@ -60,11 +58,11 @@ class bocalupdate extends bocal
/**
* Constructor
*/
function bocalupdate()
function __construct()
{
if ($this->debug > 0) $this->debug_message('bocalupdate::bocalupdate() started',True);
$this->bocal(); // calling the parent constructor
parent::__construct(); // calling the parent constructor
if ($this->debug > 0) $this->debug_message('bocalupdate::bocalupdate() finished',True);
}

View File

@ -1,56 +1,50 @@
<?php
/**************************************************************************\
* eGroupWare - ProjectManager - DataSource for InfoLog *
* http://www.egroupware.org *
* Written and (c) 2005 by Ralf Becker <RalfBecker@outdoor-training.de> *
* -------------------------------------------- *
* 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$ */
/**
* DataSource for the Calendar
*
* @link http://www.egroupware.org
* @package calendar
* @author RalfBecker-AT-outdoor-training.de
* @copyright (c) 2005-8 by RalfBecker-AT-outdoor-training.de
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
include_once(EGW_INCLUDE_ROOT.'/projectmanager/inc/class.datasource.inc.php');
/**
* DataSource for the Calendar
*
* @package calendar
* @author RalfBecker-AT-outdoor-training.de
* @copyright (c) 2005 by RalfBecker-AT-outdoor-training.de
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
*/
class datasource_calendar extends datasource
class calendar_datasource extends datasource
{
/**
* Constructor
*/
function datasource_calendar()
function __construct()
{
$this->datasource('calendar');
$this->valid = PM_PLANNED_START|PM_PLANNED_END|PM_PLANNED_TIME|PM_RESOURCES;
}
/**
* get an entry from the underlaying app (if not given) and convert it into a datasource array
*
*
* @param mixed $data_id id as used in the link-class for that app, or complete entry as array
* @return array/boolean array with the data supported by that source or false on error (eg. not found, not availible)
*/
function get($data_id)
{
// we use $GLOBALS['bocal'] as an already running instance is availible there
if (!is_object($GLOBALS['bocal']))
// we use $cal as an already running instance is availible there
if (!is_object($GLOBALS['calendar_bo']))
{
include_once(EGW_INCLUDE_ROOT.'/calendar/inc/class.bocal.inc.php');
$GLOBALS['bocal'] =& new bocal();
$GLOBALS['calendar_bo'] = new calendar_bo();
}
$cal = $GLOBALS['calendar_bo'];
if (!is_array($data_id))
{
if (!(int) $data_id || !($data = $GLOBALS['bocal']->read((int) $data_id)))
if (!(int) $data_id || !($data = $cal->read((int) $data_id)))
{
return false;
}
@ -60,9 +54,9 @@ class datasource_calendar extends datasource
$data =& $data_id;
}
$ds = array(
'pe_title' => $GLOBALS['bocal']->link_title($data),
'pe_planned_start' => $GLOBALS['bocal']->date2ts($data['start']),
'pe_planned_end' => $GLOBALS['bocal']->date2ts($data['end']),
'pe_title' => $cal->link_title($data),
'pe_planned_start' => $cal->date2ts($data['start']),
'pe_planned_end' => $cal->date2ts($data['end']),
'pe_resources' => array(),
'pe_details' => $data['description'] ? nl2br($data['description']) : '',
);
@ -74,14 +68,14 @@ class datasource_calendar extends datasource
{
foreach(array('start','end') as $name)
{
$$name = $GLOBALS['bocal']->date2array($ds['pe_planned_'.$name]);
$$name = $cal->date2array($ds['pe_planned_'.$name]);
${$name}['hour'] = 12;
${$name}['minute'] = ${$name}['second'] = 0;
unset(${$name}['raw']);
$$name = $GLOBALS['bocal']->date2ts($$name);
$$name = $cal->date2ts($$name);
}
$nights = round(($end - $start) / DAY_s);
if (!is_array($this->pm_config))
{
$c =& CreateObject('phpgwapi.config','projectmanager');
@ -103,7 +97,7 @@ class datasource_calendar extends datasource
$ds['pe_planned_time'] *= count($ds['pe_resources']);
/*
// ToDO: this does not change automatically after the event is over,
// ToDO: this does not change automatically after the event is over,
// maybe we need a flag for that in egw_pm_elements
if ($data['end']['raw'] <= time()+$GLOBALS['egw']->datetime->tz_offset)
{

View File

@ -11,8 +11,6 @@
* @version $Id$
*/
require_once(EGW_INCLUDE_ROOT.'/calendar/inc/class.bocalupdate.inc.php');
/**
* eGroupWare: GroupDAV access: calendar handler
*/
@ -21,7 +19,7 @@ class calendar_groupdav extends groupdav_handler
/**
* bo class of the application
*
* @var bocalupdate
* @var calendar_boupdate
*/
var $bo;
@ -49,7 +47,7 @@ class calendar_groupdav extends groupdav_handler
{
parent::__construct($app,$debug,$base_uri);
$this->bo =& new bocalupdate();
$this->bo =& new calendar_boupdate();
}
/**

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,503 @@
<?php
/**
* eGroupWare calendar - SIF Parser for SyncML
*
* @link http://www.egroupware.org
* @author Lars Kneschke <lkneschke@egroupware.org>
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package calendar
* @subpackage export
* @version $Id$
*/
require_once EGW_SERVER_ROOT.'/phpgwapi/inc/horde/Horde/iCalendar.php';
/**
* SIF Parser for SyncML
*/
class sifcalendar extends calendar_boupdate
{
var $sifMapping = array(
'Start' => 'start',
'End' => 'end',
'AllDayEvent' => 'alldayevent',
'BillingInformation' => '',
'Body' => 'description',
'BusyStatus' => '',
'Categories' => 'category',
'Companies' => '',
'Importance' => 'priority',
'IsRecurring' => 'isrecurring',
'Location' => 'location',
'MeetingStatus' => '',
'Mileage' => '',
'ReminderMinutesBeforeStart' => 'reminderstart',
'ReminderSet' => 'reminderset',
'ReplyTime' => '',
'Sensitivity' => 'public',
'Subject' => 'title',
'RecurrenceType' => 'recur_type',
'Interval' => 'recur_interval',
'MonthOfYear' => '',
'DayOfMonth' => '',
'DayOfWeekMask' => 'recur_weekmask',
'Instance' => '',
'PatternStartDate' => '',
'NoEndDate' => 'recur_noenddate',
'PatternEndDate' => 'recur_enddate',
'Occurrences' => '',
);
// the calendar event array
var $event;
// constants for recurence type
const olRecursDaily = 0;
const olRecursWeekly = 1;
const olRecursMonthly = 2;
const olRecursMonthNth = 3;
const olRecursYearly = 5;
const olRecursYearNth = 6;
// constants for weekdays
const olSunday = 1;
const olMonday = 2;
const olTuesday = 4;
const olWednesday = 8;
const olThursday = 16;
const olFriday = 32;
const olSaturday = 64;
function startElement($_parser, $_tag, $_attributes) {
}
function endElement($_parser, $_tag) {
//error_log('endElem: ' . $_tag .' => '. trim($this->sifData));
if(!empty($this->sifMapping[$_tag])) {
$this->event[$this->sifMapping[$_tag]] = trim($this->sifData);
}
unset($this->sifData);
}
function characterData($_parser, $_data) {
$this->sifData .= $_data;
}
function siftoegw($_sifdata) {
$vcal = &new Horde_iCalendar;
$finalEvent = array();
$sysCharSet = $GLOBALS['egw']->translation->charset();
$sifData = base64_decode($_sifdata);
#error_log($sifData);
$tmpfname = tempnam('/tmp/sync/contents','sife_');
$handle = fopen($tmpfname, "w");
fwrite($handle, $sifData);
fclose($handle);
$this->xml_parser = xml_parser_create('UTF-8');
xml_set_object($this->xml_parser, $this);
xml_parser_set_option($this->xml_parser, XML_OPTION_CASE_FOLDING, false);
xml_set_element_handler($this->xml_parser, "startElement", "endElement");
xml_set_character_data_handler($this->xml_parser, "characterData");
$this->strXmlData = xml_parse($this->xml_parser, $sifData);
if(!$this->strXmlData) {
error_log(sprintf("XML error: %s at line %d",
xml_error_string(xml_get_error_code($this->xml_parser)),
xml_get_current_line_number($this->xml_parser)));
return false;
}
#error_log(print_r($this->event, true));
foreach($this->event as $key => $value) {
$value = $GLOBALS['egw']->translation->convert($value, 'utf-8', $sysCharSet);
#error_log("$key => $value");
switch($key) {
case 'alldayevent':
if($value == 1) {
$startParts = explode('-',$this->event['start']);
$finalEvent['start'] = mktime(0, 0, 0, $startParts[1], $startParts[2], $startParts[0]);
$endParts = explode('-',$this->event['end']);
$finalEvent['end'] = mktime(23, 59, 59, $endParts[1], $endParts[2], $endParts[0]);
}
break;
case 'public':
$finalEvent[$key] = ((int)$value > 0) ? 0 : 1;
break;
case 'category':
if(!empty($value)) {
$finalEvent[$key] = implode(',',$this->find_or_add_categories(explode(';', $value)));
}
break;
case 'end':
case 'start':
if($this->event['alldayevent'] < 1) {
$finalEvent[$key] = $vcal->_parseDateTime($value);
error_log("event ".$key." val=".$value.", parsed=".$finalEvent[$key]);
}
break;
case 'isrecurring':
if($value == 1) {
$finalEvent['recur_interval'] = $this->event['recur_interval'];
if($this->event['recur_noenddate'] == 0) {
$finalEvent['recur_enddate'] = $vcal->_parseDateTime($this->event['recur_enddate']);
}
switch($this->event['recur_type']) {
case self::olRecursDaily:
$finalEvent['recur_type'] = MCAL_RECUR_DAILY;
break;
case self::olRecursWeekly:
$finalEvent['recur_type'] = MCAL_RECUR_WEEKLY;
$finalEvent['recur_data'] = $this->event['recur_weekmask'];
break;
case self::olRecursMonthly:
$finalEvent['recur_type'] = MCAL_RECUR_MONTHLY_MDAY;
break;
case self::olRecursMonthNth:
$finalEvent['recur_type'] = MCAL_RECUR_MONTHLY_WDAY;
break;
case self::olRecursYearly:
$finalEvent['recur_type'] = MCAL_RECUR_YEARLY;
$finalEvent['recur_interval'] = 1;
break;
}
}
break;
case 'priority':
$finalEvent[$key] = $value+1;
break;
case 'reminderset':
if($value == 1) {
$finalEvent['alarm'] = $this->event['reminderstart'];
}
break;
case 'recur_type':
case 'recur_enddate':
case 'recur_interval':
case 'recur_weekmask':
case 'reminderstart':
// do nothing, get's handled in isrecuring clause
break;
default:
$finalEvent[$key] = $value;
break;
}
}
#$middleName = ($finalEvent['n_middle']) ? ' '.trim($finalEvent['n_middle']) : '';
#$finalEvent['fn'] = trim($finalEvent['n_given']. $middleName .' '. $finalEvent['n_family']);
#error_log(print_r($finalEvent, true));
return $finalEvent;
}
function search($_sifdata) {
if(!$event = $this->siftoegw($_sifdata)) {
return false;
}
$query = array(
'cal_start='.$this->date2ts($event['start'],true), // true = Server-time
'cal_end='.$this->date2ts($event['end'],true),
);
#foreach(array('title','location','priority','public','non_blocking') as $name) {
foreach(array('title','location','public','non_blocking') as $name) {
if (isset($event[$name])) $query['cal_'.$name] = $event[$name];
}
if($foundEvents = parent::search(array(
'user' => $this->user,
'query' => $query,
))) {
if(is_array($foundEvents)) {
$event = array_shift($foundEvents);
return $event['id'];
}
}
return false;
$search['start'] = $event['start'];
$search['end'] = $event['end'];
unset($event['description']);
unset($event['start']);
unset($event['end']);
foreach($event as $key => $value) {
if (substr($key,0,6) != 'recur_' && substr($key,0,5) != 'alarm') {
$search['query']['cal_'.$key] = $value;
} else {
#$search['query'][$key] = $value;
}
}
if($foundEvents = parent::search($search)) {
if(is_array($foundEvents)) {
$event = array_shift($foundEvents);
return $event['id'];
}
}
return false;
}
/**
* @return int contact id
* @param string $_vcard the vcard
* @param int $_abID the internal addressbook id
* @desc import a vard into addressbook
*/
function addSIF($_sifdata, $_calID)
{
$calID = false;
#error_log('ABID: '.$_abID);
#error_log(base64_decode($_sifdata));
if(!$event = $this->siftoegw($_sifdata)) {
return false;
}
if(isset($event['alarm'])) {
$alarm = $event['alarm'];
unset($event['alarm']);
}
if($_calID > 0)
{
// update entry
$event['id'] = $_calID;
}
if($eventID = $this->update($event, TRUE)) {
$updatedEvent = $this->read($eventID);
foreach($updatedEvent['alarm'] as $alarmID => $alarmData)
{
$this->delete_alarm($alarmID);
}
if(isset($alarm)) {
$alarmData['time'] = $event['start'] - ($alarm*60);
$alarmData['offset'] = $alarm*60;
$alarmData['all'] = 1;
$alarmData['owner'] = $GLOBALS['egw_info']['user']['account_id'];
$this->save_alarm($eventID, $alarmData);
}
}
return $eventID;
}
/**
* return a vcard
*
* @param int $_id the id of the contact
* @param int $_vcardProfile profile id for mapping from vcard values to egw addressbook
* @return string containing the vcard
*/
function getSIF($_id)
{
$fields = array_unique(array_values($this->sifMapping));
sort($fields);
#$event = $this->read($_id,null,false,'server');
#error_log("FOUND EVENT: ". print_r($event, true));
if($event = $this->read($_id,null,false,'server')) {
$sysCharSet = $GLOBALS['egw']->translation->charset();
$vcal = &new Horde_iCalendar;
$sifEvent = '<appointment>';
foreach($this->sifMapping as $sifField => $egwField)
{
if(empty($egwField)) continue;
#error_log("$sifField => $egwField");
#error_log('VALUE1: '.$event[$egwField]);
$value = $GLOBALS['egw']->translation->convert($event[$egwField], $sysCharSet, 'utf-8');
#error_log('VALUE2: '.$value);
switch($sifField)
{
case 'Categories':
if(!empty($value)) {
$value = implode('; ', $this->get_categories(explode(',',$value)));
$value = $GLOBALS['egw']->translation->convert($value, $sysCharSet, 'utf-8');
}
$sifEvent .= "<$sifField>$value</$sifField>";
break;
case 'Importance':
$value = $value-1;
$sifEvent .= "<$sifField>$value</$sifField>";
break;
case 'RecurrenceType':
case 'Interval':
case 'PatternStartDate':
case 'NoEndDate':
case 'DayOfWeekMask':
case 'PatternEndDate':
break;
case 'IsRecurring':
switch($event['recur_type']) {
case MCAL_RECUR_NONE:
$sifEvent .= "<$sifField>0</$sifField>";
break;
case MCAL_RECUR_DAILY:
$eventInterval = ($event['recur_interval'] > 1 ? $event['recur_interval'] : 1);
$recurStartDate = mktime(0,0,0,date('m',$event['start']), date('d', $event['start']), date('Y', $event['start']));
$sifEvent .= "<$sifField>1</$sifField>";
$sifEvent .= '<RecurrenceType>'. self::olRecursDaily .'</RecurrenceType>';
$sifEvent .= '<Interval>'. $eventInterval .'</Interval>';
$sifEvent .= '<PatternStartDate>'. $vcal->_exportDateTime($recurStartDate) .'</PatternStartDate>';
if($event['recur_enddate'] == 0) {
$sifEvent .= '<NoEndDate>1</NoEndDate>';
} else {
$recurEndDate = mktime(24,0,0,date('m',$event['recur_enddate']), date('d', $event['recur_enddate']), date('Y', $event['recur_enddate']));
$sifEvent .= '<NoEndDate>0</NoEndDate>';
$sifEvent .= '<PatternEndDate>'. $vcal->_exportDateTime($recurEndDate) .'</PatternEndDate>';
$totalDays = ($recurEndDate - $recurStartDate) / 86400;
$occurrences = ceil($totalDays / $eventInterval);
$sifEvent .= '<Occurrences>'. $occurrences .'</Occurrences>';
}
break;
case MCAL_RECUR_WEEKLY:
$eventInterval = ($event['recur_interval'] > 1 ? $event['recur_interval'] : 1);
$recurStartDate = mktime(0,0,0,date('m',$event['start']), date('d', $event['start']), date('Y', $event['start']));
$sifEvent .= "<$sifField>1</$sifField>";
$sifEvent .= '<RecurrenceType>'. self::olRecursWeekly .'</RecurrenceType>';
$sifEvent .= '<Interval>'. $eventInterval .'</Interval>';
$sifEvent .= '<PatternStartDate>'. $vcal->_exportDateTime($recurStartDate) .'</PatternStartDate>';
$sifEvent .= '<DayOfWeekMask>'. $event['recur_data'] .'</DayOfWeekMask>';
if($event['recur_enddate'] == 0) {
$sifEvent .= '<NoEndDate>1</NoEndDate>';
} else {
$recurEndDate = mktime(24, 0, 0, date('m',$event['recur_enddate']), date('d', $event['recur_enddate']), date('Y', $event['recur_enddate']));
$daysPerWeek = substr_count(decbin($event['recur_data']),'1');
$sifEvent .= '<NoEndDate>0</NoEndDate>';
$sifEvent .= '<PatternEndDate>'. $vcal->_exportDateTime($recurEndDate) .'</PatternEndDate>';
$totalWeeks = floor(($recurEndDate - $recurStartDate) / (86400*7));
#error_log("AAA: $daysPerWeek $totalWeeks");
$occurrences = ($totalWeeks / $eventInterval) * $daysPerWeek;
for($i = $recurEndDate; $i > $recurStartDate + ($totalWeeks * 86400*7); $i = $i - 86400) {
switch(date('w', $i-1)) {
case 0:
if($event['recur_data'] & 1) $occurrences++;
break;
// monday
case 1:
if($event['recur_data'] & 2) $occurrences++;
break;
case 2:
if($event['recur_data'] & 4) $occurrences++;
break;
case 3:
if($event['recur_data'] & 8) $occurrences++;
break;
case 4:
if($event['recur_data'] & 16) $occurrences++;
break;
case 5:
if($event['recur_data'] & 32) $occurrences++;
break;
case 6:
if($event['recur_data'] & 64) $occurrences++;
break;
}
}
$sifEvent .= '<Occurrences>'. $occurrences .'</Occurrences>';
}
break;
}
break;
case 'Sensitivity':
$value = (!$value ? '2' : '0');
$sifEvent .= "<$sifField>$value</$sifField>";
break;
case 'Folder':
# skip currently. This is the folder where Outlook stores the contact.
#$sifEvent .= "<$sifField>/</$sifField>";
break;
case 'AllDayEvent':
case 'End':
// get's handled by Start clause
break;
case 'Start':
if($event['end'] - $event['start'] == 86399 && date('Y-m-d', $event['end']) == date('Y-m-d', $event['start'])) {
$value = date('Y-m-d', $event['start']);
$sifEvent .= "<Start>$value</Start>";
$sifEvent .= "<End>$value</End>";
$sifEvent .= "<AllDayEvent>1</AllDayEvent>";
} else {
$value = $vcal->_exportDateTime($event['start']);
$sifEvent .= "<Start>$value</Start>";
$value = $vcal->_exportDateTime($event['end']);
$sifEvent .= "<End>$value</End>";
$sifEvent .= "<AllDayEvent>0</AllDayEvent>";
}
break;
case 'ReminderMinutesBeforeStart':
break;
case 'ReminderSet':
if(count((array)$event['alarm']) > 0) {
$sifEvent .= "<$sifField>1</$sifField>";
foreach($event['alarm'] as $alarmID => $alarmData)
{
$sifEvent .= '<ReminderMinutesBeforeStart>'. $alarmData['offset']/60 .'</ReminderMinutesBeforeStart>';
// lets take only the first alarm
break;
}
} else {
$sifEvent .= "<$sifField>0</$sifField>";
}
break;
default:
$sifEvent .= "<$sifField>$value</$sifField>";
break;
}
}
$sifEvent .= '</appointment>';
return base64_encode($sifEvent);
}
if($this->xmlrpc)
{
$GLOBALS['server']->xmlrpc_error($GLOBALS['xmlrpcerr']['no_access'],$GLOBALS['xmlrpcstr']['no_access']);
}
return False;
}
}

View File

@ -58,7 +58,7 @@ define('ACCEPTED',3);
* BO's functions take and return user-time only (!), they convert internaly everything to servertime, because
* SO operates only on server-time
*/
class socal
class calendar_so
{
/**
* name of the main calendar table and prefix for all other calendar tables
@ -82,7 +82,7 @@ class socal
/**
* Constructor of the socal class
*/
function socal()
function __construct()
{
$this->async = $GLOBALS['egw']->asyncservice;
$this->db = $GLOBALS['egw']->db;
@ -1045,8 +1045,19 @@ ORDER BY cal_user_type, cal_usre_id
return $this->async->cancel_timer($id);
}
function change_delete_user($old_user,$new_user=false)
/**
* Delete account hook
*
* @param array|int $old_user integer old user or array with keys 'account_id' and 'new_owner' as the deleteaccount hook uses it
* @param int $new_user=null
*/
function deleteaccount($data)
{
if (is_array($old_user))
{
$new_user = $old_user['new_owner'];
$old_user = $old_user['account_id'];
}
if (!(int)$new_user)
{
$this->split_user($old_user,$user_type,$user_id);

View File

@ -22,7 +22,7 @@
*
* All permanent debug messages of the calendar-code should done via the debug-message method of the bocal class !!!
*/
class uical
class calendar_ui
{
/**
* @var $debug mixed integer level or string function-name
@ -31,7 +31,7 @@ class uical
/**
* instance of the bocal or bocalupdate class
*
* @var bocalupdate
* @var calendar_boupdate
*/
var $bo;
/**
@ -40,12 +40,6 @@ class uical
* @var jscalendar
*/
var $jscal;
/**
* Reference to global html class
*
* @var html
*/
var $html;
/**
* Reference to global datetime class
*
@ -129,14 +123,19 @@ class uical
/**
* Constructor
*
* @param boolean $use_bocalupdate use bocalupdate as parenent instead of bocal
* @param boolean $use_boupdate use bocalupdate as parenent instead of bocal
* @param array $set_states=null to manualy set / change one of the states, default NULL = use $_REQUEST
*/
function uical($use_bocalupdate=false,$set_states=NULL)
function __construct($use_boupdate=false,$set_states=NULL)
{
$bo_class = $use_bocalupdate ? 'bocalupdate' : 'bocal';
require_once(EGW_INCLUDE_ROOT.'/calendar/inc/class.'.$bo_class.'.inc.php');
$this->bo = new $bo_class();
if ($use_boupdate)
{
$this->bo = new calendar_boupdate();
}
else
{
$this->bo = new calendar_bo();
}
$this->jscal = $GLOBALS['egw']->jscalendar;
$this->datetime = $GLOBALS['egw']->datetime;
$this->accountsel = $GLOBALS['egw']->uiaccountsel;
@ -299,7 +298,7 @@ class uical
}
}
// for the uiforms class (eg. edit), dont store the (new) owner, as it might change the view
if (substr($_GET['menuaction'],0,16) == 'calendar.uiforms')
if (substr($_GET['menuaction'],0,16) == 'calendar.calendar_uiforms')
{
$this->owner = $set_states[$state];
continue;
@ -359,7 +358,7 @@ class uical
}
$this->view = $states['view'] = $func;
}
$this->view_menuaction = $this->view == 'listview' ? 'calendar.uilist.listview' : 'calendar.uiviews.'.$this->view;
$this->view_menuaction = $this->view == 'listview' ? 'calendar.calendar_uilist.listview' : 'calendar.calendar_uiviews.'.$this->view;
if ($this->debug > 0 || $this->debug == 'manage_states') $this->bo->debug_message('uical::manage_states(%1) session was %2, states now %3',True,$set_states,$states_session,$states);
// save the states in the session
@ -464,7 +463,7 @@ class uical
function add_link($content,$date=null,$hour=null,$minute=0)
{
$vars = array(
'menuaction'=>'calendar.uiforms.edit',
'menuaction'=>'calendar.calendar_uiforms.edit',
'date' => $date ? $date : $this->date,
);
if (!is_null($hour))
@ -537,11 +536,11 @@ class uical
$views = '<table style="width: 100%;"><tr>'."\n";
foreach(array(
'add' => array('icon'=>'new','text'=>'add'),
'day' => array('icon'=>'today','text'=>'Today','menuaction' => 'calendar.uiviews.day','date' => $this->bo->date2string($this->bo->now_su)),
'week' => array('icon'=>'week','text'=>'Weekview','menuaction' => 'calendar.uiviews.week'),
'month' => array('icon'=>'month','text'=>'Monthview','menuaction' => 'calendar.uiviews.month'),
'planner' => array('icon'=>'planner','text'=>'Group planner','menuaction' => 'calendar.uiviews.planner','sortby' => $this->sortby),
'list' => array('icon'=>'list','text'=>'Listview','menuaction'=>'calendar.uilist.listview'),
'day' => array('icon'=>'today','text'=>'Today','menuaction' => 'calendar.calendar_uiviews.day','date' => $this->bo->date2string($this->bo->now_su)),
'week' => array('icon'=>'week','text'=>'Weekview','menuaction' => 'calendar.calendar_uiviews.week'),
'month' => array('icon'=>'month','text'=>'Monthview','menuaction' => 'calendar.calendar_uiviews.month'),
'planner' => array('icon'=>'planner','text'=>'Group planner','menuaction' => 'calendar.calendar_uiviews.planner','sortby' => $this->sortby),
'list' => array('icon'=>'list','text'=>'Listview','menuaction'=>'calendar.calendar_uilist.listview'),
) as $view => $data)
{
$icon = array_shift($data);
@ -562,49 +561,49 @@ class uical
foreach(array(
array(
'text' => lang('dayview'),
'value' => 'menuaction=calendar.uiviews.day',
'value' => 'menuaction=calendar.calendar_uiviews.day',
'selected' => $this->view == 'day',
),
array(
'text' => lang('four days view'),
'value' => 'menuaction=calendar.uiviews.day4',
'value' => 'menuaction=calendar.calendar_uiviews.day4',
'selected' => $this->view == 'day4',
),
array(
'text' => lang('weekview with weekend'),
'value' => 'menuaction=calendar.uiviews.week&days=7',
'value' => 'menuaction=calendar.calendar_uiviews.week&days=7',
'selected' => $this->view == 'week' && $this->cal_prefs['days_in_weekview'] != 5,
),
array(
'text' => lang('weekview without weekend'),
'value' => 'menuaction=calendar.uiviews.week&days=5',
'value' => 'menuaction=calendar.calendar_uiviews.week&days=5',
'selected' => $this->view == 'week' && $this->cal_prefs['days_in_weekview'] == 5,
),
array(
'text' => lang('Multiple week view'),
'value' => 'menuaction=calendar.uiviews.weekN',
'value' => 'menuaction=calendar.calendar_uiviews.weekN',
'selected' => $this->view == 'weekN',
),
array(
'text' => lang('monthview'),
'value' => 'menuaction=calendar.uiviews.month',
'value' => 'menuaction=calendar.calendar_uiviews.month',
'selected' => $this->view == 'month',
),
array(
'text' => lang('planner by category'),
'value' => 'menuaction=calendar.uiviews.planner&sortby=category'.
'value' => 'menuaction=calendar.calendar_uiviews.planner&sortby=category'.
($planner_days_for_view !== false ? '&planner_days='.$planner_days_for_view : ''),
'selected' => $this->view == 'planner' && $this->sortby != 'user',
),
array(
'text' => lang('planner by user'),
'value' => 'menuaction=calendar.uiviews.planner&sortby=user'.
'value' => 'menuaction=calendar.calendar_uiviews.planner&sortby=user'.
($planner_days_for_view !== false ? '&planner_days='.$planner_days_for_view : ''),
'selected' => $this->view == 'planner' && $this->sortby == 'user',
),
array(
'text' => lang('listview'),
'value' => 'menuaction=calendar.uilist.listview',
'value' => 'menuaction=calendar.calendar_uilist.listview',
'selected' => $this->view == 'listview',
),
) as $data)
@ -620,16 +619,16 @@ class uical
'text' => html::form('<input name="keywords" value="'.$value.'" style="width: 185px;"'.
' onFocus="if(this.value==\''.$blur.'\') this.value=\'\';"'.
' onBlur="if(this.value==\'\') this.value=\''.$blur.'\';" title="'.lang('Search').'">',
'','/index.php',array('menuaction'=>'calendar.uilist.listview')),
'','/index.php',array('menuaction'=>'calendar.calendar_uilist.listview')),
'no_lang' => True,
'link' => False,
);
// Minicalendar
$link = array();
foreach(array(
'day' => 'calendar.uiviews.day',
'week' => 'calendar.uiviews.week',
'month' => 'calendar.uiviews.month') as $view => $menuaction)
'day' => 'calendar.calendar_uiviews.day',
'week' => 'calendar.calendar_uiviews.week',
'month' => 'calendar.calendar_uiviews.month') as $view => $menuaction)
{
if ($this->view == 'planner' || $this->view == 'listview')
{
@ -715,7 +714,7 @@ function load_cal(url,id) {
}
// Import & Export
$file[] = array(
'text' => lang('Export').': '.html::a_href(lang('iCal'),'calendar.uiforms.export',$this->first ? array(
'text' => lang('Export').': '.html::a_href(lang('iCal'),'calendar.calendar_uiforms.export',$this->first ? array(
'start' => $this->bo->date2string($this->first),
'end' => $this->bo->date2string($this->last),
) : false),
@ -723,15 +722,15 @@ function load_cal(url,id) {
'link' => False,
);
$file[] = array(
'text' => lang('Import').': '.html::a_href(lang('iCal'),'calendar.uiforms.import').
'text' => lang('Import').': '.html::a_href(lang('iCal'),'calendar.calendar_uiforms.import').
' &amp; '.html::a_href(lang('CSV'),'/calendar/csv_import.php'),
'no_lang' => True,
'link' => False,
);
/*
$print_functions = array(
'calendar.uiviews.day' => 'calendar.pdfcal.day',
'calendar.uiviews.week' => 'calendar.pdfcal.week',
'calendar.calendar_uiviews.day' => 'calendar.pdfcal.day',
'calendar.calendar_uiviews.week' => 'calendar.pdfcal.week',
);
if (isset($print_functions[$_GET['menuaction']]))
{

View File

@ -5,13 +5,11 @@
* @link http://www.egroupware.org
* @package calendar
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @copyright (c) 2004-7 by RalfBecker-At-outdoor-training.de
* @copyright (c) 2004-8 by RalfBecker-At-outdoor-training.de
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
include_once(EGW_INCLUDE_ROOT . '/calendar/inc/class.uical.inc.php');
/**
* calendar UserInterface forms: view and edit events, freetime search
*
@ -24,7 +22,7 @@ include_once(EGW_INCLUDE_ROOT . '/calendar/inc/class.uical.inc.php');
*
* All permanent debug messages of the calendar-code should done via the debug-message method of the bocal class !!!
*/
class uiforms extends uical
class calendar_uiforms extends calendar_ui
{
var $public_functions = array(
'freetimesearch' => True,
@ -32,12 +30,6 @@ class uiforms extends uical
'export' => true,
'import' => true,
);
/**
* Reference to link-class of bocal
*
* @var bolink
*/
var $link;
/**
* Standard durations used in edit and freetime search
@ -63,11 +55,9 @@ class uiforms extends uical
/**
* Constructor
*/
function uiforms()
function __construct()
{
$this->uical(true); // call the parent's constructor
$this->link =& $this->bo->link;
parent::__construct(true); // call the parent's constructor
for ($n=15; $n <= 8*60; $n+=($n < 60 ? 15 : ($n < 240 ? 30 : 60)))
{
@ -436,7 +426,7 @@ class uiforms extends uical
$msg .= ($msg ? ', ' : '') .lang('Error: the entry has been updated since you opened it for editing!').'<br />'.
lang('Copy your changes to the clipboard, %1reload the entry%2 and merge them.','<a href="'.
htmlspecialchars($GLOBALS['egw']->link('/index.php',array(
'menuaction' => 'calendar.uiforms.edit',
'menuaction' => 'calendar.calendar_uiforms.edit',
'cal_id' => $content['id'],
'referer' => $referer,
))).'">','</a>');
@ -745,7 +735,7 @@ class uiforms extends uical
elseif(egw_vfs::lock($lock_path,$preserv['lock_token'],$locktime,$lock_owner,$scope='shared',$type='write',false,false))
{
// install ajax handler to unlock the entry again, if the window get's closed by the user
$GLOBALS['egw']->js->set_onunload("xajax_doXMLHTTP('calendar.uiforms.ajax_unlock',$event[id],'$preserv[lock_token]');");
$GLOBALS['egw']->js->set_onunload("xajax_doXMLHTTP('calendar.calendar_uiforms.ajax_unlock',$event[id],'$preserv[lock_token]');");
}
else
{
@ -952,7 +942,7 @@ class uiforms extends uical
}
else
{
$etpl->exec('calendar.uiforms.process_edit',$content,$sel_options,$readonlys,$preserv,$preserv['no_popup'] ? 0 : 2);
$etpl->exec('calendar.calendar_uiforms.process_edit',$content,$sel_options,$readonlys,$preserv,$preserv['no_popup'] ? 0 : 2);
}
}
@ -1007,7 +997,7 @@ class uiforms extends uical
);
$GLOBALS['egw_info']['flags']['app_header'] = lang('calendar') . ' - ' . lang('Scheduling conflict');
$etpl->exec('calendar.uiforms.process_edit',$content,false,false,array_merge($event,$preserv),$preserv['no_popup'] ? 0 : 2);
$etpl->exec('calendar.calendar_uiforms.process_edit',$content,false,false,array_merge($event,$preserv),$preserv['no_popup'] ? 0 : 2);
}
/**
@ -1169,7 +1159,7 @@ class uiforms extends uical
// the call to set_style_by_class has to be in onload, to make sure the function and the element is already created
$GLOBALS['egw']->js->set_onload("set_style_by_class('table','end_hide','visibility','".($content['duration'] && isset($sel_options['duration'][$content['duration']]) ? 'hidden' : 'visible')."');");
$etpl->exec('calendar.uiforms.freetimesearch',$content,$sel_options,'',array(
$etpl->exec('calendar.calendar_uiforms.freetimesearch',$content,$sel_options,'',array(
'participants' => $content['participants'],
'cal_id' => $content['cal_id'],
'recur_type' => $content['recur_type'],
@ -1389,7 +1379,7 @@ class uiforms extends uical
$GLOBALS['egw_info']['flags']['app_header'] = lang('calendar') . ' - ' . lang('iCal Export');
$etpl =& CreateObject('etemplate.etemplate','calendar.export');
$etpl->exec('calendar.uiforms.export',$content);
$etpl->exec('calendar.calendar_uiforms.export',$content);
}
/**
@ -1423,6 +1413,6 @@ class uiforms extends uical
$GLOBALS['egw_info']['flags']['app_header'] = lang('calendar') . ' - ' . lang('iCal Import');
$etpl =& CreateObject('etemplate.etemplate','calendar.import');
$etpl->exec('calendar.uiforms.import',$content);
$etpl->exec('calendar.calendar_uiforms.import',$content);
}
}

View File

@ -5,13 +5,11 @@
* @link http://www.egroupware.org
* @package calendar
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @copyright (c) 2005-7 by RalfBecker-At-outdoor-training.de
* @copyright (c) 2005-8 by RalfBecker-At-outdoor-training.de
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
include_once(EGW_INCLUDE_ROOT . '/calendar/inc/class.uical.inc.php');
/**
* Class to generate the calendar listview and the search
*
@ -24,20 +22,20 @@ include_once(EGW_INCLUDE_ROOT . '/calendar/inc/class.uical.inc.php');
*
* All permanent debug messages of the calendar-code should done via the debug-message method of the bocal class !!!
*/
class uilist extends uical
class calendar_uilist extends calendar_ui
{
var $public_functions = array(
'listview' => True,
);
/**
* integer level or string function- or widget-name
*
*
* @var mixed
*/
var $debug=false;
/**
* Filternames
*
*
* @var array
*/
var $date_filters = array(
@ -52,22 +50,22 @@ class uilist extends uical
*
* @param array $set_states=null to manualy set / change one of the states, default NULL = use $_REQUEST
*/
function uilist($set_states=null)
function __construct($set_states=null)
{
$this->uical(true,$set_states); // call the parent's constructor
parent::__construct(true,$set_states); // call the parent's constructor
$GLOBALS['egw_info']['flags']['app_header'] = $GLOBALS['egw_info']['apps']['calendar']['title'].' - '.lang('Listview').
// for a single owner we add it's name to the app-header
(count(explode(',',$this->owner)) == 1 ? ': '.$this->bo->participant_name($this->owner) : '');
foreach($this->date_filters as $name => $label)
{
$this->date_filters[$name] = lang($label);
}
$this->check_owners_access();
}
/**
* Show the calendar on the home page
*
@ -82,13 +80,13 @@ class uilist extends uical
'filter' => 'all',
'owner' => $this->user,
'multiple' => 0,
'view' => $this->bo->cal_prefs['defaultcalendar'],
'view' => $this->bo->cal_prefs['defaultcalendar'],
));
$GLOBALS['egw']->session->appsession('calendar_list','calendar',''); // in case there's already something set
return $this->listview(null,'',true);
}
}
/**
* Show the listview
*/
@ -112,12 +110,12 @@ class uilist extends uical
if (is_array($content) && $content['deleteall'])
{
//_debug_array($content);
foreach($content['nm']['rows']['checked'] as $num => $id)
{
if ($this->bo->delete($id))
{
$msg .= lang('Event deleted');
$msg .= lang('Event deleted');
}
}
}
@ -128,7 +126,7 @@ class uilist extends uical
if (!is_array($content['nm']))
{
$content['nm'] = array(
'get_rows' => 'calendar.uilist.get_rows',
'get_rows' => 'calendar.calendar_uilist.get_rows',
'filter_no_lang' => True, // I set no_lang for filter (=dont translate the options)
'no_filter2' => True, // I disable the 2. filter (params are the same as for filter)
'no_cat' => True, // I disable the cat-selectbox
@ -145,11 +143,11 @@ class uilist extends uical
{
$this->adjust_for_search($_REQUEST['keywords'],$content['nm']);
}
return $etpl->exec('calendar.uilist.listview',$content,array(
return $etpl->exec('calendar.calendar_uilist.listview',$content,array(
'filter' => &$this->date_filters,
),$readonlys,'',$home ? -1 : 0);
}
/**
* set filter for search, so that everything is shown
*/
@ -174,7 +172,7 @@ class uilist extends uical
/**
* query calendar for nextmatch in the listview
*
* @internal
* @internal
* @param array &$params parameters
* @param array &$rows returned rows/events
* @param array &$readonlys eg. to disable buttons based on acl
@ -214,7 +212,7 @@ class uilist extends uical
$this->adjust_for_search($params['search'],$params);
}
$GLOBALS['egw']->session->appsession('calendar_list','calendar',$params);
$search_params = array(
'cat_id' => $this->cat_id,
'filter' => $this->filter,
@ -311,7 +309,7 @@ class uilist extends uical
$rows['format'] = '16';
$dv=1;
}
if ($wv&&$dv)
if ($wv&&$dv)
{
$rows['format'] = '64';
}

View File

@ -10,12 +10,9 @@
* @version $Id$
*/
include_once(EGW_INCLUDE_ROOT . '/calendar/inc/class.uical.inc.php');
require_once(EGW_INCLUDE_ROOT . '/phpgwapi/inc/class.dragdrop.inc.php');
/**
* Class to generate the calendar views and the necesary widgets
*
*
* The listview is in a separate class uilist!
*
* The new UI, BO and SO classes have a strikt definition, in which time-zone they operate:
@ -27,7 +24,7 @@ require_once(EGW_INCLUDE_ROOT . '/phpgwapi/inc/class.dragdrop.inc.php');
*
* All permanent debug messages of the calendar-code should done via the debug-message method of the bocal class !!!
*/
class uiviews extends uical
class calendar_uiviews extends calendar_ui
{
var $public_functions = array(
'day' => True,
@ -36,32 +33,33 @@ class uiviews extends uical
'weekN' => True,
'month' => True,
'planner' => True,
'index' => True,
);
/**
* integer level or string function- or widget-name
*
*
* @var mixed
*/
var $debug=false;
/**
* minimum width for an event
*
*
* @var int
*/
var $eventCol_min_width = 80;
/**
* extra rows above and below the workday
*
*
* @var int
*/
var $extraRows = 2;
/**
* extra rows original (save original value even if it gets changed in the class)
*
*
* @var int
*/
var $extraRowsOriginal;
@ -70,46 +68,46 @@ class uiviews extends uical
/**
* how many rows per day get displayed, gets set be the timeGridWidget
*
*
* @var int
*/
var $rowsToDisplay;
/**
* height in percent of one row, gets set be the timeGridWidget
*
*
* @var int
*/
var $rowHeight;
/**
* standard params for calling bocal::search for all views, set by the constructor
*
*
* @var array
*/
var $search_params;
/**
* should we use a time grid, can be set for week- and month-view to false by the cal_pref no_time_grid
*
*
* @var boolean
*/
var $use_time_grid=true;
/**
* Dragdrop Object
*
* @var dragdrop;
*/
var $dragdrop;
/**
* Can we display the whole day in a timeGrid of the size of the workday and just scroll to workday start
*
* @var boolean
*/
var $scroll_to_wdstart=false;
/**
* counter for the current whole day event of a single day
*
@ -122,9 +120,9 @@ class uiviews extends uical
*
* @param array $set_states=null to manualy set / change one of the states, default NULL = use $_REQUEST
*/
function uiviews($set_states=null)
function __construct($set_states=null)
{
$this->uical(false,$set_states); // call the parent's constructor
parent::__construct(false,$set_states); // call the parent's constructor
$this->extraRowsOriginal = $this->extraRows; //save original extraRows value
$GLOBALS['egw_info']['flags']['nonavbar'] = False;
@ -149,7 +147,7 @@ class uiviews extends uical
'daywise' => True,
);
$this->holidays = $this->bo->read_holidays($this->year);
$this->check_owners_access();
if($GLOBALS['egw_info']['user']['preferences']['common']['enable_dragdrop'])
@ -160,7 +158,7 @@ class uiviews extends uical
if(!$this->dragdrop->validateBrowser()) { $this->dragdrop = false; }
}
}
/**
* Show the last view or the default one, if no last
*/
@ -175,10 +173,10 @@ class uiviews extends uical
}
// get manual to load the right page
$GLOBALS['egw_info']['flags']['params']['manual'] = array('page' => 'ManualCalendar'.ucfirst($this->view));
$this->{$this->view}();
}
/**
* Show the calendar on the home page
*
@ -191,12 +189,12 @@ class uiviews extends uical
'date' => $this->bo->date2string($this->bo->now_su),
'cat_id' => 0,
'filter' => 'all',
'owner' => substr($this->cal_prefs['defaultcalendar'],0,7) == 'planner' && $this->cal_prefs['planner_start_with_group'] ?
'owner' => substr($this->cal_prefs['defaultcalendar'],0,7) == 'planner' && $this->cal_prefs['planner_start_with_group'] ?
$this->cal_prefs['planner_start_with_group'] : $this->user,
'multiple' => 0,
'view' => $this->bo->cal_prefs['defaultcalendar'],
'view' => $this->bo->cal_prefs['defaultcalendar'],
));
if (($error = $this->check_owners_access()))
{
return $error;
@ -218,12 +216,12 @@ class uiviews extends uical
default:
case 'week':
return $group_warning.$this->week(0,true);
case 'day':
return $group_warning.$this->day(true);
}
}
/**
* Displays the planner view
*
@ -265,7 +263,7 @@ class uiviews extends uical
$GLOBALS['egw_info']['flags']['app_header'] .= ': '.($this->planner_days == 1 ? lang(date('l',$this->first)).', ' : '').
$this->bo->long_date($this->first,$this->planner_days > 1 ? $this->last : 0);
}
$search_params = $this->search_params;
$search_params['daywise'] = false;
$search_params['start'] = $this->first;
@ -280,12 +278,12 @@ class uiviews extends uical
if (!$home)
{
$this->do_header();
echo $content;
}
return $content;
}
/**
* Displays a multiple week-view
*
@ -339,7 +337,7 @@ class uiviews extends uical
$week[$day_ymd] = array_shift($days);
}
$week_view = array(
'menuaction' => 'calendar.uiviews.week',
'menuaction' => 'calendar.calendar_uiviews.week',
'date' => $this->bo->date2string($week_start),
);
$title = lang('Wk').' '.adodb_date('W',$week_start);
@ -350,7 +348,7 @@ class uiviews extends uical
if (!$home)
{
$this->do_header();
echo $content;
}
@ -378,17 +376,17 @@ class uiviews extends uical
else
{
$last = $this->datetime->get_weekday_start($this->year,$this->month+1,$day);
}
}
// now we need to calculate the end of the last day of that week
// as simple $last += WEEK_s - 1; does NOT work, if daylight saving changes in that week!!!
$last = $this->bo->date2array($last);
$last['day'] += 6;
$last['hour'] = 23;
$last['day'] += 6;
$last['hour'] = 23;
$last['min'] = $last['sec'] = 59;
unset($last['raw']); // otherwise date2ts does not calc raw new, but uses it
$last = $this->bo->date2ts($last);
}
/**
* Four days view, everythings done by the week-view code ...
*
@ -445,7 +443,7 @@ class uiviews extends uical
break;
}
}
$this->last = strtotime("+$days days",$this->first) - 1;
$this->last = strtotime("+$days days",$this->first) - 1;
$GLOBALS['egw_info']['flags']['app_header'] .= ': '.lang('Week').' '.adodb_date('W',$this->first).': '.$this->bo->long_date($this->first,$this->last);
}
@ -473,7 +471,7 @@ class uiviews extends uical
$users = $this->search_params['users'];
if (!is_array($users)) $users = array($users);
if (count($users) == 1 || count($users) > 5) // for more then 3 users, show all in one row
{
$content =& $this->timeGridWidget($this->tagWholeDayOnTop($this->bo->search($search_params)),$this->cal_prefs['interval']);
@ -488,11 +486,11 @@ class uiviews extends uical
$content .= $this->timeGridWidget($this->tagWholeDayOnTop($this->bo->search($search_params)),
count($users) * $this->cal_prefs['interval'],400 / count($users),'','',$uid);
}
}
}
if (!$home)
{
$this->do_header();
echo $content;
}
@ -513,20 +511,20 @@ class uiviews extends uical
$this->last = $this->first = $this->bo->date2ts((string)$this->date);
$GLOBALS['egw_info']['flags']['app_header'] .= ': '.$this->bo->long_date($this->first,0,false,true);
$this->use_time_grid = true; // day-view always uses a time-grid, independent what's set in the prefs!
$this->search_params['end'] = $this->last = $this->first+DAY_s-1;
if (!$home)
{
$this->do_header();
$users = $this->search_params['users'];
if (!is_array($users)) $users = array($users);
// for more then 5 users, show all in one row
if (count($users) == 1 || count($users) > 5)
if (count($users) == 1 || count($users) > 5)
{
$dayEvents =& $this->bo->search($this->search_params);
$owner = 0;
@ -577,7 +575,7 @@ class uiviews extends uical
else
{
$content = $this->timeGridWidget($this->bo->search($this->search_params),$this->cal_prefs['interval'],300);
// make wz_dragdrop elements work
if(is_object($this->dragdrop)) { $this->dragdrop->setJSCode(); }
@ -658,7 +656,7 @@ class uiviews extends uical
}
return $todo_label ? '' : false;
}
/**
* Calculates the vertical position based on the time
*
@ -735,10 +733,10 @@ class uiviews extends uical
// determine if the browser supports scrollIntoView: IE4+, firefox1.0+ and safari2.0+ does
// then show all hours in a div of the size of the workday and scroll to the workday start
// still disabled, as things need to be re-aranged first, to that the column headers are not scrolled
$this->scroll_to_wdstart = false;/*$this->use_time_grid && (html::$user_agent == 'msie' ||
$this->scroll_to_wdstart = false;/*$this->use_time_grid && (html::$user_agent == 'msie' ||
html::$user_agent == 'mozilla' && html::ua_version >= 5.0 ||
html::$user_agent == 'safari' && html::ua_version >= 2.0);*/
if ($this->scroll_to_wdstart)
{
$this->extraRows = 0; // no extra rows necessary
@ -752,7 +750,7 @@ class uiviews extends uical
$totalDisplayMinutes = $this->wd_end - $this->wd_start;
$this->rowsToDisplay = ($totalDisplayMinutes/$granularity_m)+2+2*$this->extraRows;
$this->rowHeight = round(100/$this->rowsToDisplay,1);
// ensure a minimum height of each row
if ($height < ($this->rowsToDisplay+1) * 12)
{
@ -767,7 +765,7 @@ class uiviews extends uical
{
$off = false; // Off-row means a different bgcolor
$add_links = count($daysEvents) == 1;
// the hour rows
for($t = $this->scroll_to_wdstart ? 0 : $this->wd_start,$i = 1+$this->extraRows;
$t <= $this->wd_end || $this->scroll_to_wdstart && $t < 24*60;
@ -814,12 +812,12 @@ class uiviews extends uical
{
// Lars Kneschke 2005-08-28
// why do we use a div in a div which has the same height and width???
// To make IE6 happy!!! Without the second div you can't use
// To make IE6 happy!!! Without the second div you can't use
// style="left: 50px; right: 0px;"
//$html .= '<div style="width=100%; height: 100%;">'."\n";
// Ralf Becker 2006-06-19
// Lars original typo "width=100%; height: 100%;" is important ;-)
// Lars original typo "width=100%; height: 100%;" is important ;-)
// means you width: 100% does NOT work, you need no width!
$html .= '<div style="height: 100%;">'."\n";
}
@ -845,7 +843,7 @@ class uiviews extends uical
$html .= $indent."\t</div>\n"; // calDayCols
}
$html .= $indent."</div>\n"; // calTimeGrid
if ($this->scroll_to_wdstart)
{
$html .= "<script>\n\tdocument.getElementById('$id').scrollIntoView();\n";
@ -878,7 +876,7 @@ class uiviews extends uical
if ($this->debug > 1 || $this->debug==='dayColWidget') $this->bo->debug_message('uiviews::dayColWidget(%1,%2,left=%3,width=%4,)',False,$day_ymd,$events,$left,$width);
$day_start = $this->bo->date2ts((string)$day_ymd);
// if daylight saving is switched on or off, correct $day_start
// gives correct times after 2am, times between 0am and 2am are wrong
if(($daylight_diff = $day_start + 12*HOUR_s - ($this->bo->date2ts($day_ymd."T120000"))))
@ -921,9 +919,9 @@ class uiviews extends uical
$ts = $this->bo->date2ts((string)$day_ymd);
$title = !is_bool($short_title) ? $short_title :
($short_title ? lang(adodb_date('l',$ts)).' '.adodb_date('d.',$ts) : $this->bo->long_date($ts,0,false,true));
$day_view = array(
'menuaction' => 'calendar.uiviews.day',
'menuaction' => 'calendar.calendar_uiviews.day',
'date' => $day_ymd,
);
$this->_day_class_holiday($day_ymd,$class,$holidays);
@ -966,7 +964,7 @@ class uiviews extends uical
$t += $this->granularity_m,++$i)
{
$linkData = array(
'menuaction' =>'calendar.uiforms.edit',
'menuaction' =>'calendar.calendar_uiforms.edit',
'date' => $day_ymd,
'hour' => sprintf("%02d",floor($t / 60)),
'minute' => sprintf("%02d",floor($t % 60)),
@ -975,9 +973,9 @@ class uiviews extends uical
$droppableDateTime = $linkData['date'] . "T" . $linkData['hour'] . $linkData['minute'];
$droppableID='drop_'.$droppableDateTime.'_O'.$owner;
$html .= $indent."\t".'<div id="' . $droppableID . '" style="height:'. $this->rowHeight .'%; top: '. $i*$this->rowHeight .
'%;" class="calAddEvent" onclick="'.$this->popup($GLOBALS['egw']->link('/index.php',$linkData)).';return false;"></div>'."\n";
'%;" class="calAddEvent" onclick="'.$this->popup($GLOBALS['egw']->link('/index.php',$linkData)).';return false;"></div>'."\n";
if(is_object($this->dragdrop) && $dropPermission)
{
@ -1002,7 +1000,7 @@ class uiviews extends uical
return $html;
}
/**
* get the CSS class and holidays for a given day
*
@ -1040,7 +1038,7 @@ class uiviews extends uical
else
{
$day = (int) date('w',$this->bo->date2ts((string) $day_ymd));
if ($only_weekend)
{
$class = $day == 0 || $day == 6 ? 'th' : 'row_off';
@ -1091,7 +1089,7 @@ class uiviews extends uical
* @param int $owner owner of the calendar the event is in
* @param boolean $return_array=false should an array with keys(tooltip,popup,html) be returned or the complete widget as string
* @param string $block='event_widget' template used the render the widget
* @return string/array
* @return string/array
*/
function eventWidget($event,$width,$indent,$owner,$return_array=false,$block='event_widget')
{
@ -1103,7 +1101,7 @@ class uiviews extends uical
if (!$tpl)
{
$tpl = $GLOBALS['egw']->template;
$tpl->set_root($GLOBALS['egw']->common->get_tpl_dir('calendar'));
$tpl->set_file('event_widget_t','event_widget.tpl');
$tpl->set_block('event_widget_t','event_widget');
@ -1142,7 +1140,7 @@ class uiviews extends uical
// the body-colors (gradient) are calculated from the headercolor, which depends on the cat of an event
$bodybgcolor1 = $this->brighter($headerbgcolor,$headerbgcolor == '#808080' ? 100 : 170);
$bodybgcolor2 = $this->brighter($headerbgcolor,220);
// seperate each participant types
$part_array = array();
foreach($this->bo->participants($event) as $part_key => $participant)
@ -1164,7 +1162,7 @@ class uiviews extends uical
$small = $this->view != 'day' || $width < 50;
// $small = $width <= $small_trigger_width
$small_height = $this->use_time_grid && ( $event['end_m']-$event['start_m'] < 2*$this->granularity_m ||
$small_height = $this->use_time_grid && ( $event['end_m']-$event['start_m'] < 2*$this->granularity_m ||
$event['end_m'] <= $this->wd_start || $event['start_m'] >= $this->wd_end);
$tpl->set_var(array(
@ -1222,11 +1220,11 @@ class uiviews extends uical
$tpl->set_var('tooltip',html::tooltip($tooltip,False,array('BorderWidth'=>0,'Padding'=>0)));
$html = $tpl->fp('out',$block);
$view_link = $GLOBALS['egw']->link('/index.php',array('menuaction'=>'calendar.uiforms.edit','cal_id'=>$event['id'],'date'=>$this->bo->date2string($event['start'])));
$view_link = $GLOBALS['egw']->link('/index.php',array('menuaction'=>'calendar.calendar_uiforms.edit','cal_id'=>$event['id'],'date'=>$this->bo->date2string($event['start'])));
if ($event['recur_type']!= MCAL_RECUR_NONE)
if ($event['recur_type']!= MCAL_RECUR_NONE)
{
$view_link_confirm_abort = $GLOBALS['egw']->link('/index.php',array('menuaction'=>'calendar.uiforms.edit','cal_id'=>$event['id'],'date'=>$this->bo->date2string($event['start']),'exception'=>1));
$view_link_confirm_abort = $GLOBALS['egw']->link('/index.php',array('menuaction'=>'calendar.calendar_uiforms.edit','cal_id'=>$event['id'],'date'=>$this->bo->date2string($event['start']),'exception'=>1));
$view_link_confirm_text=lang('do you want to edit serialevent als exception? - Ok = Edit Exception, Abort = Edit Serial');
$popup = $is_private ? '' : ' onclick="'.$this->popup($view_link_confirm_abort,null,750,410,$view_link,$view_link_confirm_text).'; return false;"';
@ -1237,8 +1235,8 @@ class uiviews extends uical
}
//_debug_array($event);
//echo $event['id']."?<br>";
if ($return_array)
{
return array(
@ -1354,8 +1352,8 @@ class uiviews extends uical
//echo "brighter($rgb=".print_r($components,True).")=$brighter</p>\n";
return $brighter;
}
/**
* Creates a planner view: grid with columns for the time and rows for categories or users
*
@ -1371,13 +1369,13 @@ class uiviews extends uical
function &plannerWidget($events,$start,$end,$by_cat=0,$indent='')
{
$content = $indent.'<div class="plannerWidget">'."\n";
// display the header, containing a headerTitle and multiple headerRows with the scales
$content .= $indent."\t".'<div class="plannerHeader">'."\n";
// display the headerTitle
$title = $by_cat === false ? lang('User') : lang('Category');
$content .= $indent."\t\t".'<div class="plannerHeaderTitle th">'.$title."</div>\n";
// display the headerRows with the scales
$content .= $indent."\t\t".'<div class="plannerHeaderRows">'."\n";
// set start & end to timestamp and first & last to timestamp of 12h midday, to avoid trouble with daylight saving
@ -1406,7 +1404,7 @@ class uiviews extends uical
}
$content .= $indent."\t\t</div>\n"; // end of the plannerHeaderRows
$content .= $indent."\t</div>\n"; // end of the plannerHeader
// sort the events after user or category
$rows = $sort2label = array();
if ($by_cat === false) // planner by user
@ -1451,10 +1449,10 @@ class uiviews extends uical
$content .= $this->plannerRowWidget(isset($rows[$sort]) ? $rows[$sort] : array(),$start,$end,$label,$class,$indent."\t");
}
$content .= $indent."</div>\n"; // end of the plannerWidget
return $content;
}
/**
* get all users to display in the planner_by_user
*
@ -1488,13 +1486,13 @@ class uiviews extends uical
}
asort($users);
asort($resources);
return $users+$resources;
}
/**
* get all categories used as sort criteria for the planner by category
*
*
* the returned cat is as direct sub-category of $this->cat_id or a main (level 1) category if !$this->cat_id
*
* @param string $cats comma-delimited cat_id's or empty for no cat
@ -1504,7 +1502,7 @@ class uiviews extends uical
function _get_planner_cats($cats,&$sort2label)
{
static $cat2sort;
if (!is_array($cat2sort))
{
$cat2sort = array();
@ -1518,7 +1516,7 @@ class uiviews extends uical
elseif(isset($cat2sort[$data['parent']])) // parent is already in the array => add us with same target
{
$cat2sort[$data['id']] = $cat2sort[$data['parent']];
}
}
}
}
$ret = array();
@ -1627,7 +1625,7 @@ class uiviews extends uical
return $content;
}
/**
* Creates a week scale for the planner
*
@ -1647,7 +1645,7 @@ class uiviews extends uical
if ($days > 7)
{
$title = html::a_href($title,array(
'menuaction' => 'calendar.uiviews.planner',
'menuaction' => 'calendar.calendar_uiviews.planner',
'planner_days' => 7,
'date' => date('Ymd',$t),
),false,' title="'.html::htmlspecialchars(lang('Weekview')).'"');
@ -1672,7 +1670,7 @@ class uiviews extends uical
return $content;
}
/**
* Creates day scale for the planner
*
@ -1700,12 +1698,12 @@ class uiviews extends uical
}
else
{
$title = substr(lang(date('D',$t)),0,2).'<br />'.date('j',$t);
$title = substr(lang(date('D',$t)),0,2).'<br />'.date('j',$t);
}
if ($days > 1)
{
$title = html::a_href($title,array(
'menuaction' => 'calendar.uiviews.planner',
'menuaction' => 'calendar.calendar_uiviews.planner',
'planner_days' => 1,
'date' => date('Ymd',$t),
),false,strpos($class,'calHoliday') !== false || strpos($class,'calBirthday') !== false ? '' : ' title="'.html::htmlspecialchars(lang('Dayview')).'"');
@ -1734,7 +1732,7 @@ class uiviews extends uical
return $content;
}
/**
* Creates hour scale for the planner
*
@ -1761,7 +1759,7 @@ class uiviews extends uical
$hours = ($this->bo->date2ts($t_arr) - $s) / HOUR_s;
}
$cell_width = round(100 / $hours * $decr,2);
$content .= $indent.'<div class="plannerScale">'."\n";
for($t = $start,$left = 0,$i = 0; $i < $hours; $t += $decr*HOUR_s,$left += $cell_width,$i += $decr)
{
@ -1774,7 +1772,7 @@ class uiviews extends uical
return $content;
}
/**
* Creates a row for one user or category, with a header (user or category name) and (multiple) rows with non-overlapping events
*
@ -1794,7 +1792,7 @@ class uiviews extends uical
// display the row-header
$content .= $indent."\t".'<div class="plannerRowHeader">'.$header."</div>\n";
// sorting the events in non-overlapping rows
$rows = array(array());
$row_end = array();
@ -1814,7 +1812,7 @@ class uiviews extends uical
$content .= $indent."\t</div>\n"; // end of the eventRows
$content .= $indent."</div>\n"; // end of the plannerRowWidget
return $content;
}
@ -1832,16 +1830,16 @@ class uiviews extends uical
function eventRowWidget($events,$start,$end,$indent='')
{
$content = $indent.'<div class="eventRowWidget">'."\n";
foreach($events as $event)
{
$content .= $this->plannerEventWidget($event,$start,$end,$indent."\t");
}
$content .= $indent."</div>\n";
return $content;
}
/**
* Calculate a time-dependent position in the planner
*
@ -1857,7 +1855,7 @@ class uiviews extends uical
{
if ($time <= $start) return 0; // we are left of our scale
if ($time >= $end) return 100; // we are right of our scale
if ($this->planner_days)
{
$percent = ($time - $start) / ($end - $start);
@ -1867,7 +1865,7 @@ class uiviews extends uical
$t_arr = $this->bo->date2array($time);
$day_start = $this->bo->date2ts((string)$t_arr['full']);
$percent = ($day_start - $start) / ($end - $start);
$time_of_day = 60 * $t_arr['hour'] + $t_arr['minute'];
if ($time_of_day >= $this->wd_start)
{
@ -1886,7 +1884,7 @@ class uiviews extends uical
}
}
$percent = round(100 * $percent,2);
//echo "<p>_planner_pos(".date('Y-m-d H:i',$time).', '.date('Y-m-d H:i',$start).', '.date('Y-m-d H:i',$end).") = $percent</p>\n";
return $percent;
}
@ -1913,7 +1911,7 @@ class uiviews extends uical
$left = $this->_planner_pos($event['start'],$start,$end);
$width = $this->_planner_pos($event['end'],$start,$end) - $left;
$color = $data['color'] ? $data['color'] : 'gray';
return $indent.'<div class="plannerEvent'.($data['private'] ? 'Private' : '').'" style="left: '.$left.
'%; width: '.$width.'%; background-color: '.$color.';"'.$data['popup'].' '.
html::tooltip($data['tooltip'],False,array('BorderWidth'=>0,'Padding'=>0)).'>'."\n".$data['html'].$indent."</div>\n";
@ -1952,7 +1950,7 @@ class uiviews extends uical
// check after every day if we have to increase $this->extraRows
if(($this->extraRowsOriginal+$extraRowsToAdd) > $this->extraRows) { $this->extraRows = ($this->extraRowsOriginal+$extraRowsToAdd); }
}
return $dayEvents;
}

View File

@ -1,502 +0,0 @@
<?php
/**************************************************************************\
* eGroupWare - SIF Parser *
* http://www.egroupware.org *
* Written by Lars Kneschke <l.kneschke@metaways.de> *
* -------------------------------------------- *
* 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; version 2 of the License. *
\**************************************************************************/
/* $Id$ */
require_once EGW_SERVER_ROOT.'/calendar/inc/class.bocalupdate.inc.php';
require_once EGW_SERVER_ROOT.'/phpgwapi/inc/horde/Horde/iCalendar.php';
class sifcalendar extends bocalupdate
{
var $sifMapping = array(
'Start' => 'start',
'End' => 'end',
'AllDayEvent' => 'alldayevent',
'BillingInformation' => '',
'Body' => 'description',
'BusyStatus' => '',
'Categories' => 'category',
'Companies' => '',
'Importance' => 'priority',
'IsRecurring' => 'isrecurring',
'Location' => 'location',
'MeetingStatus' => '',
'Mileage' => '',
'ReminderMinutesBeforeStart' => 'reminderstart',
'ReminderSet' => 'reminderset',
'ReplyTime' => '',
'Sensitivity' => 'public',
'Subject' => 'title',
'RecurrenceType' => 'recur_type',
'Interval' => 'recur_interval',
'MonthOfYear' => '',
'DayOfMonth' => '',
'DayOfWeekMask' => 'recur_weekmask',
'Instance' => '',
'PatternStartDate' => '',
'NoEndDate' => 'recur_noenddate',
'PatternEndDate' => 'recur_enddate',
'Occurrences' => '',
);
// the calendar event array
var $event;
// constants for recurence type
const olRecursDaily = 0;
const olRecursWeekly = 1;
const olRecursMonthly = 2;
const olRecursMonthNth = 3;
const olRecursYearly = 5;
const olRecursYearNth = 6;
// constants for weekdays
const olSunday = 1;
const olMonday = 2;
const olTuesday = 4;
const olWednesday = 8;
const olThursday = 16;
const olFriday = 32;
const olSaturday = 64;
function startElement($_parser, $_tag, $_attributes) {
}
function endElement($_parser, $_tag) {
//error_log('endElem: ' . $_tag .' => '. trim($this->sifData));
if(!empty($this->sifMapping[$_tag])) {
$this->event[$this->sifMapping[$_tag]] = trim($this->sifData);
}
unset($this->sifData);
}
function characterData($_parser, $_data) {
$this->sifData .= $_data;
}
function siftoegw($_sifdata) {
$vcal = &new Horde_iCalendar;
$finalEvent = array();
$sysCharSet = $GLOBALS['egw']->translation->charset();
$sifData = base64_decode($_sifdata);
#error_log($sifData);
$tmpfname = tempnam('/tmp/sync/contents','sife_');
$handle = fopen($tmpfname, "w");
fwrite($handle, $sifData);
fclose($handle);
$this->xml_parser = xml_parser_create('UTF-8');
xml_set_object($this->xml_parser, $this);
xml_parser_set_option($this->xml_parser, XML_OPTION_CASE_FOLDING, false);
xml_set_element_handler($this->xml_parser, "startElement", "endElement");
xml_set_character_data_handler($this->xml_parser, "characterData");
$this->strXmlData = xml_parse($this->xml_parser, $sifData);
if(!$this->strXmlData) {
error_log(sprintf("XML error: %s at line %d",
xml_error_string(xml_get_error_code($this->xml_parser)),
xml_get_current_line_number($this->xml_parser)));
return false;
}
#error_log(print_r($this->event, true));
foreach($this->event as $key => $value) {
$value = $GLOBALS['egw']->translation->convert($value, 'utf-8', $sysCharSet);
#error_log("$key => $value");
switch($key) {
case 'alldayevent':
if($value == 1) {
$startParts = explode('-',$this->event['start']);
$finalEvent['start'] = mktime(0, 0, 0, $startParts[1], $startParts[2], $startParts[0]);
$endParts = explode('-',$this->event['end']);
$finalEvent['end'] = mktime(23, 59, 59, $endParts[1], $endParts[2], $endParts[0]);
}
break;
case 'public':
$finalEvent[$key] = ((int)$value > 0) ? 0 : 1;
break;
case 'category':
if(!empty($value)) {
$finalEvent[$key] = implode(',',$this->find_or_add_categories(explode(';', $value)));
}
break;
case 'end':
case 'start':
if($this->event['alldayevent'] < 1) {
$finalEvent[$key] = $vcal->_parseDateTime($value);
error_log("event ".$key." val=".$value.", parsed=".$finalEvent[$key]);
}
break;
case 'isrecurring':
if($value == 1) {
$finalEvent['recur_interval'] = $this->event['recur_interval'];
if($this->event['recur_noenddate'] == 0) {
$finalEvent['recur_enddate'] = $vcal->_parseDateTime($this->event['recur_enddate']);
}
switch($this->event['recur_type']) {
case self::olRecursDaily:
$finalEvent['recur_type'] = MCAL_RECUR_DAILY;
break;
case self::olRecursWeekly:
$finalEvent['recur_type'] = MCAL_RECUR_WEEKLY;
$finalEvent['recur_data'] = $this->event['recur_weekmask'];
break;
case self::olRecursMonthly:
$finalEvent['recur_type'] = MCAL_RECUR_MONTHLY_MDAY;
break;
case self::olRecursMonthNth:
$finalEvent['recur_type'] = MCAL_RECUR_MONTHLY_WDAY;
break;
case self::olRecursYearly:
$finalEvent['recur_type'] = MCAL_RECUR_YEARLY;
$finalEvent['recur_interval'] = 1;
break;
}
}
break;
case 'priority':
$finalEvent[$key] = $value+1;
break;
case 'reminderset':
if($value == 1) {
$finalEvent['alarm'] = $this->event['reminderstart'];
}
break;
case 'recur_type':
case 'recur_enddate':
case 'recur_interval':
case 'recur_weekmask':
case 'reminderstart':
// do nothing, get's handled in isrecuring clause
break;
default:
$finalEvent[$key] = $value;
break;
}
}
#$middleName = ($finalEvent['n_middle']) ? ' '.trim($finalEvent['n_middle']) : '';
#$finalEvent['fn'] = trim($finalEvent['n_given']. $middleName .' '. $finalEvent['n_family']);
#error_log(print_r($finalEvent, true));
return $finalEvent;
}
function search($_sifdata) {
if(!$event = $this->siftoegw($_sifdata)) {
return false;
}
$query = array(
'cal_start='.$this->date2ts($event['start'],true), // true = Server-time
'cal_end='.$this->date2ts($event['end'],true),
);
#foreach(array('title','location','priority','public','non_blocking') as $name) {
foreach(array('title','location','public','non_blocking') as $name) {
if (isset($event[$name])) $query['cal_'.$name] = $event[$name];
}
if($foundEvents = parent::search(array(
'user' => $this->user,
'query' => $query,
))) {
if(is_array($foundEvents)) {
$event = array_shift($foundEvents);
return $event['id'];
}
}
return false;
$search['start'] = $event['start'];
$search['end'] = $event['end'];
unset($event['description']);
unset($event['start']);
unset($event['end']);
foreach($event as $key => $value) {
if (substr($key,0,6) != 'recur_' && substr($key,0,5) != 'alarm') {
$search['query']['cal_'.$key] = $value;
} else {
#$search['query'][$key] = $value;
}
}
if($foundEvents = parent::search($search)) {
if(is_array($foundEvents)) {
$event = array_shift($foundEvents);
return $event['id'];
}
}
return false;
}
/**
* @return int contact id
* @param string $_vcard the vcard
* @param int $_abID the internal addressbook id
* @desc import a vard into addressbook
*/
function addSIF($_sifdata, $_calID)
{
$calID = false;
#error_log('ABID: '.$_abID);
#error_log(base64_decode($_sifdata));
if(!$event = $this->siftoegw($_sifdata)) {
return false;
}
if(isset($event['alarm'])) {
$alarm = $event['alarm'];
unset($event['alarm']);
}
if($_calID > 0)
{
// update entry
$event['id'] = $_calID;
}
if($eventID = $this->update($event, TRUE)) {
$updatedEvent = $this->read($eventID);
foreach($updatedEvent['alarm'] as $alarmID => $alarmData)
{
$this->delete_alarm($alarmID);
}
if(isset($alarm)) {
$alarmData['time'] = $event['start'] - ($alarm*60);
$alarmData['offset'] = $alarm*60;
$alarmData['all'] = 1;
$alarmData['owner'] = $GLOBALS['egw_info']['user']['account_id'];
$this->save_alarm($eventID, $alarmData);
}
}
return $eventID;
}
/**
* return a vcard
*
* @param int $_id the id of the contact
* @param int $_vcardProfile profile id for mapping from vcard values to egw addressbook
* @return string containing the vcard
*/
function getSIF($_id)
{
$fields = array_unique(array_values($this->sifMapping));
sort($fields);
#$event = $this->read($_id,null,false,'server');
#error_log("FOUND EVENT: ". print_r($event, true));
if($event = $this->read($_id,null,false,'server')) {
$sysCharSet = $GLOBALS['egw']->translation->charset();
$vcal = &new Horde_iCalendar;
$sifEvent = '<appointment>';
foreach($this->sifMapping as $sifField => $egwField)
{
if(empty($egwField)) continue;
#error_log("$sifField => $egwField");
#error_log('VALUE1: '.$event[$egwField]);
$value = $GLOBALS['egw']->translation->convert($event[$egwField], $sysCharSet, 'utf-8');
#error_log('VALUE2: '.$value);
switch($sifField)
{
case 'Categories':
if(!empty($value)) {
$value = implode('; ', $this->get_categories(explode(',',$value)));
$value = $GLOBALS['egw']->translation->convert($value, $sysCharSet, 'utf-8');
}
$sifEvent .= "<$sifField>$value</$sifField>";
break;
case 'Importance':
$value = $value-1;
$sifEvent .= "<$sifField>$value</$sifField>";
break;
case 'RecurrenceType':
case 'Interval':
case 'PatternStartDate':
case 'NoEndDate':
case 'DayOfWeekMask':
case 'PatternEndDate':
break;
case 'IsRecurring':
switch($event['recur_type']) {
case MCAL_RECUR_NONE:
$sifEvent .= "<$sifField>0</$sifField>";
break;
case MCAL_RECUR_DAILY:
$eventInterval = ($event['recur_interval'] > 1 ? $event['recur_interval'] : 1);
$recurStartDate = mktime(0,0,0,date('m',$event['start']), date('d', $event['start']), date('Y', $event['start']));
$sifEvent .= "<$sifField>1</$sifField>";
$sifEvent .= '<RecurrenceType>'. self::olRecursDaily .'</RecurrenceType>';
$sifEvent .= '<Interval>'. $eventInterval .'</Interval>';
$sifEvent .= '<PatternStartDate>'. $vcal->_exportDateTime($recurStartDate) .'</PatternStartDate>';
if($event['recur_enddate'] == 0) {
$sifEvent .= '<NoEndDate>1</NoEndDate>';
} else {
$recurEndDate = mktime(24,0,0,date('m',$event['recur_enddate']), date('d', $event['recur_enddate']), date('Y', $event['recur_enddate']));
$sifEvent .= '<NoEndDate>0</NoEndDate>';
$sifEvent .= '<PatternEndDate>'. $vcal->_exportDateTime($recurEndDate) .'</PatternEndDate>';
$totalDays = ($recurEndDate - $recurStartDate) / 86400;
$occurrences = ceil($totalDays / $eventInterval);
$sifEvent .= '<Occurrences>'. $occurrences .'</Occurrences>';
}
break;
case MCAL_RECUR_WEEKLY:
$eventInterval = ($event['recur_interval'] > 1 ? $event['recur_interval'] : 1);
$recurStartDate = mktime(0,0,0,date('m',$event['start']), date('d', $event['start']), date('Y', $event['start']));
$sifEvent .= "<$sifField>1</$sifField>";
$sifEvent .= '<RecurrenceType>'. self::olRecursWeekly .'</RecurrenceType>';
$sifEvent .= '<Interval>'. $eventInterval .'</Interval>';
$sifEvent .= '<PatternStartDate>'. $vcal->_exportDateTime($recurStartDate) .'</PatternStartDate>';
$sifEvent .= '<DayOfWeekMask>'. $event['recur_data'] .'</DayOfWeekMask>';
if($event['recur_enddate'] == 0) {
$sifEvent .= '<NoEndDate>1</NoEndDate>';
} else {
$recurEndDate = mktime(24, 0, 0, date('m',$event['recur_enddate']), date('d', $event['recur_enddate']), date('Y', $event['recur_enddate']));
$daysPerWeek = substr_count(decbin($event['recur_data']),'1');
$sifEvent .= '<NoEndDate>0</NoEndDate>';
$sifEvent .= '<PatternEndDate>'. $vcal->_exportDateTime($recurEndDate) .'</PatternEndDate>';
$totalWeeks = floor(($recurEndDate - $recurStartDate) / (86400*7));
#error_log("AAA: $daysPerWeek $totalWeeks");
$occurrences = ($totalWeeks / $eventInterval) * $daysPerWeek;
for($i = $recurEndDate; $i > $recurStartDate + ($totalWeeks * 86400*7); $i = $i - 86400) {
switch(date('w', $i-1)) {
case 0:
if($event['recur_data'] & 1) $occurrences++;
break;
// monday
case 1:
if($event['recur_data'] & 2) $occurrences++;
break;
case 2:
if($event['recur_data'] & 4) $occurrences++;
break;
case 3:
if($event['recur_data'] & 8) $occurrences++;
break;
case 4:
if($event['recur_data'] & 16) $occurrences++;
break;
case 5:
if($event['recur_data'] & 32) $occurrences++;
break;
case 6:
if($event['recur_data'] & 64) $occurrences++;
break;
}
}
$sifEvent .= '<Occurrences>'. $occurrences .'</Occurrences>';
}
break;
}
break;
case 'Sensitivity':
$value = (!$value ? '2' : '0');
$sifEvent .= "<$sifField>$value</$sifField>";
break;
case 'Folder':
# skip currently. This is the folder where Outlook stores the contact.
#$sifEvent .= "<$sifField>/</$sifField>";
break;
case 'AllDayEvent':
case 'End':
// get's handled by Start clause
break;
case 'Start':
if($event['end'] - $event['start'] == 86399 && date('Y-m-d', $event['end']) == date('Y-m-d', $event['start'])) {
$value = date('Y-m-d', $event['start']);
$sifEvent .= "<Start>$value</Start>";
$sifEvent .= "<End>$value</End>";
$sifEvent .= "<AllDayEvent>1</AllDayEvent>";
} else {
$value = $vcal->_exportDateTime($event['start']);
$sifEvent .= "<Start>$value</Start>";
$value = $vcal->_exportDateTime($event['end']);
$sifEvent .= "<End>$value</End>";
$sifEvent .= "<AllDayEvent>0</AllDayEvent>";
}
break;
case 'ReminderMinutesBeforeStart':
break;
case 'ReminderSet':
if(count((array)$event['alarm']) > 0) {
$sifEvent .= "<$sifField>1</$sifField>";
foreach($event['alarm'] as $alarmID => $alarmData)
{
$sifEvent .= '<ReminderMinutesBeforeStart>'. $alarmData['offset']/60 .'</ReminderMinutesBeforeStart>';
// lets take only the first alarm
break;
}
} else {
$sifEvent .= "<$sifField>0</$sifField>";
}
break;
default:
$sifEvent .= "<$sifField>$value</$sifField>";
break;
}
}
$sifEvent .= '</appointment>';
return base64_encode($sifEvent);
}
if($this->xmlrpc)
{
$GLOBALS['server']->xmlrpc_error($GLOBALS['xmlrpcerr']['no_access'],$GLOBALS['xmlrpcstr']['no_access']);
}
return False;
}
}

View File

@ -1,25 +0,0 @@
<?php
/**************************************************************************\
* eGroupWare - Calendar *
* http://www.egroupware.org *
* -------------------------------------------- *
* 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$ */
{
// Only Modify the $file and $title variables.....
$title = $appname;
$file = Array(
'Site Configuration' => $GLOBALS['egw']->link('/index.php','menuaction=admin.uiconfig.index&appname=calendar'),
'Custom fields' => $GLOBALS['egw']->link('/index.php','menuaction=admin.customfields.edit&appname=calendar'),
'Calendar Holiday Management' => $GLOBALS['egw']->link('/index.php','menuaction=calendar.uiholiday.admin'),
'Global Categories' => $GLOBALS['egw']->link('/index.php','menuaction=admin.uicategories.index&appname=calendar')
);
//Do not modify below this line
display_section($appname,$title,$file);
}
?>

View File

@ -1,15 +0,0 @@
<?php
/**************************************************************************\
* eGroupWare *
* http://www.egroupware.org *
* -------------------------------------------- *
* 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$ */
$socal =& CreateObject('calendar.socal');
$socal->change_delete_user((int)$_POST['account_id'],(int)$_POST['new_owner']);
unset($socal);

View File

@ -1,77 +0,0 @@
<?php
/**************************************************************************\
* eGroupWare - Calendar on Homepage *
* http://www.egroupware.org *
* Written and (c) 2004 by Ralf Becker <RalfBecker@outdoor-training.de> *
* -------------------------------------------- *
* 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$ */
if($GLOBALS['egw_info']['user']['preferences']['calendar']['mainscreen_showevents'])
{
$GLOBALS['egw']->translation->add_app('calendar');
$save_app_header = $GLOBALS['egw_info']['flags']['app_header'];
if ($GLOBALS['egw_info']['user']['preferences']['calendar']['defaultcalendar'] == 'listview')
{
if (!file_exists(EGW_SERVER_ROOT.($et_css_file ='/etemplate/templates/'.$GLOBALS['egw_info']['user']['preferences']['common']['template_set'].'/app.css')))
{
$et_css_file = '/etemplate/templates/default/app.css';
}
$content =& ExecMethod('calendar.uilist.home');
}
else
{
unset($et_css_file);
$content =& ExecMethod('calendar.uiviews.home');
}
$portalbox =& CreateObject('phpgwapi.listbox',array(
'title' => $GLOBALS['egw_info']['flags']['app_header'],
'primary' => $GLOBALS['egw_info']['theme']['navbar_bg'],
'secondary' => $GLOBALS['egw_info']['theme']['navbar_bg'],
'tertiary' => $GLOBALS['egw_info']['theme']['navbar_bg'],
'width' => '100%',
'outerborderwidth' => '0',
'header_background_image' => $GLOBALS['egw']->common->image('phpgwapi/templates/default','bg_filler')
));
$GLOBALS['egw_info']['flags']['app_header'] = $save_app_header;
unset($save_app_header);
$GLOBALS['portal_order'][] = $app_id = $GLOBALS['egw']->applications->name2id('calendar');
foreach(array('up','down','close','question','edit') as $key)
{
$portalbox->set_controls($key,Array('url' => '/set_box.php', 'app' => $app_id));
}
$portalbox->data = Array();
if (!file_exists(EGW_SERVER_ROOT.($css_file ='/calendar/templates/'.$GLOBALS['egw_info']['user']['preferences']['common']['template_set'].'/app.css')))
{
$css_file = '/calendar/templates/default/app.css';
}
echo '
<!-- BEGIN Calendar info -->
<style type="text/css">
<!--';
if ($et_css_file) // listview
{
echo '
@import url('.$GLOBALS['egw_info']['server']['webserver_url'].$et_css_file.');';
}
echo '
@import url('.$GLOBALS['egw_info']['server']['webserver_url'].$css_file.');
-->
</style>
'.$portalbox->draw($content)."\n".'<!-- END Calendar info -->'."\n";
unset($css_file); unset($et_css_file);
unset($key);
unset($app_id);
unset($content);
unset($portalbox);
}

View File

@ -1,23 +0,0 @@
<?php
/**************************************************************************\
* eGroupWare - Calendar *
* http://www.egroupware.org *
* -------------------------------------------- *
* 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$ */
{
// Only Modify the $file and $title variables.....
$title = $appname;
$file = array(
'Preferences' => $GLOBALS['egw']->link('/index.php','menuaction=preferences.uisettings.index&appname=' . $appname),
'Grant Access' => $GLOBALS['egw']->link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app='.$appname),
'Edit Categories' => $GLOBALS['egw']->link('/index.php','menuaction=preferences.uicategories.index&cats_app='.$appname.'&cats_level=True&global_cats=True'),
'Import CSV-File' => $GLOBALS['egw']->link('/calendar/csv_import.php'),
);
//Do not modify below this line
display_section($appname,$title,$file);
}

View File

@ -1,374 +0,0 @@
<?php
/**
* eGroupWare - Calendar Preferences
*
* @link http://www.egroupware.org
* @package calendar
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @author Mark Peters <skeeter@phpgroupware.org>
* Originally based on Webcalendar by Craig Knudsen <cknudsen@radix.net>
* http://www.radix.net/~cknudsen
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
$bocal =& CreateObject('calendar.bocal');
$bocal->check_set_default_prefs();
$default = array(
'day' => lang('Dayview'),
'day4' => lang('Four days view'),
'week' => lang('Weekview'),
'weekN' => lang('Multiple week view'),
'month' => lang('Monthview'),
'planner_cat' => lang('Planner by category'),
'planner_user' => lang('Planner by user'),
'listview' => lang('Listview'),
);
$grid_views = array(
'all' => lang('all'),
'day_week' => lang('Dayview').', '.lang('Four days view').' &amp; '.lang('Weekview'),
'day4' => lang('Dayview').' &amp; '.lang('Four days view'),
'day' => lang('Dayview'),
);
/* Select list with number of day by week */
$week_view = array(
'5' => lang('Weekview without weekend'),
'7' => lang('Weekview with weekend'),
);
$mainpage = array(
'1' => lang('Yes'),
'0' => lang('No'),
);
/*
$summary = array(
'no' => lang('Never'),
'daily' => lang('Daily'),
'weekly' => lang('Weekly')
);
create_select_box('Receive summary of appointments','summary',$summary,
'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.');
*/
$updates = array(
'no' => lang('Never'),
'add_cancel' => lang('on invitation / cancelation only'),
'time_change_4h' => lang('on time change of more than 4 hours too'),
'time_change' => lang('on any time change too'),
'modifications' => lang('on all modification, but responses'),
'responses' => lang('on participant responses too')
);
$update_formats = array(
'none' => lang('None'),
'extended' => lang('Extended'),
'ical' => lang('iCal / rfc2445')
);
$event_details = array(
'to-fullname' => lang('Fullname of person to notify'),
'to-firstname'=> lang('Firstname of person to notify'),
'to-lastname' => lang('Lastname of person to notify'),
'title' => lang('Title of the event'),
'description' => lang('Description'),
'startdate' => lang('Start Date/Time'),
'enddate' => lang('End Date/Time'),
'olddate' => lang('Old Startdate'),
'category' => lang('Category'),
'location' => lang('Location'),
'priority' => lang('Priority'),
'participants'=> lang('Participants'),
'owner' => lang('Owner'),
'repetition' => lang('Repetitiondetails (or empty)'),
'action' => lang('Action that caused the notify: Added, Canceled, Accepted, Rejected, ...'),
'link' => lang('Link to view the event'),
'disinvited' => lang('Participants disinvited from an event'),
);
$weekdaystarts = array(
'Monday' => lang('Monday'),
'Sunday' => lang('Sunday'),
'Saturday' => lang('Saturday')
);
for ($i=0; $i < 24; ++$i)
{
$times[$i] = $GLOBALS['egw']->common->formattime($i,'00');
}
for ($i = 2; $i <= 9; ++$i)
{
$muliple_weeks[$i.' weeks'] = lang('%1 weeks',$i);
}
$intervals = array(
5 => '5',
10 => '10',
15 => '15',
20 => '20',
30 => '30',
45 => '45',
60 => '60'
);
$groups = $GLOBALS['egw']->accounts->membership($GLOBALS['egw_info']['user']['account_id']);
$options = array('0' => lang('none'));
if (is_array($groups))
{
foreach($groups as $group)
{
$options[$group['account_id']] = $GLOBALS['egw']->common->grab_owner_name($group['account_id']);
}
}
$defaultfilter = array(
'all' => lang('all'),
'private' => lang('private only'),
// 'public' => lang('global public only'),
// 'group' => lang('group public only'),
// 'private+public' => lang('private and global public'),
// 'private+group' => lang('private and group public'),
// 'public+group' => lang('global public and group public')
);
$freebusy_url = $bocal->freebusy_url($GLOBALS['egw_info']['user']['account_lid'],$GLOBALS['egw_info']['user']['preferences']['calendar']['freebusy_pw']);
$freebusy_help = lang('Should not loged in persons be able to see your freebusy information? You can set an extra password, different from your normal password, to protect this informations. The freebusy information is in iCal format and only include the times when you are busy. It does not include the event-name, description or locations. The URL to your freebusy information is %1.','<a href="'.$freebusy_url.'" target="_blank">'.$freebusy_url.'</a>');
$GLOBALS['settings'] = array(
'defaultcalendar' => array(
'type' => 'select',
'label' => 'default calendar view',
'name' => 'defaultcalendar',
'values' => $default,
'help' => 'Which of calendar view do you want to see, when you start calendar ?',
'xmlrpc' => True,
'admin' => False
),
'days_in_weekview' => array(
'type' => 'select',
'label' => 'default week view',
'name' => 'days_in_weekview',
'values' => $week_view,
'help' => 'Do you want a weekview with or without weekend?',
'xmlrpc' => True,
'admin' => False
),
'multiple_weeks' => array(
'type' => 'select',
'label' => 'Weeks in multiple week view',
'name' => 'multiple_weeks',
'values' => $muliple_weeks,
'help' => 'How many weeks should the multiple week view show?',
'xmlrpc' => True,
'admin' => False
),
'mainscreen_showevents' => array(
'type' => 'select',
'label' => 'show default view on main screen',
'name' => 'mainscreen_showevents',
'values' => $mainpage,
'help' => 'Displays your default calendar view on the startpage (page you get when you enter eGroupWare or click on the homepage icon)?',
'xmlrpc' => True,
'admin' => False
),
'show_rejected' => array(
'type' => 'check',
'label' => 'Show invitations you rejected',
'name' => 'show_rejected',
'help' => '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!'
),
'weekdaystarts' => array(
'type' => 'select',
'label' => 'weekday starts on',
'name' => 'weekdaystarts',
'values' => $weekdaystarts,
'help' => 'This day is shown as first day in the week or month view.',
'xmlrpc' => True,
'admin' => False
),
'workdaystarts' => array(
'type' => 'select',
'label' => 'work day starts on',
'name' => 'workdaystarts',
'values' => $times,
'help' => '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.',
'xmlrpc' => True,
'admin' => False
),
'workdayends' => array(
'type' => 'select',
'label' => 'work day ends on',
'name' => 'workdayends',
'values' => $times,
'help' => 'This defines the end of your dayview. Events after this time, are shown below the dayview.',
'xmlrpc' => True,
'admin' => False
),
'use_time_grid' => array(
'type' => 'select',
'label' => 'Views with fixed time intervals',
'name' => 'use_time_grid',
'values' => $grid_views,
'help' => 'For which views should calendar show distinct lines with a fixed time interval.',
'xmlrpc' => True,
'admin' => False
),
'interval' => array(
'type' => 'select',
'label' => 'Length of the time interval',
'name' => 'interval',
'values' => $intervals,
'help' => 'How many minutes should each interval last?',
'xmlrpc' => True,
'admin' => False
),
'defaultlength' => array(
'type' => 'input',
'label' => 'default appointment length (in minutes)',
'name' => 'defaultlength',
'help' => 'Default length of newly created events. The length is in minutes, eg. 60 for 1 hour.',
'default' => '',
'size' => 3,
'xmlrpc' => True,
'admin' => False
),
'planner_start_with_group' => array(
'type' => 'select',
'label' => 'Preselected group for entering the planner',
'name' => 'planner_start_with_group',
'values' => $options,
'help' => 'This group that is preselected when you enter the planner. You can change it in the planner anytime you want.',
'xmlrpc' => True,
'admin' => False
),
'planner_show_empty_rows' => array(
'type' => 'select',
'label' => 'Show empty rows in Planner',
'name' => 'planner_show_empty_rows',
'values' => array(
0 => lang('no'),
'user' => lang('Planner by user'),
'cat' => lang('Planner by category'),
'both' => lang('All'),
),
'help' => 'Should the planner display an empty row for users or categories without any appointment.',
'xmlrpc' => True,
'admin' => False
),
'default_private' => array(
'type' => 'check',
'label' => 'Set new events to private',
'name' => 'default_private',
'help' => 'Should new events created as private by default ?',
'xmlrpc' => True,
'admin' => False
),
'receive_updates' => array(
'type' => 'select',
'label' => 'Receive email updates',
'name' => 'receive_updates',
'values' => $updates,
'help' => "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.",
'xmlrpc' => True,
'admin' => False
),
'update_format' => array(
'type' => 'select',
'label' => 'Format of event updates',
'name' => 'update_format',
'values' => $update_formats,
'help' => 'Extended updates always include the complete event-details. iCal\'s can be imported by certain other calendar-applications.',
'xmlrpc' => True,
'admin' => False
),
'notifyAdded' => array(
'type' => 'notify',
'label' => 'Notification messages for added events ',
'name' => 'notifyAdded',
'rows' => 5,
'cols' => 50,
'help' => '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.',
'default' => '',
'values' => $event_details,
'xmlrpc' => True,
'admin' => False
),
'notifyCanceled' => array(
'type' => 'notify',
'label' => 'Notification messages for canceled events ',
'name' => 'notifyCanceled',
'rows' => 5,
'cols' => 50,
'help' => 'This message is sent for canceled or deleted events.',
'default' => '',
'values' => $event_details,
'subst_help' => False,
'xmlrpc' => True,
'admin' => False
),
'notifyModified' => array(
'type' => 'notify',
'label' => 'Notification messages for modified events ',
'name' => 'notifyModified',
'rows' => 5,
'cols' => 50,
'help' => 'This message is sent for modified or moved events.',
'default' => '',
'values' => $event_details,
'subst_help' => False,
'xmlrpc' => True,
'admin' => False
),
'notifyDisinvited' => array(
'type' => 'notify',
'label' => 'Notification messages for disinvited participants ',
'name' => 'notifyDisinvited',
'rows' => 5,
'cols' => 50,
'help' => 'This message is sent to disinvited participants.',
'default' => '',
'values' => $event_details,
'subst_help' => False,
'xmlrpc' => True,
'admin' => False
),
'notifyResponse' => array(
'type' => 'notify',
'label' => 'Notification messages for your responses ',
'name' => 'notifyResponse',
'rows' => 5,
'cols' => 50,
'help' => 'This message is sent when you accept, tentative accept or reject an event.',
'default' => '',
'values' => $event_details,
'subst_help' => False,
'xmlrpc' => True,
'admin' => False
),
'notifyAlarm' => array(
'type' => 'notify',
'label' => 'Notification messages for your alarms',
'name' => 'notifyAlarm',
'rows' => 5,
'cols' => 50,
'help' => 'This message is sent when you set an Alarm for a certain event. Include all information you might need.',
'default' => '',
'values' => $event_details,
'subst_help' => False,
'xmlrpc' => True,
'admin' => False
),
'freebusy' => array(
'type' => 'check',
'label' => 'Make freebusy information available to not loged in persons?',
'name' => 'freebusy',
'help' => $freebusy_help,
'run_lang' => false,
'default' => '',
'subst_help' => False,
'xmlrpc' => True,
'admin' => False,
),
'freebusy_pw' => array(
'type' => 'input',
'label' => 'Password for not loged in users to your freebusy information?',
'name' => 'freebusy_pw',
'help' => 'If you dont set a password here, the information is available to everyone, who knows the URL!!!',
'xmlrpc' => True,
'admin' => False
)
);

View File

@ -1,25 +1,13 @@
<?php
/**************************************************************************\
* eGroupWare - Calendar *
* http://www.egroupware.org *
* Written and (c) 2005 by Ralf Becker <RalfBecker@outdoor-training.de> *
* -------------------------------------------- *
* 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. *
\**************************************************************************/
/**
* eGroupWare Calendar
*
* @link http://www.egroupware.org
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @package calendar
* @copyright (c) 2005-8 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
/* $Id$ */
$GLOBALS['egw_info'] = array('flags' => array(
'currentapp'=> 'calendar',
'noheader' => True,
'nonavbar' => True,
));
include('../header.inc.php');
ExecMethod('calendar.uiviews.index');
$GLOBALS['egw']->common->egw_footer();
header('Location: ../index.php?menuaction=calendar.calendar_uiviews.index');

View File

@ -1,10 +1,21 @@
/**
* Calendar - dragNdrop
*
* @link http://www.egroupware.org
* @author Christian Binder <christian.binder@freakmail.de>
* @package calendar
* @copyright (c) 2006 by Christian Binder <christian.binder@freakmail.de>
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
function dragEvent()
{
if(minOffset())
{
// make a snapshot of the old (original) innerHTML of the dragged event
if(!dd.obj.oldInnerHTML)
{
{
dd.obj.oldInnerHTML = dd.obj.div.innerHTML;
}
@ -26,10 +37,10 @@ function dragEvent()
}
function dropEvent()
{
{
// minimum requirements for ajax call
if( minOffset() &&
(dropTarget = dd.obj.getEltBelow()) &&
if( minOffset() &&
(dropTarget = dd.obj.getEltBelow()) &&
(dropTarget.my_datetime) &&
(dd.obj.my_calendarOwner == dropTarget.my_owner)
)
@ -37,7 +48,7 @@ function dropEvent()
dd.obj.div.innerHTML = '<div style="height: 100%; width: 100%; text-align: center;">' + dd.obj.my_loaderImage + '</div>';
xajax_doXMLHTTP(
'calendar.ajaxcalendar.moveEvent',
'calendar.calendar_ajax.moveEvent',
dd.obj.my_eventId,
dd.obj.my_calendarOwner,
dropTarget.my_datetime,
@ -59,7 +70,7 @@ function minOffset()
{
var offsetX = Math.abs(dd.obj.defx - dd.obj.x);
var offsetY = Math.abs(dd.obj.defy - dd.obj.y);
if(offsetX > 5 || offsetY > 5) { return true; }
return false;
}

File diff suppressed because one or more lines are too long

View File

@ -1,83 +1,60 @@
<?php
/**************************************************************************\
* eGroupWare - Calendar *
* http://www.egroupware.org *
* -------------------------------------------- *
* 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$ */
$setup_info['calendar']['name'] = 'calendar';
$setup_info['calendar']['version'] = '1.5.002';
$setup_info['calendar']['app_order'] = 3;
$setup_info['calendar']['enable'] = 1;
$setup_info['calendar']['license'] = 'GPL';
$setup_info['calendar']['description'] =
'Powerful group calendar with meeting request system and ACL security.';
$setup_info['calendar']['note'] =
'The calendar has been completly rewritten for eGroupWare 1.2.';
$setup_info['calendar']['author'] = $setup_info['calendar']['maintainer'] = array(
'name' => 'Ralf Becker',
'email' => 'RalfBecker@outdoor-training.de'
);
$setup_info['calendar']['tables'][] = 'egw_cal';
$setup_info['calendar']['tables'][] = 'egw_cal_holidays';
$setup_info['calendar']['tables'][] = 'egw_cal_repeats';
$setup_info['calendar']['tables'][] = 'egw_cal_user';
$setup_info['calendar']['tables'][] = 'egw_cal_extra';
$setup_info['calendar']['tables'][] = 'egw_cal_dates';
/* The hooks this app includes, needed for hooks registration */
$setup_info['calendar']['hooks'][] = 'add_def_prefs';
$setup_info['calendar']['hooks'][] = 'admin';
$setup_info['calendar']['hooks'][] = 'deleteaccount';
$setup_info['calendar']['hooks'][] = 'home';
$setup_info['calendar']['hooks'][] = 'preferences';
$setup_info['calendar']['hooks'][] = 'settings';
$setup_info['calendar']['hooks']['sidebox_menu'] = 'calendar.uical.sidebox_menu';
$setup_info['calendar']['hooks']['search_link'] = 'calendar.bocal.search_link';
/* Dependencies for this app to work */
$setup_info['calendar']['depends'][] = array(
'appname' => 'phpgwapi',
'versions' => Array('1.3','1.4','1.5')
);
$setup_info['calendar']['depends'][] = array(
'appname' => 'etemplate',
'versions' => Array('1.3','1.4','1.5')
);
// installation checks for calendar
$setup_info['calendar']['check_install'] = array(
// check if PEAR is availible
'' => array(
'func' => 'pear_check',
'from' => 'Calendar (iCal import+export)',
),
);
/**
* eGroupWare - Calendar setup
*
* @link http://www.egroupware.org
* @package calendar
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
$setup_info['calendar']['name'] = 'calendar';
$setup_info['calendar']['version'] = '1.6';
$setup_info['calendar']['app_order'] = 3;
$setup_info['calendar']['enable'] = 1;
$setup_info['calendar']['license'] = 'GPL';
$setup_info['calendar']['description'] =
'Powerful group calendar with meeting request system and ACL security.';
$setup_info['calendar']['note'] =
'The calendar has been completly rewritten for eGroupWare 1.2.';
$setup_info['calendar']['author'] = $setup_info['calendar']['maintainer'] = array(
'name' => 'Ralf Becker',
'email' => 'RalfBecker@outdoor-training.de'
);
$setup_info['calendar']['tables'][] = 'egw_cal';
$setup_info['calendar']['tables'][] = 'egw_cal_holidays';
$setup_info['calendar']['tables'][] = 'egw_cal_repeats';
$setup_info['calendar']['tables'][] = 'egw_cal_user';
$setup_info['calendar']['tables'][] = 'egw_cal_extra';
$setup_info['calendar']['tables'][] = 'egw_cal_dates';
/* The hooks this app includes, needed for hooks registration */
$setup_info['calendar']['hooks']['admin'] = 'calendar_hooks::admin';
$setup_info['calendar']['hooks']['deleteaccount'] = 'calendar.calendar_so.deleteaccount';
$setup_info['calendar']['hooks']['home'] = 'calendar_hooks::home';
$setup_info['calendar']['hooks']['preferences'] = 'calendar_hooks::preferences';
$setup_info['calendar']['hooks']['settings'] = 'calendar_hooks::settings';
$setup_info['calendar']['hooks']['sidebox_menu'] = 'calendar.calendar_ui.sidebox_menu';
$setup_info['calendar']['hooks']['search_link'] = 'calendar_hooks::search_link';
/* Dependencies for this app to work */
$setup_info['calendar']['depends'][] = array(
'appname' => 'phpgwapi',
'versions' => Array('1.3','1.4','1.5','1.6','1.7')
);
$setup_info['calendar']['depends'][] = array(
'appname' => 'etemplate',
'versions' => Array('1.3','1.4','1.5','1.6','1.7')
);
// installation checks for calendar
$setup_info['calendar']['check_install'] = array(
// check if PEAR is availible
'' => array(
'func' => 'pear_check',
'from' => 'Calendar (iCal import+export)',
),
);

View File

@ -1,104 +1,102 @@
<?php
/**************************************************************************\
* eGroupWare *
* http://www.egroupware.org *
* -------------------------------------------- *
* 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. *
\**************************************************************************/
/**
* eGroupWare - Calendar setup
*
* @link http://www.egroupware.org
* @package calendar
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
/* $Id$ */
$phpgw_baseline = array(
'egw_cal' => array(
'fd' => array(
'cal_id' => array('type' => 'auto','nullable' => False),
'cal_uid' => array('type' => 'varchar','precision' => '255','nullable' => False),
'cal_owner' => array('type' => 'int','precision' => '4','nullable' => False),
'cal_category' => array('type' => 'varchar','precision' => '30'),
'cal_modified' => array('type' => 'int','precision' => '8'),
'cal_priority' => array('type' => 'int','precision' => '2','nullable' => False,'default' => '2'),
'cal_public' => array('type' => 'int','precision' => '2','nullable' => False,'default' => '1'),
'cal_title' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '1'),
'cal_description' => array('type' => 'text'),
'cal_location' => array('type' => 'varchar','precision' => '255'),
'cal_reference' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'),
'cal_modifier' => array('type' => 'int','precision' => '4'),
'cal_non_blocking' => array('type' => 'int','precision' => '2','default' => '0'),
'cal_special' => array('type' => 'int','precision' => '2','default' => '0'),
'cal_etag' => array('type' => 'int','precision' => '4','default' => '0')
),
'pk' => array('cal_id'),
'fk' => array(),
'ix' => array(),
'uc' => array()
$phpgw_baseline = array(
'egw_cal' => array(
'fd' => array(
'cal_id' => array('type' => 'auto','nullable' => False),
'cal_uid' => array('type' => 'varchar','precision' => '255','nullable' => False),
'cal_owner' => array('type' => 'int','precision' => '4','nullable' => False),
'cal_category' => array('type' => 'varchar','precision' => '30'),
'cal_modified' => array('type' => 'int','precision' => '8'),
'cal_priority' => array('type' => 'int','precision' => '2','nullable' => False,'default' => '2'),
'cal_public' => array('type' => 'int','precision' => '2','nullable' => False,'default' => '1'),
'cal_title' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '1'),
'cal_description' => array('type' => 'text'),
'cal_location' => array('type' => 'varchar','precision' => '255'),
'cal_reference' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'),
'cal_modifier' => array('type' => 'int','precision' => '4'),
'cal_non_blocking' => array('type' => 'int','precision' => '2','default' => '0'),
'cal_special' => array('type' => 'int','precision' => '2','default' => '0'),
'cal_etag' => array('type' => 'int','precision' => '4','default' => '0')
),
'egw_cal_holidays' => array(
'fd' => array(
'hol_id' => array('type' => 'auto','nullable' => False),
'hol_locale' => array('type' => 'char','precision' => '2','nullable' => False),
'hol_name' => array('type' => 'varchar','precision' => '50','nullable' => False),
'hol_mday' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0'),
'hol_month_num' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0'),
'hol_occurence' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0'),
'hol_dow' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0'),
'hol_observance_rule' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0')
),
'pk' => array('hol_id'),
'fk' => array(),
'ix' => array('hol_locale'),
'uc' => array()
'pk' => array('cal_id'),
'fk' => array(),
'ix' => array(),
'uc' => array()
),
'egw_cal_holidays' => array(
'fd' => array(
'hol_id' => array('type' => 'auto','nullable' => False),
'hol_locale' => array('type' => 'char','precision' => '2','nullable' => False),
'hol_name' => array('type' => 'varchar','precision' => '50','nullable' => False),
'hol_mday' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0'),
'hol_month_num' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0'),
'hol_occurence' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0'),
'hol_dow' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0'),
'hol_observance_rule' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0')
),
'egw_cal_repeats' => array(
'fd' => array(
'cal_id' => array('type' => 'int','precision' => '4','nullable' => False),
'recur_type' => array('type' => 'int','precision' => '2','nullable' => False),
'recur_enddate' => array('type' => 'int','precision' => '8'),
'recur_interval' => array('type' => 'int','precision' => '2','default' => '1'),
'recur_data' => array('type' => 'int','precision' => '2','default' => '1'),
'recur_exception' => array('type' => 'text')
),
'pk' => array('cal_id'),
'fk' => array(),
'ix' => array(),
'uc' => array()
'pk' => array('hol_id'),
'fk' => array(),
'ix' => array('hol_locale'),
'uc' => array()
),
'egw_cal_repeats' => array(
'fd' => array(
'cal_id' => array('type' => 'int','precision' => '4','nullable' => False),
'recur_type' => array('type' => 'int','precision' => '2','nullable' => False),
'recur_enddate' => array('type' => 'int','precision' => '8'),
'recur_interval' => array('type' => 'int','precision' => '2','default' => '1'),
'recur_data' => array('type' => 'int','precision' => '2','default' => '1'),
'recur_exception' => array('type' => 'text')
),
'egw_cal_user' => array(
'fd' => array(
'cal_id' => array('type' => 'int','precision' => '4','nullable' => False),
'cal_recur_date' => array('type' => 'int','precision' => '8','default' => '0'),
'cal_user_type' => array('type' => 'varchar','precision' => '1','nullable' => False,'default' => 'u'),
'cal_user_id' => array('type' => 'varchar','precision' => '128','nullable' => False),
'cal_status' => array('type' => 'char','precision' => '1','default' => 'A'),
'cal_quantity' => array('type' => 'int','precision' => '4','default' => '1')
),
'pk' => array('cal_id','cal_recur_date','cal_user_type','cal_user_id'),
'fk' => array(),
'ix' => array(),
'uc' => array()
'pk' => array('cal_id'),
'fk' => array(),
'ix' => array(),
'uc' => array()
),
'egw_cal_user' => array(
'fd' => array(
'cal_id' => array('type' => 'int','precision' => '4','nullable' => False),
'cal_recur_date' => array('type' => 'int','precision' => '8','default' => '0'),
'cal_user_type' => array('type' => 'varchar','precision' => '1','nullable' => False,'default' => 'u'),
'cal_user_id' => array('type' => 'varchar','precision' => '128','nullable' => False),
'cal_status' => array('type' => 'char','precision' => '1','default' => 'A'),
'cal_quantity' => array('type' => 'int','precision' => '4','default' => '1')
),
'egw_cal_extra' => array(
'fd' => array(
'cal_id' => array('type' => 'int','precision' => '4','nullable' => False),
'cal_extra_name' => array('type' => 'varchar','precision' => '40','nullable' => False),
'cal_extra_value' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '')
),
'pk' => array('cal_id','cal_extra_name'),
'fk' => array(),
'ix' => array(),
'uc' => array()
'pk' => array('cal_id','cal_recur_date','cal_user_type','cal_user_id'),
'fk' => array(),
'ix' => array(),
'uc' => array()
),
'egw_cal_extra' => array(
'fd' => array(
'cal_id' => array('type' => 'int','precision' => '4','nullable' => False),
'cal_extra_name' => array('type' => 'varchar','precision' => '40','nullable' => False),
'cal_extra_value' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '')
),
'egw_cal_dates' => array(
'fd' => array(
'cal_id' => array('type' => 'int','precision' => '4','nullable' => False),
'cal_start' => array('type' => 'int','precision' => '8','nullable' => False),
'cal_end' => array('type' => 'int','precision' => '8','nullable' => False)
),
'pk' => array('cal_id','cal_start'),
'fk' => array(),
'ix' => array(),
'uc' => array()
)
);
'pk' => array('cal_id','cal_extra_name'),
'fk' => array(),
'ix' => array(),
'uc' => array()
),
'egw_cal_dates' => array(
'fd' => array(
'cal_id' => array('type' => 'int','precision' => '4','nullable' => False),
'cal_start' => array('type' => 'int','precision' => '8','nullable' => False),
'cal_end' => array('type' => 'int','precision' => '8','nullable' => False)
),
'pk' => array('cal_id','cal_start'),
'fk' => array(),
'ix' => array(),
'uc' => array()
)
);

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!-- $Id$ -->
<overlay>
<template id="calendar.edit.general" template="" lang="" group="0" version="1.4.002">
<template id="calendar.edit.general" template="" lang="" group="0" version="1.5.001">
<hbox options="0,0">
<grid width="100%" height="200">
<columns>
@ -27,7 +27,7 @@
</row>
<row>
<description/>
<buttononly label="Freetime search" onclick="window.open(egw::link('/index.php','menuaction=calendar.uiforms.freetimesearch')+values2url(this.form,'start,end,duration,participants,recur_type,whole_day'),'ft_search','dependent=yes,width=700,height=500,scrollbars=yes,status=yes'); return false;" width="0" id="freetime" statustext="Find free timeslots where the selected participants are availible for the given timespan"/>
<buttononly label="Freetime search" onclick="window.open(egw::link('/index.php','menuaction=calendar.calendar_uiforms.freetimesearch')+values2url(this.form,'start,end,duration,participants,recur_type,whole_day'),'ft_search','dependent=yes,width=700,height=500,scrollbars=yes,status=yes'); return false;" width="0" id="freetime" statustext="Find free timeslots where the selected participants are availible for the given timespan"/>
</row>
<row class="row">
<description options=",,,location" value="Location" width="0"/>
@ -114,7 +114,7 @@
</rows>
</grid>
</template>
<template id="calendar.edit.recurrence" template="" lang="" group="0" version="1.3.001">
<template id="calendar.edit.recurrence" template="" lang="" group="0" version="1.3.002">
<grid width="100%" height="200">
<columns>
<column width="95"/>
@ -133,7 +133,7 @@
</menulist>
<description options=",,,recur_interval" value="Interval"/>
<menulist>
<menupopup type="select-number" id="recur_interval" statustext="repeating interval, eg. 2 to repeat every second week" options="None,2,10"/>
<menupopup type="select-number" id="recur_interval" statustext="repeating interval, eg. 2 to repeat every second week" options="None,2,31"/>
</menulist>
</row>
<row class="row" height="12">
@ -258,7 +258,7 @@
</rows>
</grid>
</template>
<template id="calendar.edit" template="" lang="" group="0" version="1.3.004">
<template id="calendar.edit" template="" lang="" group="0" version="1.3.005">
<grid width="100%">
<columns>
<column width="100"/>
@ -267,7 +267,7 @@
</columns>
<rows>
<row disabled="!@msg">
<description span="all" class="redItalic" id="msg" no_lang="1" align="center"/>
<html span="all" class="redItalic" id="msg" no_lang="1" align="center"/>
<description/>
<description/>
</row>

View File

@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!-- $Id$ -->
<overlay>
<template id="calendar.list.rows" template="" lang="" group="0" version="1.3.003">
<template id="calendar.list.rows" template="" lang="" group="0" version="1.5.001">
<grid width="100%">
<columns>
<column/>
@ -11,6 +11,11 @@
<column/>
<column/>
<column/>
<column/>
<column/>
<column/>
<column/>
<column/>
</columns>
<rows>
<row class="th">
@ -22,12 +27,17 @@
<nextmatch-sortheader label="Title" id="cal_title"/>
<nextmatch-sortheader label="Description" id="cal_description"/>
</vbox>
<nextmatch-sortheader label="Title" id="cal_title"/>
<nextmatch-sortheader label="Description" id="cal_description"/>
<nextmatch-sortheader label="Recurrence" id="recure"/>
<nextmatch-header label="Project" id="pm_id"/>
<nextmatch-header label="Category" id="cat_id"/>
<vbox>
<nextmatch-sortheader id="cal_owner" label="Owner" readonly="true"/>
<nextmatch-sortheader id="cal_location" label="Location"/>
</vbox>
<nextmatch-sortheader id="cal_owner" label="Owner" readonly="true"/>
<nextmatch-sortheader id="cal_location" label="Location"/>
<nextmatch-accountfilter options="All" id="participant" label="Participants"/>
<description value="Actions" class="noPrint"/>
</row>
@ -41,6 +51,9 @@
<description id="${row}[description]" no_lang="1"/>
<description id="${row}[recure]" no_lang="1"/>
</vbox>
<description id="${row}[title]"/>
<description id="${row}[description]" no_lang="1"/>
<description id="${row}[recure]"/>
<link-string options="calendar,projectmanager" id="${row}[id]"/>
<menulist>
<menupopup type="select-cat" id="${row}[category]" readonly="true"/>
@ -51,17 +64,22 @@
</menulist>
<description id="${row}[location]" no_lang="1"/>
</vbox>
<menulist class="noWrap">
<menupopup type="select-account" id="${row}[owner]" readonly="true"/>
</menulist>
<description id="${row}[location]" no_lang="1"/>
<html id="${row}[parts]" readonly="true" no_lang="1"/>
<hbox class="noPrint">
<button image="view" label="View" id="view[$row_cont[id]]" statustext="View this event" onclick="window.open(egw::link('/index.php','menuaction=calendar.uiforms.edit&amp;cal_id=$row_cont[id]&amp;date=$row_cont[date]'),'425','dependent=yes,width=750,height=450,scrollbars=yes,status=yes'); return false;"/>
<button image="edit" label="Edit" id="edit[$row_cont[id]]" statustext="Edit this event" onclick="window.open(egw::link('/index.php','menuaction=calendar.uiforms.edit&amp;cal_id=$row_cont[id]&amp;date=$row_cont[date]'),'425','dependent=yes,width=750,height=450,scrollbars=yes,status=yes'); return false;"/>
<button image="view" label="View" id="view[$row_cont[id]]" statustext="View this event" onclick="window.open(egw::link('/index.php','menuaction=calendar.calendar_uiforms.edit&amp;cal_id=$row_cont[id]&amp;date=$row_cont[date]'),'425','dependent=yes,width=750,height=450,scrollbars=yes,status=yes'); return false;"/>
<button image="edit" label="Edit" id="edit[$row_cont[id]]" statustext="Edit this event" onclick="window.open(egw::link('/index.php','menuaction=calendar.calendar_uiforms.edit&amp;cal_id=$row_cont[id]&amp;date=$row_cont[date]'),'425','dependent=yes,width=750,height=450,scrollbars=yes,status=yes'); return false;"/>
<button id="delete[$row_cont[id]]" image="delete" label="Delete" statustext="Delete this event" onclick="return confirm('Delete this event');"/>
<checkbox id="checked[]" options="$row_cont[id]" statustext="Select multiple contacts for a further action" align="right"/>
</hbox>
</row>
</rows>
</grid>
</template>
<template id="calendar.list" template="" lang="" group="0" version="1.0.1.001">
<template id="calendar.list" template="" lang="" group="0" version="1.5.001">
<grid width="100%">
<columns>
<column/>
@ -73,6 +91,12 @@
<row>
<nextmatch options="calendar.list.rows" id="nm"/>
</row>
<row>
<hbox label="Check all" id="check_all" statustext="Check all" needed="1" align="right">
<button id="deleteall" image="delete" label="Delete" statustext="Delete selected Envents" onclick="return confirm('Delete selected Envents?');"/>
<button image="arrow_ltr" label="Check all" id="check_all" statustext="Check all" onclick="toggle_all(this.form,form::name('nm[rows][checked][]')); return false;" class="checkAllArrow"/>
</hbox>
</row>
</rows>
</grid>
<styles>