fixed bug [ 1103731 ] calendar dont work without infolog installed

fixed bug [ 1115160 ] Calender Updated Time Error
This commit is contained in:
Ralf Becker 2005-02-09 18:17:44 +00:00
parent 008cb40024
commit 388b950a2a

View File

@ -527,7 +527,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);
@ -535,16 +534,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;
}
} }
} }
} }
@ -1117,7 +1121,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']);
@ -3100,7 +3105,7 @@
$var['updated'] = Array( $var['updated'] = Array(
'field' => lang('Updated'), 'field' => lang('Updated'),
'data' => $GLOBALS['phpgw']->common->show_date($this->maketime($event['modtime']) - $GLOBALS['phpgw']->datetime->tz_offset) 'data' => $GLOBALS['phpgw']->common->show_date($this->maketime($event['modtime']))
); );
$var['access'] = Array( $var['access'] = Array(