fixed bug [ 1103731 ] calendar dont work without infolog installed

This commit is contained in:
Ralf Becker 2005-02-09 17:54:46 +00:00
parent a029793462
commit 7aa0f60d98

View File

@ -521,7 +521,6 @@
function read_entry($id,$ignore_acl=False) function read_entry($id,$ignore_acl=False)
{ {
$bolink = createObject('infolog.bolink');
if (is_array($id) && count($id) == 1) if (is_array($id) && count($id) == 1)
{ {
list(,$id) = each($id); list(,$id) = each($id);
@ -529,6 +528,10 @@
if($ignore_acl || $this->check_perms(PHPGW_ACL_READ,$id)) if($ignore_acl || $this->check_perms(PHPGW_ACL_READ,$id))
{ {
$event = $this->so->read_entry($id); $event = $this->so->read_entry($id);
if (isset($GLOBALS['phpgw_info']['apps']['infolog'])) // check if infolog is installed
{
$bolink = createObject('infolog.bolink');
$linkIDs = $bolink->get_links('calendar', $id); $linkIDs = $bolink->get_links('calendar', $id);
if(is_array($linkIDs)) if(is_array($linkIDs))
{ {
@ -542,6 +545,7 @@
} }
} }
} }
}
if(!isset($event['participants'][$this->owner]) && $this->user_is_a_member($event,$this->owner)) if(!isset($event['participants'][$this->owner]) && $this->user_is_a_member($event,$this->owner))
{ {
$this->so->add_attribute('participants','U',(int)$this->owner); $this->so->add_attribute('participants','U',(int)$this->owner);
@ -1102,7 +1106,8 @@
} }
$date = sprintf("%04d%02d%02d",$event['start']['year'],$event['start']['month'],$event['start']['mday']); $date = sprintf("%04d%02d%02d",$event['start']['year'],$event['start']['month'],$event['start']['mday']);
if(isset($l_cal['project'])) // check if infolog is availible
if(isset($GLOBALS['phpgw_info']['apps']['infolog']) && isset($l_cal['project']))
{ {
$bolink = createObject('infolog.bolink'); $bolink = createObject('infolog.bolink');
$bolink->unlink(0,'calendar',$event['id']); $bolink->unlink(0,'calendar',$event['id']);