From 9892d222c52b91381b5ccb2809abff45ca8bf07a Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 24 Nov 2002 10:34:28 +0000 Subject: [PATCH] fix to get hook_email working with both email and felamimail --- calendar/inc/class.uicalendar.inc.php | 6 ++--- calendar/inc/hook_email.inc.php | 32 ++++++++++++++------------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/calendar/inc/class.uicalendar.inc.php b/calendar/inc/class.uicalendar.inc.php index eff2eaa58b..82eaf3f032 100755 --- a/calendar/inc/class.uicalendar.inc.php +++ b/calendar/inc/class.uicalendar.inc.php @@ -2510,7 +2510,8 @@ $GLOBALS['phpgw']->preferences->save_repository(); } } - if($GLOBALS['phpgw_info']['flags']['currentapp'] == 'home') + if($GLOBALS['phpgw_info']['flags']['currentapp'] == 'home' || + strstr($GLOBALS['phpgw_info']['flags']['currentapp'],'mail')) // email, felamimail, ... { $page_app = 'calendar'; } @@ -3952,8 +3953,7 @@ $pix = $GLOBALS['phpgw']->common->image('calendar','pix'); $str = '
'.lang($GLOBALS['phpgw']->common->show_date($date['raw'],'l')) - . ', '.lang($GLOBALS['phpgw']->common->show_date($date['raw'],'F')) - . ' '.$GLOBALS['phpgw']->common->show_date($date['raw'],'d, Y').'
' + . ', '.$this->bo->long_date($date).'
' . '' . '' . ''; diff --git a/calendar/inc/hook_email.inc.php b/calendar/inc/hook_email.inc.php index 39b79dc28a..8ca533cdef 100755 --- a/calendar/inc/hook_email.inc.php +++ b/calendar/inc/hook_email.inc.php @@ -16,7 +16,7 @@ global $calendar_id; - $d1 = strtolower(substr($phpgw_info['server']['app_inc'],0,3)); + $d1 = strtolower(substr($GLOBALS['phpgw_info']['server']['app_inc'],0,3)); if($d1 == 'htt' || $d1 == 'ftp') { echo 'Failed attempt to break in via an old Security Hole!
'."\n"; @@ -25,26 +25,28 @@ } unset($d1); + $GLOBALS['phpgw']->translation->add_app('calendar'); + $cal = CreateObject('calendar.uicalendar'); - echo 'Event ID: '.$calendar_id."
\n"; + //echo "Event ID: $calendar_id
\n"; $event = $cal->bo->read_entry($calendar_id); - reset($event['participants']); - while(list($particpants,$status) = each($event['participants'])) - { - $parts[] = $participants; - } - @reset($parts); + echo $cal->timematrix( + Array( + 'date' => $GLOBALS['phpgw']->datetime->localdates(mktime(0,0,0,$event['start']['month'],$event['start']['mday'],$event['start']['year']) - $phpgw->calendar->tz_offset), + 'starttime' => $cal->bo->splittime('000000',False), + 'endtime' => 0, + 'participants' => $event['participants']) + ) . - $freetime = $cal->bo->datetime->localdates(mktime(0,0,0,$event['start']['month'],$event['start']['mday'],$event['start']['year']) - $phpgw->calendar->tz_offset); - echo $cal->timematrix($freetime,$cal->bo->splittime('000000',False),0,$parts); + ''; - - echo $cal->get_response($calendar_id); + $cal->get_response($calendar_id); + + unset($cal); unset($event); ?>
'.lang('Participant').'
' . - echo '
'; + $cal->view_event($event) . - echo $cal->view_event($event); + '
' . - echo '