mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 23:00:56 +01:00
syncml categories fixes
This commit is contained in:
parent
0964862aa7
commit
da41b918c9
@ -137,13 +137,15 @@ class sifaddressbook extends bocontacts
|
|||||||
case 'cat_id':
|
case 'cat_id':
|
||||||
if(!empty($value)) {
|
if(!empty($value)) {
|
||||||
$isAdmin = $GLOBALS['egw']->acl->check('run',1,'admin');
|
$isAdmin = $GLOBALS['egw']->acl->check('run',1,'admin');
|
||||||
$egwCategories =& CreateObject('phpgwapi.categories',$GLOBALS['egw_info']['user']['account_id'],'addressbook');
|
$egwCategories =& CreateObject('phpgwapi.categories', $GLOBALS['egw_info']['user']['account_id'], 'addressbook');
|
||||||
$categories = explode('; ',$value);
|
$categories = explode(';',$value);
|
||||||
$cat_id = '';
|
// add missing categories as personal categories as needed
|
||||||
foreach($categories as $categorieName) {
|
foreach($categories as $categorieName) {
|
||||||
|
$cat_id = false;
|
||||||
$categorieName = trim($categorieName);
|
$categorieName = trim($categorieName);
|
||||||
if(!($cat_id = $egwCategories->name2id($categorieName)) && $isAdmin) {
|
if(!($cat_id = $egwCategories->name2id($categorieName))) {
|
||||||
$cat_id = $egwCategories->add(array('name' => $categorieName, 'descr' => $categorieName));
|
$cat_id = $egwCategories->add(array('name' => $categorieName, 'descr' => lang('added by synchronisation')));
|
||||||
|
error_log("added $cat_id => $categorieName");
|
||||||
}
|
}
|
||||||
if($cat_id) {
|
if($cat_id) {
|
||||||
if(!empty($finalContact[$key])) $finalContact[$key] .= ',';
|
if(!empty($finalContact[$key])) $finalContact[$key] .= ',';
|
||||||
|
@ -132,7 +132,7 @@ class vcaladdressbook extends bocontacts
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
error_log(print_r($contact, true));
|
//error_log(print_r($contact, true));
|
||||||
|
|
||||||
#if($foundContacts = parent::search($contact, true, '', '', '%')) {
|
#if($foundContacts = parent::search($contact, true, '', '', '%')) {
|
||||||
if($foundContacts = parent::search($contact)) {
|
if($foundContacts = parent::search($contact)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user