summaryrefslogtreecommitdiffstats
path: root/apps/contacts
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2012-07-21 00:42:21 +0200
committerThomas Tanghus <thomas@tanghus.net>2012-07-21 00:43:01 +0200
commit06b5e05c86d29de51a18f13e1d44787a3021a8f0 (patch)
treed9cffdc98e3b76f7d45d39a410e86e06215cf750 /apps/contacts
parent8a19e134df09dd9a3e49736489f28ad0aee79803 (diff)
downloadnextcloud-server-06b5e05c86d29de51a18f13e1d44787a3021a8f0.tar.gz
nextcloud-server-06b5e05c86d29de51a18f13e1d44787a3021a8f0.zip
Damn, that Jenkins dude is tough ;)
Diffstat (limited to 'apps/contacts')
-rw-r--r--apps/contacts/lib/VCFExportPlugin.php8
-rw-r--r--apps/contacts/lib/hooks.php18
-rw-r--r--apps/contacts/lib/vcard.php2
3 files changed, 17 insertions, 11 deletions
diff --git a/apps/contacts/lib/VCFExportPlugin.php b/apps/contacts/lib/VCFExportPlugin.php
index 6554cb258e8..9a64c964b06 100644
--- a/apps/contacts/lib/VCFExportPlugin.php
+++ b/apps/contacts/lib/VCFExportPlugin.php
@@ -31,7 +31,7 @@ class Sabre_CardDAV_VCFExportPlugin extends Sabre_DAV_ServerPlugin {
public function initialize(Sabre_DAV_Server $server) {
$this->server = $server;
- $this->server->subscribeEvent('beforeMethod',array($this,'beforeMethod'), 90);
+ $this->server->subscribeEvent('beforeMethod', array($this,'beforeMethod'), 90);
}
@@ -49,7 +49,7 @@ class Sabre_CardDAV_VCFExportPlugin extends Sabre_DAV_ServerPlugin {
if ($this->server->httpRequest->getQueryString()!='export') return;
// splitting uri
- list($uri) = explode('?',$uri,2);
+ list($uri) = explode('?', $uri, 2);
$node = $this->server->tree->getNodeForPath($uri);
@@ -60,12 +60,12 @@ class Sabre_CardDAV_VCFExportPlugin extends Sabre_DAV_ServerPlugin {
$aclPlugin->checkPrivileges($uri, '{DAV:}read');
}
- $this->server->httpResponse->setHeader('Content-Type','text/directory');
+ $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);
+ ), 1);
$this->server->httpResponse->sendBody($this->generateVCF($nodes));
diff --git a/apps/contacts/lib/hooks.php b/apps/contacts/lib/hooks.php
index 6239aec49ef..3344e3d6939 100644
--- a/apps/contacts/lib/hooks.php
+++ b/apps/contacts/lib/hooks.php
@@ -61,8 +61,8 @@ class OC_Contacts_Hooks{
static public function getCalenderSources($parameters) {
$base_url = OCP\Util::linkTo('calendar', 'ajax/events.php').'?calendar_id=';
foreach(OC_Contacts_Addressbook::all(OCP\USER::getUser()) as $addressbook) {
- $parameters['sources'][] =
- array(
+ $parameters['sources'][]
+ = array(
'url' => $base_url.'birthday_'. $addressbook['id'],
'backgroundColor' => '#cccccc',
'borderColor' => '#888',
@@ -91,18 +91,24 @@ class OC_Contacts_Hooks{
$date = new DateTime($birthday);
$vevent = new OC_VObject('VEVENT');
//$vevent->setDateTime('LAST-MODIFIED', new DateTime($vcard->REV));
- $vevent->setDateTime('DTSTART', $date, Sabre_VObject_Element_DateTime::DATE);
+ $vevent->setDateTime('DTSTART', $date,
+ Sabre_VObject_Element_DateTime::DATE);
$vevent->setString('DURATION', 'P1D');
- $vevent->setString('UID', substr(md5(rand().time()),0,10));
+ $vevent->setString('UID', substr(md5(rand().time()), 0, 10));
// DESCRIPTION?
$vevent->setString('RRULE', 'FREQ=YEARLY');
- $title = str_replace('{name}', $vcard->getAsString('FN'), OC_Contacts_App::$l10n->t('{name}\'s Birthday'));
+ $title = str_replace('{name}',
+ $vcard->getAsString('FN'),
+ OC_Contacts_App::$l10n->t('{name}\'s Birthday'));
$parameters['events'][] = array(
'id' => 0,//$card['id'],
'vevent' => $vevent,
'repeating' => true,
'summary' => $title,
- 'calendardata' => "BEGIN:VCALENDAR\nVERSION:2.0\nPRODID:ownCloud Contacts " . OCP\App::getAppVersion('contacts') . "\n" . $vevent->serialize() . "END:VCALENDAR"
+ 'calendardata' => "BEGIN:VCALENDAR\nVERSION:2.0\n"
+ . "PRODID:ownCloud Contacts "
+ . OCP\App::getAppVersion('contacts') . "\n"
+ . $vevent->serialize() . "END:VCALENDAR"
);
}
}
diff --git a/apps/contacts/lib/vcard.php b/apps/contacts/lib/vcard.php
index 6b9a4c04f1e..ca171e792fc 100644
--- a/apps/contacts/lib/vcard.php
+++ b/apps/contacts/lib/vcard.php
@@ -212,7 +212,7 @@ class OC_Contacts_VCard{
// Add version if needed
if($version && $version < '3.0') {
$upgrade = true;
- OCP\Util::writeLog('contacts', 'OC_Contacts_VCard::updateValuesFromAdd. Updating from version: '.$version,OCP\Util::DEBUG);
+ OCP\Util::writeLog('contacts', 'OC_Contacts_VCard::updateValuesFromAdd. Updating from version: '.$version, OCP\Util::DEBUG);
}
foreach($vcard->children as &$property){
// Decode string properties and remove obsolete properties.