|
@@ 148-160 (lines=13) @@
|
| 145 |
|
$addressBooks = []; |
| 146 |
|
|
| 147 |
|
$result = $query->execute(); |
| 148 |
|
while($row = $result->fetch()) { |
| 149 |
|
$addressBooks[$row['id']] = [ |
| 150 |
|
'id' => $row['id'], |
| 151 |
|
'uri' => $row['uri'], |
| 152 |
|
'principaluri' => $this->convertPrincipal($row['principaluri'], false), |
| 153 |
|
'{DAV:}displayname' => $row['displayname'], |
| 154 |
|
'{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'], |
| 155 |
|
'{http://calendarserver.org/ns/}getctag' => $row['synctoken'], |
| 156 |
|
'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0', |
| 157 |
|
]; |
| 158 |
|
|
| 159 |
|
$this->addOwnerPrincipal($addressBooks[$row['id']]); |
| 160 |
|
} |
| 161 |
|
$result->closeCursor(); |
| 162 |
|
|
| 163 |
|
// query for shared calendars |
|
@@ 229-241 (lines=13) @@
|
| 226 |
|
$addressBooks = []; |
| 227 |
|
|
| 228 |
|
$result = $query->execute(); |
| 229 |
|
while($row = $result->fetch()) { |
| 230 |
|
$addressBooks[$row['id']] = [ |
| 231 |
|
'id' => $row['id'], |
| 232 |
|
'uri' => $row['uri'], |
| 233 |
|
'principaluri' => $this->convertPrincipal($row['principaluri'], false), |
| 234 |
|
'{DAV:}displayname' => $row['displayname'], |
| 235 |
|
'{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'], |
| 236 |
|
'{http://calendarserver.org/ns/}getctag' => $row['synctoken'], |
| 237 |
|
'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0', |
| 238 |
|
]; |
| 239 |
|
|
| 240 |
|
$this->addOwnerPrincipal($addressBooks[$row['id']]); |
| 241 |
|
} |
| 242 |
|
$result->closeCursor(); |
| 243 |
|
|
| 244 |
|
return array_values($addressBooks); |