2000-08-18 05:24:22 +02:00
|
|
|
<?php
|
|
|
|
/**************************************************************************\
|
2000-12-26 21:13:34 +01:00
|
|
|
* phpGroupWare *
|
2000-08-18 05:24:22 +02:00
|
|
|
* http://www.phpgroupware.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$ */
|
|
|
|
|
2001-04-21 14:43:00 +02:00
|
|
|
if (floor(phpversion()) == 4)
|
2001-03-03 04:55:01 +01:00
|
|
|
{
|
|
|
|
global $phpgw_info, $phpgw, $grants, $owner, $rights, $filter;
|
|
|
|
global $date, $year, $month, $day, $thisyear, $thismonth, $thisday;
|
|
|
|
}
|
2001-02-14 03:58:46 +01:00
|
|
|
|
2001-02-20 04:48:00 +01:00
|
|
|
if(!isset($filter) || !$filter)
|
|
|
|
{
|
2001-03-04 05:13:04 +01:00
|
|
|
$filter = $phpgw_info['user']['preferences']['calendar']['defaultfilter'];
|
2001-02-20 04:48:00 +01:00
|
|
|
}
|
2001-02-14 03:58:46 +01:00
|
|
|
|
2001-02-20 04:48:00 +01:00
|
|
|
// This is the initialization of the ACL usage
|
2001-02-15 05:12:31 +01:00
|
|
|
|
2001-02-20 04:48:00 +01:00
|
|
|
$grants = $phpgw->acl->get_grants('calendar');
|
2001-02-14 03:58:46 +01:00
|
|
|
|
2001-02-20 04:48:00 +01:00
|
|
|
if(!isset($owner))
|
|
|
|
{
|
|
|
|
$owner = 0;
|
|
|
|
}
|
2001-02-14 03:58:46 +01:00
|
|
|
|
2001-03-18 18:03:11 +01:00
|
|
|
settype($owner,'integer');
|
|
|
|
|
2001-03-04 05:13:04 +01:00
|
|
|
if(!isset($owner) || !$owner || ($owner == $phpgw_info['user']['account_id']))
|
2001-02-20 04:48:00 +01:00
|
|
|
{
|
|
|
|
$owner = $phpgw_info['user']['account_id'];
|
2001-03-18 14:41:29 +01:00
|
|
|
$rights = PHPGW_ACL_READ + PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE + PHPGW_ACL_PRIVATE;
|
2001-03-20 04:33:02 +01:00
|
|
|
$grants[$owner] = $rights;
|
2001-02-20 04:48:00 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if($grants[$owner])
|
|
|
|
{
|
2001-04-13 16:34:15 +02:00
|
|
|
$grants[$phpgw_info['user']['account_id']] = PHPGW_ACL_READ + PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE + PHPGW_ACL_PRIVATE;
|
|
|
|
|
2001-02-20 04:48:00 +01:00
|
|
|
$rights = $grants[$owner];
|
|
|
|
if ($rights == 0)
|
|
|
|
{
|
|
|
|
$owner = $phpgw_info['user']['account_id'];
|
2001-03-18 14:41:29 +01:00
|
|
|
$rights = PHPGW_ACL_READ + PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE + PHPGW_ACL_PRIVATE;
|
2001-03-20 04:33:02 +01:00
|
|
|
$grants[$owner] = $rights;
|
2001-02-20 04:48:00 +01:00
|
|
|
}
|
|
|
|
}
|
2001-03-13 06:03:50 +01:00
|
|
|
else
|
|
|
|
{
|
|
|
|
$owner = $phpgw_info['user']['account_id'];
|
2001-03-18 14:41:29 +01:00
|
|
|
$rights = PHPGW_ACL_READ + PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE + PHPGW_ACL_PRIVATE;
|
2001-03-20 04:33:02 +01:00
|
|
|
$grants[$owner] = $rights;
|
2001-03-13 06:03:50 +01:00
|
|
|
}
|
2001-02-20 04:48:00 +01:00
|
|
|
}
|
2001-02-14 03:58:46 +01:00
|
|
|
|
2001-02-20 04:48:00 +01:00
|
|
|
/* Load calendar class */
|
|
|
|
$parameters = Array(
|
|
|
|
'printer_friendly'=> ((isset($friendly) && ($friendly==1))?True:False),
|
2001-03-13 06:03:50 +01:00
|
|
|
'owner' => intval($owner),
|
|
|
|
'rights' => intval($rights)
|
2001-02-20 04:48:00 +01:00
|
|
|
);
|
2001-02-15 05:12:31 +01:00
|
|
|
|
2001-02-20 04:48:00 +01:00
|
|
|
if(!isset($phpgw_info['user']['preferences']['calendar']['weekdaystarts']))
|
|
|
|
{
|
|
|
|
$phpgw_info['user']['preferences']['calendar']['weekdaystarts'] = 'Sunday';
|
2001-04-02 19:24:57 +02:00
|
|
|
$phpgw->preferences->save_repository();
|
2001-02-20 04:48:00 +01:00
|
|
|
}
|
|
|
|
|
2001-05-03 01:23:48 +02:00
|
|
|
$phpgw->calendar = CreateObject('calendar.calendar',$parameters);
|
|
|
|
$phpgw->calendar->holidays->read_holiday();
|
|
|
|
|
2001-02-20 04:48:00 +01:00
|
|
|
if (isset($date) && strlen($date) > 0)
|
|
|
|
{
|
|
|
|
$thisyear = intval(substr($date, 0, 4));
|
|
|
|
$thismonth = intval(substr($date, 4, 2));
|
|
|
|
$thisday = intval(substr($date, 6, 2));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (!isset($day) || !$day)
|
|
|
|
{
|
|
|
|
$thisday = $phpgw->calendar->today['day'];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$thisday = $day;
|
|
|
|
}
|
2001-02-14 03:58:46 +01:00
|
|
|
|
2001-02-20 04:48:00 +01:00
|
|
|
if (!isset($month) || !$month)
|
|
|
|
{
|
|
|
|
$thismonth = $phpgw->calendar->today['month'];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$thismonth = $month;
|
|
|
|
}
|
2001-02-14 03:58:46 +01:00
|
|
|
|
2001-02-20 04:48:00 +01:00
|
|
|
if (!isset($year) || !$year)
|
|
|
|
{
|
|
|
|
$thisyear = $phpgw->calendar->today['year'];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$thisyear = $year;
|
|
|
|
}
|
2001-02-14 03:58:46 +01:00
|
|
|
|
2001-02-20 04:48:00 +01:00
|
|
|
}
|
2001-02-14 03:58:46 +01:00
|
|
|
|
|
|
|
$phpgw->calendar->tempyear = $thisyear;
|
|
|
|
$phpgw->calendar->tempmonth = $thismonth;
|
|
|
|
$phpgw->calendar->tempday = $thisday;
|
2000-08-19 01:13:45 +02:00
|
|
|
?>
|