Try to fix cats issue with pgsql

This commit is contained in:
Miles Lott 2001-05-28 23:11:10 +00:00
parent 3321467f40
commit 4acc0e41a7
3 changed files with 13 additions and 6 deletions

View File

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

View File

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

View File

@ -218,6 +218,7 @@
}
else
{
$fields[0]['cat_id'] = ereg_replace(',','',$fields[0]['cat_id']);
$catinfo = $cat->return_single($fields[0]['cat_id']);
$catname = $catinfo[0]['name'];
if (!$cat_id)