$GLOBALS and using $GLOBALS['phpgw']['accounts']

This commit is contained in:
Ralf Becker 2001-10-03 19:21:08 +00:00
parent 98f82ed2e0
commit bbb3385ee1

View File

@ -34,8 +34,6 @@
function boinfolog( $info_id = 0)
{
global $phpgw;
$this->enums = array(
'priority' => array (
'urgent' => 'urgent','high' => 'high','normal' => 'normal',
@ -72,18 +70,14 @@
function accountInfo($id,$account_data=0)
{
global $phpgw,$phpgw_info;
if (!$id) return ' ';
if (!is_array($account_data))
{
$accounts = createobject('phpgwapi.accounts',$id);
$accounts->db = $phpgw->db;
$accounts->read_repository();
$account_data = $accounts->data;
$GLOBALS['phpgw']->accounts->read_repository();
$account_data = $GLOBALS['phpgw']->accounts->data;
}
if ($phpgw_info['user']['preferences']['infolog']['longNames'])
if ($GLOBALS['phpgw_info']['user']['preferences']['infolog']['longNames'])
{
return $account_data['firstname'].' '.$account_data['lastname'];
}
@ -92,8 +86,6 @@
function addr2name( $addr )
{
global $phpgw;
$name = $addr['n_family'];
if ($addr['n_given'])
{
@ -110,7 +102,7 @@
{
$name = $addr['org_name'].': '.$name;
}
return $phpgw->strip_html($name);
return $GLOBALS['phpgw']->strip_html($name);
}
function readProj($proj_id)
@ -182,15 +174,13 @@
function write($values)
{
global $phpgw_info;
if ($values['responsible'] && $values['status'] == 'offer')
{
$values['status'] = 'ongoing'; // have to match if not finished
}
if (!$values['info_id'] && !$values['owner'])
{
$values['owner'] = $phpgw_info['user']['account_id'];
$values['owner'] = $this->so->user;
}
$values['datecreated'] = time(); // is now MODIFICATION-date
@ -200,8 +190,7 @@
}
if ($values['addr_id'] && !$values['from'])
{
$values['from'] = $this->addr2name( $this->readAddr(
$values['addr_id'] ));
$values['from'] = $this->addr2name( $this->readAddr( $values['addr_id'] ));
}
$this->so->write($values);
}