1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2024-12-11 22:24:32 +01:00

Merge branch 'master' into filesystem

This commit is contained in:
Robin Appelman 2012-10-30 23:00:10 +01:00
commit d717b8e8b9
4 changed files with 24 additions and 114 deletions

View File

@ -1,17 +1,16 @@
<?php
OC::$CLASSPATH['OC_Contacts_App'] = 'apps/contacts/lib/app.php';
OC::$CLASSPATH['OC_Contacts_Addressbook'] = 'apps/contacts/lib/addressbook.php';
OC::$CLASSPATH['OC_Contacts_VCard'] = 'apps/contacts/lib/vcard.php';
OC::$CLASSPATH['OC_Contacts_Hooks'] = 'apps/contacts/lib/hooks.php';
OC::$CLASSPATH['OC_Share_Backend_Contact'] = 'apps/contacts/lib/share/contact.php';
OC::$CLASSPATH['OC_Share_Backend_Addressbook'] = 'apps/contacts/lib/share/addressbook.php';
OC::$CLASSPATH['OC_Connector_Sabre_CardDAV'] = 'apps/contacts/lib/sabre/backend.php';
OC::$CLASSPATH['OC_Connector_Sabre_CardDAV_AddressBookRoot'] = 'apps/contacts/lib/sabre/addressbookroot.php';
OC::$CLASSPATH['OC_Connector_Sabre_CardDAV_UserAddressBooks'] = 'apps/contacts/lib/sabre/useraddressbooks.php';
OC::$CLASSPATH['OC_Connector_Sabre_CardDAV_AddressBook'] = 'apps/contacts/lib/sabre/addressbook.php';
OC::$CLASSPATH['OC_Connector_Sabre_CardDAV_Card'] = 'apps/contacts/lib/sabre/card.php';
OC::$CLASSPATH['OC_Connector_Sabre_CardDAV_VCFExportPlugin'] = 'apps/contacts/lib/sabre/vcfexportplugin.php';
OC::$CLASSPATH['OC_Search_Provider_Contacts'] = 'apps/contacts/lib/search.php';
OC::$CLASSPATH['OC_Contacts_App'] = 'contacts/lib/app.php';
OC::$CLASSPATH['OC_Contacts_Addressbook'] = 'contacts/lib/addressbook.php';
OC::$CLASSPATH['OC_Contacts_VCard'] = 'contacts/lib/vcard.php';
OC::$CLASSPATH['OC_Contacts_Hooks'] = 'contacts/lib/hooks.php';
OC::$CLASSPATH['OC_Share_Backend_Contact'] = 'contacts/lib/share/contact.php';
OC::$CLASSPATH['OC_Share_Backend_Addressbook'] = 'contacts/lib/share/addressbook.php';
OC::$CLASSPATH['OC_Connector_Sabre_CardDAV'] = 'contacts/lib/sabre/backend.php';
OC::$CLASSPATH['OC_Connector_Sabre_CardDAV_AddressBookRoot'] = 'contacts/lib/sabre/addressbookroot.php';
OC::$CLASSPATH['OC_Connector_Sabre_CardDAV_UserAddressBooks'] = 'contacts/lib/sabre/useraddressbooks.php';
OC::$CLASSPATH['OC_Connector_Sabre_CardDAV_AddressBook'] = 'contacts/lib/sabre/addressbook.php';
OC::$CLASSPATH['OC_Connector_Sabre_CardDAV_Card'] = 'contacts/lib/sabre/card.php';
OC::$CLASSPATH['OC_Search_Provider_Contacts'] = 'contacts/lib/search.php';
OCP\Util::connectHook('OC_User', 'post_createUser', 'OC_Contacts_Hooks', 'createUser');
OCP\Util::connectHook('OC_User', 'post_deleteUser', 'OC_Contacts_Hooks', 'deleteUser');
OCP\Util::connectHook('OC_Calendar', 'getEvents', 'OC_Contacts_Hooks', 'getBirthdayEvents');

View File

@ -55,7 +55,7 @@ $server->addPlugin(new Sabre_DAV_Auth_Plugin($authBackend, 'ownCloud'));
$server->addPlugin(new Sabre_CardDAV_Plugin());
$server->addPlugin(new Sabre_DAVACL_Plugin());
$server->addPlugin(new Sabre_DAV_Browser_Plugin(false)); // Show something in the Browser, but no upload
$server->addPlugin(new OC_Connector_Sabre_CardDAV_VCFExportPlugin());
$server->addPlugin(new Sabre_CardDAV_VCFExportPlugin());
// And off we go!
$server->exec();

View File

