no longer deleting all custom-fields on updating an event, as requested by the outlook sync people

This commit is contained in:
Ralf Becker 2005-02-10 00:10:39 +00:00
parent 42c0476556
commit c6aa4719ef

View File

@ -605,17 +605,26 @@
$this->db->delete($this->recur_table,array('cal_id' => $event['id']),__LINE__,__FILE__);
}
// Custom fields
$this->db->delete($this->extra_table,array('cal_id' => $event['id']),__LINE__,__FILE__);
foreach($event as $name => $value)
{
if ($name[0] == '#' && strlen($value))
if ($name[0] == '#')
{
$this->db->insert($this->extra_table,array(
'cal_id' => $event['id'],
'cal_extra_name' => substr($name,1),
'cal_extra_value' => $value,
),False,__LINE__,__FILE__);
if (strlen($value))
{
$this->db->insert($this->extra_table,array(
'cal_extra_value' => $value,
),array(
'cal_id' => $event['id'],
'cal_extra_name' => substr($name,1),
),__LINE__,__FILE__);
}
else
{
$this->db->delete($this->extra_table,array(
'cal_id' => $event['id'],
'cal_extra_name' => substr($name,1),
),__LINE__,__FILE__);
}
}
}
print_debug('Event Saved: ID #',$event['id']);