update hook_home

This commit is contained in:
ceb 2002-10-26 00:26:51 +00:00
parent b9f2dba2b3
commit f42db9d12d
6 changed files with 29 additions and 87 deletions

View File

@ -1,14 +1,13 @@
<?php <?php
/**************************************************************************\ /**************************************************************************\
* phpGroupWare - E-Mail * * phpGroupWare - Addressbook hook_home *
* http://www.phpgroupware.org * * http://www.phpgroupware.org *
* -------------------------------------------- * * -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it * * 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 * * 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 * * Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. * * option) any later version. *
\**************************************************************************/ \**************************************************************************/
/* $Id$ */ /* $Id$ */
$d1 = strtolower(substr(PHPGW_APP_INC,0,3)); $d1 = strtolower(substr(PHPGW_APP_INC,0,3));
@ -23,10 +22,9 @@
if ($GLOBALS['phpgw_info']['user']['apps']['addressbook'] if ($GLOBALS['phpgw_info']['user']['apps']['addressbook']
&& $GLOBALS['phpgw_info']['user']['preferences']['addressbook']['mainscreen_showbirthdays']) && $GLOBALS['phpgw_info']['user']['preferences']['addressbook']['mainscreen_showbirthdays'])
{ {
$tmp = "\n<!-- Birthday info -->\n";
$c = CreateObject('phpgwapi.contacts'); $c = CreateObject('phpgwapi.contacts');
$qfields = array( $qfields = array
(
'n_given' => 'n_given', 'n_given' => 'n_given',
'n_family' => 'n_family', 'n_family' => 'n_family',
'bday' => 'bday' 'bday' => 'bday'
@ -36,38 +34,17 @@
$bdays = $c->read(0,15,$qfields,$today,'tid=n','','',$GLOBALS['phpgw_info']['user']['account_id']); $bdays = $c->read(0,15,$qfields,$today,'tid=n','','',$GLOBALS['phpgw_info']['user']['account_id']);
$title = '<center><font color="#FFFFFF">'.lang('Birthdays').'</font></center>';
$portalbox = CreateObject('phpgwapi.listbox',
Array(
'title' => $title,
'width' => '100%',
'header_background_image' => $GLOBALS['phpgw']->common->image('phpgwapi/templates/default','bg_filler')
)
);
$app_id = $GLOBALS['phpgw']->applications->name2id('addressbook'); $app_id = $GLOBALS['phpgw']->applications->name2id('addressbook');
$GLOBALS['portal_order'][] = $app_id; $GLOBALS['portal_order'][] = $app_id;
$var = Array(
'up' => Array('url' => '/set_box.php', 'app' => $app_id),
'down' => Array('url' => '/set_box.php', 'app' => $app_id),
'close' => Array('url' => '/set_box.php', 'app' => $app_id),
'question' => Array('url' => '/set_box.php', 'app' => $app_id),
'edit' => Array('url' => '/set_box.php', 'app' => $app_id)
);
while(list($key,$value) = each($var))
{
$portalbox->set_controls($key,$value);
}
$portalbox->data = Array();
$GLOBALS['phpgw']->portalbox->set_params(array('app_id' => $app_id,
'title' => lang('addressbook')));
while(list($key,$val) = @each($bdays)) while(list($key,$val) = @each($bdays))
{ {
$portalbox->data[] = array $GLOBALS['phpgw']->portalbox->data[] = array
( (
'text' => lang("Today is x's birthday!", $val['n_given'] . ' ' . $val['n_family']), 'text' => lang("Today is x's birthday!", $val['n_given'] . ' ' . $val['n_family']),
'link' => $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.view&ab_id=' . $val['id']), 'link' => $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.view&ab_id=' . $val['id']),
'lang_link_statustext' => lang('show contact') 'lang_link_statustext' => lang('show contact')
); );
} }
@ -78,20 +55,13 @@
while(list($key,$val) = @each($bdays)) while(list($key,$val) = @each($bdays))
{ {
$portalbox->data[] = array $GLOBALS['phpgw']->portalbox->data[] = array
( (
'text' => lang("Tomorrow is x's birthday.", $val['n_given'] . ' ' . $val['n_family']), 'text' => lang("Tomorrow is x's birthday.", $val['n_given'] . ' ' . $val['n_family']),
'link' => $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.view&ab_id='.$val['id']), 'link' => $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.view&ab_id='.$val['id']),
'lang_link_statustext' => lang('show contact') 'lang_link_statustext' => lang('show contact')
); );
} }
if(count($portalbox->data)) $GLOBALS['phpgw']->portalbox->draw();
{
$tmp = $portalbox->draw();
}
unset($portalbox);
$GLOBALS['phpgw']->template->set_var('phpgw_body',$tmp,True);
unset($tmp);
} }
?> ?>

View File

