1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2025-01-30 19:52:17 +01:00

Merge pull request #816 from owncloud/fix_807_810

Fix 807 810
This commit is contained in:
Thomas Müller 2015-07-01 16:06:28 +02:00
commit efa780c5dc
6 changed files with 30 additions and 18 deletions

View File

@ -156,18 +156,18 @@ author: Nicolas Mora mail@babelouest.org
</vcard_entry>
</import_entry>
<import_entry name="E-mail 1 - Value" enabled="true">
<import_entry name="E-mail 1 - Value" enabled="true" separator=":::">
<vcard_entry property="EMAIL" group="email1">
</vcard_entry>
</import_entry>
<import_entry name="Phone 1 - Type" enabled="true" remove="*">
<vcard_entry property="PHONE" group="phone1" value="type">
<vcard_entry property="TEL" group="phone1" value="type">
</vcard_entry>
</import_entry>
<import_entry name="Phone 1 - Value" enabled="true">
<vcard_entry property="PHONE" group="phone1">
<import_entry name="Phone 1 - Value" enabled="true" separator=":::">
<vcard_entry property="TEL" group="phone1">
</vcard_entry>
</import_entry>

View File

@ -115,37 +115,37 @@ author: Nicolas Mora mail@babelouest.org
</import_entry>
<import_entry name="Home" enabled="true">
<vcard_entry property="PHONE" type="HOME">
<vcard_entry property="TEL" type="HOME">
</vcard_entry>
</import_entry>
<import_entry name="Work" enabled="true">
<vcard_entry property="PHONE" type="WORK">
<vcard_entry property="TEL" type="WORK">
</vcard_entry>
</import_entry>
<import_entry name="Pager" enabled="true">
<vcard_entry property="PHONE" type="PAGER">
<vcard_entry property="TEL" type="PAGER">
</vcard_entry>
</import_entry>
<import_entry name="Fax" enabled="true">
<vcard_entry property="PHONE" type="FAX">
<vcard_entry property="TEL" type="FAX">
</vcard_entry>
</import_entry>
<import_entry name="Mobile" enabled="true">
<vcard_entry property="PHONE" type="CELL">
<vcard_entry property="TEL" type="CELL">
</vcard_entry>
</import_entry>
<import_entry name="Other" enabled="true">
<vcard_entry property="PHONE" type="OTHER">
<vcard_entry property="TEL" type="OTHER">
</vcard_entry>
</import_entry>
<import_entry name="Yahoo Phone" enabled="true">
<vcard_entry property="PHONE" type="OTHER,YAHOO">
<vcard_entry property="TEL" type="OTHER,YAHOO">
</vcard_entry>
</import_entry>

View File

@ -93,7 +93,7 @@ author: Nicolas Mora mail@babelouest.org
</import_entry>
<import_entry property="X-PRIMARY-PHONE" enabled="true">
<vcard_entry property="PHONE" type="HOME">
<vcard_entry property="TEL" type="HOME">
</vcard_entry>
</import_entry>

View File

@ -234,8 +234,12 @@ class ImportCsvConnector extends ImportConnector {
return 0;
} else {
$element = $this->convertElementToVCard($parts[0], $titles);
$unknownElements = $element->select("X-Unknown-Element");
return (1 - (0.5 * count($unknownElements)/count($parts[0])));
if ($element) {
$unknownElements = $element->select("X-Unknown-Element");
return (1 - (0.5 * count($unknownElements)/count($parts[0])));
} else {
return 0;
}
}
}
}

View File

@ -207,8 +207,12 @@ class ImportLdifConnector extends ImportConnector{
return 0;
} else {
$element = $this->convertElementToVCard($parts[0]);
$unknownElements = $element->select("X-Unknown-Element");
return (1 - (0.5 * count($unknownElements)/count($parts[0])));
if ($element) {
$unknownElements = $element->select("X-Unknown-Element");
return (1 - (0.5 * count($unknownElements)/count($parts[0])));
} else {
return 0;
}
}
}
}

View File

@ -199,8 +199,12 @@ class ImportVCardConnector extends ImportConnector{
return 0;
} else {
$element = $this->convertElementToVCard($parts[0]);
$unknownElements = $element->select("X-Unknown-Element");
return (1 - (0.5 * count($unknownElements)/count($parts[0])));
if ($element) {
$unknownElements = $element->select("X-Unknown-Element");
return (1 - (0.5 * count($unknownElements)/count($parts[0])));
} else {
return 0;
}
}
}