!$_') {
$temp['label'] = Properties::$l10n->t('Other');
}
@@ -142,7 +142,7 @@ class JSONSerializer {
if(!in_array($property->name, Properties::$indexProperties)) {
return;
}
- $value = $property->value;
+ $value = $property->getValue();
if($property->name == 'ADR' || $property->name == 'N' || $property->name == 'ORG' || $property->name == 'CATEGORIES') {
$value = $property->getParts();
$value = array_map('trim', $value);
@@ -195,15 +195,15 @@ class JSONSerializer {
// Faulty entries by kaddressbook
// Actually TYPE=PREF is correct according to RFC 2426
// but this way is more handy in the UI. Tanghus.
- if($parameter->name == 'TYPE' && strtoupper($parameter->value) == 'PREF') {
+ if($parameter->name == 'TYPE' && strtoupper($parameter->getValue()) == 'PREF') {
$parameter->name = 'PREF';
- $parameter->value = '1';
+ $parameter->setValue('1');
}
// NOTE: Apparently \Sabre\VObject\Reader can't always deal with value list parameters
// like TYPE=HOME,CELL,VOICE. Tanghus.
// TODO: Check if parameter is has commas and split + merge if so.
if ($parameter->name == 'TYPE') {
- $pvalue = $parameter->value;
+ $pvalue = $parameter->getValue();
if(is_string($pvalue) && strpos($pvalue, ',') !== false) {
$pvalue = array_map('trim', explode(',', $pvalue));
}
@@ -216,7 +216,7 @@ class JSONSerializer {
}
}
else{
- $temp['parameters'][$parameter->name] = \OCP\Util::sanitizeHTML($parameter->value);
+ $temp['parameters'][$parameter->name] = \OCP\Util::sanitizeHTML($parameter->getValue());
}
}
return $temp;
diff --git a/lib/utils/properties.php b/lib/utils/properties.php
index 89cb3dd7..40f6d73a 100644
--- a/lib/utils/properties.php
+++ b/lib/utils/properties.php
@@ -260,7 +260,7 @@ Class Properties {
}
$preferred = 0;
foreach($property->parameters as $parameter) {
- if($parameter->name == 'TYPE' && strtoupper($parameter->value) == 'PREF') {
+ if($parameter->name == 'TYPE' && strtoupper($parameter->getValue()) == 'PREF') {
$preferred = 1;
break;
}
@@ -268,10 +268,10 @@ Class Properties {
try {
$result = self::$updateindexstmt->execute(
array(
- \OCP\User::getUser(),
+ \OC::$server->getUserSession()->getUser()->getUId(),
$contactid,
$property->name,
- substr($property->value, 0, 254),
+ substr($property->getValue(), 0, 254),
$preferred,
)
);
diff --git a/lib/vobject/groupproperty.php b/lib/vobject/groupproperty.php
index 9b8617a1..1a4265f4 100644
--- a/lib/vobject/groupproperty.php
+++ b/lib/vobject/groupproperty.php
@@ -29,7 +29,7 @@ use OC\VObject\CompoundProperty;
*
* NOTE: Group names are case-insensitive.
*/
-class GroupProperty extends CompoundProperty {
+class GroupProperty extends \Sabre\VObject\Property\Text {
/**
* Add a group.
@@ -117,4 +117,4 @@ class GroupProperty extends CompoundProperty {
}
return array_search(strtolower($needle), array_map('strtolower', $haystack));
}
-}
\ No newline at end of file
+}
diff --git a/lib/vobject/stringproperty.php b/lib/vobject/stringproperty.php
deleted file mode 100644
index 013f8d77..00000000
--- a/lib/vobject/stringproperty.php
+++ /dev/null
@@ -1,82 +0,0 @@
-.
- *
- */
-
-namespace OCA\Contacts\VObject;
-
-use Sabre\VObject;
-
-/**
- * This class overrides \Sabre\VObject\Property::serialize() to properly
- * escape commas and semi-colons in string properties.
-*/
-class StringProperty extends VObject\Property {
-
- /**
- * Turns the object back into a serialized clob.
- *
- * @return string
- */
- public function serialize() {
-
- $str = $this->name;
- if ($this->group) {
- $str = $this->group . '.' . $this->name;
- }
-
- foreach($this->parameters as $param) {
- $str.=';' . $param->serialize();
- }
-
- $src = array(
- '\\',
- "\n",
- ';',
- ',',
- );
- $out = array(
- '\\\\',
- '\n',
- '\;',
- '\,',
- );
- $value = strtr($this->value, array('\,' => ',', '\;' => ';', '\\\\' => '\\'));
- $str.=':' . str_replace($src, $out, $value);
-
- $out = '';
- while(strlen($str) > 0) {
- if (strlen($str) > 75) {
- $out .= mb_strcut($str, 0, 75, 'utf-8') . "\r\n";
- $str = ' ' . mb_strcut($str, 75, strlen($str), 'utf-8');
- } else {
- $out .= $str . "\r\n";
- $str = '';
- break;
- }
- }
-
- return $out;
-
- }
-
-}
\ No newline at end of file
diff --git a/lib/vobject/vcard.php b/lib/vobject/vcard.php
index fb429d06..bedb56c5 100644
--- a/lib/vobject/vcard.php
+++ b/lib/vobject/vcard.php
@@ -121,22 +121,22 @@ class VCard extends VObject\Component\VCard {
foreach($property->parameters as $key=>&$parameter) {
// Check for values without names which Sabre interprets
// as names without values.
- if(trim($parameter->value) === '') {
- $parameter->value = $parameter->name;
+ if(trim($parameter->getValue()) === '') {
+ $parameter->setValue($parameter->name);
$parameter->name = $this->paramName($parameter->name);
}
// Check out for encoded string and decode them :-[
if(strtoupper($parameter->name) == 'ENCODING') {
- if(strtoupper($parameter->value) == 'QUOTED-PRINTABLE') {
- $property->value = str_replace(
+ if(strtoupper($parameter->getValue()) == 'QUOTED-PRINTABLE') {
+ $property->setValue(str_replace(
"\r\n", "\n",
VObject\StringUtil::convertToUTF8(
- quoted_printable_decode($property->value)
+ quoted_printable_decode($property->getValue())
)
- );
+ ));
unset($property->parameters[$key]);
- } elseif(strtoupper($parameter->value) == 'BASE64') {
- $parameter->value = 'b';
+ } elseif(strtoupper($parameter->getValue()) == 'BASE64') {
+ $parameter->setValue('b');
}
} elseif(strtoupper($parameter->name) == 'CHARSET') {
unset($property->parameters[$key]);
@@ -154,12 +154,12 @@ class VCard extends VObject\Component\VCard {
// Work around issue in older VObject sersions
// https://github.com/fruux/sabre-vobject/issues/24
foreach($property->parameters as $key=>$parameter) {
- if(strpos($parameter->value, ',') === false) {
+ if(strpos($parameter->getValue(), ',') === false) {
continue;
}
- $values = explode(',', $parameter->value);
+ $values = explode(',', $parameter->getValue());
$values = array_map('trim', $values);
- $parameter->value = array_shift($values);
+ $parameter->setValue(array_shift($values));
foreach($values as $value) {
$property->add($parameter->name, $value);
}
@@ -305,7 +305,7 @@ class VCard extends VObject\Component\VCard {
if(count($slice) < 2) { // If not enought, add one more...
$slice[] = "";
}
- $this->N = implode(';', $slice).';;;';
+ $this->N = $slice;
}
}
diff --git a/settings.php b/settings.php
index fa70992f..102ab190 100644
--- a/settings.php
+++ b/settings.php
@@ -1,6 +1,6 @@
assign('addressbooks', OCA\Contacts\Addressbook::all(OCP\USER::getUser()));
+$tmpl->assign('addressbooks', OCA\Contacts\Addressbook::all(\OC::$server->getUserSession()->getUser()->getUId()));
$tmpl->printPage();
diff --git a/templates/contacts.php b/templates/contacts.php
index 00c188ba..6c117168 100644
--- a/templates/contacts.php
+++ b/templates/contacts.php
@@ -449,7 +449,7 @@ vendor_style('contacts', array(
-
+