Fixed a problem with the categories class not being instantiated correctly.

This commit is contained in:
skeeter 2001-03-21 03:30:29 +00:00
parent f63a0289b8
commit e2a2e74619

View File

@ -206,6 +206,44 @@
$phpgw_info["server"][$phpgw->db->f("config_name")] = stripslashes($phpgw->db->f("config_value"));
}
/************************************************************************\
* This function will return a properly formatted account_id. *
* This needs to be placed here, or some classes will have a problem *
* on instantiation. *
\************************************************************************/
function get_account_id($account_id = '',$default_id = '')
{
global $phpgw, $phpgw_info;
if (gettype($account_id) == 'integer')
{
return $account_id;
}
elseif ($account_id == '')
{
if ($default_id == '')
{
return $phpgw_info['user']['account_id'];
}
elseif (gettype($default_id) == 'string')
{
return $phpgw->accounts->name2id($default_id);
}
return intval($default_id);
}
elseif (gettype($account_id) == 'string')
{
if($phpgw->accounts->exists(intval($account_id)) == True)
{
return intval($account_id);
}
else
{
return $phpgw->accounts->name2id($account_id);
}
}
}
/************************************************************************\
* Required classes *
\************************************************************************/
@ -387,38 +425,6 @@
include(PHPGW_APP_INC . "/header.inc.php");
}
}
error_reporting(7);
function get_account_id($account_id = '',$default_id = '')
{
global $phpgw, $phpgw_info;
if (gettype($account_id) == 'integer')
{
return $account_id;
}
elseif ($account_id == '')
{
if ($default_id == '')
{
return $phpgw_info['user']['account_id'];
}
elseif (gettype($default_id) == 'string')
{
return $phpgw->accounts->name2id($default_id);
}
return intval($default_id);
}
elseif (gettype($account_id) == 'string')
{
if($phpgw->accounts->exists(intval($account_id)) == True)
{
return intval($account_id);
}
else
{
return $phpgw->accounts->name2id($account_id);
}
}
}