diff --git a/phpgwapi/addressbook.php b/phpgwapi/addressbook.php
index b3f455a734..fa54e59645 100644
--- a/phpgwapi/addressbook.php
+++ b/phpgwapi/addressbook.php
@@ -12,7 +12,7 @@
/* $Id$ */
- $GLOBALS['phpgw_info']['flags'] = array(
+ $GLOBALS['egw_info']['flags'] = array(
'noheader' => True,
'nonavbar' => True,
'currentapp' => 'addressbook',
@@ -22,23 +22,22 @@
include('../header.inc.php');
// add a content-type header to overwrite an existing default charset in apache (AddDefaultCharset directiv)
- header('Content-type: text/html; charset='.$GLOBALS['phpgw']->translation->charset());
+ header('Content-type: text/html; charset='.$GLOBALS['egw']->translation->charset());
- include('templates/'.$GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'].'/head.inc.php');
+ include('templates/'.$GLOBALS['egw_info']['user']['preferences']['common']['template_set'].'/head.inc.php');
- $GLOBALS['phpgw']->template->set_root(PHPGW_TEMPLATE_DIR);
- $GLOBALS['phpgw']->template->set_file(array(
+ $GLOBALS['egw']->template->set_root(EGW_TEMPLATE_DIR);
+ $GLOBALS['egw']->template->set_file(array(
'addressbook_list_t' => 'addressbook.tpl',
));
- $GLOBALS['phpgw']->template->set_block('addressbook_list_t','addressbook_list','list');
+ $GLOBALS['egw']->template->set_block('addressbook_list_t','addressbook_list','list');
- $contacts = CreateObject('phpgwapi.contacts');
- $cats = CreateObject('phpgwapi.categories');
- $cats->app_name = 'addressbook';
+ $contacts =& CreateObject('phpgwapi.contacts');
+ $cats =& CreateObject('phpgwapi.categories','','addressbook');
$include_personal = True;
- $GLOBALS['phpgw']->template->set_var(array(
+ $GLOBALS['egw']->template->set_var(array(
'lang_search' => lang('Search'),
'lang_select_cats' => lang('Show all categorys'),
'lang_done' => lang('Done'),
@@ -68,10 +67,10 @@
);
$link = '/phpgwapi/addressbook.php';
- $full_link = $GLOBALS['phpgw']->link($link,$common_vars+array(
+ $full_link = $GLOBALS['egw']->link($link,$common_vars+array(
'start' => $start,
));
- $GLOBALS['phpgw']->template->set_var('form_action',$full_link);
+ $GLOBALS['egw']->template->set_var('form_action',$full_link);
$qfilter = 'tid=n';
switch($filter)
@@ -82,7 +81,7 @@
$qfilter .=',access=private';
// fall-through
case 'yours':
- $qfilter .= ',owner='.$GLOBALS['phpgw_info']['user']['account_id'];
+ $qfilter .= ',owner='.$GLOBALS['egw_info']['user']['account_id'];
break;
default:
if(is_numeric($filter))
@@ -97,16 +96,16 @@
$qfilter .= ',cat_id='.$cat_id;
}
- if ($GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] > 0)
+ if ($GLOBALS['egw_info']['user']['preferences']['common']['maxmatchs'] > 0)
{
- $offset = $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
+ $offset = $GLOBALS['egw_info']['user']['preferences']['common']['maxmatchs'];
}
else
{
$offset = 15;
}
- $account_id = $GLOBALS['phpgw_info']['user']['account_id'];
+ $account_id = $GLOBALS['egw_info']['user']['account_id'];
$cols = array (
'n_given' => 'n_given',
@@ -132,9 +131,9 @@
$entries = $contacts->read($start,$offset,$cols,$query,$qfilter,$sort,$order,$account_id);
}
//------------------------------------------- nextmatch --------------------------------------------
- $GLOBALS['phpgw']->template->set_var('left',$GLOBALS['phpgw']->nextmatchs->left(
+ $GLOBALS['egw']->template->set_var('left',$GLOBALS['egw']->nextmatchs->left(
$link,$start,$contacts->total_records,'&'.explode('&',$common_vars)));
- $GLOBALS['phpgw']->template->set_var('right',$GLOBALS['phpgw']->nextmatchs->right(
+ $GLOBALS['egw']->template->set_var('right',$GLOBALS['egw']->nextmatchs->right(
$link,$start,$contacts->total_records,'&'.explode('&',$common_vars)));
foreach(array(
'n_given' => lang('Firstname'),
@@ -142,20 +141,20 @@
'org_name' => lang('Company'),
) as $col => $translation)
{
- $GLOBALS['phpgw']->template->set_var('sort_'.$col,$GLOBALS['phpgw']->nextmatchs->show_sort_order(
+ $GLOBALS['egw']->template->set_var('sort_'.$col,$GLOBALS['egw']->nextmatchs->show_sort_order(
$sort,$col,$order,$link,$translation,'&cat_id='.$cat_id));
}
if ($contacts->total_records > $offset)
{
- $GLOBALS['phpgw']->template->set_var('lang_showing',lang('showing %1 - %2 of %3',
+ $GLOBALS['egw']->template->set_var('lang_showing',lang('showing %1 - %2 of %3',
1+$start,$start+$offset>$contacts->total_records ? $contacts->total_records : $start+$offset,
$contacts->total_records));
}
else
{
- $GLOBALS['phpgw']->template->set_var('lang_showing',lang('showing %1',$contacts->total_records));
+ $GLOBALS['egw']->template->set_var('lang_showing',lang('showing %1',$contacts->total_records));
}
// --------------------------------------- end nextmatch ------------------------------------------
@@ -169,14 +168,14 @@
'cc' => lang('Cc'),
'bcc'=> lang('Bcc')) as $target => $lang_target)
{
- $GLOBALS['phpgw']->template->set_var('title_'.$type.'_'.$target,
+ $GLOBALS['egw']->template->set_var('title_'.$type.'_'.$target,
lang('Insert all %1 addresses of the %2 contacts in %3',$lang_type,
$contacts->total_records,$lang_target));
}
}
// ------------------- list header variable template-declaration -----------------------
- $GLOBALS['phpgw']->template->set_var('cats_list',$cats->formated_list('select','all',$cat_id,'True'));
+ $GLOBALS['egw']->template->set_var('cats_list',$cats->formated_list('select','all',$cat_id,'True'));
$filter_list = '';
foreach(array(
@@ -187,7 +186,7 @@
{
$filter_list .= "\n";
}
- $GLOBALS['phpgw']->template->set_var(array(
+ $GLOBALS['egw']->template->set_var(array(
'query' => $query,
'filter_list' => $filter_list,
));
@@ -197,8 +196,8 @@
if ($entries)
foreach ($entries as $entry)
{
- $GLOBALS['phpgw']->template->set_var('tr_class',
- $GLOBALS['phpgw']->nextmatchs->alternate_row_color('',True));
+ $GLOBALS['egw']->template->set_var('tr_class',
+ $GLOBALS['egw']->nextmatchs->alternate_row_color('',True));
$firstname = $entry['n_given'];
if (!$firstname)
@@ -273,17 +272,17 @@
$hemail = htmlspecialchars($hemail);
// --------------------- template declaration for list records --------------------------
- $GLOBALS['phpgw']->template->set_var(array(
+ $GLOBALS['egw']->template->set_var(array(
'firstname' => $firstname,
'lastname' => $lastname,
'company' => $company
));
- $GLOBALS['phpgw']->template->set_var('id',$id);
- $GLOBALS['phpgw']->template->set_var('email',$email);
- $GLOBALS['phpgw']->template->set_var('hemail',$hemail);
+ $GLOBALS['egw']->template->set_var('id',$id);
+ $GLOBALS['egw']->template->set_var('email',$email);
+ $GLOBALS['egw']->template->set_var('hemail',$hemail);
- $GLOBALS['phpgw']->template->parse('list','addressbook_list',True);
+ $GLOBALS['egw']->template->parse('list','addressbook_list',True);
}
}
// --------------------------- end record declaration ---------------------------
@@ -307,11 +306,11 @@
{
if ($inserted || $inserted === 0)
{
- $GLOBALS['phpgw']->template->set_var('message',''.
+ $GLOBALS['egw']->template->set_var('message',''.
lang('%1 email addresses inserted',(int)$_GET['inserted']).'');
}
- $GLOBALS['phpgw']->template->parse('out','addressbook_list_t',True);
- $GLOBALS['phpgw']->template->p('out');
+ $GLOBALS['egw']->template->parse('out','addressbook_list_t',True);
+ $GLOBALS['egw']->template->p('out');
}
- $GLOBALS['phpgw']->common->phpgw_exit();
+ $GLOBALS['egw']->common->egw_exit();
?>