cat_id now just the number for a single entry, multiple entrys are separated as well as surounded by ','

empty stay empty
This commit is contained in:
Ralf Becker 2001-05-29 13:06:04 +00:00
parent e58696276e
commit e10d2f4650
2 changed files with 12 additions and 8 deletions

View File

@ -196,11 +196,13 @@
$fields['access'] = 'public'; $fields['access'] = 'public';
} }
if ($fields['cat_id']) if (is_array($cat_id))
{ {
$fields['cat_id'] = is_array($cat_id) ? implode(',',$cat_id) : $cat_id; $fields['cat_id'] = count($cat_id) > 1 ? ','.implode(',',$cat_id).',' : $cat_id[0];
// make sure commas surround each value }
$fields['cat_id'] = ',' . $fields['cat_id'] . ','; else
{
$fields['cat_id'] = $cat_id;
} }
addressbook_add_entry($phpgw_info['user']['account_id'],$fields,$fields['access'],$fields['cat_id']); addressbook_add_entry($phpgw_info['user']['account_id'],$fields,$fields['access'],$fields['cat_id']);

View File

@ -204,11 +204,13 @@
$fields['access'] = 'public'; $fields['access'] = 'public';
} }
if ($fields['cat_id']) if (is_array($cat_id))
{ {
$fields['cat_id'] = is_array($cat_id) ? implode(',',$cat_id) : $cat_id; $fields['cat_id'] = count($cat_id) > 1 ? ','.implode(',',$cat_id).',' : $cat_id[0];
// make sure commas surround each value }
$fields['cat_id'] = ',' . $fields['cat_id'] . ','; else
{
$fields['cat_id'] = $cat_id;
} }
if (($this->grants[$check[0]['owner']] & PHPGW_ACL_EDIT) && $check[0]['owner'] != $phpgw_info['user']['account_id']) if (($this->grants[$check[0]['owner']] & PHPGW_ACL_EDIT) && $check[0]['owner'] != $phpgw_info['user']['account_id'])