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,16 +528,21 @@
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);
$linkIDs = $bolink->get_links('calendar', $id);
if(is_array($linkIDs)) if (isset($GLOBALS['phpgw_info']['apps']['infolog'])) // check if infolog is installed
{ {
foreach($linkIDs as $linkData) $bolink = createObject('infolog.bolink');
$linkIDs = $bolink->get_links('calendar', $id);
if(is_array($linkIDs))
{ {
//$event['projectID'] = 8; foreach($linkIDs as $linkData)
if($linkData['app'] == 'projects')
{ {
$event['projectID'] = $linkData['id']; //$event['projectID'] = 8;
continue; if($linkData['app'] == 'projects')
{
$event['projectID'] = $linkData['id'];
continue;
}
} }
} }
} }
@ -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']);