From a3b405b2f1e119ff9a772964dfb2335ece8ec03c Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 14 Nov 2003 22:12:59 +0000 Subject: [PATCH] fixed copy to copy all fields and not only the stock ones --- addressbook/inc/class.uiaddressbook.inc.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/addressbook/inc/class.uiaddressbook.inc.php b/addressbook/inc/class.uiaddressbook.inc.php index 8fa7ce15e3..8fab95f01c 100644 --- a/addressbook/inc/class.uiaddressbook.inc.php +++ b/addressbook/inc/class.uiaddressbook.inc.php @@ -577,13 +577,21 @@ function copy() { + $custom = $this->fields->read_custom_fields(); + $customfields = array(); + while(list($x,$y) = @each($custom)) + { + $customfields[$y['name']] = $y['title']; + } + list($addnew) = $this->bo->read_entry(array( 'id' => $_GET['ab_id'], - 'fields' => $this->bo->stock_contact_fields + 'fields' => $this->bo->stock_contact_fields + $this->extrafields + $customfields )); $addnew['note'] .= "\n".lang("Copied by %1, from record #%2.",$GLOBALS['phpgw']->accounts->id2name($addnew['owner']),$addnew['id']); $addnew['owner'] = $GLOBALS['phpgw_info']['user']['account_id']; + unset($addnew['rights']); unset($addnew['id']); $ab_id = $this->bo->add_entry($addnew);