@ -50,6 +50,7 @@
"Not implemented" => "Pole implementeeritud",
"Couldn't get a valid address." => "Kehtiva aadressi hankimine ebaõnnestus",
"Error" => "Viga",
"Please enter an email address." => "Palun sisesta e-posti aadress.",
"Enter name" => "Sisesta nimi",
"Format custom, Short name, Full name, Reverse or Reverse with comma" => "Kohandatud vorming, Lühike nimi, Täielik nimi, vastupidine või vastupidine komadega",
"Select type" => "Vali tüüp",
@ -57,15 +58,24 @@
"You do not have permission to add contacts to " => "Sul pole luba lisada kontakti aadressiraamatusse",
"Please select one of your own address books." => "Palun vali üks oma aadressiraamatutest.",
"Permission error" => "Õiguse viga",
"Click to undo deletion of \"" => "Kliki kustutamise tühistamiseks \"",
"Cancelled deletion of: \"" => "Kustutamine tühistati: \"",
"This property has to be non-empty." => "See omadus ei tohi olla tühi.",
"Couldn't serialize elements." => "Elemente ei saa sarjana esitleda.",
"Unknown error. Please check logs." => "Tundmatu viga. Palun kontrolli vealogisid.",
"'deleteProperty' called without type argument. Please report at bugs.owncloud.org" => "'deleteProperty' kutsuti välja ilma tüübi argumendita. Palun teavita leitud veast aadressil bugs.owncloud.org",
"Edit name" => "Muuda nime",
"No files selected for upload." => "Üleslaadimiseks pole faile valitud.",
"The file you are trying to upload exceed the maximum size for file uploads on this server." => "Fail , mida sa proovid üles laadida ületab sinu serveri poolt määratud maksimaalse üleslaadimise limiidi.",
"Error loading profile picture." => "Viga profiilipildi laadimisel",
"Some contacts are marked for deletion, but not deleted yet. Please wait for them to be deleted." => "Mõned kontaktid on märgitud kustutamiseks, aga pole veel kustutatud. Palun oota, kuni need kustutatakse.",
"Do you want to merge these address books?" => "Kas sa soovid liita neid aadressiraamatuid?",
"Shared by " => "Jagas",
"Upload too large" => "Üleslaadimine on liiga suur",
"Only image files can be used as profile picture." => "Profiilipildina saab kasutada ainult pilte.",
"Wrong file type" => "Vale failitüüp",
"Your browser doesn't support AJAX upload. Please click on the profile picture to select a photo to upload." => "Sinu veebilehitseja ei toeta AJAX-põhist üleslaadimist. Palun kliki profiili pildil, et valida üleslaetav foto.",
"Unable to upload your file as it is a directory or has 0 bytes" => "Faili ei saa üles laadida, kuna see on kaust või selle suurus on 0 baiti",
"Upload Error" => "Üleslaadimise viga",
"Pending" => "Ootel",
"Import done" => "Importimine on tehtud",
@ -229,6 +239,7 @@
"create a new addressbook" => "loo uus aadressiraamat",
"Name of new addressbook" => "Uue aadressiraamatu nimi",
"Importing contacts" => "Kontaktide importimine",
"<h3>You have no contacts in your addressbook.</h3><p>You can import VCF files by dragging them to the contacts list and either drop them on an addressbook to import into it, or on an empty spot to create a new addressbook and import into that.<br />You can also import by clicking on the import button at the bottom of the list.</p>" => "<h3>Sinu aadressiraamatus pole ühtegi kontakti.</h3><p>Sa võid importida VCF faile lohistades neid kontaktide nimekirja sellele aadressiraamatule, millesse sa soovid neid importida või tühjale kohale, et luua uus aadressiraamat, millesse importida.<br />Sa võid importida ka kasutades nimekirja all olevat nuppu Impordi.</p>",
"Add contact" => "Lisa kontakt",
"Select Address Books" => "Vali aadressiraamatud",
"Enter description" => "Sisesta kirjeldus",

View File

@ -1,100 +0,0 @@
<?php
/**
* VCF Exporter
*
* This plugin adds the ability to export entire address books as .vcf files.
* This is useful for clients that don't support CardDAV yet. They often do
* support vcf files.
*
* @package Sabre
* @subpackage CardDAV
* @copyright Copyright (C) 2007-2012 Rooftop Solutions. All rights reserved.
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
*/
class OC_Connector_Sabre_CardDAV_VCFExportPlugin extends Sabre_DAV_ServerPlugin {
/**
* Reference to Server class
*
* @var Sabre_DAV_Server
*/
private $server;
/**
* Initializes the plugin and registers event handlers
*
* @param Sabre_DAV_Server $server
* @return void
*/
public function initialize(Sabre_DAV_Server $server) {
$this->server = $server;
$this->server->subscribeEvent('beforeMethod', array($this,'beforeMethod'), 90);
}
/**
* 'beforeMethod' event handles. This event handles intercepts GET requests ending
* with ?export
*
* @param string $method
* @param string $uri
* @return bool
*/
public function beforeMethod($method, $uri) {
if ($method!='GET') return;
if ($this->server->httpRequest->getQueryString()!='export') return;
// splitting uri
list($uri) = explode('?', $uri, 2);
$node = $this->server->tree->getNodeForPath($uri);
if (!($node instanceof Sabre_CardDAV_IAddressBook)) return;
// Checking ACL, if available.
if ($aclPlugin = $this->server->getPlugin('acl')) {
$aclPlugin->checkPrivileges($uri, '{DAV:}read');
}
$this->server->httpResponse->setHeader('Content-Type', 'text/directory');
$this->server->httpResponse->sendStatus(200);
$nodes = $this->server->getPropertiesForPath($uri, array(
'{' . Sabre_CardDAV_Plugin::NS_CARDDAV . '}address-data',
), 1);
$this->server->httpResponse->sendBody($this->generateVCF($nodes));
// Returning false to break the event chain
return false;
}
/**
* Merges all vcard objects, and builds one big vcf export
*
* @param array $nodes
* @return string
*/
public function generateVCF(array $nodes) {
$objects = array();
foreach($nodes as $node) {
if (!isset($node[200]['{' . Sabre_CardDAV_Plugin::NS_CARDDAV . '}address-data'])) {
continue;
}
$nodeData = $node[200]['{' . Sabre_CardDAV_Plugin::NS_CARDDAV . '}address-data'];
$objects[] = $nodeData;
}
return implode("\r\n", $objects);
}
}