aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2018-10-30 19:27:05 +0100
committerGitHub <noreply@github.com>2018-10-30 19:27:05 +0100
commit41ff001b77abbf29d8341d2b4d5647bb92632f11 (patch)
tree2b77af83a4c84a5525555aeae4bf86a0b90daa19 /apps
parent514185820e1e1ad1a82648eb3c927552357e0f5f (diff)
parentffc32222f1686d520c0d27a482f45d1c258c64de (diff)
downloadnextcloud-server-41ff001b77abbf29d8341d2b4d5647bb92632f11.tar.gz
nextcloud-server-41ff001b77abbf29d8341d2b4d5647bb92632f11.zip
Merge pull request #11899 from nextcloud/enhancement/noid/sharing-consolidation
Sharing user consolidation
Diffstat (limited to 'apps')
-rw-r--r--apps/dav/lib/CardDAV/AddressBookImpl.php35
-rw-r--r--apps/files_sharing/css/sharetabview.scss29
2 files changed, 56 insertions, 8 deletions
diff --git a/apps/dav/lib/CardDAV/AddressBookImpl.php b/apps/dav/lib/CardDAV/AddressBookImpl.php
index 5034b16ed2f..1aedd5d5643 100644
--- a/apps/dav/lib/CardDAV/AddressBookImpl.php
+++ b/apps/dav/lib/CardDAV/AddressBookImpl.php
@@ -88,16 +88,26 @@ class AddressBookImpl implements IAddressBook {
/**
* @param string $pattern which should match within the $searchProperties
* @param array $searchProperties defines the properties within the query pattern should match
- * @param array $options - for future use. One should always have options!
+ * @param array $options Options to define the output format
+ * - types boolean (since 15.0.0) If set to true, fields that come with a TYPE property will be an array
+ * example: ['id' => 5, 'FN' => 'Thomas Tanghus', 'EMAIL' => ['type => 'HOME', 'value' => 'g@h.i']]
+ * @return array an array of contacts which are arrays of key-value-pairs
+ * example result:
+ * [
+ * ['id' => 0, 'FN' => 'Thomas Müller', 'EMAIL' => 'a@b.c', 'GEO' => '37.386013;-122.082932'],
+ * ['id' => 5, 'FN' => 'Thomas Tanghus', 'EMAIL' => ['d@e.f', 'g@h.i']]
+ * ]
* @return array an array of contacts which are arrays of key-value-pairs
* @since 5.0.0
*/
public function search($pattern, $searchProperties, $options) {
$results = $this->backend->search($this->getKey(), $pattern, $searchProperties);
+ $withTypes = \array_key_exists('types', $options) && $options['types'] === true;
+
$vCards = [];
foreach ($results as $result) {
- $vCards[] = $this->vCard2Array($result['uri'], $this->readCard($result['carddata']));
+ $vCards[] = $this->vCard2Array($result['uri'], $this->readCard($result['carddata']), $withTypes);
}
return $vCards;
@@ -220,7 +230,7 @@ class AddressBookImpl implements IAddressBook {
* @param VCard $vCard
* @return array
*/
- protected function vCard2Array($uri, VCard $vCard) {
+ protected function vCard2Array($uri, VCard $vCard, $withTypes = false) {
$result = [
'URI' => $uri,
];
@@ -255,15 +265,28 @@ class AddressBookImpl implements IAddressBook {
$result[$property->name] = [];
}
- $result[$property->name][] = $property->getValue();
+ $type = $this->getTypeFromProperty($property);
+ if ($withTypes) {
+ $result[$property->name][] = [
+ 'type' => $type,
+ 'value' => $property->getValue()
+ ];
+ } else {
+ $result[$property->name][] = $property->getValue();
+ }
+
} else {
$result[$property->name] = $property->getValue();
}
}
- if ($this->addressBookInfo['principaluri'] === 'principals/system/system' &&
- $this->addressBookInfo['uri'] === 'system') {
+ if (
+ $this->addressBookInfo['principaluri'] === 'principals/system/system' && (
+ $this->addressBookInfo['uri'] === 'system' ||
+ $this->addressBookInfo['{DAV:}displayname'] === $this->urlGenerator->getBaseUrl()
+ )
+ ) {
$result['isLocalSystemBook'] = true;
}
return $result;
diff --git a/apps/files_sharing/css/sharetabview.scss b/apps/files_sharing/css/sharetabview.scss
index 14be9562228..0d277c58bd7 100644
--- a/apps/files_sharing/css/sharetabview.scss
+++ b/apps/files_sharing/css/sharetabview.scss
@@ -4,6 +4,10 @@
.share-autocomplete-item {
display: flex;
+
+ &.merged {
+ margin-left: 32px;
+ }
.autocomplete-item-text {
margin-left: 10px;
margin-right: 10px;
@@ -12,6 +16,27 @@
overflow: hidden;
line-height: 32px;
vertical-align: middle;
+ flex-grow: 1;
+ .ui-state-highlight {
+ border: none;
+ margin: 0;
+ }
+ }
+ &.with-description {
+ .autocomplete-item-text {
+ line-height: 100%;
+ }
+ }
+ .autocomplete-item-details {
+ display: block;
+ line-height: 130%;
+ font-size: 90%;
+ opacity: 0.7;
+ }
+
+ .icon {
+ opacity: .7;
+ margin-right: 7px;
}
}
@@ -204,8 +229,8 @@
}
.ui-autocomplete {
- /* limit dropdown height to 4 1/2 entries */
- max-height: calc(36px * 4.5);;
+ /* limit dropdown height to 6 1/2 entries */
+ max-height: calc(36px * 6.5);
overflow-y: auto;
overflow-x: hidden;
z-index: 1550 !important;