@ -36,8 +36,6 @@
$GLOBALS['g_month'] = substr($GLOBALS['date'],4,2); $GLOBALS['g_month'] = substr($GLOBALS['date'],4,2);
$GLOBALS['g_day'] = substr($GLOBALS['date'],6,2); $GLOBALS['g_day'] = substr($GLOBALS['date'],6,2);
$GLOBALS['owner'] = $GLOBALS['phpgw_info']['user']['account_id']; $GLOBALS['owner'] = $GLOBALS['phpgw_info']['user']['account_id'];
$GLOBALS['css'] = "\n".'<STYLE type="text/css">'."\n".'<!--'."\n"
. ExecMethod('calendar.uicalendar.css').'-->'."\n".'</style>';
$page_ = explode('.',$GLOBALS['phpgw_info']['user']['preferences']['calendar']['defaultcalendar']); $page_ = explode('.',$GLOBALS['phpgw_info']['user']['preferences']['calendar']['defaultcalendar']);
$_page = $page_[0]; $_page = $page_[0];
@ -54,37 +52,11 @@
} }
include(PHPGW_INCLUDE_ROOT.'/calendar/inc/hook_home_'.$_page.'.inc.php'); include(PHPGW_INCLUDE_ROOT.'/calendar/inc/hook_home_'.$_page.'.inc.php');
$title = '<font color="#FFFFFF">'.lang('Calendar').'</font>';
$portalbox = CreateObject('phpgwapi.listbox',
Array(
'title' => $title,
'width' => '100%',
'outerborderwidth' => '0',
'header_background_image' => $GLOBALS['phpgw']->common->image('phpgwapi/templates/default','bg_filler')
)
);
$app_id = $GLOBALS['phpgw']->applications->name2id('calendar'); $app_id = $GLOBALS['phpgw']->applications->name2id('calendar');
$GLOBALS['portal_order'][] = $app_id; $GLOBALS['portal_order'][] = $app_id;
$var = Array(
'up' => Array('url' => '/set_box.php', 'app' => $app_id),
'down' => Array('url' => '/set_box.php', 'app' => $app_id),
'close' => Array('url' => '/set_box.php', 'app' => $app_id),
'question' => Array('url' => '/set_box.php', 'app' => $app_id),
'edit' => Array('url' => '/set_box.php', 'app' => $app_id)
);
while(list($key,$value) = each($var)) $GLOBALS['phpgw']->portalbox->set_params(array('app_id' => $app_id,
{ 'title' => lang('calendar')));
$portalbox->set_controls($key,$value); $GLOBALS['phpgw']->portalbox->draw($GLOBALS['extra_data'])
}
$portalbox->data = Array();
$GLOBALS['phpgw']->template->set_var('phpgw_body', "\n".'<!-- BEGIN Calendar info -->'."\n".$portalbox->draw($GLOBALS['extra_data'])."\n".'<!-- END Calendar info -->'."\n",True);
unset($cal);
} }
flush();
?> ?>

View File

@ -23,7 +23,7 @@
} }
unset($d1); unset($d1);
$GLOBALS['extra_data'] = $GLOBALS['css']."\n".'<td>'."\n".'<table border="0" cols="3"><tr><td align="center" width="35%" valign="top">' $GLOBALS['extra_data'] = '<td>'."\n".'<table border="0" cols="3"><tr><td align="center" width="35%" valign="top">'
. ExecMethod('calendar.uicalendar.mini_calendar', . ExecMethod('calendar.uicalendar.mini_calendar',
Array( Array(
'day' => $GLOBALS['g_day'], 'day' => $GLOBALS['g_day'],

View File

@ -23,7 +23,7 @@
} }
unset($d1); unset($d1);
$GLOBALS['extra_data'] = $GLOBALS['css']."\n".'<td>'."\n".'<table border="0" cols="3"><tr><td align="center" width="100%" valign="top">' $GLOBALS['extra_data'] = '<td>'."\n".'<table border="0" cols="3"><tr><td align="center" width="100%" valign="top">'
. ExecMethod('calendar.uicalendar.get_month') . ExecMethod('calendar.uicalendar.get_month')
.'</td>'."\n".'</tr>'."\n".'</table>'."\n".'</td>'."\n"; .'</td>'."\n".'</tr>'."\n".'</table>'."\n".'</td>'."\n";
?> ?>

View File

@ -23,7 +23,7 @@
} }
unset($d1); unset($d1);
$GLOBALS['extra_data'] = $GLOBALS['css']."\n".'<td>'."\n".'<table border="0" cols="3"><tr><td align="center" width="100%" valign="top">' $GLOBALS['extra_data'] = '<td>'."\n".'<table border="0" cols="3"><tr><td align="center" width="100%" valign="top">'
. ExecMethod('calendar.uicalendar.get_week') . ExecMethod('calendar.uicalendar.get_week')
.'</td>'."\n".'</tr>'."\n".'</table>'."\n".'</td>'."\n"; .'</td>'."\n".'</tr>'."\n".'</table>'."\n".'</td>'."\n";
?> ?>

View File

@ -23,7 +23,7 @@
} }
unset($d1); unset($d1);
$GLOBALS['extra_data'] = $GLOBALS['css']."\n".'<td>'."\n".'<table border="0" cols="3"><tr><td align="center" width="100%" valign="top">' $GLOBALS['extra_data'] = '<td>'."\n".'<table border="0" cols="3"><tr><td align="center" width="100%" valign="top">'
. ExecMethod('calendar.uicalendar.get_year') . ExecMethod('calendar.uicalendar.get_year')
.'</td>'."\n".'</tr>'."\n".'</table>'."\n".'</td>'."\n"; .'</td>'."\n".'</tr>'."\n".'</table>'."\n".'</td>'."\n";
?> ?>