@@ -228,9 +228,9 @@ discard block |
||
228 | 228 | <label class="ptype" for="gender">gender:</label> |
229 | 229 | <select id="gender" name="genders_0_value"> |
230 | 230 | <option value=""></option> |
231 | - <option value="male"<?php echo ($oContact['genders'][0]['value'] ?? '') == 'male' ? ' selected' : '';?>>male</option> |
|
232 | - <option value="female"<?php echo ($oContact['genders'][0]['value'] ?? '') == 'female' ? ' selected' : '';?>>female</option> |
|
233 | - <option value="unspecified"<?php echo ($oContact['genders'][0]['value'] ?? '') == 'unspecified' ? ' selected' : '';?>>unspecified</option> |
|
231 | + <option value="male"<?php echo ($oContact['genders'][0]['value'] ?? '') == 'male' ? ' selected' : ''; ?>>male</option> |
|
232 | + <option value="female"<?php echo ($oContact['genders'][0]['value'] ?? '') == 'female' ? ' selected' : ''; ?>>female</option> |
|
233 | + <option value="unspecified"<?php echo ($oContact['genders'][0]['value'] ?? '') == 'unspecified' ? ' selected' : ''; ?>>unspecified</option> |
|
234 | 234 | </select> |
235 | 235 | <br/> |
236 | 236 | </fieldset> |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | echo ' <input type="tel" id="' . $strField . '" name="' . $strFieldName . '" value="' . ($aPhone['value'] ?? '') . '">' . PHP_EOL; |
249 | 249 | echo ' <label class="ptype" for="' . $strType . '">type:</label>' . PHP_EOL; |
250 | 250 | echo ' <input class="ptype" type="text" id="' . $strType . '" name="' . $strTypeName . '" value="' . ($aPhone['type'] ?? 'other') . '">' . PHP_EOL; |
251 | - echo ' <input type="radio" name="phoneNumbers" value="' . ($i-1) . '"' . $strPrimary . '> primary phone' . PHP_EOL; |
|
251 | + echo ' <input type="radio" name="phoneNumbers" value="' . ($i - 1) . '"' . $strPrimary . '> primary phone' . PHP_EOL; |
|
252 | 252 | echo ' <br/>' . PHP_EOL; |
253 | 253 | } |
254 | 254 | ?> |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | echo ' <input class="mail" type="text" id="' . $strField . '" name="' . $strFieldName . '" value="' . ($aMail['value'] ?? '') . '">' . PHP_EOL; |
268 | 268 | echo ' <label class="ptype" for="' . $strType . '">type:</label>' . PHP_EOL; |
269 | 269 | echo ' <input class="ptype" type="text" id="' . $strType . '" name="' . $strTypeName . '" value="' . ($aMail['type'] ?? 'other') . '">' . PHP_EOL; |
270 | - echo ' <input type="radio" name="emailAddresses" value="' . ($i-1) . '"' . $strPrimary . '> primary email' . PHP_EOL; |
|
270 | + echo ' <input type="radio" name="emailAddresses" value="' . ($i - 1) . '"' . $strPrimary . '> primary email' . PHP_EOL; |
|
271 | 271 | echo ' <br/>' . PHP_EOL; |
272 | 272 | } |
273 | 273 | ?> |
@@ -295,23 +295,23 @@ discard block |
||
295 | 295 | } |
296 | 296 | $strPrimary = $oContact->isPrimaryItem($aAdr) ? ' checked' : ''; |
297 | 297 | echo ' <label for="adrType' . $i . '">type:</label>' . PHP_EOL; |
298 | - echo ' <input class="ptype" type="text" id="adrType' . $i . '" name="addresses_' . ($i-1) . '_type" value="' . ($aAdr['type'] ?? 'home') . '">' . PHP_EOL; |
|
299 | - echo ' <input type="radio" name="addresses" value="' . ($i-1) . '"' . $strPrimary . '> primary address' . PHP_EOL; |
|
298 | + echo ' <input class="ptype" type="text" id="adrType' . $i . '" name="addresses_' . ($i - 1) . '_type" value="' . ($aAdr['type'] ?? 'home') . '">' . PHP_EOL; |
|
299 | + echo ' <input type="radio" name="addresses" value="' . ($i - 1) . '"' . $strPrimary . '> primary address' . PHP_EOL; |
|
300 | 300 | echo ' <br/>' . PHP_EOL; |
301 | 301 | echo ' <label for="adrStreet' . $i . '">adrStreet:</label>' . PHP_EOL; |
302 | - echo ' <input class="city" type="text" id="adrStreet' . $i . '" name="addresses_' . ($i-1) . '_streetAddress" value="' . ($aAdr['streetAddress'] ?? '') . '">' . PHP_EOL; |
|
303 | - echo ' <input class="ptype" type="text" id="extendedAddress' . $i . '" name="addresses_' . ($i-1) . '_extendedAddress" value="' . ($aAdr['extendedAddress'] ?? '') . '">' . PHP_EOL; |
|
302 | + echo ' <input class="city" type="text" id="adrStreet' . $i . '" name="addresses_' . ($i - 1) . '_streetAddress" value="' . ($aAdr['streetAddress'] ?? '') . '">' . PHP_EOL; |
|
303 | + echo ' <input class="ptype" type="text" id="extendedAddress' . $i . '" name="addresses_' . ($i - 1) . '_extendedAddress" value="' . ($aAdr['extendedAddress'] ?? '') . '">' . PHP_EOL; |
|
304 | 304 | echo ' <br/>' . PHP_EOL; |
305 | 305 | echo ' <label for="adrPostcode' . $i . '">adrPostcode/adrCity:</label>' . PHP_EOL; |
306 | - echo ' <input class="ptype" type="text" id="adrPostcode' . $i . '" name="addresses_' . ($i-1) . '_postalCode" value="' . ($aAdr['postalCode'] ?? '') . '">' . PHP_EOL; |
|
307 | - echo ' <input class="city" type="text" id="adrCity' . $i . '" name="addresses_' . ($i-1) . '_city" value="' . ($aAdr['city'] ?? '') . '">' . PHP_EOL; |
|
306 | + echo ' <input class="ptype" type="text" id="adrPostcode' . $i . '" name="addresses_' . ($i - 1) . '_postalCode" value="' . ($aAdr['postalCode'] ?? '') . '">' . PHP_EOL; |
|
307 | + echo ' <input class="city" type="text" id="adrCity' . $i . '" name="addresses_' . ($i - 1) . '_city" value="' . ($aAdr['city'] ?? '') . '">' . PHP_EOL; |
|
308 | 308 | echo ' <br/>' . PHP_EOL; |
309 | 309 | echo ' <label for="adrCountry' . $i . '">adrCountry/Code:</label>' . PHP_EOL; |
310 | - echo ' <input class="city" type="text" id="adrCountry' . $i . '" name="addresses_' . ($i-1) . '_country" value="' . ($aAdr['country'] ?? '') . '">' . PHP_EOL; |
|
311 | - echo ' <input class="ptype" type="text" id="adrCountryCode' . $i . '" name="addresses_' . ($i-1) . '_countryCode" value="' . ($aAdr['countryCode'] ?? '') . '">' . PHP_EOL; |
|
310 | + echo ' <input class="city" type="text" id="adrCountry' . $i . '" name="addresses_' . ($i - 1) . '_country" value="' . ($aAdr['country'] ?? '') . '">' . PHP_EOL; |
|
311 | + echo ' <input class="ptype" type="text" id="adrCountryCode' . $i . '" name="addresses_' . ($i - 1) . '_countryCode" value="' . ($aAdr['countryCode'] ?? '') . '">' . PHP_EOL; |
|
312 | 312 | echo ' <br/>' . PHP_EOL; |
313 | 313 | echo ' <label for="adrPOBox' . $i . '">adrPOBox:</label>' . PHP_EOL; |
314 | - echo ' <input type="text" id="adrPOBox' . $i . '" name="addresses_' . ($i-1) . '_poBox" value="' . ($aAdr['poBox'] ?? '') . '">' . PHP_EOL; |
|
314 | + echo ' <input type="text" id="adrPOBox' . $i . '" name="addresses_' . ($i - 1) . '_poBox" value="' . ($aAdr['poBox'] ?? '') . '">' . PHP_EOL; |
|
315 | 315 | echo ' <br/>' . PHP_EOL; |
316 | 316 | } |
317 | 317 | ?> |
@@ -7,7 +7,7 @@ |
||
7 | 7 | */ |
8 | 8 | function displayApiError(string $strAction, string $strResourceName, int $iResponseCode, string $strMessage, string $strStatus) : void |
9 | 9 | { |
10 | - $strHTML =<<<HTML |
|
10 | + $strHTML = <<<HTML |
|
11 | 11 | <html> |
12 | 12 | <head> |
13 | 13 | <style> |
@@ -34,10 +34,10 @@ discard block |
||
34 | 34 | /** readonly access to the users contacts */ |
35 | 35 | public const CONTACTS_READONLY = "https://www.googleapis.com/auth/contacts.readonly"; |
36 | 36 | /** readonly access to the users other contacts */ |
37 | - public const CONTACTS_OTHER_READONLY ="https://www.googleapis.com/auth/contacts.other.readonly"; |
|
37 | + public const CONTACTS_OTHER_READONLY = "https://www.googleapis.com/auth/contacts.other.readonly"; |
|
38 | 38 | |
39 | 39 | /** Sort people by when they were changed; older entries first. */ |
40 | - public const SO_LAST_MODIFIED_ASCENDING ='LAST_MODIFIED_ASCENDING'; |
|
40 | + public const SO_LAST_MODIFIED_ASCENDING = 'LAST_MODIFIED_ASCENDING'; |
|
41 | 41 | /** Sort people by when they were changed; newer entries first. */ |
42 | 42 | public const SO_LAST_MODIFIED_DESCENDING = 'LAST_MODIFIED_DESCENDING'; |
43 | 43 | /** Sort people by first name. */ |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | 'readMask' => implode(',', $this->aPersonFields), |
206 | 206 | 'pageSize' => ($this->iPageSize > self::SEARCH_MAX_PAGESIZE ? self::SEARCH_MAX_PAGESIZE : $this->iPageSize), |
207 | 207 | ]; |
208 | - $strURI = 'https://people.googleapis.com/v1/people:searchContacts?' . http_build_query($aParams);; |
|
208 | + $strURI = 'https://people.googleapis.com/v1/people:searchContacts?' . http_build_query($aParams); ; |
|
209 | 209 | |
210 | 210 | // 'warmup' request |
211 | 211 | // Note from google documentation: |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | // https://developers.google.com/people/v1/contacts#search_the_users_contacts |
214 | 214 | $this->oClient->fetchJsonResponse($strURI, GClient::GET, $aHeader); |
215 | 215 | $aParams['query'] = $strQuery; |
216 | - $strURI = 'https://people.googleapis.com/v1/people:searchContacts?' . http_build_query($aParams);; |
|
216 | + $strURI = 'https://people.googleapis.com/v1/people:searchContacts?' . http_build_query($aParams); ; |
|
217 | 217 | |
218 | 218 | $aContactList = false; |
219 | 219 | if (($strResponse = $this->oClient->fetchJsonResponse($strURI, GClient::GET, $aHeader)) !== false) { |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | 'personFields' => implode(',', $this->aPersonFields), |
247 | 247 | ]; |
248 | 248 | |
249 | - $strURI = 'https://people.googleapis.com/v1/' . $strResourceName . '?' . http_build_query($aParams);; |
|
249 | + $strURI = 'https://people.googleapis.com/v1/' . $strResourceName . '?' . http_build_query($aParams); ; |
|
250 | 250 | $strResponse = $this->oClient->fetchJsonResponse($strURI, GClient::GET, $aHeader); |
251 | 251 | |
252 | 252 | $result = false; |
@@ -521,7 +521,7 @@ discard block |
||
521 | 521 | $this->strLastStatus = ''; |
522 | 522 | } else { |
523 | 523 | $strError = substr($strResponse, $iHeaderSize); |
524 | - if (strlen($strError) > 0) { |
|
524 | + if (strlen($strError) > 0) { |
|
525 | 525 | $aError = json_decode($strError, true); |
526 | 526 | if (isset($aError['error'])) { |
527 | 527 | $this->strLastError = $aError['error']['message'] ?? ''; |
@@ -558,11 +558,11 @@ discard block |
||
558 | 558 | { |
559 | 559 | $aHeader = []; |
560 | 560 | $strHeader = trim($strHeader); |
561 | - $aLine = explode("\n",$strHeader); |
|
561 | + $aLine = explode("\n", $strHeader); |
|
562 | 562 | $aHeader['status'] = $aLine[0]; |
563 | 563 | array_shift($aLine); |
564 | 564 | |
565 | - foreach($aLine as $strLine){ |
|
565 | + foreach ($aLine as $strLine) { |
|
566 | 566 | // only consider the first colon, since other colons can also appear in |
567 | 567 | // the header value - the rest of such a value would be lost |
568 | 568 | // (eg "Location: https: // www ...." - "// www ...." would be gone !) |
@@ -388,7 +388,7 @@ |
||
388 | 388 | } |
389 | 389 | if ($iType == self::DT_UNIX_TIMESTAMP) { |
390 | 390 | $result = $uxtsBirth; |
391 | - } else if ($iType == self::DT_OBJECT) { |
|
391 | + } else if ($iType == self::DT_OBJECT) { |
|
392 | 392 | $dtBirth = null; |
393 | 393 | if ($uxtsBirth > 0) { |
394 | 394 | $dtBirth = new \DateTime(); |