</Sync>';
/**
- * Runs the test methods of this class.
- *
- * @access public
- * @static
- */
- public static function main()
- {
- $suite = new PHPUnit_Framework_TestSuite('Tine 2.0 ActiveSync Controller Calendar Tests');
- PHPUnit_TextUI_TestRunner::run($suite);
- }
-
- /**
* (non-PHPdoc)
* @see ActiveSync/ActiveSync_TestCase::setUp()
*/
// assert created group & groupmembers
$syncrotonEventtoUpdate = $controller->getEntry(new Syncroton_Model_SyncCollection(array('collectionId' => $syncrotonFolder->serverId)), $serverId);
- $this->assertCount(count($defaultUserGroupMembers) + 1, $syncrotonEventtoUpdate->attendees, 'groupmembers not resolved');
+ $this->assertCount(count($defaultUserGroupMembers) + 1, $syncrotonEventtoUpdate->attendees, 'groupmembers not resolved: ' . print_r($syncrotonEventtoUpdate->attendees, true));
$this->assertCount(count($defaultUserGroupMembers) + 1, $syncrotonEventtoUpdate->exceptions[0]->attendees, 'groupmembers not resolved');
// update event
*/
class Addressbook_Config extends Tinebase_Config_Abstract
{
+
+ /**
+ * contact nominatim during contact import
+ *
+ * @var string
+ */
+ const CONTACT_IMPORT_NOMINATIM = 'contactImportNominatim';
+
/**
* fields for contact record duplicate check
*
),
)
),
+ self::CONTACT_IMPORT_NOMINATIM => array(
+ //_('Use Nominatim during contact import')
+ 'label' => 'Use Nominatim during contact import',
+ 'description' => 'Use Nominatim during contact import',
+ 'type' => 'bool',
+ 'default' => false,
+ 'clientRegistryInclude' => false,
+ 'setByAdminModule' => true,
+ 'setBySetupModule' => true,
+ ),
);
/**
public function __construct(array $_options = array())
{
parent::__construct($_options);
-
- // don't set geodata for imported contacts as this is too much traffic for the nominatim server
- $this->_controller->setGeoDataForContacts(FALSE);
+
+ if (! Addressbook_Config::getInstance()->get(Addressbook_Config::CONTACT_IMPORT_NOMINATIM)) {
+ // don't set geodata for imported contacts as this might be too much traffic for the nominatim server
+ // TODO make this setting overwritable via import definition/options
+ $this->_controller->setGeoDataForContacts(FALSE);
+ }
// get container id from default container if not set
if (empty($this->_options['container_id'])) {
$syncrotonEvent = new Syncroton_Model_Event();
foreach ($this->_mapping as $syncrotonProperty => $tine20Property) {
- if (empty($entry->$tine20Property) && $entry->$tine20Property != '0' || count($entry->$tine20Property) === 0) {
+ if ((empty($entry->$tine20Property) && $entry->$tine20Property != '0') || count($entry->$tine20Property) === 0) {
continue;
}
if ($this->_device->devicetype === Syncroton_Model_Device::TYPE_IPHONE &&
// note: might comparing an integer with a string here (at least with pgsql)
$this->_syncFolderId != $this->_getDefaultContainerId()) {
-
- continue;
+ break;
}
// fill attendee cache
} else {
if ($tine20Property === 'attendee' && $entry &&
$this->_device->devicetype === Syncroton_Model_Device::TYPE_IPHONE &&
- $this->_syncFolderId !== $this->_getDefaultContainerId()) {
+ $this->_syncFolderId != $this->_getDefaultContainerId()) {
// keep attendees as the are / they were not sent to the device before
} else {
if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) Tinebase_Core::getLogger()->trace(
switch ($tine20Property) {
case 'alarms':
// handled after switch statement
-
break;
case 'attendee':
if ($entry &&
$this->_device->devicetype === Syncroton_Model_Device::TYPE_IPHONE &&
- $this->_syncFolderId !== $this->_getDefaultContainerId()) {
+ $this->_syncFolderId != $this->_getDefaultContainerId()) {
if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(
__METHOD__ . '::' . __LINE__ . " keep attendees as the are / they were not sent to the device before ");
- continue;
+ break;
}
$newAttendees = array();