"using global db object"

This commit is contained in:
Ralf Becker 2008-03-13 20:18:52 +00:00
parent e79c4b3e6a
commit f57f6a805b

View File

@ -204,8 +204,7 @@ class socontacts
function socontacts($contact_app='addressbook') function socontacts($contact_app='addressbook')
{ {
$this->db = clone($GLOBALS['egw']->db); $this->db = $GLOBALS['egw']->db;
$this->db->set_app('infolog');
$this->user = $GLOBALS['egw_info']['user']['account_id']; $this->user = $GLOBALS['egw_info']['user']['account_id'];
$this->memberships = $GLOBALS['egw']->accounts->memberships($this->user,true); $this->memberships = $GLOBALS['egw']->accounts->memberships($this->user,true);
@ -361,8 +360,7 @@ class socontacts
$fields = array(); $fields = array();
$filter[$this->distri_id]=$ids; $filter[$this->distri_id]=$ids;
if (count($dl_allowed)) $filter[$this->distri_key]=$dl_allowed; if (count($dl_allowed)) $filter[$this->distri_key]=$dl_allowed;
$this->db->select($this->distributionlist_view,'*',$filter,__LINE__,__FILE__); foreach($this->db->select($this->distributionlist_view,'*',$filter,__LINE__,__FILE__) as $row)
while ($row = $this->db->row(true))
{ {
if ((isset($row[$this->distri_id])&&strlen($row[$this->distri_value])>0)) if ((isset($row[$this->distri_id])&&strlen($row[$this->distri_value])>0))
{ {
@ -717,7 +715,7 @@ class socontacts
else else
{ {
$this->somain->change_owner($account_id,$new_owner); $this->somain->change_owner($account_id,$new_owner);
$this->soextra->db->update($this->soextra->table_name,array( $this->db->update($this->soextra->table_name,array(
$this->extra_owner => $new_owner $this->extra_owner => $new_owner
),array( ),array(
$this->extra_owner => $account_id $this->extra_owner => $account_id
@ -756,7 +754,7 @@ class socontacts
*/ */
function get_fields($type='all',$contact_id=null,$owner=null) function get_fields($type='all',$contact_id=null,$owner=null)
{ {
$def = $this->soextra->db->get_table_definitions('phpgwapi','egw_addressbook'); $def = $this->db->get_table_definitions('phpgwapi','egw_addressbook');
$all_fields = array(); $all_fields = array();
foreach($def['fd'] as $field => $data) foreach($def['fd'] as $field => $data)