fix: address2, address3 and ophone where not saved :-(

This commit is contained in:
Cornelius Weiß 2006-02-16 11:50:16 +00:00
parent aef673da05
commit 488df1c485
2 changed files with 10 additions and 9 deletions

View File

@ -143,10 +143,10 @@ class bocontacts extends socontacts
($contact['n_family'] ? ' '.$contact['n_family'] : '').
($contact['n_suffix'] ? ' '.$contact['n_suffix'] : '');
// for some bad historical reasons we mainfileds saved in cf :-(((
$data['#ophone'] = $data['ophone']; unset($data['ophone']);
$data['#address2'] = $data['address2']; unset($data['address2']);
$data['#address3'] = $data['address3']; unset($data['address3']);
$contact['#ophone'] = $contact['ophone']; unset($contact['ophone']);
$contact['#address2'] = $contact['address2']; unset($contact['address2']);
$contact['#address3'] = $contact['address3']; unset($contact['address3']);
$error_nr = parent::save($contact);
if(!$error_nr)
@ -159,9 +159,10 @@ class bocontacts extends socontacts
}
// for some bad historical reasons we mainfileds saved in cf :-(((
$data['ophone'] = $data['#ophone']; unset($data['#ophone']);
$data['address2'] = $data['#address2']; unset($data['#address2']);
$data['address3'] = $data['#address3']; unset($data['#address3']);
$contact['ophone'] = $contact['#ophone']; unset($contact['#ophone']);
$contact['address2'] = $contact['#address2']; unset($contact['#address2']);
$contact['address3'] = $contact['#address3']; unset($contact['#address3']);
$contact['msg'] = $error_nr ?
lang('Something went wrong by saving this contact. Errorcode %1',$error_nr) :
lang('Contact saved');
@ -250,4 +251,4 @@ class bocontacts extends socontacts
$access = $access ? $access : 'public';
return $access == 'private' ? false : $this->grants[$owner] & $needed;
}
}
}

View File

@ -108,7 +108,7 @@ class socontacts
if($error_nr) return $error_nr_main;
// save customfields
foreach ($this->customfields as $field => $options)
foreach ((array)$this->customfields + array('ophone' => '', 'address2' => '' , 'address3' => '') as $field => $options)
{
$value = $contact['#'.$field];
$data = array(