r28422 - in /trunk/addressbook/inc: class.addressbook_sif.inc.php class.addressbook_vcal.inc.php

jlehrke-2 () r28422 - in /trunk/addressbook/inc: class.addressbook_sif.inc.php class.addressbook_vcal.inc.php
Reply Threaded More More options
Print post
Permalink
Author: jlehrke
Date: Thu Nov 19 21:52:44 2009
New Revision: 28422

URL: http://www.egroupware.org/viewvc/egroupware?rev=28422&view=rev
Log:
Add new contacts to selected addressbook. Fix SIF category delimiter

Modified:
    trunk/addressbook/inc/class.addressbook_sif.inc.php
    trunk/addressbook/inc/class.addressbook_vcal.inc.php

Modified: trunk/addressbook/inc/class.addressbook_sif.inc.php
URL: http://www.egroupware.org/viewvc/egroupware/trunk/addressbook/inc/class.addressbook_sif.inc.php?rev=28422&r1=28421&r2=28422&view=diff
==============================================================================
--- trunk/addressbook/inc/class.addressbook_sif.inc.php (original)
+++ trunk/addressbook/inc/class.addressbook_sif.inc.php Thu Nov 19 21:52:44 2009
@@ -121,6 +121,8 @@
  #fwrite($handle, $sifData);
  #fclose($handle);
 
+ Horde::logMessage("SyncML siftoegw:\n$sifData", __FILE__, __LINE__, PEAR_LOG_DEBUG);
+
  $this->xml_parser = xml_parser_create('UTF-8');
  xml_set_object($this->xml_parser, $this);
  xml_parser_set_option($this->xml_parser, XML_OPTION_CASE_FOLDING, false);
@@ -141,7 +143,10 @@
  case 'cat_id':
  if(!empty($value))
  {
- $finalContact[$key] = implode(",", $this->find_or_add_categories(explode(';', $value), $_abID));
+ $categories1 = explode(',', $value);
+ $categories2 = explode(';', $value);
+ $categories = count($categories1) > count($categories2) ? $categories1 : $categories2;
+ $finalContact[$key] = implode(",", $this->find_or_add_categories($categories, $_abID));
  }
  else
  {
@@ -160,6 +165,7 @@
  }
 
  $this->fixup_contact($finalContact);
+ Horde::logMessage("SyncML siftoegw: " . print_r($finalContact, true), __FILE__, __LINE__, PEAR_LOG_DEBUG);
  return $finalContact;
  }
 
@@ -203,6 +209,11 @@
  // update entry
  $contact['id'] = $_abID;
  }
+ elseif (array_key_exists('filter_addressbook', $GLOBALS['egw_info']['user']['preferences']['syncml']))
+     {
+     $contact['owner'] = (int) $GLOBALS['egw_info']['user']['preferences']['syncml']['filter_addressbook'];
+     }
+
  return $this->save($contact);
  }
 
@@ -253,7 +264,7 @@
 
  case 'Categories':
  if(!empty($value)) {
- $value = implode("; ", $this->get_categories($value));
+ $value = implode(", ", $this->get_categories($value));
  $value = $GLOBALS['egw']->translation->convert($value, $sysCharSet, 'utf-8');
  } else {
  break;

Modified: trunk/addressbook/inc/class.addressbook_vcal.inc.php
URL: http://www.egroupware.org/viewvc/egroupware/trunk/addressbook/inc/class.addressbook_vcal.inc.php?rev=28422&r1=28421&r2=28422&view=diff
==============================================================================
--- trunk/addressbook/inc/class.addressbook_vcal.inc.php (original)
+++ trunk/addressbook/inc/class.addressbook_vcal.inc.php Thu Nov 19 21:52:44 2009
@@ -143,6 +143,10 @@
  // update entry
  $contact['id'] = $_abID;
  }
+ elseif (array_key_exists('filter_addressbook', $GLOBALS['egw_info']['user']['preferences']['syncml']))
+     {
+     $contact['owner'] = (int) $GLOBALS['egw_info']['user']['preferences']['syncml']['filter_addressbook'];
+     }
  return $this->save($contact);
  }
 


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
eGroupWare-cvs mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs