mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 16:03:47 +01:00
"dont store empty cf's"
This commit is contained in:
parent
8c58d4c3f1
commit
8a8f37ecff
@ -578,6 +578,7 @@ class soinfolog // DB-Layer
|
||||
//echo "<p>soinfolog.write values= "; _debug_array($values);
|
||||
|
||||
// write customfields now
|
||||
$to_delete = array();
|
||||
foreach($values as $key => $val)
|
||||
{
|
||||
if ($key[0] != '#')
|
||||
@ -586,6 +587,8 @@ class soinfolog // DB-Layer
|
||||
}
|
||||
$this->data[$key] = $val; // update internal data
|
||||
|
||||
if ($val)
|
||||
{
|
||||
$this->db->insert($this->extra_table,array(
|
||||
'info_extra_value'=>$val
|
||||
),array(
|
||||
@ -593,6 +596,18 @@ class soinfolog // DB-Layer
|
||||
'info_extra_name' => substr($key,1),
|
||||
),__LINE__,__FILE__);
|
||||
}
|
||||
else
|
||||
{
|
||||
$to_delete[] = substr($key,1);
|
||||
}
|
||||
}
|
||||
if ($to_delete)
|
||||
{
|
||||
$this->db->delete($this->extra_table,array(
|
||||
'info_id' => $info_id,
|
||||
'info_extra_name' => $to_delete,
|
||||
),__LINE__,__FILE__);
|
||||
}
|
||||
// echo "<p>soinfolog.write this->data= "; _debug_array($this->data);
|
||||
//error_log("### soinfolog::write(".print_r($to_write,true).") where=".print_r($where,true)." returning id=".$this->data['info_id']);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user