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,12 +196,14 @@
$fields['access'] = 'public';
}
if ($fields['cat_id'])
if (is_array($cat_id))
{
$fields['cat_id'] = is_array($cat_id) ? implode(',',$cat_id) : $cat_id;
// make sure commas surround each value
$fields['cat_id'] = ',' . $fields['cat_id'] . ',';
$fields['cat_id'] = count($cat_id) > 1 ? ','.implode(',',$cat_id).',' : $cat_id[0];
}
else
{
$fields['cat_id'] = $cat_id;
}
addressbook_add_entry($phpgw_info['user']['account_id'],$fields,$fields['access'],$fields['cat_id']);
$ab_id = addressbook_get_lastid();

View File

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