virtual_calendar Class Reference

Inheritance diagram for virtual_calendar:

icalvircal List of all members.

Detailed Description

Virtual Calendar across egw resources.

This class provides structures to define searches on egroupware calendar and infolog like resources and associate access grants/restrictions for these resources. A combination of such a structure will define a set of events, todos found in these resources together with rights to access these and to possibly add new ones to these resources: a so called Virtual Calendar.

These virtual calendars can be used to access the data contained in them via for example icalsrv or other egw services. Users can create new Virtual Calendars by defining queries on and access rights restrictions to egw resources.

Basic operations supported on virtual calendars are:

Author:
jvl
Since:
0.9.36-a1 first version adapted to NAPi-3.1
Version:
0.9.37-a2 added some php4 compatibility
Date:
20060427


Public Member Functions

int fromArray (VCalDefAr &$vcar)
 Retrieve definitions of the virtual calendar from an array and set object accordingly.
array rewrite_directives (mixed &$field, boolean &$oke, array &$rwdirtable)
 Rewrite recursively any array value string starting fn_ into a eval of a namelike member function.
VCalDefAr toArray ()
 Convert encode definitions of the virtual calendar in an array.
Directive definitions
int _fn_cal_owner_id ()
 deliver calendar owner id (int) This is best taken from a the member var $cal_owner_id
string _fn_month_end (int $offset=0)
 give end of month, relative to today, in Ymd time the end is only roughly calculated, mostly a day or so after the last day of the month.
string _fn_month_start (int $offset=0)
 give start of month, relative to today, in Ymd time the start is only roughly calculated, mostly a day before the first day of the month.
string _fn_months_away (int $n=-1)
 give n months away , relative to today, in Ymd time the date is only roughly calculated.
string _fn_week_end (int $offset=0)
 give end of week, relative to today, in Ymd time the end is only roughly calculated, mostly a day or so after the last day of the week.
string _fn_week_start (int $offset=0)
 give start of week, relative to today, in Ymd time the start is only roughly calculated, mostly a day before the first day of the week.
Auxiliary functions
int a6toutime (array $a6)
 Convert a 6 field hash array in the current active timezone to a unix timestamp.
array utimetoa6 (int $utime)
 Convert a unix timestamp to a 6 field hash array in the current active timezone.

Public Attributes

string $auth = 'NOT SET'
 Authentication demanded.
int $cal_owner_id = null
 Calendar Owner Id.
string $pw = null
 Password if demanded.


Member Function Documentation

int virtual_calendar::_fn_cal_owner_id  ) 
 

deliver calendar owner id (int) This is best taken from a the member var $cal_owner_id

Returns:
id of the calendar owner if provided else 0

string virtual_calendar::_fn_month_end int $  offset = 0  ) 
 

give end of month, relative to today, in Ymd time the end is only roughly calculated, mostly a day or so after the last day of the month.

Parameters:
$offset offset (+ ro -) from this month (in months) (so ex. lastmonth -> offset=-1 etc)
Returns:
Ymd time end of current month

string virtual_calendar::_fn_month_start int $  offset = 0  ) 
 

give start of month, relative to today, in Ymd time the start is only roughly calculated, mostly a day before the first day of the month.

Parameters:
$offset offset (+ ro -) from this month (in months) (so ex. lastmonth -> offset=-1 etc)
Returns:
Ymd time start of current month

string virtual_calendar::_fn_months_away int $  n = -1  ) 
 

give n months away , relative to today, in Ymd time the date is only roughly calculated.

..

Parameters:
$n number of months away from today (+ or -)
Returns:
date calculated n months from now

string virtual_calendar::_fn_week_end int $  offset = 0  ) 
 

give end of week, relative to today, in Ymd time the end is only roughly calculated, mostly a day or so after the last day of the week.

Bug:
week_end currently implemented as 4days before today
Parameters:
$offset offset (+ ro -) from this month (in months) (so ex. lastmonth -> offset=-1 etc)
Returns:
Ymd time end of current month

string virtual_calendar::_fn_week_start int $  offset = 0  ) 
 

give start of week, relative to today, in Ymd time the start is only roughly calculated, mostly a day before the first day of the week.

Bug:
week_start currently implemented as 4days before today
Parameters:
$offset offset (+ ro -) from this week (in weeks) (so ex. lastmonth -> offset=-1 etc)
Returns:
Ymd time start of current week

int virtual_calendar::a6toutime array $  a6  ) 
 

Convert a 6 field hash array in the current active timezone to a unix timestamp.

This is basically the inverseof php getdate() function.

The a6date array has fields as in the php getdate() function:

  • year four digit year field
  • month integer month number note: mon, not month!!
  • mday integer day of month number
  • hour integer hour
  • minute integer minutes
  • second integer seconds

Parameters:
$a6 The date in a6date in local timezone format.
Returns:
a unixtimestamp assumed in utc timezone

int virtual_calendar::fromArray VCalDefAr &$  vcar  ) 
 

Retrieve definitions of the virtual calendar from an array and set object accordingly.

Note that the special directives (starting with _fn_) are tried to be evaluated, using private member funcs(starting with _fn_) See Array Encoding of the Virtual Calendar Definitions for description of the array format

Parameters:
$vcar the array with all definitions of the virtual calendar.
Returns:
number of calendars restored. On error false

array virtual_calendar::rewrite_directives mixed &$  field,
boolean &$  oke,
array &$  rwdirtable
 

Rewrite recursively any array value string starting fn_ into a eval of a namelike member function.

If a no good eval function is found an error is returned

Parameters:
$field field or array to rewrite
$oke error status of rewrite (on problems: false)
$rwdirtable table of allowed rewrite directives
Returns:
rewritten input if recursive rewrite went ok. False on error

VCalDefAr virtual_calendar::toArray  ) 
 

Convert encode definitions of the virtual calendar in an array.

See Array Encoding of the Virtual Calendar Definitions for a description of the array format

Returns:
the virtual calendar definition as an array

array virtual_calendar::utimetoa6 int $  utime  ) 
 

Convert a unix timestamp to a 6 field hash array in the current active timezone.

This is basically alike the php getdate() function but with different field names

The a6date array has fields as in the php getdate() function:

  • year four digit year field
  • month integer month number
  • mday integer day of month number
  • hour integer hour
  • minute integer minutes
  • second integer seconds

Parameters:
$utime a unixtimestamp assumed in utc timezone
Returns:
The date in a6date in local timezone format.


Generated on Thu Jun 8 22:17:14 2006 for IcalSrv-API by  doxygen 1.4.6