Fix addition of hr profiles

This commit is contained in:
Miles Lott 2001-03-26 23:41:34 +00:00
parent 4af9f4af7d
commit b2da5d14f0
2 changed files with 8 additions and 4 deletions

View File

@ -61,7 +61,7 @@
$addnew['owner'] = $phpgw_info["user"]["account_id"];
$addnew['id'] = '';
if ($account=True) { addressbook_add_entry($addnew['owner'],$addnew,'','',True); }
if ($addnew['tid']) { addressbook_add_entry($addnew['owner'],$addnew,'','',$addnew['tid']); }
else { addressbook_add_entry($addnew['owner'],$addnew); }
$fields = addressbook_read_last_entry($qfields);

View File

@ -483,14 +483,18 @@
return $return_fields;
}
function add($owner,$fields,$access='',$cat_id='')
function add($owner,$fields,$access='',$cat_id='',$tid='n')
{
list($stock_fields,$stock_fieldnames,$extra_fields) = $this->split_stock_and_extras($fields);
//$this->db->lock(array("contacts"));
$this->db->query("insert into $this->std_table (owner,access,cat_id,"
if ($fields['lid']) {
$lid[0] = 'lid,';
$lid[1] = $fields['lid']."','";
}
$this->db->query("insert into $this->std_table (owner,access,cat_id,tid,".$lid[0]
. implode(",",$this->stock_contact_fields)
. ") values ('$owner','$access','$cat_id','"
. ") values ('$owner','$access','$cat_id','$tid','".$lid[1]
. implode("','",$this->loop_addslashes($stock_fields)) . "')",__LINE__,__FILE__);
$this->db->query("select max(id) from $this->std_table ",__LINE__,__FILE__);