Lines Matching +full:e +full:- +full:tel
5 * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
29 if($this->sqlite === null)
31 $this->sqlite = plugin_load('helper', 'sqlite');
32 if(!$this->sqlite)
35 msg('This plugin requires the sqlite plugin. Please install it.', -1);
38 if(!$this->sqlite->init('davcard', DOKU_PLUGIN.'davcard/db/'))
40 $this->sqlite = null;
45 return $this->sqlite;
64 return $this->getLang('no_wdc');
66 $settings = $wdc->getConnection($connectionId);
69 … return array('formattedname' => $this->getLang('settings_not_found'), 'result' => false);
71 return array('formattedname' => $this->getLang('wrong_type'), 'result' => false);
73 $entries = $wdc->getAddressbookEntries($connectionId);
85 return array('formattedname' => $this->getLang('no_permission'), 'result' => false);
91 $addressbookid = $this->getAddressbookIdForPage($id);
92 $entries = $this->getAddressbookEntries($addressbookid);
101 …return array('formattedname' => sprintf($this->getLang('contact_not_found'), $params['firstname'].…
112 $info = $this->parseVcard($entry['contactdata'], $entry['uri'], $write);
120 $info = $this->parseVcard($entry['contactdata'], $entry['uri'], $write);
125 $info = $this->parseVcard($entry['contactdata'], $entry['uri'], $write);
134 …return array('formattedname' => sprintf($this->getLang('contact_not_found'), $this->getLang('inval…
147 $sqlite = $this->getDB();
151 $res = $sqlite->query($query, $id);
152 return $sqlite->res2arr($res);
166 return $this->getContactByDetails($id, 'structuredname',
171 * Retrieve a contact by e-mail address
174 * @param string $email The E-Mail address
180 // FIXME: Maybe it's a good idea to save the e-mail in the database as well!
181 return $this->getContactByDetails($id, 'email', array('email' => strtolower($email)));
194 …return $this->getContactByDetails($id, 'formattedname', array('formattedname' => strtolower($name)…
212 return $this->getLang('no_wdc');
214 $settings = $wdc->getConnection($connectionId);
217 … return array('formattedname' => $this->getLang('settings_not_found'), 'result' => false);
219 return array('formattedname' => $this->getLang('wrong_type'), 'result' => false);
221 $row = $wdc->getAddressbookEntryByUri($connectionId, $uri);
233 return array('formattedname' => $this->getLang('no_permission'), 'result' => false);
239 $addressbookid = $this->getAddressbookIdForPage($id);
240 $row = $this->getAddressbookEntryByUri($addressbookid, $uri);
244 …return array('formattedname' => sprintf($this->getLang('contact_not_found'), 'ID='.$id.' URI='.$ur…
245 $info = $this->parseVcard($row['contactdata'], $row['uri'], $write);
251 * Retrieve an address book entry by URI (low-level version)
260 $sqlite = $this->getDB();
264 $res = $sqlite->query($query, $id, $uri);
265 return $sqlite->res2row($res);
293 $userid = uniqid('davcard-');
296 $bookid = $this->getAddressbookIdForPage($id);
298 return $this->createAddressbookForPage($name, $description, $id, $userid);
300 $sqlite = $this->getDB();
304 $res = $sqlite->query($query, $name, $description, $bookid);
325 $sqlite = $this->getDB();
330 $res = $sqlite->query($query, $id);
331 $row = $sqlite->res2row($res);
365 $userid = uniqid('davcard-');
369 $sqlite = $this->getDB();
380 $res = $sqlite->query($query, $values);
387 $res = $sqlite->query($query, $values);
388 $row = $sqlite->res2row($res);
394 $res = $sqlite->query($query, $id, $row['id']);
416 return $this->getLang('no_wdc');
418 $settings = $wdc->getConnection($connectionId);
421 … return array('formattedname' => $this->getLang('settings_not_found'), 'result' => false);
423 return array('formattedname' => $this->getLang('wrong_type'), 'result' => false);
425 return $wdc->deleteAddressbookEntry($connectionId, $uri);
428 $sqlite = $this->getDB();
432 $addressbookid = $this->getAddressbookIdForPage($id);
435 $res = $sqlite->query($query, $uri, $addressbookid);
438 $this->updateSyncTokenLog($addressbookid, $uri, 'deleted');
462 return $this->getLang('no_wdc');
464 $settings = $wdc->getConnection($connectionId);
467 … return array('formattedname' => $this->getLang('settings_not_found'), 'result' => false);
469 return array('formattedname' => $this->getLang('wrong_type'), 'result' => false);
471 $row = $wdc->getAddressbookEntryByUri($connectionId, $uri);
475 $addressbookid = $this->getAddressbookIdForPage($id);
476 $row = $this->getAddressbookEntryByUri($addressbookid, $uri);
480 $vcard->remove('ADR');
481 $vcard->remove('TEL');
482 $vcard->remove('EMAIL');
488 $vcard->add('TEL', $data['number'], array('type' => $data['type']));
496 $vcard->add('EMAIL', $data['mail'], array('type' => $data['type']));
504 …$vcard->add('ADR', array('', '', $data['street'], $data['city'], '', $data['zipcode'], $data['coun…
508 $structuredname = explode(';', (string)$vcard->N);
512 $vcard->N = $structuredname;
513 $vcard->FN = $formattedname;
515 $contactdata = $vcard->serialize();
519 return $wdc->editAddressbookEntry($connectionId, $uri, $contactdata);
523 $sqlite = $this->getDB();
528 $res = $sqlite->query($query,
530 $now->getTimestamp(),
540 $this->updateSyncTokenLog($addressbookid, $uri, 'modified');
562 $vcard->FN = $formattedname;
563 $vcard->N = $structuredname;
569 $vcard->add('TEL', $data['number'], array('type' => $data['type']));
576 $vcard->add('EMAIL', $data['mail'], array('type' => $data['type']));
583 …$vcard->add('ADR', array('', '', $data['street'], $data['city'], '', $data['zipcode'], $data['coun…
587 $contactdata = $vcard->serialize();
595 return $wdc->addAddressbookEntry($connectionId, $contactdata);
599 $sqlite = $this->getDB();
602 $addressbookid = $this->getAddressbookIdForPage($id);
603 $uri = uniqid('dokuwiki-').'.vcf';
606 $res = $sqlite->query($query,
610 $now->getTimestamp(),
619 $this->updateSyncTokenLog($addressbookid, $uri, 'added');
643 $tel = array();
652 if(isset($vObject->FN))
653 $formattedname = (string)$vObject->FN;
655 if(isset($vObject->N))
656 $structuredname = join(';', $vObject->N->getParts());
658 if(isset($vObject->TEL))
660 foreach($vObject->TEL as $number)
663 … $tel[] = array('type' => strtolower((string)$number['TYPE']), 'number' => (string)$number);
665 $tel[] = array('number' => (string)$number);
669 if(isset($vObject->ADR))
671 foreach($vObject->ADR as $adr)
674 … $addr[] = array('type' => strtolower((string)$adr['TYPE']), 'address' => $adr->getParts());
676 $addr[] = array('address' => $adr->getParts());
680 if(isset($vObject->EMAIL))
682 foreach($vObject->EMAIL as $email)
691 if(isset($vObject->PHOTO))
693 if(isset($vObject->PHOTO['TYPE']))
695 …photo[] = array('type' => strtolower((string)$vObject->PHOTO['TYPE']), 'photo' => (string)$vObject…
698 $photo[] = array('photo' => (string)$vObject->PHOTO);
701 if(isset($vObject->BDAY))
703 $birthday = (string)$vObject->BDAY;
704 $birthday = str_replace('-', '', $birthday);
707 if(isset($vObject->NOTE))
709 $note = (string)$vObject->NOTE;
712 if(isset($vObject->TITLE))
714 $title = (string)$vObject->TITLE;
717 if(isset($vObject->URL))
719 $url = (string)$vObject->URL;
725 'tel' => $tel,
748 $sqlite = $this->getDB();
752 $res = $sqlite->query($query, $addressbookid);
753 $row = $sqlite->res2row($res);
766 $row = $this->getAddressbookSettings($addressbookid);
808 $currentToken = $this->getSyncTokenForAddressbook($addressbookid);
809 $operationCode = $this->operationNameToOperation($operation);
817 $sqlite = $this->getDB();
821 $res = $sqlite->query($query, $uri, $currentToken, $addressbookid, $operationCode);
826 $res = $sqlite->query($query, $currentToken, $addressbookid);
844 $settings = $wdc->getConnection($connectionId);
853 $addr = $this->getAddressbookIdForPage($id);