From 488df1c48516bccb5b1437bf1d367ecb4d919828 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cornelius=20Wei=C3=9F?= Date: Thu, 16 Feb 2006 11:50:16 +0000 Subject: [PATCH] fix: address2, address3 and ophone where not saved :-( --- addressbook/inc/class.bocontacts.inc.php | 17 +++++++++-------- addressbook/inc/class.socontacts.inc.php | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/addressbook/inc/class.bocontacts.inc.php b/addressbook/inc/class.bocontacts.inc.php index b654a2ecd6..64fc5078d6 100755 --- a/addressbook/inc/class.bocontacts.inc.php +++ b/addressbook/inc/class.bocontacts.inc.php @@ -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; } -} \ No newline at end of file +} diff --git a/addressbook/inc/class.socontacts.inc.php b/addressbook/inc/class.socontacts.inc.php index ddc5fc97c1..e2102ef393 100755 --- a/addressbook/inc/class.socontacts.inc.php +++ b/addressbook/inc/class.socontacts.inc.php @@ -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(