Merge branch 'master' into tasks

This commit is contained in:
Bart Visscher 2011-10-06 15:37:20 +02:00
commit 16ee08385e
533 changed files with 27334 additions and 10571 deletions

5
.gitignore vendored
View File

@ -28,3 +28,8 @@ RCS/*
# eclipse
.project
.settings
# netbeans
nbproject
.DS_Store

View File

@ -1,7 +1,8 @@
ErrorDocument 404 //owncloud/core/templates/404.php
ErrorDocument 404 /owncloud/core/templates/404.php
<IfModule mod_php5.c>
php_value upload_max_filesize 512M
php_value post_max_size 512M
SetEnv htaccessWorking true
php_value upload_max_filesize 512M
php_value post_max_size 512M
php_value memory_limit 128M
SetEnv htaccessWorking true
</IfModule>
Options -Indexes

View File

@ -13,16 +13,21 @@ trans.da = l10n/da/core.po
trans.de = l10n/de/core.po
trans.el = l10n/el/core.po
trans.es = l10n/es/core.po
trans.et_EE = l10n/et_EE/core.po
trans.fr = l10n/fr/core.po
trans.id = l10n/id/core.po
trans.it = l10n/it/core.po
trans.lb = l10n/lb/core.po
trans.ms_MY = l10n/ms_MY/core.po
trans.nb_NO = l10n/nb_NO/core.po
trans.nl = l10n/nl/core.po
trans.pl = l10n/pl/core.po
trans.pt_BR = l10n/pt_BR/core.po
trans.pt_PT = l10n/pt_PT/core.po
trans.ro = l10n/ro/core.po
trans.ru = l10n/ru/core.po
trans.sr = l10n/sr/core.po
trans.sr@latin = l10n/sr@latin/core.po
trans.sv = l10n/sv/core.po
trans.zh_CN = l10n/zh_CN/core.po
@ -38,16 +43,21 @@ trans.da = l10n/da/settings.po
trans.de = l10n/de/settings.po
trans.el = l10n/el/settings.po
trans.es = l10n/es/settings.po
trans.et_EE = l10n/et_EE/settings.po
trans.fr = l10n/fr/settings.po
trans.id = l10n/id/settings.po
trans.it = l10n/it/settings.po
trans.lb = l10n/lb/settings.po
trans.ms_MY = l10n/ms_MY/settings.po
trans.nb_NO = l10n/nb_NO/settings.po
trans.nl = l10n/nl/settings.po
trans.pl = l10n/pl/settings.po
trans.pt_BR = l10n/pt_BR/settings.po
trans.pt_PT = l10n/pt_PT/settings.po
trans.ro = l10n/ro/settings.po
trans.ru = l10n/ru/settings.po
trans.sr = l10n/sr/settings.po
trans.sr@latin = l10n/sr@latin/settings.po
trans.sv = l10n/sv/settings.po
trans.zh_CN = l10n/zh_CN/settings.po
@ -63,16 +73,21 @@ trans.da = l10n/da/files.po
trans.de = l10n/de/files.po
trans.el = l10n/el/files.po
trans.es = l10n/es/files.po
trans.et_EE = l10n/et_EE/files.po
trans.fr = l10n/fr/files.po
trans.id = l10n/id/files.po
trans.it = l10n/it/files.po
trans.lb = l10n/lb/files.po
trans.ms_MY = l10n/ms_MY/files.po
trans.nb_NO = l10n/nb_NO/files.po
trans.nl = l10n/nl/files.po
trans.pl = l10n/pl/files.po
trans.pt_BR = l10n/pt_BR/files.po
trans.pt_PT = l10n/pt_PT/files.po
trans.ro = l10n/ro/files.po
trans.ru = l10n/ru/files.po
trans.sr = l10n/sr/files.po
trans.sr@latin = l10n/sr@latin/files.po
trans.sv = l10n/sv/files.po
trans.zh_CN = l10n/zh_CN/files.po
@ -88,16 +103,80 @@ trans.da = l10n/da/media.po
trans.de = l10n/de/media.po
trans.el = l10n/el/media.po
trans.es = l10n/es/media.po
trans.et_EE = l10n/et_EE/media.po
trans.fr = l10n/fr/media.po
trans.id = l10n/id/media.po
trans.it = l10n/it/media.po
trans.lb = l10n/lb/media.po
trans.ms_MY = l10n/ms_MY/media.po
trans.nb_NO = l10n/nb_NO/media.po
trans.nl = l10n/nl/media.po
trans.pl = l10n/pl/media.po
trans.pt_BR = l10n/pt_BR/media.po
trans.pt_PT = l10n/pt_PT/media.po
trans.ro = l10n/ro/media.po
trans.ru = l10n/ru/media.po
trans.sr = l10n/sr/media.po
trans.sr@latin = l10n/sr@latin/media.po
trans.sv = l10n/sv/media.po
trans.zh_CN = l10n/zh_CN/media.po
[owncloud.calendar]
file_filter = l10n/<lang>/calendar.po
host = http://www.transifex.net
source_file = l10n/templates/calendar.pot
source_lang = en
trans.bg_BG = l10n/bg_BG/calendar.po
trans.ca = l10n/ca/calendar.po
trans.cs_CZ = l10n/cs_CZ/calendar.po
trans.da = l10n/da/calendar.po
trans.de = l10n/de/calendar.po
trans.el = l10n/el/calendar.po
trans.es = l10n/es/calendar.po
trans.et_EE = l10n/et_EE/calendar.po
trans.fr = l10n/fr/calendar.po
trans.id = l10n/id/calendar.po
trans.it = l10n/it/calendar.po
trans.lb = l10n/lb/calendar.po
trans.ms_MY = l10n/ms_MY/calendar.po
trans.nb_NO = l10n/nb_NO/calendar.po
trans.nl = l10n/nl/calendar.po
trans.pl = l10n/pl/calendar.po
trans.pt_BR = l10n/pt_BR/calendar.po
trans.pt_PT = l10n/pt_PT/calendar.po
trans.ro = l10n/ro/calendar.po
trans.ru = l10n/ru/calendar.po
trans.sr = l10n/sr/calendar.po
trans.sr@latin = l10n/sr@latin/calendar.po
trans.sv = l10n/sv/calendar.po
trans.zh_CN = l10n/zh_CN/calendar.po
[owncloud.contacts]
file_filter = translations/owncloud.contacts/<lang>.po
host = http://www.transifex.net
source_file = l10n/templates/contacts.pot
source_lang = en
trans.bg_BG = l10n/bg_BG/contacts.po
trans.ca = l10n/ca/contacts.po
trans.cs_CZ = l10n/cs_CZ/contacts.po
trans.da = l10n/da/contacts.po
trans.de = l10n/de/contacts.po
trans.el = l10n/el/contacts.po
trans.es = l10n/es/contacts.po
trans.et_EE = l10n/et_EE/contacts.po
trans.fr = l10n/fr/contacts.po
trans.id = l10n/id/contacts.po
trans.it = l10n/it/contacts.po
trans.lb = l10n/lb/contacts.po
trans.ms_MY = l10n/ms_MY/contacts.po
trans.nb_NO = l10n/nb_NO/contacts.po
trans.nl = l10n/nl/contacts.po
trans.pl = l10n/pl/contacts.po
trans.pt_BR = l10n/pt_BR/contacts.po
trans.pt_PT = l10n/pt_PT/contacts.po
trans.ro = l10n/ro/contacts.po
trans.ru = l10n/ru/contacts.po
trans.sr = l10n/sr/contacts.po
trans.sr@latin = l10n/sr@latin/contacts.po
trans.sv = l10n/sv/contacts.po
trans.zh_CN = l10n/zh_CN/contacts.po

68
3rdparty/COPYING-PHP vendored
View File

@ -1,68 +0,0 @@
--------------------------------------------------------------------
The PHP License, version 3.01
Copyright (c) 1999 - 2010 The PHP Group. All rights reserved.
--------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
modification, is permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
3. The name "PHP" must not be used to endorse or promote products
derived from this software without prior written permission. For
written permission, please contact group@php.net.
4. Products derived from this software may not be called "PHP", nor
may "PHP" appear in their name, without prior written permission
from group@php.net. You may indicate that your software works in
conjunction with PHP by saying "Foo for PHP" instead of calling
it "PHP Foo" or "phpfoo"
5. The PHP Group may publish revised and/or new versions of the
license from time to time. Each version will be given a
distinguishing version number.
Once covered code has been published under a particular version
of the license, you may always continue to use it under the terms
of that version. You may also choose to use such covered code
under the terms of any subsequent version of the license
published by the PHP Group. No one other than the PHP Group has
the right to modify the terms applicable to covered code created
under this License.
6. Redistributions of any form whatsoever must retain the following
acknowledgment:
"This product includes PHP software, freely available from
<http://www.php.net/software/>".
THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND
ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PHP
DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------
This software consists of voluntary contributions made by many
individuals on behalf of the PHP Group.
The PHP Group can be contacted via Email at group@php.net.
For more information on the PHP Group and the PHP project,
please see <http://www.php.net>.
PHP includes the Zend Engine, freely available at
<http://www.zend.com>.

View File

@ -1,7 +0,0 @@
HTTP is three clause BSD licence
MDB2 uses a custom licence in the BSD style
User is AGPL
XML/RPC is both MIT and PHP License
The rest all licenced under the PHP License see packages/ directory
for details

5
3rdparty/MDB2.php vendored
View File

@ -969,11 +969,10 @@ class MDB2
static function fileExists($file)
{
// safe_mode does notwork with is_readable()
global $SERVERROOT;
if (!@ini_get('safe_mode')) {
$dirs = explode(PATH_SEPARATOR, ini_get('include_path'));
array_unshift($dirs,$SERVERROOT);
array_unshift($dirs,$SERVERROOT. DIRECTORY_SEPARATOR .'inc');
array_unshift($dirs,OC::$SERVERROOT);
array_unshift($dirs,OC::$SERVERROOT. DIRECTORY_SEPARATOR .'inc');
// print_r($dirs);die();
foreach ($dirs as $dir) {
if (is_readable($dir . DIRECTORY_SEPARATOR . $file)) {

View File

@ -71,8 +71,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common
*/
function createDatabase($name, $options = array())
{
global $SERVERROOT;
$datadir=OC_Config::getValue( "datadirectory", "$SERVERROOT/data" );
$datadir=OC_Config::getValue( "datadirectory", OC::$SERVERROOT."/data" );
$db =$this->getDBInstance();
if (PEAR::isError($db)) {
return $db;
@ -1362,4 +1361,4 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common
// }}}
}
?>
?>

View File

@ -347,8 +347,7 @@ class MDB2_Driver_sqlite extends MDB2_Driver_Common
**/
function connect()
{
global $SERVERROOT;
$datadir=OC_Config::getValue( "datadirectory", "$SERVERROOT/data" );
$datadir=OC_Config::getValue( "datadirectory", OC::$SERVERROOT."/data" );
$database_file = $this->_getDatabaseFile($this->database_name);
if (is_resource($this->connection)) {
//if (count(array_diff($this->connected_dsn, $this->dsn)) == 0
@ -1086,4 +1085,4 @@ class MDB2_Statement_sqlite extends MDB2_Statement_Common
}
?>
?>

View File

@ -36,20 +36,17 @@ abstract class Sabre_CalDAV_Backend_Abstract {
* If the creation was a success, an id must be returned that can be used to reference
* this calendar in other methods, such as updateCalendar.
*
* This function must return a server-wide unique id that can be used
* later to reference the calendar.
*
* @param string $principalUri
* @param string $calendarUri
* @param array $properties
* @return string|int
* @return void
*/
abstract function createCalendar($principalUri,$calendarUri,array $properties);
/**
* Updates properties on this node,
* Updates properties for a calendar.
*
* The properties array uses the propertyName in clark-notation as key,
* The mutations array uses the propertyName in clark-notation as key,
* and the array value for the property value. In the case a property
* should be deleted, the property value will be null.
*
@ -79,10 +76,10 @@ abstract class Sabre_CalDAV_Backend_Abstract {
* (424 Failed Dependency) because the request needs to be atomic.
*
* @param string $calendarId
* @param array $properties
* @param array $mutations
* @return bool|array
*/
public function updateCalendar($calendarId, array $properties) {
public function updateCalendar($calendarId, array $mutations) {
return false;
@ -97,7 +94,7 @@ abstract class Sabre_CalDAV_Backend_Abstract {
abstract function deleteCalendar($calendarId);
/**
* Returns all calendar objects within a calendar object.
* Returns all calendar objects within a calendar.
*
* Every item contains an array with the following keys:
* * id - unique identifier which will be used for subsequent updates

View File

@ -129,7 +129,6 @@ class Sabre_CalDAV_Backend_PDO extends Sabre_CalDAV_Backend_Abstract {
* @param string $principalUri
* @param string $calendarUri
* @param array $properties
* @return mixed
*/
public function createCalendar($principalUri,$calendarUri, array $properties) {
@ -173,9 +172,9 @@ class Sabre_CalDAV_Backend_PDO extends Sabre_CalDAV_Backend_Abstract {
}
/**
* Updates a calendars properties
* Updates properties for a calendar.
*
* The properties array uses the propertyName in clark-notation as key,
* The mutations array uses the propertyName in clark-notation as key,
* and the array value for the property value. In the case a property
* should be deleted, the property value will be null.
*
@ -205,10 +204,10 @@ class Sabre_CalDAV_Backend_PDO extends Sabre_CalDAV_Backend_Abstract {
* (424 Failed Dependency) because the request needs to be atomic.
*
* @param string $calendarId
* @param array $properties
* @param array $mutations
* @return bool|array
*/
public function updateCalendar($calendarId, array $properties) {
public function updateCalendar($calendarId, array $mutations) {
$newValues = array();
$result = array(
@ -219,13 +218,13 @@ class Sabre_CalDAV_Backend_PDO extends Sabre_CalDAV_Backend_Abstract {
$hasError = false;
foreach($properties as $propertyName=>$propertyValue) {
foreach($mutations as $propertyName=>$propertyValue) {
// We don't know about this property.
if (!isset($this->propertyMap[$propertyName])) {
$hasError = true;
$result[403][$propertyName] = null;
unset($properties[$propertyName]);
unset($mutations[$propertyName]);
continue;
}
@ -237,7 +236,7 @@ class Sabre_CalDAV_Backend_PDO extends Sabre_CalDAV_Backend_Abstract {
// If there were any errors we need to fail the request
if ($hasError) {
// Properties has the remaining properties
foreach($properties as $propertyName=>$propertyValue) {
foreach($mutations as $propertyName=>$propertyValue) {
$result[424][$propertyName] = null;
}
@ -284,7 +283,7 @@ class Sabre_CalDAV_Backend_PDO extends Sabre_CalDAV_Backend_Abstract {
}
/**
* Returns all calendar objects within a calendar object.
* Returns all calendar objects within a calendar.
*
* Every item contains an array with the following keys:
* * id - unique identifier which will be used for subsequent updates

View File

@ -12,7 +12,7 @@
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
*/
class Sabre_CalDAV_Calendar implements Sabre_DAV_ICollection, Sabre_DAV_IProperties, Sabre_DAVACL_IACL {
class Sabre_CalDAV_Calendar implements Sabre_CalDAV_ICalendar, Sabre_DAV_IProperties, Sabre_DAVACL_IACL {
/**
* This is an array with calendar information
@ -178,6 +178,8 @@ class Sabre_CalDAV_Calendar implements Sabre_DAV_ICollection, Sabre_DAV_IPropert
public function createFile($name,$calendarData = null) {
$calendarData = stream_get_contents($calendarData);
// Converting to UTF-8, if needed
$calendarData = Sabre_DAV_StringUtil::ensureUTF8($calendarData);
$supportedComponents = $this->calendarInfo['{' . Sabre_CalDAV_Plugin::NS_CALDAV . '}supported-calendar-component-set'];
if ($supportedComponents) {

View File

@ -9,7 +9,7 @@
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
*/
class Sabre_CalDAV_CalendarObject extends Sabre_DAV_File implements Sabre_DAVACL_IACL {
class Sabre_CalDAV_CalendarObject extends Sabre_DAV_File implements Sabre_CalDAV_ICalendarObject, Sabre_DAVACL_IACL {
/**
* Sabre_CalDAV_Backend_Abstract
@ -93,6 +93,9 @@ class Sabre_CalDAV_CalendarObject extends Sabre_DAV_File implements Sabre_DAVACL
if (is_resource($calendarData))
$calendarData = stream_get_contents($calendarData);
// Converting to UTF-8, if needed
$calendarData = Sabre_DAV_StringUtil::ensureUTF8($calendarData);
$supportedComponents = $this->calendarInfo['{' . Sabre_CalDAV_Plugin::NS_CALDAV . '}supported-calendar-component-set'];
if ($supportedComponents) {
$supportedComponents = $supportedComponents->getValue();

18
3rdparty/Sabre/CalDAV/ICalendar.php vendored Normal file
View File

@ -0,0 +1,18 @@
<?php
/**
* Calendar interface
*
* Implement this interface to allow a node to be recognized as an calendar.
*
* @package Sabre
* @subpackage CalDAV
* @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
*/
interface Sabre_CalDAV_ICalendar extends Sabre_DAV_ICollection {
}

View File

@ -0,0 +1,20 @@
<?php
/**
* CalendarObject interface
/**
* Extend the ICalendarObject interface to allow your custom nodes to be picked up as
* CalendarObjects.
*
* Calendar objects are resources such as Events, Todo's or Journals.
*
* @package Sabre
* @subpackage CalDAV
* @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
*/
interface Sabre_CalDAV_ICalendarObject extends Sabre_DAV_IFile {
}

View File

@ -114,7 +114,7 @@ class Sabre_CalDAV_Plugin extends Sabre_DAV_ServerPlugin {
public function getSupportedReportSet($uri) {
$node = $this->server->tree->getNodeForPath($uri);
if ($node instanceof Sabre_CalDAV_Calendar || $node instanceof Sabre_CalDAV_CalendarObject) {
if ($node instanceof Sabre_CalDAV_ICalendar || $node instanceof Sabre_CalDAV_ICalendarObject) {
return array(
'{' . self::NS_CALDAV . '}calendar-multiget',
'{' . self::NS_CALDAV . '}calendar-query',
@ -143,7 +143,7 @@ class Sabre_CalDAV_Plugin extends Sabre_DAV_ServerPlugin {
$server->propertyMap['{' . self::NS_CALDAV . '}supported-calendar-component-set'] = 'Sabre_CalDAV_Property_SupportedCalendarComponentSet';
$server->resourceTypeMapping['Sabre_CalDAV_Calendar'] = '{urn:ietf:params:xml:ns:caldav}calendar';
$server->resourceTypeMapping['Sabre_CalDAV_ICalendar'] = '{urn:ietf:params:xml:ns:caldav}calendar';
$server->resourceTypeMapping['Sabre_CalDAV_Principal_ProxyRead'] = '{http://calendarserver.org/ns/}calendar-proxy-read';
$server->resourceTypeMapping['Sabre_CalDAV_Principal_ProxyWrite'] = '{http://calendarserver.org/ns/}calendar-proxy-write';
@ -326,7 +326,7 @@ class Sabre_CalDAV_Plugin extends Sabre_DAV_ServerPlugin {
} // instanceof IPrincipal
if ($node instanceof Sabre_CalDAV_CalendarObject) {
if ($node instanceof Sabre_CalDAV_ICalendarObject) {
// The calendar-data property is not supposed to be a 'real'
// property, but in large chunks of the spec it does act as such.
// Therefore we simply expose it as a property.

View File

@ -14,7 +14,7 @@ class Sabre_CalDAV_Version {
/**
* Full version number
*/
const VERSION = '1.5.0';
const VERSION = '1.5.3';
/**
* Stability : alpha, beta, stable

View File

@ -112,6 +112,8 @@ class Sabre_CardDAV_AddressBook extends Sabre_DAV_Collection implements Sabre_Ca
public function createFile($name,$vcardData = null) {
$vcardData = stream_get_contents($vcardData);
// Converting to UTF-8, if needed
$vcardData = Sabre_DAV_StringUtil::ensureUTF8($vcardData);
$this->carddavBackend->createCard($this->addressBookInfo['id'],$name,$vcardData);

View File

@ -66,7 +66,9 @@ class Sabre_CardDAV_Backend_PDO extends Sabre_CardDAV_Backend_Abstract {
'principaluri' => $row['principaluri'],
'{DAV:}displayname' => $row['displayname'],
'{' . Sabre_CardDAV_Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'],
'{http://calendarserver.org/ns/}getctag' => $row['ctag'],
'{http://calendarserver.org/ns/}getctag' => $row['ctag'],
'{' . Sabre_CardDAV_Plugin::NS_CARDDAV . '}supported-address-data' =>
new Sabre_CardDAV_Property_SupportedAddressData(),
);
}

View File

@ -88,6 +88,9 @@ class Sabre_CardDAV_Card extends Sabre_DAV_File implements Sabre_CardDAV_ICard,
if (is_resource($cardData))
$cardData = stream_get_contents($cardData);
// Converting to UTF-8, if needed
$cardData = Sabre_DAV_StringUtil::ensureUTF8($cardData);
$this->carddavBackend->updateCard($this->addressBookInfo['id'],$this->cardData['uri'],$cardData);
$this->cardData['carddata'] = $cardData;

View File

@ -95,9 +95,10 @@ class Sabre_CardDAV_Plugin extends Sabre_DAV_ServerPlugin {
public function getSupportedReportSet($uri) {
$node = $this->server->tree->getNodeForPath($uri);
if ($node instanceof Sabre_CardDAV_AddressBook || $node instanceof Sabre_CardDAV_ICard) {
if ($node instanceof Sabre_CardDAV_IAddressBook || $node instanceof Sabre_CardDAV_ICard) {
return array(
'{' . self::NS_CARDDAV . '}addressbook-multiget',
'{' . self::NS_CARDDAV . '}addressbook-query',
);
}
return array();

View File

@ -0,0 +1,69 @@
<?php
/**
* Supported-address-data property
*
* This property is a representation of the supported-address-data property
* in the CardDAV namespace.
*
* @package Sabre
* @subpackage CardDAV
* @copyright Copyright (C) 2007-2011 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 Sabre_CardDAV_Property_SupportedAddressData extends Sabre_DAV_Property {
/**
* supported versions
*
* @var array
*/
protected $supportedData = array();
/**
* Creates the property
*
* @param array $components
*/
public function __construct(array $supportedData = null) {
if (is_null($supportedData)) {
$supportedData = array(
array('contentType' => 'text/vcard', 'version' => '3.0'),
array('contentType' => 'text/vcard', 'version' => '4.0'),
);
}
$this->supportedData = $supportedData;
}
/**
* Serializes the property in a DOMDocument
*
* @param Sabre_DAV_Server $server
* @param DOMElement $node
* @return void
*/
public function serialize(Sabre_DAV_Server $server,DOMElement $node) {
$doc = $node->ownerDocument;
$prefix =
isset($server->xmlNamespaces[Sabre_CardDAV_Plugin::NS_CARDDAV]) ?
$server->xmlNamespaces[Sabre_CardDAV_Plugin::NS_CARDDAV] :
'card';
foreach($this->supportedData as $supported) {
$caldata = $doc->createElementNS(Sabre_CardDAV_Plugin::NS_CARDDAV, $prefix . ':address-data-type');
$caldata->setAttribute('content-type',$supported['contentType']);
$caldata->setAttribute('version',$supported['version']);
$node->appendChild($caldata);
}
}
}

View File

@ -18,11 +18,11 @@ class Sabre_CardDAV_Version {
/**
* Full version number
*/
const VERSION = '0.2';
const VERSION = '1.5.3';
/**
* Stability : alpha, beta, stable
*/
const STABILITY = 'alpha';
const STABILITY = 'stable';
}

View File

@ -68,9 +68,16 @@ class Sabre_DAV_Browser_Plugin extends Sabre_DAV_ServerPlugin {
public function httpGetInterceptor($method, $uri) {
if ($method!='GET') return true;
$node = $this->server->tree->getNodeForPath($uri);
if ($node instanceof Sabre_DAV_IFile) return true;
try {
$node = $this->server->tree->getNodeForPath($uri);
} catch (Sabre_DAV_Exception_FileNotFound $e) {
// We're simply stopping when the file isn't found to not interfere
// with other plugins.
return;
}
if ($node instanceof Sabre_DAV_IFile)
return;
$this->server->httpResponse->sendStatus(200);
$this->server->httpResponse->setHeader('Content-Type','text/html; charset=utf-8');
@ -165,6 +172,8 @@ class Sabre_DAV_Browser_Plugin extends Sabre_DAV_ServerPlugin {
'{DAV:}getlastmodified',
),1);
$parent = $this->server->tree->getNodeForPath($path);
if ($path) {
@ -189,6 +198,7 @@ class Sabre_DAV_Browser_Plugin extends Sabre_DAV_ServerPlugin {
$type = null;
if (isset($file[200]['{DAV:}resourcetype'])) {
$type = $file[200]['{DAV:}resourcetype']->getValue();
@ -246,7 +256,7 @@ class Sabre_DAV_Browser_Plugin extends Sabre_DAV_ServerPlugin {
$html.= "<tr><td colspan=\"4\"><hr /></td></tr>";
if ($this->enablePost) {
if ($this->enablePost && $parent instanceof Sabre_DAV_ICollection) {
$html.= '<tr><td><form method="post" action="">
<h3>Create new folder</h3>
<input type="hidden" name="sabreAction" value="mkcol" />

View File

@ -738,6 +738,34 @@ class Sabre_DAV_Server {
$body = $this->httpRequest->getBody();
// Intercepting Content-Range
if ($this->httpRequest->getHeader('Content-Range')) {
/**
Content-Range is dangerous for PUT requests: PUT per definition
stores a full resource. draft-ietf-httpbis-p2-semantics-15 says
in section 7.6:
An origin server SHOULD reject any PUT request that contains a
Content-Range header field, since it might be misinterpreted as
partial content (or might be partial content that is being mistakenly
PUT as a full representation). Partial content updates are possible
by targeting a separately identified resource with state that
overlaps a portion of the larger resource, or by using a different
method that has been specifically defined for partial updates (for
example, the PATCH method defined in [RFC5789]).
This clarifies RFC2616 section 9.6:
The recipient of the entity MUST NOT ignore any Content-*
(e.g. Content-Range) headers that it does not understand or implement
and MUST return a 501 (Not Implemented) response in such cases.
OTOH is a PUT request with a Content-Range currently the only way to
continue an aborted upload request and is supported by curl, mod_dav,
Tomcat and others. Since some clients do use this feature which results
in unexpected behaviour (cf PEAR::HTTP_WebDAV_Client 1.0.1), we reject
all PUT requests with a Content-Range for now.
*/
throw new Sabre_DAV_Exception_NotImplemented('PUT with Content-Range is not allowed.');
}
// Intercepting the Finder problem
if (($expected = $this->httpRequest->getHeader('X-Expected-Entity-Length')) && $expected > 0) {
@ -798,7 +826,10 @@ class Sabre_DAV_Server {
} else {
// If we got here, the resource didn't exist yet.
$this->createFile($this->getRequestUri(),$body);
if (!$this->createFile($this->getRequestUri(),$body)) {
// For one reason or another the file was not created.
return;
}
$this->httpResponse->setHeader('Content-Length','0');
$this->httpResponse->sendStatus(201);
@ -1377,23 +1408,27 @@ class Sabre_DAV_Server {
* Currently this is done by HTTP PUT and HTTP LOCK (in the Locks_Plugin).
* It was important to get this done through a centralized function,
* allowing plugins to intercept this using the beforeCreateFile event.
*
* This method will return true if the file was actually created
*
* @param string $uri
* @param resource $data
* @return void
* @return bool
*/
public function createFile($uri,$data) {
list($dir,$name) = Sabre_DAV_URLUtil::splitPath($uri);
if (!$this->broadcastEvent('beforeBind',array($uri))) return;
if (!$this->broadcastEvent('beforeCreateFile',array($uri,$data))) return;
if (!$this->broadcastEvent('beforeBind',array($uri))) return false;
if (!$this->broadcastEvent('beforeCreateFile',array($uri,$data))) return false;
$parent = $this->tree->getNodeForPath($dir);
$parent->createFile($name,$data);
$this->tree->markDirty($dir);
$this->broadcastEvent('afterBind',array($uri));
return true;
}
/**

120
3rdparty/Sabre/DAV/SimpleFile.php vendored Normal file
View File

@ -0,0 +1,120 @@
<?php
/**
* SimpleFile
*
* The 'SimpleFile' class is used to easily add read-only immutable files to
* the directory structure. One usecase would be to add a 'readme.txt' to a
* root of a webserver with some standard content.
*
* @package Sabre
* @subpackage DAV
* @copyright Copyright (C) 2007-2011 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 Sabre_DAV_SimpleFile extends Sabre_DAV_File {
/**
* File contents
*
* @var string
*/
protected $contents = array();
/**
* Name of this resource
*
* @var string
*/
protected $name;
/**
* A mimetype, such as 'text/plain' or 'text/html'
*
* @var string
*/
protected $mimeType;
/**
* Creates this node
*
* The name of the node must be passed, as well as the contents of the
* file.
*
* @param string $name
* @param string $contents
*/
public function __construct($name, $contents, $mimeType = null) {
$this->name = $name;
$this->contents = $contents;
$this->mimeType = $mimeType;
}
/**
* Returns the node name for this file.
*
* This name is used to construct the url.
*
* @return string
*/
public function getName() {
return $this->name;
}
/**
* Returns the data
*
* This method may either return a string or a readable stream resource
*
* @return mixed
*/
public function get() {
return $this->contents;
}
/**
* Returns the size of the file, in bytes.
*
* @return int
*/
public function getSize() {
return strlen($this->contents);
}
/**
* Returns the ETag for a file
*
* An ETag is a unique identifier representing the current version of the file. If the file changes, the ETag MUST change.
* The ETag is an arbritrary string, but MUST be surrounded by double-quotes.
*
* Return null if the ETag can not effectively be determined
*/
public function getETag() {
return '"' . md5($this->contents) . '"';
}
/**
* Returns the mime-type for a file
*
* If null is returned, we'll assume application/octet-stream
*/
public function getContentType() {
return $this->mimeType;
}
}
?>

View File

@ -64,6 +64,27 @@ class Sabre_DAV_StringUtil {
}
}
/**
* This method takes an input string, checks if it's not valid UTF-8 and
* attempts to convert it to UTF-8 if it's not.
*
* Note that currently this can only convert ISO-8559-1 to UTF-8 (latin-1),
* anything else will likely fail.
*
* @param string $input
* @return string
*/
static public function ensureUTF8($input) {
$encoding = mb_detect_encoding($input , array('UTF-8','ISO-8859-1'), true);
if ($encoding === 'ISO-8859-1') {
return utf8_encode($input);
} else {
return $input;
}
}

View File

@ -30,9 +30,14 @@ class Sabre_DAV_URLUtil {
*/
static function encodePath($path) {
$path = explode('/',$path);
return implode('/',array_map(array('Sabre_DAV_URLUtil','encodePathSegment'), $path));
$valid_chars = '/ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-.~()';
$newStr = '';
for( $i=0; isset($path[$i]); ++$i ) {
if( strpos($valid_chars,($c=$path[$i]))===false ) $newStr .= '%'.sprintf('%02x',ord($c));
else $newStr .= $c;
}
return $newStr;
}
/**
@ -45,35 +50,13 @@ class Sabre_DAV_URLUtil {
*/
static function encodePathSegment($pathSegment) {
$valid_chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-.~()';
$newStr = '';
for($i=0;$i<strlen($pathSegment);$i++) {
$c = ord($pathSegment[$i]);
if(
/* Unreserved chacaters */
($c>=0x41 /* A */ && $c<=0x5a /* Z */) ||
($c>=0x61 /* a */ && $c<=0x7a /* z */) ||
($c>=0x30 /* 0 */ && $c<=0x39 /* 9 */) ||
$c===0x5f /* _ */ ||
$c===0x2d /* - */ ||
$c===0x2e /* . */ ||
$c===0x7E /* ~ */ ||
/* Reserved, but no reserved purpose */
$c===0x28 /* ( */ ||
$c===0x29 /* ) */
) {
$newStr.=$pathSegment[$i];
} else {
$newStr.='%' . str_pad(dechex($c), 2, '0', STR_PAD_LEFT);
}
for( $i=0; isset($pathSegment[$i]); ++$i ) {
if( strpos($valid_chars,($c=$pathSegment[$i]))===false ) $newStr .= '%'.sprintf('%02x',ord($c));
else $newStr .= $c;
}
return $newStr;
}
/**
@ -103,6 +86,7 @@ class Sabre_DAV_URLUtil {
case 'ISO-8859-1' :
$path = utf8_encode($path);
}
return $path;

View File

@ -14,11 +14,11 @@ class Sabre_DAV_Version {
/**
* Full version number
*/
const VERSION = '1.5.0';
const VERSION = '1.5.3';
/**
* Stability : alpha, beta, stable
*/
const STABILITY = 'alpha';
const STABILITY = 'stable';
}

View File

@ -68,12 +68,19 @@ class Sabre_DAVACL_Principal extends Sabre_DAV_Node implements Sabre_DAVACL_IPri
*/
public function getAlternateUriSet() {
if (isset($this->principalProperties['{http://sabredav.org/ns}email-address'])) {
return array('mailto:' . $this->principalProperties['{http://sabredav.org/ns}email-address']);
} else {
return array();
$uris = array();
if (isset($this->principalProperties['{DAV:}alternate-URI-set'])) {
$uris = $this->principalProperties['{DAV:}alternate-URI-set'];
}
if (isset($this->principalProperties['{http://sabredav.org/ns}email-address'])) {
$uris[] = 'mailto:' . $this->principalProperties['{http://sabredav.org/ns}email-address'];
}
return array_unique($uris);
}
/**

View File

@ -14,7 +14,7 @@ class Sabre_DAVACL_Version {
/**
* Full version number
*/
const VERSION = '1.4.4';
const VERSION = '1.5.2';
/**
* Stability : alpha, beta, stable

View File

@ -23,7 +23,7 @@ class Sabre_HTTP_Response {
100 => 'Continue',
101 => 'Switching Protocols',
102 => 'Processing',
200 => 'Ok',
200 => 'OK',
201 => 'Created',
202 => 'Accepted',
203 => 'Non-Authorative Information',

View File

@ -14,7 +14,7 @@ class Sabre_HTTP_Version {
/**
* Full version number
*/
const VERSION = '1.4.1';
const VERSION = '1.5.3';
/**
* Stability : alpha, beta, stable

View File

@ -70,20 +70,20 @@ class Sabre_VObject_Element_DateTime extends Sabre_VObject_Property {
$this->setValue($dt->format('Ymd\\THis'));
$this->offsetUnset('VALUE');
$this->offsetUnset('TZID');
$this->offsetSet('VALUE','DATETIME');
$this->offsetSet('VALUE','DATE-TIME');
break;
case self::UTC :
$dt->setTimeZone(new DateTimeZone('UTC'));
$this->setValue($dt->format('Ymd\\THis\\Z'));
$this->offsetUnset('VALUE');
$this->offsetUnset('TZID');
$this->offsetSet('VALUE','DATETIME');
$this->offsetSet('VALUE','DATE-TIME');
break;
case self::LOCALTZ :
$this->setValue($dt->format('Ymd\\THis'));
$this->offsetUnset('VALUE');
$this->offsetUnset('TZID');
$this->offsetSet('VALUE','DATETIME');
$this->offsetSet('VALUE','DATE-TIME');
$this->offsetSet('TZID', $dt->getTimeZone()->getName());
break;
case self::DATE :

View File

@ -60,7 +60,7 @@ class Sabre_VObject_Element_MultiDateTime extends Sabre_VObject_Property {
$val[] = $i->format('Ymd\\THis');
}
$this->setValue(implode(',',$val));
$this->offsetSet('VALUE','DATETIME');
$this->offsetSet('VALUE','DATE-TIME');
break;
case Sabre_VObject_Element_DateTime::UTC :
$val = array();
@ -69,7 +69,7 @@ class Sabre_VObject_Element_MultiDateTime extends Sabre_VObject_Property {
$val[] = $i->format('Ymd\\THis\\Z');
}
$this->setValue(implode(',',$val));
$this->offsetSet('VALUE','DATETIME');
$this->offsetSet('VALUE','DATE-TIME');
break;
case Sabre_VObject_Element_DateTime::LOCALTZ :
$val = array();
@ -77,7 +77,7 @@ class Sabre_VObject_Element_MultiDateTime extends Sabre_VObject_Property {
$val[] = $i->format('Ymd\\THis');
}
$this->setValue(implode(',',$val));
$this->offsetSet('VALUE','DATETIME');
$this->offsetSet('VALUE','DATE-TIME');
$this->offsetSet('TZID', $dt[0]->getTimeZone()->getName());
break;
case Sabre_VObject_Element_DateTime::DATE :

View File

@ -128,6 +128,44 @@ class Sabre_VObject_Property extends Sabre_VObject_Element {
}
/**
* Adds a new componenten or element
*
* You can call this method with the following syntaxes:
*
* add(Sabre_VObject_Parameter $element)
* add(string $name, $value)
*
* The first version adds an Parameter
* The second adds a property as a string.
*
* @param mixed $item
* @param mixed $itemValue
* @return void
*/
public function add($item, $itemValue = null) {
if ($item instanceof Sabre_VObject_Parameter) {
if (!is_null($itemValue)) {
throw new InvalidArgumentException('The second argument must not be specified, when passing a VObject');
}
$this->parameters[] = $item;
} elseif(is_string($item)) {
if (!is_scalar($itemValue)) {
throw new InvalidArgumentException('The second argument must be scalar');
}
$this->parameters[] = new Sabre_VObject_Parameter($item,$itemValue);
} else {
throw new InvalidArgumentException('The first argument must either be a Sabre_VObject_Element or a string');
}
}
/* ArrayAccess interface {{{ */
/**

View File

@ -42,16 +42,10 @@ class Sabre_VObject_Reader {
*/
static function read($data) {
// Detecting line endings
if (strpos($data,"\r\n")!==false) {
$newLine = "\r\n";
} elseif (strpos($data,"\r")) {
$newLine = "\r";
} else {
$newLine = "\n";
}
// Normalizing newlines
$data = str_replace(array("\r","\n\n"), array("\n","\n"), $data);
$lines = explode($newLine, $data);
$lines = explode("\n", $data);
// Unfolding lines
$lines2 = array();

View File

@ -14,7 +14,7 @@ class Sabre_VObject_Version {
/**
* Full version number
*/
const VERSION = '1.2.0';
const VERSION = '1.2.2';
/**
* Stability : alpha, beta, stable

View File

@ -1365,7 +1365,7 @@ class XML_RPC_Message extends XML_RPC_Base
!preg_match('@^HTTP/[0-9\.]+ 10[0-9]([A-Za-z ]+)?[\r\n]+HTTP/[0-9\.]+ 200@', $data))
{
$errstr = substr($data, 0, strpos($data, "\n") - 1);
error_log('HTTP error, got response: ' . $errstr);
if(defined("DEBUG") && DEBUG) {error_log('HTTP error, got response: ' . $errstr);}
$r = new XML_RPC_Response(0, $XML_RPC_err['http_error'],
$XML_RPC_str['http_error'] . ' (' .
$errstr . ')');
@ -1396,7 +1396,7 @@ class XML_RPC_Message extends XML_RPC_Base
xml_error_string(xml_get_error_code($parser_resource)),
xml_get_current_line_number($parser_resource));
}
error_log($errstr);
if(defined("DEBUG") && DEBUG) {error_log($errstr);}
$r = new XML_RPC_Response(0, $XML_RPC_err['invalid_return'],
$XML_RPC_str['invalid_return']);
xml_parser_free($parser_resource);

View File

@ -10,6 +10,7 @@ select.chzn-select {
display: inline-block;
zoom: 1;
*display: inline;
vertical-align: bottom;
}
.chzn-container .chzn-drop {
background: #fff;

View File

@ -2,7 +2,12 @@ Files in ownCloud are licensed under the Affero General Public License version 3
the text of which can be found in COPYING-AGPL, or any later version of the AGPL,
unless otherwise noted.
Components of ownCloud, including jQuery, are licensed under the MIT/X11 license.
Components of ownCloud:
* jQuery is dual licensed under MIT and GPL
* HTTP is three clause BSD license
* MDB2 uses a custom license in the BSD style
* User is AGPL
* XML/RPC is both MIT and PHP license
All unmodified files from these and other sources retain their original copyright
and license notices: see the relevant individual files.

2
README
View File

@ -4,7 +4,7 @@ It is alpha software in development and should be treated accordingly.
http://ownCloud.org
Installation instructions: http://owncloud.org/index.php/Installation
Installation instructions: http://owncloud.org/install
Source code: http://gitorious.org/owncloud
Mailing list: http://mail.kde.org/mailman/listinfo/owncloud

View File

@ -0,0 +1,33 @@
<?php
/**
* ownCloud - user_ldap
*
* @author Dominik Schmidt
* @copyright 2011 Dominik Schmidt dev@dominik-schmidt.de
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
OC_APP::registerAdmin('admin_export','settings');
// add settings page to navigation
$entry = array(
'id' => "admin_export_settings",
'order'=>1,
'href' => OC_Helper::linkTo( "admin_export", "settings.php" ),
'name' => 'Export'
);

View File

@ -0,0 +1,10 @@
<?xml version="1.0"?>
<info>
<id>admin_export</id>
<name>Import/Export</name>
<description>Import/Export your owncloud data</description>
<version>0.1</version>
<licence>AGPL</licence>
<author>Thomas Schmidt</author>
<require>2</require>
</info>

View File

@ -0,0 +1,96 @@
<?php
/**
* ownCloud - admin export
*
* @author Thomas Schmidt
* @copyright 2011 Thomas Schmidt tom@opensuse.org
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
OC_Util::checkAdminUser();
OC_Util::checkAppEnabled('admin_export');
if (isset($_POST['admin_export'])) {
$root = OC::$SERVERROOT . "/";
$zip = new ZipArchive();
$filename = sys_get_temp_dir() . "/owncloud_export_" . date("y-m-d_H-i-s") . ".zip";
error_log("Creating export file at: " . $filename);
if ($zip->open($filename, ZIPARCHIVE::CREATE) !== TRUE) {
exit("Cannot open <$filename>\n");
}
if (isset($_POST['owncloud_system'])) {
// adding owncloud system files
error_log("Adding owncloud system files to export");
zipAddDir($root, $zip, false);
foreach (array(".git", "3rdparty", "apps", "core", "files", "l10n", "lib", "ocs", "search", "settings", "tests") as $dirname) {
zipAddDir($root . $dirname, $zip, true, basename($root) . "/");
}
}
if (isset($_POST['owncloud_config'])) {
// adding owncloud config
// todo: add database export
error_log("Adding owncloud config to export");
zipAddDir($root . "config/", $zip, true, basename($root) . "/");
$zip->addFile($root . '/data/.htaccess', basename($root) . "/data/owncloud.db");
}
if (isset($_POST['user_files'])) {
// adding user files
$zip->addFile($root . '/data/.htaccess', basename($root) . "/data/.htaccess");
$zip->addFile($root . '/data/index.html', basename($root) . "/data/index.html");
foreach (OC_User::getUsers() as $i) {
error_log("Adding owncloud user files of $i to export");
zipAddDir($root . "data/" . $i, $zip, true, basename($root) . "/data/");
}
}
$zip->close();
header("Content-Type: application/zip");
header("Content-Disposition: attachment; filename=" . basename($filename));
header("Content-Length: " . filesize($filename));
ob_end_clean();
readfile($filename);
unlink($filename);
} else {
// fill template
$tmpl = new OC_Template('admin_export', 'settings');
return $tmpl->fetchPage();
}
function zipAddDir($dir, $zip, $recursive=true, $internalDir='') {
$dirname = basename($dir);
$zip->addEmptyDir($internalDir . $dirname);
$internalDir.=$dirname.='/';
if ($dirhandle = opendir($dir)) {
while (false !== ( $file = readdir($dirhandle))) {
if (( $file != '.' ) && ( $file != '..' )) {
if (is_dir($dir . '/' . $file) && $recursive) {
zipAddDir($dir . '/' . $file, $zip, $recursive, $internalDir);
} elseif (is_file($dir . '/' . $file)) {
$zip->addFile($dir . '/' . $file, $internalDir . $file);
}
}
}
closedir($dirhandle);
} else {
error_log("Was not able to open directory: " . $dir);
}
}

View File

@ -0,0 +1,13 @@
<form id="export" action="#" method="post">
<fieldset class="personalblock">
<legend><strong><?php echo $l->t('Export this ownCloud instance');?></strong></legend>
<p><?php echo $l->t('This will create a compressed file that contains the data of this owncloud instance.
Please choose which components should be included:');?>
</p>
<p><input type="checkbox" id="user_files" name="user_files" value="true"><label for="user_files"><?php echo $l->t('User files');?></label><br/>
<input type="checkbox" id="owncloud_system" name="owncloud_system" value="true"><label for="owncloud_system"><?php echo $l->t('ownCloud system files');?></label><br/>
<input type="checkbox" id="owncloud_config" name="owncloud_config" value="true"><label for="owncloud_config"><?php echo $l->t('ownCloud configuration');?></label>
</p>
<input type="submit" name="admin_export" value="Export" />
</fieldset>
</form>

View File

@ -24,10 +24,8 @@
require_once('../../lib/base.php');
// Check if we are a user
if( !OC_User::isLoggedIn()){
header( 'Location: '.OC_Helper::linkTo( '', 'index.php' ));
exit();
}
OC_Util::checkLoggedIn();
OC_Util::checkAppEnabled('bookmarks');
require_once('bookmarksHelper.php');
@ -45,4 +43,4 @@ $tmpl->assign('URL', htmlentities($metadata['url']));
$tmpl->assign('TITLE', htmlentities($metadata['title']));
$tmpl->assign('DESCRIPTION', htmlentities($metadata['description']));
$tmpl->printPage();
$tmpl->printPage();

View File

@ -26,14 +26,9 @@ $RUNTIME_NOSETUPFS=true;
require_once('../../../lib/base.php');
// We send json data
header( "Content-Type: application/jsonrequest" );
// Check if we are a user
if( !OC_User::isLoggedIn()){
echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" )));
exit();
}
OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('bookmarks');
$CONFIG_DBTYPE = OC_Config::getValue( "dbtype", "sqlite" );
if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){
@ -76,6 +71,6 @@ if($b_id !== false) {
$query->execute($params);
}
echo json_encode( array( 'status' => 'success', 'data' => $b_id));
OC_JSON::success(array('data' => $b_id));
}

View File

@ -26,14 +26,9 @@ $RUNTIME_NOSETUPFS=true;
require_once('../../../lib/base.php');
// We send json data
header( "Content-Type: application/jsonrequest" );
// Check if we are a user
if( !OC_User::isLoggedIn()){
echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" )));
exit();
}
OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('bookmarks');
$params=array(
htmlspecialchars_decode($_GET["url"]),
@ -64,4 +59,4 @@ $query = OC_DB::prepare("
$result = $query->execute();
// var_dump($params);
echo json_encode( array( "status" => "success", "data" => array()));
OC_JSON::success(array('data' => array()));

View File

@ -26,14 +26,9 @@ $RUNTIME_NOSETUPFS=true;
require_once('../../../lib/base.php');
// We send json data
header( 'Content-Type: application/jsonrequest' );
// Check if we are a user
if( !OC_User::isLoggedIn()){
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => 'Authentication error' )));
exit();
}
OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('bookmarks');
$CONFIG_DBTYPE = OC_Config::getValue( "dbtype", "sqlite" );
if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){

View File

@ -26,14 +26,9 @@ $RUNTIME_NOSETUPFS=true;
require_once('../../../lib/base.php');
// We send json data
header( 'Content-Type: application/jsonrequest' );
// Check if we are a user
if( !OC_User::isLoggedIn()){
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => 'Authentication error' )));
exit();
}
OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('bookmarks');
// $metadata = array();
@ -41,4 +36,4 @@ require '../bookmarksHelper.php';
$metadata = getURLMetadata(htmlspecialchars_decode($_GET["url"]));
echo json_encode( array( 'status' => 'success', 'data' => $metadata));
OC_JSON::success(array('data' => $metadata));

View File

@ -27,11 +27,8 @@ $RUNTIME_NOSETUPFS=true;
require_once('../../../lib/base.php');
// Check if we are a user
if( !OC_User::isLoggedIn()){
header( "Content-Type: application/jsonrequest" );
echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" )));
exit();
}
OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('bookmarks');
$query = OC_DB::prepare("
UPDATE *PREFIX*bookmarks

View File

@ -26,14 +26,9 @@ $RUNTIME_NOSETUPFS=true;
require_once('../../../lib/base.php');
// We send json data
header( 'Content-Type: application/jsonrequest' );
// Check if we are a user
if( !OC_User::isLoggedIn()){
echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => 'Authentication error' )));
exit();
}
OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('bookmarks');
$params=array(OC_User::getUser());
$CONFIG_DBTYPE = OC_Config::getValue( 'dbtype', 'sqlite' );
@ -70,7 +65,8 @@ $query = OC_DB::prepare('
ELSE \' \'
END
AS tags
FROM *PREFIX*bookmarks, *PREFIX*bookmarks_tags
FROM *PREFIX*bookmarks
LEFT JOIN *PREFIX*bookmarks_tags ON 1=1
WHERE (*PREFIX*bookmarks.id = *PREFIX*bookmarks_tags.bookmark_id
OR *PREFIX*bookmarks.id NOT IN (
SELECT *PREFIX*bookmarks_tags.bookmark_id FROM *PREFIX*bookmarks_tags
@ -84,4 +80,4 @@ $query = OC_DB::prepare('
$bookmarks = $query->execute($params)->fetchAll();
echo json_encode( array( 'status' => 'success', 'data' => $bookmarks));
OC_JSON::success(array('data' => $bookmarks));

View File

@ -9,7 +9,12 @@ function getURLMetadata($url) {
}
$metadata['url'] = $url;
$page = file_get_contents($url);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$page = curl_exec($ch);
curl_close($ch);
@preg_match( "/<title>(.*)<\/title>/si", $page, $match );
$metadata['title'] = htmlspecialchars_decode(@$match[1]);

View File

@ -24,10 +24,8 @@
require_once('../../lib/base.php');
// Check if we are a user
if( !OC_User::isLoggedIn()){
header( "Location: ".OC_Helper::linkTo( '', 'index.php' ));
exit();
}
OC_Util::checkLoggedIn();
OC_Util::checkAppEnabled('bookmarks');
OC_App::setActiveNavigationEntry( 'bookmarks_index' );
@ -36,4 +34,4 @@ OC_Util::addStyle('bookmarks', 'bookmarks');
$tmpl = new OC_Template( 'bookmarks', 'list', 'user' );
$tmpl->printPage();
$tmpl->printPage();

View File

@ -1,8 +1,8 @@
<div class="bookmarks_addBm">
<p><label class="bookmarks_label">Address</label><input type="text" id="bookmark_add_url" class="bookmarks_input" value="<? echo $_['URL']; ?>"/></p>
<p><label class="bookmarks_label">Title</label><input type="text" id="bookmark_add_title" class="bookmarks_input" value="<? echo $_['TITLE']; ?>" /></p>
<p><label class="bookmarks_label">Description</label><input type="text" id="bookmark_add_description" class="bookmarks_input" value="<? echo $_['DESCRIPTION']; ?>" /></p>
<p><label class="bookmarks_label">Tags</label><input type="text" id="bookmark_add_tags" class="bookmarks_input" /></p>
<p><label class="bookmarks_label"> </label><label class="bookmarks_hint">Hint: Use space to separate tags.</label></p>
<p><label class="bookmarks_label"></label><input type="submit" id="bookmark_add_submit" /></p>
</div>
<p><label class="bookmarks_label"><?php echo $l->t('Address'); ?></label><input type="text" id="bookmark_add_url" class="bookmarks_input" value="<?php echo $_['URL']; ?>"/></p>
<p><label class="bookmarks_label"><?php echo $l->t('Title'); ?></label><input type="text" id="bookmark_add_title" class="bookmarks_input" value="<?php echo $_['TITLE']; ?>" /></p>
<p><label class="bookmarks_label"><?php echo $l->t('Description'); ?></label><input type="text" id="bookmark_add_description" class="bookmarks_input" value="<?php echo $_['DESCRIPTION']; ?>" /></p>
<p><label class="bookmarks_label"><?php echo $l->t('Tags'); ?></label><input type="text" id="bookmark_add_tags" class="bookmarks_input" /></p>
<p><label class="bookmarks_label"> </label><label class="bookmarks_hint"><?php echo $l->t('Hint: Use space to separate tags.'); ?></label></p>
<p><label class="bookmarks_label"></label><input type="submit" value="<?php echo $l->t('Add bookmark'); ?>" id="bookmark_add_submit" /></p>
</div>

View File

@ -1,30 +1,27 @@
<input type="hidden" id="bookmarkFilterTag" value="<?php if(isset($_GET['tag'])) echo htmlentities($_GET['tag']); ?>" />
<h2 class="bookmarks_headline"><?php echo isset($_GET["tag"]) ? 'Bookmarks with tag: ' . urldecode($_GET["tag"]) : 'All bookmarks'; ?></h2>
<h2 class="bookmarks_headline"><?php echo isset($_GET["tag"]) ? $l->t('Bookmarks with tag: ') . urldecode($_GET["tag"]) : $l->t('All bookmarks'); ?></h2>
<div class="bookmarks_menu">
<input type="button" class="bookmarks_addBtn" value="Add Bookmark"/>&nbsp;
<a class="bookmarks_addBml" href="javascript:var url = encodeURIComponent(location.href);window.open('<?php echo OC_Helper::linkTo('bookmarks', 'addBm.php', null, true); ?>?url='+url, 'owncloud-bookmarks');" title="Drag this to your browser bookmarks and click it, when you want to bookmark a webpage.">Add page to ownCloud</a>
<input type="button" class="bookmarks_addBtn" value="<?php echo $l->t('Add bookmark'); ?>"/>&nbsp;
<a class="bookmarks_addBml" href="javascript:var url = encodeURIComponent(location.href);window.open('<?php echo OC_Helper::linkTo('bookmarks', 'addBm.php', null, true); ?>?url='+url, 'owncloud-bookmarks');" title="<?php echo $l->t('Drag this to your browser bookmarks and click it, when you want to bookmark a webpage.'); ?>"><?php echo $l->t('Add page to ownCloud'); ?></a>
</div>
<div class="bookmarks_add">
<input type="hidden" id="bookmark_add_id" value="0" />
<p><label class="bookmarks_label">Address</label><input type="text" id="bookmark_add_url" class="bookmarks_input" /></p>
<p><label class="bookmarks_label">Title</label><input type="text" id="bookmark_add_title" class="bookmarks_input" />
<p><label class="bookmarks_label"><?php echo $l->t('Address'); ?></label><input type="text" id="bookmark_add_url" class="bookmarks_input" /></p>
<p><label class="bookmarks_label"><?php echo $l->t('Title'); ?></label><input type="text" id="bookmark_add_title" class="bookmarks_input" />
<img class="loading_meta" src="<?php echo OC_Helper::imagePath('core', 'loading.gif'); ?>" /></p>
<p><label class="bookmarks_label">Description</label><input type="text" id="bookmark_add_description" class="bookmarks_input" />
<p><label class="bookmarks_label"><?php echo $l->t('Description'); ?></label><input type="text" id="bookmark_add_description" class="bookmarks_input" />
<img class="loading_meta" src="<?php echo OC_Helper::imagePath('core', 'loading.gif'); ?>" /></p>
<p><label class="bookmarks_label">Tags</label><input type="text" id="bookmark_add_tags" class="bookmarks_input" /></p>
<p><label class="bookmarks_label"> </label><label class="bookmarks_hint">Hint: Use space to separate tags.</label></p>
<p><label class="bookmarks_label"></label><input type="submit" id="bookmark_add_submit" /></p>
<p><label class="bookmarks_label"><?php echo $l->t('Tags'); ?></label><input type="text" id="bookmark_add_tags" class="bookmarks_input" /></p>
<p><label class="bookmarks_label"> </label><label class="bookmarks_hint"><?php echo $l->t('Hint: Use space to separate tags.'); ?></label></p>
<p><label class="bookmarks_label"></label><input type="submit" value="<?php echo $l->t('Add bookmark'); ?>" id="bookmark_add_submit" /></p>
</div>
<div class="bookmarks_sorting pager">
<ul>
<li class="bookmarks_sorting_recent">Recent Bookmarks</li>
<li class="bookmarks_sorting_clicks">Most clicks</li>
<li class="bookmarks_sorting_recent"><?php echo $l->t('Recent Bookmarks'); ?></li>
<li class="bookmarks_sorting_clicks"><?php echo $l->t('Most clicks'); ?></li>
</ul>
</div>
<div class="clear"></div>
<div class="bookmarks_list">
<noscript>
JavaScript is needed to display your Bookmarks
</noscript>
You have no bookmarks
<?php echo $l->t('You have no bookmarks'); ?>
</div>

View File

@ -1,21 +1,16 @@
<?php
/*************************************************
* ownCloud - Calendar Plugin *
* *
* (c) Copyright 2011 Bart Visscher *
* License: GNU AFFERO GENERAL PUBLIC LICENSE *
* *
* If you are not able to view the License, *
* <http://www.gnu.org/licenses/> *
* please write to the Free Software Foundation. *
* Address: *
* 59 Temple Place, Suite 330, Boston, *
* MA 02111-1307 USA *
*************************************************/
/**
* Copyright (c) 2011 Bart Visscher <bartv@thisnet.nl>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
require_once ("../../../lib/base.php");
if(!OC_USER::isLoggedIn()) {
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
}
OC_JSON::checkAppEnabled('calendar');
$calendarid = $_POST['calendarid'];
OC_Calendar_Calendar::setCalendarActive($calendarid, $_POST['active']);
$cal = OC_Calendar_Calendar::findCalendar($calendarid);

View File

@ -1,26 +1,16 @@
<?php
/*************************************************
* ownCloud - Calendar Plugin *
* *
* (c) Copyright 2011 Georg Ehrke *
* author: Georg Ehrke *
* email: ownclouddev at georgswebsite dot de *
* homepage: ownclouddev.georgswebsite.de *
* manual: ownclouddev.georgswebsite.de/manual *
* License: GNU AFFERO GENERAL PUBLIC LICENSE *
* *
* If you are not able to view the License, *
* <http://www.gnu.org/licenses/> *
* <http://ownclouddev.georgswebsite.de/license/> *
* please write to the Free Software Foundation. *
* Address: *
* 59 Temple Place, Suite 330, Boston, *
* MA 02111-1307 USA *
*************************************************/
/**
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
require_once ("../../../lib/base.php");
if(!OC_USER::isLoggedIn()) {
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
}
OC_JSON::checkAppEnabled('calendar');
$currentview = $_GET["v"];
OC_Preferences::setValue(OC_USER::getUser(), "calendar", "currentview", $currentview);
?>
?>

View File

@ -1,27 +1,17 @@
<?php
/*************************************************
* ownCloud - Calendar Plugin *
* *
* (c) Copyright 2011 Georg Ehrke *
* author: Georg Ehrke *
* email: ownclouddev at georgswebsite dot de *
* homepage: ownclouddev.georgswebsite.de *
* manual: ownclouddev.georgswebsite.de/manual *
* License: GNU AFFERO GENERAL PUBLIC LICENSE *
* *
* If you are not able to view the License, *
* <http://www.gnu.org/licenses/> *
* <http://ownclouddev.georgswebsite.de/license/> *
* please write to the Free Software Foundation. *
* Address: *
* 59 Temple Place, Suite 330, Boston, *
* MA 02111-1307 USA *
*************************************************/
/**
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
require_once('../../../lib/base.php');
$l10n = new OC_L10N('calendar');
if(!OC_USER::isLoggedIn()) {
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
}
OC_JSON::checkAppEnabled('calendar');
$output = new OC_TEMPLATE("calendar", "part.choosecalendar");
$output -> printpage();
?>
?>

View File

@ -1,29 +1,18 @@
<?php
/*************************************************
* ownCloud - Calendar Plugin *
* *
* (c) Copyright 2011 Bart Visscher *
* License: GNU AFFERO GENERAL PUBLIC LICENSE *
* *
* If you are not able to view the License, *
* <http://www.gnu.org/licenses/> *
* please write to the Free Software Foundation. *
* Address: *
* 59 Temple Place, Suite 330, Boston, *
* MA 02111-1307 USA *
*************************************************/
/**
* Copyright (c) 2011 Bart Visscher <bartv@thisnet.nl>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
require_once('../../../lib/base.php');
$l10n = new OC_L10N('calendar');
// We send json data
header( "Content-Type: application/jsonrequest" );
// Check if we are a user
if( !OC_User::isLoggedIn()){
echo json_encode( array( "status" => "error", "data" => array( "message" => $l->t("Authentication error") )));
exit();
}
OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('calendar');
$userid = OC_User::getUser();
$calendarid = OC_Calendar_Calendar::addCalendar($userid, $_POST['name'], $_POST['description'], 'VEVENT,VTODO,VJOURNAL', null, 0, $_POST['color']);
@ -31,4 +20,4 @@ OC_Calendar_Calendar::setCalendarActive($calendarid, 1);
$calendar = OC_Calendar_Calendar::findCalendar($calendarid);
$tmpl = new OC_Template('calendar', 'part.choosecalendar.rowfields');
$tmpl->assign('calendar', $calendar);
echo json_encode( array( "status" => "error", "data" => $tmpl->fetchPage().'' ));
OC_JSON::success(array('data' => $tmpl->fetchPage()));

View File

@ -0,0 +1,11 @@
<?php
/**
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
require_once('../../../lib/base.php');
OC_JSON::checkLoggedIn();
echo OC_Preferences::getValue( OC_User::getUser(), 'calendar', 'weekend', '{"Monday":"false","Tuesday":"false","Wednesday":"false","Thursday":"false","Friday":"false","Saturday":"true","Sunday":"true"}');
?>

View File

@ -0,0 +1,29 @@
<?php
/**
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
require_once('../../../lib/base.php');
$l10n = new OC_L10N('calendar');
if(!OC_USER::isLoggedIn()) {
die('<script type="text/javascript">document.location = oc_webroot;</script>');
}
OC_JSON::checkAppEnabled('calendar');
$cal = $_POST["calendarid"];
$calendar = OC_Calendar_Calendar::findCalendar($cal);
if($calendar["userid"] != OC_User::getUser()){
OC_JSON::error(array('error'=>'permission_denied'));
exit;
}
$del = OC_Calendar_Calendar::deleteCalendar($cal);
if($del == true){
OC_JSON::success();
}else{
OC_JSON::error(array('error'=>'dberror'));
}
?>

View File

@ -0,0 +1,31 @@
<?php
/**
* Copyright (c) 2011 Bart Visscher <bartv@thisnet.nl>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
require_once('../../../lib/base.php');
$l10n = new OC_L10N('calendar');
if(!OC_USER::isLoggedIn()) {
die('<script type="text/javascript">document.location = oc_webroot;</script>');
}
OC_JSON::checkAppEnabled('calendar');
$id = $_POST['id'];
$data = OC_Calendar_Object::find($id);
if (!$data)
{
OC_JSON::error();
exit;
}
$calendar = OC_Calendar_Calendar::findCalendar($data['calendarid']);
if($calendar['userid'] != OC_User::getUser()){
OC_JSON::error();
exit;
}
$result = OC_Calendar_Object::delete($id);
OC_JSON::success();
?>

View File

@ -0,0 +1,12 @@
<?php
/**
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
require_once('../../../lib/base.php');
OC_JSON::checkLoggedIn();
$duration = OC_Preferences::getValue( OC_User::getUser(), 'calendar', 'duration', "60");
OC_JSON::encodedPrint(array("duration" => $duration));
?>

View File

@ -1,25 +1,31 @@
<?php
/*************************************************
* ownCloud - Calendar Plugin *
* *
* (c) Copyright 2011 Bart Visscher *
* License: GNU AFFERO GENERAL PUBLIC LICENSE *
* *
* If you are not able to view the License, *
* <http://www.gnu.org/licenses/> *
* please write to the Free Software Foundation. *
* Address: *
* 59 Temple Place, Suite 330, Boston, *
* MA 02111-1307 USA *
*************************************************/
/**
* Copyright (c) 2011 Bart Visscher <bartv@thisnet.nl>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
require_once('../../../lib/base.php');
$l10n = new OC_L10N('calendar');
if(!OC_USER::isLoggedIn()) {
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
}
$calendarcolor_options = array(
'ff0000', // "Red"
'00ff00', // "Green"
'ffff00', // "Yellow"
'808000', // "Olive"
'ffa500', // "Orange"
'ff7f50', // "Coral"
'ee82ee', // "Violet"
'ecc255', // dark yellow
);
OC_JSON::checkAppEnabled('calendar');
$calendar = OC_Calendar_Calendar::findCalendar($_GET['calendarid']);
$tmpl = new OC_Template("calendar", "part.editcalendar");
$tmpl->assign('new', false);
$tmpl->assign('calendarcolor_options', $calendarcolor_options);
$tmpl->assign('calendar', $calendar);
$tmpl->printPage();
?>

View File

@ -1,18 +1,11 @@
<?php
/*************************************************
* ownCloud - Calendar Plugin *
* *
* (c) Copyright 2011 Bart Visscher *
* License: GNU AFFERO GENERAL PUBLIC LICENSE *
* *
* <http://www.gnu.org/licenses/> *
* If you are not able to view the License, *
* <http://www.gnu.org/licenses/> *
* please write to the Free Software Foundation. *
* Address: *
* 59 Temple Place, Suite 330, Boston, *
* MA 02111-1307 USA *
*************************************************/
/**
* Copyright (c) 2011 Bart Visscher <bartv@thisnet.nl>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
require_once('../../../lib/base.php');
$l10n = new OC_L10N('calendar');
@ -20,12 +13,12 @@ $l10n = new OC_L10N('calendar');
if(!OC_USER::isLoggedIn()) {
die('<script type="text/javascript">document.location = oc_webroot;</script>');
}
OC_JSON::checkAppEnabled('calendar');
$errarr = OC_Calendar_Object::validateRequest($_POST);
if($errarr){
//show validate errors
$errarr['status'] = 'error';
echo json_encode($errarr);
OC_JSON::error($errarr);
exit;
}else{
$id = $_POST['id'];
@ -33,12 +26,12 @@ if($errarr){
$data = OC_Calendar_Object::find($id);
if (!$data)
{
echo json_encode(array("error"=>"true"));
OC_JSON::error();
exit;
}
$calendar = OC_Calendar_Calendar::findCalendar($data['calendarid']);
if($calendar['userid'] != OC_User::getUser()){
echo json_encode(array("error"=>"true"));
OC_JSON::error();
exit;
}
$vcalendar = Sabre_VObject_Reader::read($data['calendardata']);
@ -47,6 +40,6 @@ if($errarr){
if ($data['calendarid'] != $cal) {
OC_Calendar_Object::moveToCalendar($id, $cal);
}
echo json_encode(array('status' => 'success'));
OC_JSON::success();
}
?>
?>

View File

@ -1,17 +1,11 @@
<?php
/*************************************************
* ownCloud - Calendar Plugin *
* *
* (c) Copyright 2011 Bart Visscher *
* License: GNU AFFERO GENERAL PUBLIC LICENSE *
* *
* If you are not able to view the License, *
* <http://www.gnu.org/licenses/> *
* please write to the Free Software Foundation. *
* Address: *
* 59 Temple Place, Suite 330, Boston, *
* MA 02111-1307 USA *
*************************************************/
/**
* Copyright (c) 2011 Bart Visscher <bartv@thisnet.nl>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
require_once('../../../lib/base.php');
$l10n = new OC_L10N('calendar');
@ -19,9 +13,10 @@ $l10n = new OC_L10N('calendar');
if(!OC_USER::isLoggedIn()) {
die('<script type="text/javascript">document.location = oc_webroot;</script>');
}
OC_JSON::checkAppEnabled('calendar');
$calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser());
$categories = OC_Calendar_Object::getCategoryOptions($l10n);
$calendar_options = OC_Calendar_Calendar::allCalendars(OC_User::getUser());
$category_options = OC_Calendar_Object::getCategoryOptions($l10n);
$repeat_options = OC_Calendar_Object::getRepeatOptions($l10n);
$id = $_GET['id'];
@ -34,9 +29,10 @@ if($calendar['userid'] != OC_User::getUser()){
$object = Sabre_VObject_Reader::read($data['calendardata']);
$vevent = $object->VEVENT;
$dtstart = $vevent->DTSTART;
$dtend = $vevent->DTEND;
$dtend = OC_Calendar_Object::getDTEndFromVEvent($vevent);
switch($dtstart->getDateType()) {
case Sabre_VObject_Element_DateTime::LOCALTZ:
case Sabre_VObject_Element_DateTime::LOCAL:
$startdate = $dtstart->getDateTime()->format('d-m-Y');
$starttime = $dtstart->getDateTime()->format('H:i');
$enddate = $dtend->getDateTime()->format('d-m-Y');
@ -55,19 +51,28 @@ switch($dtstart->getDateType()) {
$summary = isset($vevent->SUMMARY) ? $vevent->SUMMARY->value : '';
$location = isset($vevent->LOCATION) ? $vevent->LOCATION->value : '';
$category = isset($vevent->CATEGORIES) ? $vevent->CATEGORIES->value : '';
$categories = array();
if (isset($vevent->CATEGORIES)){
$categories = explode(',', $vevent->CATEGORIES->value);
$categories = array_map('trim', $categories);
}
foreach($categories as $category){
if (!in_array($category, $category_options)){
array_unshift($category_options, $category);
}
}
$repeat = isset($vevent->CATEGORY) ? $vevent->CATEGORY->value : '';
$description = isset($vevent->DESCRIPTION) ? $vevent->DESCRIPTION->value : '';
$tmpl = new OC_Template('calendar', 'part.editevent');
$tmpl->assign('id', $id);
$tmpl->assign('calendars', $calendars);
$tmpl->assign('categories', $categories);
$tmpl->assign('calendar_options', $calendar_options);
$tmpl->assign('category_options', $category_options);
$tmpl->assign('repeat_options', $repeat_options);
$tmpl->assign('title', $summary);
$tmpl->assign('location', $location);
$tmpl->assign('category', $category);
$tmpl->assign('categories', $categories);
$tmpl->assign('calendar', $data['calendarid']);
$tmpl->assign('allday', $allday);
$tmpl->assign('startdate', $startdate);

View File

@ -0,0 +1,12 @@
<?php
/**
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
require_once('../../../lib/base.php');
OC_JSON::checkLoggedIn();
$firstdayofweek = OC_Preferences::getValue( OC_User::getUser(), 'calendar', 'firstdayofweek', "1");
OC_JSON::encodedPrint(array("firstdayofweek" => $firstdayofweek));
?>

View File

@ -1,26 +1,701 @@
<?php
/*************************************************
* ownCloud - Calendar Plugin *
* *
* (c) Copyright 2011 Georg Ehrke *
* author: Georg Ehrke *
* email: ownclouddev at georgswebsite dot de *
* homepage: ownclouddev.georgswebsite.de *
* manual: ownclouddev.georgswebsite.de/manual *
* License: GNU AFFERO GENERAL PUBLIC LICENSE *
* *
* If you are not able to view the License, *
* <http://www.gnu.org/licenses/> *
* <http://ownclouddev.georgswebsite.de/license/> *
* please write to the Free Software Foundation. *
* Address: *
* 59 Temple Place, Suite 330, Boston, *
* MA 02111-1307 USA *
*************************************************/
/**
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
require_once ("../../../lib/base.php");
if(!OC_USER::isLoggedIn()) {
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
}
$output = new OC_TEMPLATE("calendar", "part.getcal");
$output -> printpage();
?>
OC_JSON::checkAppEnabled('calendar');
$calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser(), 1);
$events = array();
$return = array('calendars'=>array());
foreach($calendars as $calendar) {
$tmp = OC_Calendar_Object::all($calendar['id']);
$events = array_merge($events, $tmp);
$return['calendars'][$calendar['id']] = array(
'displayname' => $calendar['displayname'],
'color' => '#'.$calendar['calendarcolor']
);
}
$select_year = $_GET["year"];
$user_timezone = OC_Preferences::getValue(OC_USER::getUser(), "calendar", "timezone", "Europe/London");
foreach($events as $event)
{
if($select_year != substr($event['startdate'], 0, 4) && $event["repeating"] == false)
continue;
if($select_year == substr($event['startdate'], 0, 4) && $event["repeating"] == false){
$object = Sabre_VObject_Reader::read($event['calendardata']);
$vevent = $object->VEVENT;
$dtstart = $vevent->DTSTART;
$dtend = OC_Calendar_Object::getDTEndFromVEvent($vevent);
$start_dt = $dtstart->getDateTime();
$start_dt->setTimezone(new DateTimeZone($user_timezone));
$end_dt = $dtend->getDateTime();
$end_dt->setTimezone(new DateTimeZone($user_timezone));
$year = $start_dt->format('Y');
$month = $start_dt->format('n') - 1; // return is 0 based
$day = $start_dt->format('j');
$hour = $start_dt->format('G');
if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
$hour = 'allday';
}
$return_event = array();
foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop)
{
$return_event[$prop] = $event[$prop];
}
$return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
$return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
$return_event['description'] = $event['summary'];
if ($hour == 'allday')
{
$return_event['allday'] = true;
}
if (isset($return[$year][$month][$day][$hour]))
{
$return[$year][$month][$day][$hour][] = $return_event;
}
else
{
$return[$year][$month][$day][$hour] = array(1 => $return_event);
}
}
if($event["repeating"] == 1){
$object = Sabre_VObject_Reader::read($event['calendardata']);
$vevent = $object->VEVENT;
//echo substr_count($event["calendardata"], "EXDATE");
$numofelements = substr_count($vevent->RRULE, ";");
$properties = array("FREQ"=>"false", "UNTIL"=>"false", "COUNT"=>"false", "INTERVAL"=>"false", "BYDAY"=>"false", "BYMONTHDAY"=>"false", "BYWEEKNO"=>"false", "BYMONTH"=>"false", "BYYEARDAY"=>"false", "BYSETPOS"=>"false");
$exruleproperties = array("FREQ"=>"false", "UNTIL"=>"false", "COUNT"=>"false", "INTERVAL"=>"false", "BYDAY"=>"false", "BYMONTHDAY"=>"false", "BYWEEKNO"=>"false", "BYMONTH"=>"false", "BYYEARDAY"=>"false", "BYSETPOS"=>"false");
$byday = array("MO"=>"false", "TU"=>"false", "WE"=>"false", "TH"=>"false", "FR"=>"false", "SA"=>"false", "SU"=>"false");
if($numofelements != 0){
$rrule = explode(";", $vevent->RRULE);
for($i = 0;$i <= $numofelements;$i++){
$rule = explode("=", $rrule[$i]);
$property = $rule[0];
$value = $rule[1];
$properties[$property] = $value;
}
if($properties["BYDAY"] != "false"){
$numofdays = substr_count($properties["BYDAY"], ",");
if($numofdays == 0){
if(strlen($properties["BYDAY"]) != 2){
$lenght = strlen($properties["BYDAY"]);
switch($lenght){
case "3":
$properties["BYSETPOS"] = substr($properties["BYDAY"],0,1);
$properties["BYDAY"] = substr($properties["BYDAY"],1,2);
break;
case "4":
$properties["BYSETPOS"] = substr($properties["BYDAY"],0,2);
$properties["BYDAY"] = substr($properties["BYDAY"],2,2);
break;
case "5":
$properties["BYSETPOS"] = substr($properties["BYDAY"],0,3);
$properties["BYDAY"] = substr($properties["BYDAY"],3,2);
break;
case "6":
$properties["BYSETPOS"] = substr($properties["BYDAY"],0,4);
$properties["BYDAY"] = substr($properties["BYDAY"],4,2);
break;
}
}
$byday[$properties["BYDAY"]] = true;
}else{
$days = explode(",", $properties["BYDAY"]);
for($i = 0;$i <= $numofdays;$i++){
$day = $days[$i];
$byday[$day] = true;
}
}
}
}else{
$rule = explode("=", $vevent->RRULE);
$properties[$rule[0]] = $rule[1];
}
if($properties["INTERVAL"] == "false"){
$properties["INTERVAL"] = 1;
}
$count = 0; //counts all loops
$countedoutputs = 0; //counts only the outputs
$countchecker = true;
$dtstart = $vevent->DTSTART;
$dtend = OC_Calendar_Object::getDTEndFromVEvent($vevent);
$start_dt = $dtstart->getDateTime();
$start_dt->setTimezone(new DateTimeZone($user_timezone));
$end_dt = $dtend->getDateTime();
$end_dt->setTimezone(new DateTimeZone($user_timezone));
$firststart_year = $start_dt->format('Y');
$firststart_month = $start_dt->format('n');
$firststart_day = $start_dt->format('j');
$hour = $start_dt->format('G');
$interval = 0;
if($properties["UNTIL"] != "false"){
$until = $properties["UNTIL"];
$until_year = substr($until, 0, 4);
$until_month = substr($until, 4, 2);
$until_day = substr($until, 6, 2);
}
//print_r($properties);
//print_r($byday);
if($properties["FREQ"] == "DAILY"){
if($properties["BYDAY"] == "false"){
$byday = array("MO"=>"1", "TU"=>"1", "WE"=>"1", "TH"=>"1", "FR"=>"1", "SA"=>"1", "SU"=>"1");
}
while(date("Y", mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year) + ($count * 1 * 86400 * $interval)) <= $select_year && $countchecker == true){
if($byday[strtoupper(substr(date("D", mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year) + ($count * 1 * 86400 * $interval)), 0, 2))] == "1"){
$newunixtime = mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year) + ($count * 1 * 86400 * $interval);
$year = date("Y", $newunixtime);
$month = date("n", $newunixtime) - 1; // return is 0 based
$day = date("j", $newunixtime);
if($properties["UNTIL"] != "false"){
if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){
break;
}
}
if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
$hour = 'allday';
}
$return_event = array();
foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){
$return_event[$prop] = $event[$prop];
}
$return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
$return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
$return_event['description'] = $event['summary'];
$interval = $properties["INTERVAL"];
$countedoutputs++;
if($properties["COUNT"] != "false"){
if($countedoutputs == $properties["COUNT"]){
$countchecker = false;
}
}
if ($hour == 'allday'){
$return_event['allday'] = true;
}
if (isset($return[$year][$month][$day][$hour])){
$return[$year][$month][$day][$hour][] = $return_event;
}else{
$return[$year][$month][$day][$hour] = array(1 => $return_event);
}
}
$count++;
}
}
if($properties["FREQ"] == "WEEKLY"){
if($properties["BYDAY"] == "false"){
$byday[strtoupper(substr(date("D", mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year)), 0, 2))] = "1";
}
while(date("Y", mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year) + ($count * 1 * 86400 * $interval)) <= $select_year && $countchecker == true){
if($byday[strtoupper(substr(date("D", mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year) + ($count * 1 * 86400 * $interval)), 0, 2))] == "1"){
$newunixtime = mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year) + ($count * 1 * 86400 * $interval);
$year = date("Y", $newunixtime);
$month = date("n", $newunixtime) - 1; // return is 0 based
$day = date("j", $newunixtime);
if($properties["UNTIL"] != "false"){
if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){
break;
}
}
if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
$hour = 'allday';
}
$return_event = array();
foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){
$return_event[$prop] = $event[$prop];
}
$return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
$return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
$return_event['description'] = $event['summary'];
$interval = $properties["INTERVAL"];
$countedoutputs++;
if($properties["COUNT"] != "false"){
if($countedoutputs == $properties["COUNT"]){
$countchecker = false;
}
}
if ($hour == 'allday'){
$return_event['allday'] = true;
}
if (isset($return[$year][$month][$day][$hour])){
$return[$year][$month][$day][$hour][] = $return_event;
}else{
$return[$year][$month][$day][$hour] = array(1 => $return_event);
}
}
$count++;
}
}
if($properties["FREQ"] == "MONTHLY"){
if(substr_count($properties["BYMONTHDAY"], ",") != 0){
$numofBYMONTHDAY = substr_count($properties["BYMONTHDAY"], ",");
if($numofBYMONTHDAY == 0){
$BYMONTHDAY = array();
$BYMONTHDAY[0] = $properties["BYMONTHDAY"];
}else{
$BYMONTHDAY = explode(",", $properties["BYMONTHDAY"]);
}
while(date("Y", mktime(0,0,0, $firststart_month + ($count * $interval), $properties["BYMONTHDAY"], $firststart_year)) <= $select_year && $countchecker == true){
for($i = 0;$i <= $numofBYMONTHDAY;$i++){
$newunixtime = mktime(0,0,0, $firststart_month + ($count * $interval), $BYMONTHDAY[$i], $firststart_year);
$year = date("Y", $newunixtime);
$month = date("n", $newunixtime) - 1; // return is 0 based
$day = date("j", $newunixtime);
if($properties["UNTIL"] != "false"){
if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){
break;
}
}
if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
$hour = 'allday';
}
$return_event = array();
foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){
$return_event[$prop] = $event[$prop];
}
$return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
$return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
$return_event['description'] = $event['summary'];
$interval = $properties["INTERVAL"];
$countedoutputs++;
if($properties["COUNT"] != "false"){
if($countedoutputs == $properties["COUNT"]){
$countchecker = false;
}
}
if ($hour == 'allday'){
$return_event['allday'] = true;
}
if (isset($return[$year][$month][$day][$hour])){
$return[$year][$month][$day][$hour][] = $return_event;
}else{
$return[$year][$month][$day][$hour] = array(1 => $return_event);
}
}
$count++;
}
}
//if($properties["BYMONTHDAY"] != "false"){
if($properties["BYSETPOS"] == "false"){
while(date("Y", mktime(0,0,0, $firststart_month + ($count * $interval), $properties["BYMONTHDAY"], $firststart_year)) <= $select_year && $countchecker == true){
$newunixtime = mktime(0,0,0, $firststart_month + ($count * $interval), $properties["BYMONTHDAY"], $firststart_year);
$year = date("Y", $newunixtime);
$month = date("n", $newunixtime) - 1; // return is 0 based
$day = date("j", $newunixtime);
if($properties["UNTIL"] != "false"){
if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){
break;
}
}
if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
$hour = 'allday';
}
$return_event = array();
foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){
$return_event[$prop] = $event[$prop];
}
$return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
$return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
$return_event['description'] = $event['summary'];
$interval = $properties["INTERVAL"];
$countedoutputs++;
if($properties["COUNT"] != "false"){
if($countedoutputs == $properties["COUNT"]){
$countchecker = false;
}
}
if ($hour == 'allday'){
$return_event['allday'] = true;
}
if (isset($return[$year][$month][$day][$hour])){
$return[$year][$month][$day][$hour][] = $return_event;
}else{
$return[$year][$month][$day][$hour] = array(1 => $return_event);
}
$count++;
}
}else{
if(!is_nan($properties["BYSETPOS"]) && $properties["BYSETPOS"] >= 1){
while(date("Y", mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year)) <= $select_year && $countchecker == true){
$lastdayofmonth = date("t", mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year));
$matches = 0;
$matchedday = "";
for($i = 1;$i <= $lastdayofmonth;$i++){
$thisday = date("j", mktime(0,0,0, $firststart_month + ($count * $interval), $i, $firststart_year));
$thisdayname = strtoupper(substr(date("D", mktime(0,0,0, $firststart_month + ($count * $interval), $i, $firststart_year)),0,2));
//echo $thisdayname . " " . $thisday . "\n";
if($byday[$thisdayname] == 1){
$matches++;
}
if($matches == $properties["BYSETPOS"]){
$matchedday = $thisday;
$i = 32;
}
}
$newunixtime = mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year);
$year = date("Y", $newunixtime);
$month = date("n", $newunixtime) - 1; // return is 0 based
$day = $matchedday;
if($properties["UNTIL"] != "false"){
if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){
break;
}
}
if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
$hour = 'allday';
}
$return_event = array();
foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){
$return_event[$prop] = $event[$prop];
}
$return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
$return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
$return_event['description'] = $event['summary'];
$interval = $properties["INTERVAL"];
$countedoutputs++;
if($properties["COUNT"] != "false"){
if($countedoutputs == $properties["COUNT"]){
$countchecker = false;
}
}
if ($hour == 'allday'){
$return_event['allday'] = true;
}
if (isset($return[$year][$month][$day][$hour])){
$return[$year][$month][$day][$hour][] = $return_event;
}else{
$return[$year][$month][$day][$hour] = array(1 => $return_event);
}
$count++;
}
}elseif(!is_nan($properties["BYSETPOS"]) && $properties["BYSETPOS"] <= -1){
while(date("Y", mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year)) <= $select_year && $countchecker == true){
$lastdayofmonth = date("t", mktime(0,0,0, $firststart_month + ($count * $interval), 1, $firststart_year));
$matches = 0;
$matchedday = "";
for($i = $lastdayofmonth;$i >= 1;$i--){
$thisday = date("j", mktime(0,0,0, $firststart_month + ($count * $interval), $i, $firststart_year));
$thisdayname = strtoupper(substr(date("D", mktime(0,0,0, $firststart_month + ($count * $interval), $i, $firststart_year)),0,2));
//echo $thisdayname . " " . $thisday . "\n";
if($byday[$thisdayname] == 1){
$matches++;
}
if($matches == $properties["BYSETPOS"]){
$matchedday = $thisday;
$i = 0;
}
}
$newunixtime = mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year);
$year = date("Y", $newunixtime);
$month = date("n", $newunixtime) - 1; // return is 0 based
$day = $matchedday;
if($properties["UNTIL"] != "false"){
if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){
break;
}
}
if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
$hour = 'allday';
}
$return_event = array();
foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){
$return_event[$prop] = $event[$prop];
}
$return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
$return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
$return_event['description'] = $event['summary'];
$interval = $properties["INTERVAL"];
$countedoutputs++;
if($properties["COUNT"] != "false"){
if($countedoutputs == $properties["COUNT"]){
$countchecker = false;
}
}
if ($hour == 'allday'){
$return_event['allday'] = true;
}
if (isset($return[$year][$month][$day][$hour])){
$return[$year][$month][$day][$hour][] = $return_event;
}else{
$return[$year][$month][$day][$hour] = array(1 => $return_event);
}
$count++;
}
//}
}
}
if(strlen($properties["BYDAY"]) == 2){
while(date("Y", mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year)) <= $select_year && $countchecker == true){
if($byday[strtoupper(substr(date("D", mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year)), 0, 2))] == "1"){
$newunixtime = mktime(0,0,0, $firststart_month + ($count * $interval), $firststart_day, $firststart_year);
$year = date("Y", $newunixtime);
$month = date("n", $newunixtime) - 1; // return is 0 based
$day = date("j", $newunixtime);
if($properties["UNTIL"] != "false"){
if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){
break;
}
}
if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
$hour = 'allday';
}
$return_event = array();
foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){
$return_event[$prop] = $event[$prop];
}
$return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
$return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
$return_event['description'] = $event['summary'];
$interval = $properties["INTERVAL"];
$countedoutputs++;
if($properties["COUNT"] != "false"){
if($countedoutputs == $properties["COUNT"]){
$countchecker = false;
}
}
if ($hour == 'allday'){
$return_event['allday'] = true;
}
if (isset($return[$year][$month][$day][$hour])){
$return[$year][$month][$day][$hour][] = $return_event;
}else{
$return[$year][$month][$day][$hour] = array(1 => $return_event);
}
}
$count++;
}
}else{
while(date("Y", mktime(0,0,0, 0, 0, $firststart_year + ($count * $interval))) <= $select_year && $countchecker == true){
$newunixtime = mktime(0,0,0, $properties["BYMONTH"], $properties["BYMONTHDAY"], $firststart_year + ($count * $interval));
$year = date("Y", $newunixtime);
$month = $month - 1; // return is 0 based
$day = $dateofweekone;
if($properties["UNTIL"] != "false"){
if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){
break;
}
}
if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
$hour = 'allday';
}
$return_event = array();
foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){
$return_event[$prop] = $event[$prop];
}
$return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
$return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
$return_event['description'] = $event['summary'];
$interval = $properties["INTERVAL"];
$countedoutputs++;
if($properties["COUNT"] != "false"){
if($countedoutputs == $properties["COUNT"]){
$countchecker = false;
}
}
if ($hour == 'allday'){
$return_event['allday'] = true;
}
if (isset($return[$year][$month][$day][$hour])){
$return[$year][$month][$day][$hour][] = $return_event;
}else{
$return[$year][$month][$day][$hour] = array(1 => $return_event);
}
$count++;
}
}
}
if($properties["FREQ"] == "YEARLY"){
if($properties["BYMONTH"] != "false"){
if($properties["BYMONTHDAY"] == false){
$properties["BYMONTHDAY"] = date("j", mktime(0,0,0, $firststart_month, $firststart_day, $firststart_year));
}
if($properties["BYDAY"] == "false"){
while(date("Y", mktime(0,0,0, $properties["BYMONTH"], $properties["BYMONTHDAY"], $firststart_year + ($count * $interval))) <= $select_year && $countchecker == true){
$newunixtime = mktime(0,0,0, $properties["BYMONTH"], $properties["BYMONTHDAY"], $firststart_year + ($count * $interval));
$year = date("Y", $newunixtime);
$month = date("n", $newunixtime) - 1; // return is 0 based
$day = date("j", $newunixtime);
if($properties["UNTIL"] != "false"){
if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){
break;
}
}
if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
$hour = 'allday';
}
$return_event = array();
foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){
$return_event[$prop] = $event[$prop];
}
$return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
$return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
$return_event['description'] = $event['summary'];
$interval = $properties["INTERVAL"];
$countedoutputs++;
if($properties["COUNT"] != "false"){
if($countedoutputs == $properties["COUNT"]){
$countchecker = false;
}
}
if ($hour == 'allday'){
$return_event['allday'] = true;
}
if (isset($return[$year][$month][$day][$hour])){
$return[$year][$month][$day][$hour][] = $return_event;
}else{
$return[$year][$month][$day][$hour] = array(1 => $return_event);
}
$count++;
}
}
if(strlen($properties["BYDAY"]) == 2){
while(date("Y", mktime(0,0,0, $properties["BYMONTH"], $properties["BYMONTHDAY"], $firststart_year + ($count * $interval))) <= $select_year && $countchecker == true){
$newunixtime = mktime(0,0,0, $properties["BYMONTH"], $properties["BYMONTHDAY"], $firststart_year + ($count * $interval));
$year = date("Y", $newunixtime);
$month = date("n", $newunixtime) - 1; // return is 0 based
$day = date("j", $newunixtime);
if($properties["UNTIL"] != "false"){
if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){
break;
}
}
if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
$hour = 'allday';
}
$return_event = array();
foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){
$return_event[$prop] = $event[$prop];
}
$return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
$return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
$return_event['description'] = $event['summary'];
$interval = $properties["INTERVAL"];
$countedoutputs++;
if($properties["COUNT"] != "false"){
if($countedoutputs == $properties["COUNT"]){
$countchecker = false;
}
}
if ($hour == 'allday'){
$return_event['allday'] = true;
}
if (isset($return[$year][$month][$day][$hour])){
$return[$year][$month][$day][$hour][] = $return_event;
}else{
$return[$year][$month][$day][$hour] = array(1 => $return_event);
}
$count++;
}
}else{
$number = substr($properties["BYDAY"],0,1);
$weekday = substr($properties["BYDAY"],1,2);
$month = $properties["BYMONTH"];
$dateofweekone = "";
for($i = 0; $i <= 7;$i++){
if(strtoupper(substr(date("D", mktime(0,0,0, $properties["BYMONTH"], $i, $select_year)), 0, 2)) == $weekday){
$dateofweekone = date("j", mktime(0,0,0, $properties["BYMONTH"], $i, $select_year));
$i = 8;
}
}
if($number != 1){
$dateofweekone = $dateofweekone + (7 * ($number - 1));
}
while(date("Y", mktime(0,0,0, 0, 0, $firststart_year + ($count * $interval))) <= $select_year && $countchecker == true){
$newunixtime = mktime(0,0,0, $properties["BYMONTH"], $properties["BYMONTHDAY"], $firststart_year + ($count * $interval));
$year = date("Y", $newunixtime);
$month = $month - 1; // return is 0 based
$day = $dateofweekone;
if($properties["UNTIL"] != "false"){
if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){
break;
}
}
if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
$hour = 'allday';
}
$return_event = array();
foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){
$return_event[$prop] = $event[$prop];
}
$return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
$return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
$return_event['description'] = $event['summary'];
$interval = $properties["INTERVAL"];
$countedoutputs++;
if($properties["COUNT"] != "false"){
if($countedoutputs == $properties["COUNT"]){
$countchecker = false;
}
}
if ($hour == 'allday'){
$return_event['allday'] = true;
}
if (isset($return[$year][$month][$day][$hour])){
$return[$year][$month][$day][$hour][] = $return_event;
}else{
$return[$year][$month][$day][$hour] = array(1 => $return_event);
}
$count++;
}
}
}elseif($properties["BYYEARDAY"] != false){
$numofyeardays = substr_count($properties["BYYEARDAY"], ",");
if($numofyeardays == 0){
$yeardays = array();
$yeardays[0] = $properties["BYYEARDAY"];
}else{
$yeardays = explode(",", $properties["BYYEARDAY"]);
}
while(date("Y", mktime(0,0,0, 0, 0, $firststart_year + ($count * $interval)) + ($yeardays[$numofyeardays]-1) * 86400) <= $select_year && $countchecker == true){
for($i = 0;$i <= $numofyeardays;$i++){
$newunixtime = mktime(0,0,0, 1, 1, $firststart_year + ($count * $interval)) + ($yeardays[$i] -1) * 86400;
$year = date("Y", $newunixtime);
$month = date("n", $newunixtime) - 1; // return is 0 based
$day = date("j", $newunixtime);
if($properties["UNTIL"] != "false"){
if($year >= $until_year && $month + 1 >= $until_month && $day > $until_day){
break;
}
}
if ($dtstart->getDateType() == Sabre_VObject_Element_DateTime::DATE) {
$hour = 'allday';
}
$return_event = array();
foreach(array('id', 'calendarid', 'objecttype', 'repeating') as $prop){
$return_event[$prop] = $event[$prop];
}
$return_event['startdate'] = explode('|', $start_dt->format('Y|m|d|H|i'));
$return_event['enddate'] = explode('|', $end_dt->format('Y|m|d|H|i'));
$return_event['description'] = $event['summary'];
$interval = $properties["INTERVAL"];
$countedoutputs++;
if($properties["COUNT"] != "false"){
if($countedoutputs == $properties["COUNT"]){
$countchecker = false;
}
}
if ($hour == 'allday'){
$return_event['allday'] = true;
}
if (isset($return[$year][$month][$day][$hour])){
$return[$year][$month][$day][$hour][] = $return_event;
}else{
$return[$year][$month][$day][$hour] = array(1 => $return_event);
}
}
$count++;
}
}
}
}
}
OC_JSON::encodedPrint($return);

View File

@ -1,22 +0,0 @@
<?php
/*************************************************
* ownCloud - Calendar Plugin *
* *
* (c) Copyright 2011 Georg Ehrke *
* author: Georg Ehrke *
* email: ownclouddev at georgswebsite dot de *
* homepage: ownclouddev.georgswebsite.de *
* manual: ownclouddev.georgswebsite.de/manual *
* License: GNU AFFERO GENERAL PUBLIC LICENSE *
* *
* <http://www.gnu.org/licenses/> *
* If you are not able to view the License, *
* <http://www.gnu.org/licenses/> *
* <http://ownclouddev.georgswebsite.de/license/> *
* please write to the Free Software Foundation. *
* Address: *
* 59 Temple Place, Suite 330, Boston, *
* MA 02111-1307 USA *
*************************************************/
?>

View File

@ -0,0 +1,20 @@
<?php
/**
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
require_once('../../../lib/base.php');
$l10n = new OC_L10N('calendar');
if(!OC_USER::isLoggedIn()) {
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
}
OC_JSON::checkAppEnabled('calendar');
$tmpl = new OC_Template('calendar', 'part.import');
$tmpl->printpage();
?>

View File

@ -0,0 +1,103 @@
<?php
/**
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
error_reporting(E_ALL);
require_once('../../../lib/base.php');
OC_JSON::checkLoggedIn();
$data = OC_Calendar_Object::find($_POST["id"]);
$calendarid = $data["calendarid"];
$cal = $calendarid;
$id = $_POST["id"];
$calendar = OC_Calendar_Calendar::findCalendar($calendarid);
if(OC_User::getUser() != $calendar["userid"]){
OC_JSON::error();
exit;
}
$newdate = $_POST["newdate"];
$caldata = array();
//modified part of editeventform.php
$object = Sabre_VObject_Reader::read($data['calendardata']);
$vevent = $object->VEVENT;
$dtstart = $vevent->DTSTART;
$dtend = OC_Calendar_Object::getDTEndFromVEvent($vevent);
switch($dtstart->getDateType()) {
case Sabre_VObject_Element_DateTime::LOCALTZ:
case Sabre_VObject_Element_DateTime::LOCAL:
$startdate = $dtstart->getDateTime()->format('d-m-Y');
$starttime = $dtstart->getDateTime()->format('H:i');
$enddate = $dtend->getDateTime()->format('d-m-Y');
$endtime = $dtend->getDateTime()->format('H:i');
$allday = false;
break;
case Sabre_VObject_Element_DateTime::DATE:
$startdate = $dtstart->getDateTime()->format('d-m-Y');
$starttime = '00:00';
$dtend->getDateTime()->modify('-1 day');
$enddate = $dtend->getDateTime()->format('d-m-Y');
$endtime = '23:59';
$allday = true;
break;
}
$caldata["title"] = isset($vevent->SUMMARY) ? $vevent->SUMMARY->value : '';
$caldata["location"] = isset($vevent->LOCATION) ? $vevent->LOCATION->value : '';
$caldata["categories"] = array();
if (isset($vevent->CATEGORIES)){
$caldata["categories"] = explode(',', $vevent->CATEGORIES->value);
$caldata["categories"] = array_map('trim', $categories);
}
foreach($caldata["categories"] as $category){
if (!in_array($category, $category_options)){
array_unshift($category_options, $category);
}
}
$caldata["repeat"] = isset($vevent->CATEGORY) ? $vevent->CATEGORY->value : '';
$caldata["description"] = isset($vevent->DESCRIPTION) ? $vevent->DESCRIPTION->value : '';
//end part of editeventform.php
$startdatearray = explode("-", $startdate);
$starttimearray = explode(":", $starttime);
$startunix = mktime($starttimearray[0], $starttimearray[1], 0, $startdatearray[1], $startdatearray[0], $startdatearray[2]);
$enddatearray = explode("-", $enddate);
$endtimearray = explode(":", $endtime);
$endunix = mktime($endtimearray[0], $endtimearray[1], 0, $enddatearray[1], $enddatearray[0], $enddatearray[2]);
$difference = $endunix - $startunix;
if(strlen($newdate) > 10){
$newdatestringarray = explode("-", $newdate);
if($newdatestringarray[1] == "allday"){
$allday = true;
$newdatestringarray[1] = "00:00";
}else{
if($allday == true){
$difference = 3600;
}
$allday = false;
}
}else{
$newdatestringarray = array();
$newdatestringarray[0] = $newdate;
$newdatestringarray[1] = $starttime;
}
$newdatearray = explode(".", $newdatestringarray[0]);
$newtimearray = explode(":", $newdatestringarray[1]);
$newstartunix = mktime($newtimearray[0], $newtimearray[1], 0, $newdatearray[1], $newdatearray[0], $newdatearray[2]);
$newendunix = $newstartunix + $difference;
if($allday == true){
$caldata["allday"] = true;
}else{
unset($caldata["allday"]);
}
$caldata["from"] = date("d-m-Y", $newstartunix);
$caldata["fromtime"] = date("H:i", $newstartunix);
$caldata["to"] = date("d-m-Y", $newendunix);
$caldata["totime"] = date("H:i", $newendunix);
//modified part of editevent.php
$vcalendar = Sabre_VObject_Reader::read($data["calendardata"]);
OC_Calendar_Object::updateVCalendarFromRequest($caldata, $vcalendar);
$result = OC_Calendar_Object::edit($id, $vcalendar->serialize());
OC_JSON::success();
//end part of editevent.php
?>

View File

@ -1,27 +1,22 @@
<?php
/*************************************************
* ownCloud - Calendar Plugin *
* *
* (c) Copyright 2011 Bart Visscher *
* License: GNU AFFERO GENERAL PUBLIC LICENSE *
* *
* If you are not able to view the License, *
* <http://www.gnu.org/licenses/> *
* please write to the Free Software Foundation. *
* Address: *
* 59 Temple Place, Suite 330, Boston, *
* MA 02111-1307 USA *
*************************************************/
/**
* Copyright (c) 2011 Bart Visscher <bartv@thisnet.nl>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
require_once('../../../lib/base.php');
$l10n = new OC_L10N('calendar');
if(!OC_USER::isLoggedIn()) {
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
}
OC_JSON::checkAppEnabled('calendar');
$calendar = array(
'id' => 'new',
'displayname' => 'Test',
'description' => 'Test calendar',
'calendarcolor' => 'black',
'displayname' => '',
'description' => '',
'calendarcolor' => '',
);
$tmpl = new OC_Template('calendar', 'part.editcalendar');
$tmpl->assign('new', true);

View File

@ -1,23 +1,11 @@
<?php
/*************************************************
* ownCloud - Calendar Plugin *
* *
* (c) Copyright 2011 Georg Ehrke *
* author: Georg Ehrke *
* email: ownclouddev at georgswebsite dot de *
* homepage: ownclouddev.georgswebsite.de *
* manual: ownclouddev.georgswebsite.de/manual *
* License: GNU AFFERO GENERAL PUBLIC LICENSE *
* *
* <http://www.gnu.org/licenses/> *
* If you are not able to view the License, *
* <http://www.gnu.org/licenses/> *
* <http://ownclouddev.georgswebsite.de/license/> *
* please write to the Free Software Foundation. *
* Address: *
* 59 Temple Place, Suite 330, Boston, *
* MA 02111-1307 USA *
*************************************************/
/**
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
require_once('../../../lib/base.php');
$l10n = new OC_L10N('calendar');
@ -25,17 +13,17 @@ $l10n = new OC_L10N('calendar');
if(!OC_USER::isLoggedIn()) {
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
}
OC_JSON::checkAppEnabled('calendar');
$errarr = OC_Calendar_Object::validateRequest($_POST);
if($errarr){
//show validate errors
$errarr["error"] = "true";
echo json_encode($errarr);
OC_JSON::error($errarr);
exit;
}else{
$cal = $_POST['calendar'];
$vcalendar = OC_Calendar_Object::createVCalendarFromRequest($_POST);
$result = OC_Calendar_Object::add($cal, $vcalendar->serialize());
echo json_encode(array("success"=>"true"));
OC_JSON::success();
}
?>

View File

@ -1,22 +1,11 @@
<?php
/*************************************************
* ownCloud - Calendar Plugin *
* *
* (c) Copyright 2011 Georg Ehrke *
* author: Georg Ehrke *
* email: ownclouddev at georgswebsite dot de *
* homepage: ownclouddev.georgswebsite.de *
* manual: ownclouddev.georgswebsite.de/manual *
* License: GNU AFFERO GENERAL PUBLIC LICENSE *
* *
* If you are not able to view the License, *
* <http://www.gnu.org/licenses/> *
* <http://ownclouddev.georgswebsite.de/license/> *
* please write to the Free Software Foundation. *
* Address: *
* 59 Temple Place, Suite 330, Boston, *
* MA 02111-1307 USA *
*************************************************/
/**
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
require_once('../../../lib/base.php');
$l10n = new OC_L10N('calendar');
@ -24,9 +13,10 @@ $l10n = new OC_L10N('calendar');
if(!OC_USER::isLoggedIn()) {
die('<script type="text/javascript">document.location = oc_webroot;</script>');
}
OC_JSON::checkAppEnabled('calendar');
$calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser());
$categories = OC_Calendar_Object::getCategoryOptions($l10n);
$calendar_options = OC_Calendar_Calendar::allCalendars(OC_User::getUser());
$category_options = OC_Calendar_Object::getCategoryOptions($l10n);
$repeat_options = OC_Calendar_Object::getRepeatOptions($l10n);
$startday = substr($_GET['d'], 0, 2);
$startmonth = substr($_GET['d'], 2, 2);
@ -39,25 +29,25 @@ if($starttime != 'undefined' && !is_nan($starttime) && !$allday){
$starttime = '0';
$startminutes = '00';
}else{
$starttime = date('H');
$starttime = date('G');
$startminutes = date('i');
}
$endday = $startday;
$endmonth = $startmonth;
$endyear = $startyear;
$endtime = $starttime;
$endminutes = $startminutes;
if($endtime == 23) {
$endday++;
$endtime = 0;
} else {
$endtime++;
}
$datetimestamp = mktime($starttime, $startminutes, 0, $startmonth, $startday, $startyear);
$duration = OC_Preferences::getValue( OC_User::getUser(), 'calendar', 'duration', "60");
$datetimestamp = $datetimestamp + ($duration * 60);
$endmonth = date("m", $datetimestamp);
$endday = date("d", $datetimestamp);
$endyear = date("Y", $datetimestamp);
$endtime = date("G", $datetimestamp);
$endminutes = date("i", $datetimestamp);
$tmpl = new OC_Template('calendar', 'part.newevent');
$tmpl->assign('calendars', $calendars);
$tmpl->assign('categories', $categories);
$tmpl->assign('calendar_options', $calendar_options);
$tmpl->assign('category_options', $category_options);
$tmpl->assign('startdate', $startday . '-' . $startmonth . '-' . $startyear);
$tmpl->assign('starttime', ($starttime <= 9 ? '0' : '') . $starttime . ':' . $startminutes);
$tmpl->assign('enddate', $endday . '-' . $endmonth . '-' . $endyear);

View File

@ -0,0 +1,30 @@
<?php
/**
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
require_once('../../../lib/base.php');
OC_JSON::checkLoggedIn();
$weekenddays = array("Monday"=>"false", "Tuesday"=>"false", "Wednesday"=>"false", "Thursday"=>"false", "Friday"=>"false", "Saturday"=>"false", "Sunday"=>"false");
for($i = 0;$i < count($_POST["weekend"]); $i++){
switch ($_POST["weekend"][$i]){
case "Monday":
case "Tuesday":
case "Wednesday":
case "Thursday":
case "Friday":
case "Saturday":
case "Sunday":
break;
default:
OC_JSON::error();
exit;
}
$weekenddays[$_POST["weekend"][$i]] = "true";
}
$setValue = json_encode($weekenddays);
OC_Preferences::setValue(OC_User::getUser(), 'calendar', 'weekend', $setValue);
OC_JSON::success();
?>

View File

@ -0,0 +1,17 @@
<?php
/**
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
require_once('../../../lib/base.php');
OC_JSON::checkLoggedIn();
if(isset($_POST["duration"])){
OC_Preferences::setValue(OC_User::getUser(), 'calendar', 'duration', $_POST["duration"]);
OC_JSON::success();
}else{
OC_JSON::error();
}
?>

View File

@ -0,0 +1,16 @@
<?php
/**
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
require_once('../../../lib/base.php');
OC_JSON::checkLoggedIn();
if(isset($_POST["firstdayofweek"])){
OC_Preferences::setValue(OC_User::getUser(), 'calendar', 'firstdayofweek', $_POST["firstdayofweek"]);
OC_JSON::success();
}else{
OC_JSON::error();
}
?>

View File

@ -0,0 +1,17 @@
<?php
/**
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
require_once('../../../lib/base.php');
OC_JSON::checkLoggedIn();
if(isset($_POST["timeformat"])){
OC_Preferences::setValue(OC_User::getUser(), 'calendar', 'timeformat', $_POST["timeformat"]);
OC_JSON::success();
}else{
OC_JSON::error();
}
?>

View File

@ -1,39 +1,27 @@
<?php
/*************************************************
* ownCloud - Calendar Plugin *
* *
* (c) Copyright 2011 Bart Visscher *
* License: GNU AFFERO GENERAL PUBLIC LICENSE *
* *
* If you are not able to view the License, *
* <http://www.gnu.org/licenses/> *
* please write to the Free Software Foundation. *
* Address: *
* 59 Temple Place, Suite 330, Boston, *
* MA 02111-1307 USA *
*************************************************/
/**
* Copyright (c) 2011 Bart Visscher <bartv@thisnet.nl>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
// Init owncloud
require_once('../../../lib/base.php');
$l=new OC_L10N('calendar');
// We send json data
header( "Content-Type: application/jsonrequest" );
// Check if we are a user
if( !OC_User::isLoggedIn()){
echo json_encode( array( "status" => "error", "data" => array( "message" => $l->t("Authentication error") )));
exit();
}
OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('calendar');
// Get data
if( isset( $_POST['timezone'] ) ){
$timezone=$_POST['timezone'];
OC_Preferences::setValue( OC_User::getUser(), 'calendar', 'timezone', $timezone );
echo json_encode( array( "status" => "success", "data" => array( "message" => $l->t("Timezone changed") )));
OC_JSON::success(array('data' => array( 'message' => $l->t('Timezone changed') )));
}else{
echo json_encode( array( "status" => "error", "data" => array( "message" => $l->t("Invalid request") )));
OC_JSON::error(array('data' => array( 'message' => $l->t('Invalid request') )));
}
?>

View File

@ -0,0 +1,12 @@
<?php
/**
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
require_once('../../../lib/base.php');
OC_JSON::checkLoggedIn();
$timeformat = OC_Preferences::getValue( OC_User::getUser(), 'calendar', 'timeformat', "24");
OC_JSON::encodedPrint(array("timeformat" => $timeformat));
?>

View File

@ -1,29 +1,18 @@
<?php
/*************************************************
* ownCloud - Calendar Plugin *
* *
* (c) Copyright 2011 Bart Visscher *
* License: GNU AFFERO GENERAL PUBLIC LICENSE *
* *
* If you are not able to view the License, *
* <http://www.gnu.org/licenses/> *
* please write to the Free Software Foundation. *
* Address: *
* 59 Temple Place, Suite 330, Boston, *
* MA 02111-1307 USA *
*************************************************/
/**
* Copyright (c) 2011 Bart Visscher <bartv@thisnet.nl>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
require_once('../../../lib/base.php');
$l10n = new OC_L10N('calendar');
// We send json data
header( "Content-Type: application/jsonrequest" );
// Check if we are a user
if( !OC_User::isLoggedIn()){
echo json_encode( array( "status" => "error", "data" => array( "message" => $l->t("Authentication error") )));
exit();
}
OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('calendar');
$calendarid = $_POST['id'];
OC_Calendar_Calendar::editCalendar($calendarid, $_POST['name'], $_POST['description'], null, null, null, $_POST['color']);
@ -31,4 +20,4 @@ OC_Calendar_Calendar::setCalendarActive($calendarid, $_POST['active']);
$calendar = OC_Calendar_Calendar::findCalendar($calendarid);
$tmpl = new OC_Template('calendar', 'part.choosecalendar.rowfields');
$tmpl->assign('calendar', $calendar);
echo json_encode( array( "status" => "success", "data" => $tmpl->fetchPage() ));
OC_JSON::success(array('data' => $tmpl->fetchPage()));

View File

@ -6,6 +6,8 @@ OC::$CLASSPATH['OC_Calendar_Hooks'] = 'apps/calendar/lib/hooks.php';
OC::$CLASSPATH['OC_Connector_Sabre_CalDAV'] = 'apps/calendar/lib/connector_sabre.php';
OC_HOOK::connect('OC_User', 'post_createUser', 'OC_Calendar_Hooks', 'deleteUser');
OC_Util::addScript('calendar','loader');
OC_App::register( array(
'order' => 10,
'id' => 'calendar',

View File

@ -7,4 +7,5 @@
<author>Georg Ehrke (Userinterface), Jakob Sack</author>
<require>2</require>
<description>Calendar with CalDAV support</description>
<default_enable/>
</info>

View File

@ -1,29 +1,16 @@
<?php
/**
* ownCloud - Calendar
*
* @author Jakob Sack
* @copyright 2011 Jakob Sack mail@jakobsack.de
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (c) 2011 Jakob Sack <mail@jakobsack.de>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
// Do not load FS ...
$RUNTIME_NOSETUPFS = true;
require_once('../../lib/base.php');
OC_Util::checkAppEnabled('calendar');
// Backends
$authBackend = new OC_Connector_Sabre_Auth();
@ -38,11 +25,12 @@ $nodes = array(
// Fire up server
$server = new Sabre_DAV_Server($nodes);
$server->setBaseUri($WEBROOT.'/apps/calendar/caldav.php');
$server->setBaseUri(OC::$WEBROOT.'/apps/calendar/caldav.php');
// Add plugins
$server->addPlugin(new Sabre_DAV_Auth_Plugin($authBackend,'ownCloud'));
$server->addPlugin(new Sabre_CalDAV_Plugin());
$server->addPlugin(new Sabre_DAVACL_Plugin());
$server->addPlugin(new Sabre_DAV_Browser_Plugin(false)); // Show something in the Browser, but no upload
// And off we go!
$server->exec();

View File

@ -1,22 +1,9 @@
/*************************************************
* ownCloud - Calendar Plugin *
* *
* (c) Copyright 2011 Georg Ehrke *
* author: Georg Ehrke *
* email: ownclouddev at georgswebsite dot de *
* homepage: ownclouddev.georgswebsite.de *
* manual: ownclouddev.georgswebsite.de/manual *
* License: GNU AFFERO GENERAL PUBLIC LICENSE *
* *
* <http://www.gnu.org/licenses/> *
* If you are not able to view the License, *
* <http://www.gnu.org/licenses/> *
* <http://ownclouddev.georgswebsite.de/license/> *
* please write to the Free Software Foundation. *
* Address: *
* 59 Temple Place, Suite 330, Boston, *
* MA 02111-1307 USA *
*************************************************/
/**
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
#view {margin-left: 10px; float: left; font-size: 12px;}
#datecontrol {text-align: center;}
@ -49,15 +36,16 @@
.controls {min-width: 800px;}
.center {text-align: center;}
.dateinfo {height: 20px;width: 100%; overflow: hidden; margin-top: 0; padding: 0; font-size: 12px;background: #F7F7F7;}
.events {width: 100%; margin: 0; padding: 0;}
.events {width: 100%; margin: 0; padding: 0;min-height: 100px;}
.calendar_row {height: 20px; text-align: center;background: #ffffff;}
#oneweekview .calendar_row {width: 13.5%;}
.calendar_time {height: 20px; width: 50px; text-align:right;background: #ffffff;}
.day {text-align: center; background: #ffffff; margin: 0; padding: 0; vertical-align: top; width: 14%; height: 22%;}
.weekend .events{text-align: center;margin: 0; padding: 0;vertical-align: top;background: #F3F3F3; width: 100%; }
.weekend {background: #F3F3F3; }
.weekend_thead, .weekend_row{height: 20px;text-align: center;text-align: center;background: #F3F3F3;}
.thisday{background: #FFFABC;text-align: center;margin: 0;padding: 0;vertical-align: top;height: 20px;}
.thisday{background: #FFFABC;}
.event {position:relative;}
.event.colored {border-bottom: 1px solid white;}
.popup {display: none; position: absolute; z-index: 1000; background: #eeeeee; color: #000000; border: 1px solid #1a1a1a; font-size: 90%;}
.event_popup {width: 280px; height: 40px; padding: 10px;}
@ -68,3 +56,8 @@ color:#333;
#fromtime.disabled, #totime.disabled {
color:#A9A9A9;
}
select#category{width:140px;}
button.category{margin:0 3px;}
.calendar-colorpicker-color{display:inline-block;width:20px;height:20px;margin-right:2px;cursor:pointer;}
.calendar-colorpicker-color.active{background-image:url("../../../core/img/jquery-ui/ui-icons_222222_256x240.png");background-position:-62px -143px;}

View File

@ -1,37 +1,38 @@
<?php
/*************************************************
* ownCloud - Calendar Plugin *
* *
* (c) Copyright 2011 Georg Ehrke *
* author: Georg Ehrke *
* email: ownclouddev at georgswebsite dot de *
* homepage: ownclouddev.georgswebsite.de *
* manual: ownclouddev.georgswebsite.de/manual *
* License: GNU AFFERO GENERAL PUBLIC LICENSE *
* *
* If you are not able to view the License, *
* <http://www.gnu.org/licenses/> *
* <http://ownclouddev.georgswebsite.de/license/> *
* please write to the Free Software Foundation. *
* Address: *
* 59 Temple Place, Suite 330, Boston, *
* MA 02111-1307 USA *
*************************************************/
/**
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
require_once ("../../lib/base.php");
if(!OC_USER::isLoggedIn()) {
header("Location: " . OC_HELPER::linkTo("", "index.php"));
exit;
}
OC_Util::checkLoggedIn();
OC_Util::checkAppEnabled('calendar');
$cal = $_GET["calid"];
$calendar = OC_Calendar_Calendar::findCalendar($cal);
if($calendar["userid"] != OC_User::getUser()){
header("Location: " . OC_HELPER::linkTo("", "index.php"));
exit;
}
$calobjects = OC_Calendar_Object::all($cal);
header("Content-Type: text/Calendar");
header("Content-Disposition: inline; filename=calendar.ics");
for($i = 0;$i <= count($calobjects); $i++){
echo $calobjects[$i]["calendardata"] . "\n";
$event = $_GET["eventid"];
if(isset($cal)){
$calendar = OC_Calendar_Calendar::findCalendar($cal);
if($calendar["userid"] != OC_User::getUser()){
OC_JSON::error();
exit;
}
$calobjects = OC_Calendar_Object::all($cal);
header("Content-Type: text/Calendar");
header("Content-Disposition: inline; filename=calendar.ics");
for($i = 0;$i <= count($calobjects); $i++){
echo $calobjects[$i]["calendardata"] . "\n";
}
}elseif(isset($event)){
$data = OC_Calendar_Object::find($_GET["eventid"]);
$calendarid = $data["calendarid"];
$calendar = OC_Calendar_Calendar::findCalendar($calendarid);
if($calendar["userid"] != OC_User::getUser()){
OC_JSON::error();
exit;
}
header("Content-Type: text/Calendar");
header("Content-Disposition: inline; filename=" . $data["summary"] . ".ics");
echo $data["calendardata"];
}
?>

50
apps/calendar/import.php Normal file
View File

@ -0,0 +1,50 @@
<?php
/**
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
require_once ('../../lib/base.php');
OC_JSON::checkLoggedIn();
OC_Util::checkAppEnabled('calendar');
if($_GET["import"] == "existing"){
$calid = $_GET["calid"];
$calendar = OC_Calendar_Calendar::findCalendar($calid);
if($calendar['userid'] != OC_User::getUser()){
OC_JSON::error();
exit;
}
if($_GET["path"] != ""){
$filename = $_GET["path"] . "/" . $_GET["file"];
}else{
$filename = "/" . $_GET["file"];
}
}else{
$id = OC_Calendar_Calendar::addCalendar(OC_User::getUser(), $_POST['calname'], $_POST['description']);
OC_Calendar_Calendar::setCalendarActive($id, 1);
$calid = $id;
if($_POST["path"] != ""){
$filename = $_POST["path"] . "/" . $_POST["file"];
}else{
$filename = "/" . $_POST["file"];
}
}
$vcalendar = OC_Filesystem::file_get_contents($filename);
$vcalendar = explode("BEGIN:VEVENT", $vcalendar);
for($i = 1;$i < count($vcalendar);$i++){
$vcalendar[$i] = "BEGIN:VEVENT" . $vcalendar[$i];
}
for($i = 1;$i < count($vcalendar) - 1;$i++){
$vcalendar[$i] = $vcalendar[$i] . "END:VCALENDAR";
}
for($i = 1;$i < count($vcalendar);$i++){
$vcalendar[$i] = $vcalendar[0] . $vcalendar[$i];
}
for($i = 1;$i < count($vcalendar);$i++){
OC_Calendar_Object::add($calid, $vcalendar[$i]);
}
OC_JSON::success();
?>

View File

@ -1,35 +1,24 @@
<?php
/*************************************************
* ownCloud - Calendar Plugin *
* *
* (c) Copyright 2011 Georg Ehrke *
* author: Georg Ehrke *
* email: ownclouddev at georgswebsite dot de *
* homepage: ownclouddev.georgswebsite.de *
* manual: ownclouddev.georgswebsite.de/manual *
* License: GNU AFFERO GENERAL PUBLIC LICENSE *
* *
* If you are not able to view the License, *
* <http://www.gnu.org/licenses/> *
* <http://ownclouddev.georgswebsite.de/license/> *
* please write to the Free Software Foundation. *
* Address: *
* 59 Temple Place, Suite 330, Boston, *
* MA 02111-1307 USA *
*************************************************/
require_once ("../../lib/base.php");
if(!OC_USER::isLoggedIn()) {
header("Location: " . OC_HELPER::linkTo("", "index.php"));
exit;
}
/**
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
require_once ('../../lib/base.php');
OC_Util::checkLoggedIn();
OC_Util::checkAppEnabled('calendar');
// Create default calendar ...
$calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser());
if( count($calendars) == 0){
OC_Calendar_Calendar::addCalendar(OC_User::getUser(),'default','Default calendar');
$calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser());
}
OC_UTIL::addScript("calendar", "calendar");
OC_UTIL::addStyle("calendar", "style");
OC_APP::setActiveNavigationEntry("calendar_index");
$output = new OC_TEMPLATE("calendar", "calendar", "user");
OC_UTIL::addScript('calendar', 'calendar');
OC_UTIL::addStyle('calendar', 'style');
OC_UTIL::addScript('', 'jquery.multiselect');
OC_UTIL::addStyle('', 'jquery.multiselect');
OC_APP::setActiveNavigationEntry('calendar_index');
$output = new OC_TEMPLATE('calendar', 'calendar', 'user');
$output -> printPage();

View File

@ -1,46 +1,15 @@
/*************************************************
* ownCloud - Calendar Plugin *
* *
* (c) Copyright 2011 Georg Ehrke *
* (c) Copyright 2011 Bart Visscher *
* author: Georg Ehrke *
* email: ownclouddev at georgswebsite dot de *
* homepage: ownclouddev.georgswebsite.de *
* manual: ownclouddev.georgswebsite.de/manual *
* License: GNU AFFERO GENERAL PUBLIC LICENSE *
* *
* <http://www.gnu.org/licenses/> *
* If you are not able to view the License, *
* <http://www.gnu.org/licenses/> *
* <http://ownclouddev.georgswebsite.de/license/> *
* please write to the Free Software Foundation. *
* Address: *
* 59 Temple Place, Suite 330, Boston, *
* MA 02111-1307 USA *
**************************************************
* list of all fx *
* calw - Calendarweek *
* doy - Day of the year *
* checkforleapyear - check for a leap year *
* forward_day - switching one day forward *
* forward_week - switching one week forward *
* forward_month - switching one month forward *
* backward_day - switching one day backward *
* backward_week - switching one week backward *
* backward_month - switching one month backward *
* update_view - update the view of the calendar *
* onedayview - one day view *
* oneweekview - one week view *
* fourweekview - four Weeks view *
* onemonthview - one Month view *
* listview - listview *
* generateDates - generate other days for view *
* switch2today - switching to today *
* removeEvents - remove old events in view *
* loadEvents - load the events *
*************************************************/
/**
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
* Copyright (c) 2011 Bart Visscher <bartv@thisnet.nl>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
Calendar={
space:' ',
firstdayofweek: '',
weekend: '',
Date:{
normal_year_cal: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
leap_year_cal: [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
@ -112,7 +81,7 @@ Calendar={
},
UI:{
weekdays: ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"],
weekdays: '',
formatDayShort:function(day){
if (typeof(day) == 'undefined'){
day = Calendar.Date.current.getDay();
@ -157,7 +126,7 @@ Calendar={
$('#'+this.currentview + "_radio").removeClass('active');
this.currentview = view;
//sending ajax request on every change view
$("#sysbox").load(oc_webroot + "/apps/calendar/ajax/changeview.php?v="+view);
$("#sysbox").load(OC.filePath('calendar', 'ajax', 'changeview.php') + "?v="+view);
//not necessary to check whether the response is true or not
switch(view) {
case "onedayview":
@ -186,6 +155,7 @@ Calendar={
Calendar.UI.updateView()
});
},
drageventid: '',
updateDate:function(direction){
if(direction == 'forward' && this.current.forward) {
this.current.forward();
@ -211,18 +181,19 @@ Calendar={
if( typeof (this.events[year]) == "undefined") {
this.events[year] = []
}
$.getJSON(oc_webroot + "/apps/calendar/ajax/getcal.php?year=" + year, function(newevents, status) {
$.getJSON(OC.filePath('calendar', 'ajax', 'getcal.php') + "?year=" + year, function(jsondata, status) {
if(status == "nosession") {
alert("You are not logged in. That can happen if you don't use owncloud for a long time.");
document.location(oc_webroot);
}
if(status == "parsingfail" || typeof (newevents) == "undefined") {
if(status == "parsingfail" || typeof (jsondata) == "undefined") {
$.ready(function() {
$( "#parsingfail_dialog" ).dialog();
});
} else {
if (typeof(newevents[year]) != 'undefined'){
Calendar.UI.events[year] = newevents[year];
if (typeof(jsondata[year]) != 'undefined'){
Calendar.UI.calendars = jsondata['calendars'];
Calendar.UI.events[year] = jsondata[year];
}
$(document).ready(function() {
Calendar.UI.updateView();
@ -251,7 +222,7 @@ Calendar={
if (!events) {
return;
}
var weekday = (date.getDay()+6)%7;
var weekday = (date.getDay()+7-Calendar.firstdayofweek)%7;
if( typeof (events["allday"]) != "undefined") {
var eventnumber = 1;
var eventcontainer = this.current.getEventContainer(week, weekday, "allday");
@ -277,7 +248,17 @@ Calendar={
.data('event_info', event)
.hover(this.createEventPopup,
this.hideEventPopup)
.draggable({
drag: function() {
Calendar.UI.drageventid = event.id;
}
})
.click(this.editEvent);
var color = this.calendars[event['calendarid']]['color'];
if (color){
event_holder.css('background-color', color)
.addClass('colored');
}
eventcontainer.append(event_holder);
},
startEventDialog:function(){
@ -288,6 +269,13 @@ Calendar={
$( "#to" ).datepicker({
dateFormat : 'dd-mm-yy'
});
$('#category').multiselect({
header: false,
noneSelectedText: $('#category').attr('title'),
selectedList: 2,
minWidth:'auto',
classes: 'category',
});
$('#event').dialog({
width : 500,
close : function(event, ui) {
@ -312,7 +300,7 @@ Calendar={
// TODO: save event
$('#event').dialog('destroy').remove();
}else{
$('#dialog_holder').load(oc_webroot + '/apps/calendar/ajax/neweventform.php?d=' + date + '&t=' + time, Calendar.UI.startEventDialog);
$('#dialog_holder').load(OC.filePath('calendar', 'ajax', 'neweventform.php') + '?d=' + date + '&t=' + time, Calendar.UI.startEventDialog);
}
},
editEvent:function(event){
@ -323,12 +311,25 @@ Calendar={
// TODO: save event
$('#event').dialog('destroy').remove();
}else{
$('#dialog_holder').load(oc_webroot + '/apps/calendar/ajax/editeventform.php?id=' + id, Calendar.UI.startEventDialog);
$('#dialog_holder').load(OC.filePath('calendar', 'ajax', 'editeventform.php') + '?id=' + id, Calendar.UI.startEventDialog);
}
},
submitDeleteEventForm:function(url){
var post = $( "#event_form" ).serialize();
$("#errorbox").empty();
$.post(url, post, function(data){
if(data.status == 'success'){
$('#event').dialog('destroy').remove();
Calendar.UI.loadEvents();
} else {
$("#errorbox").html("Deletion failed");
}
}, "json");
},
validateEventForm:function(url){
var post = $( "#event_form" ).serialize();
$("#errorbox").html("");
$("#errorbox").empty();
$.post(url, post,
function(data){
if(data.status == "error"){
@ -365,6 +366,16 @@ Calendar={
}
},"json");
},
moveevent:function(eventid, newstartdate){
$.post(OC.filePath('calendar', 'ajax', 'moveevent.php'), { id: eventid, newdate: newstartdate},
function(data) {
console.log("Event moved successfully");
});
},
showadvancedoptions:function(){
$("#advanced_options").css("display", "block");
$("#advanced_options_button").css("display", "none");
},
createEventPopup:function(e){
var popup = $(this).data('popup');
if (!popup){
@ -429,12 +440,25 @@ Calendar={
$('#caldav_url').show();
$("#caldav_url_close").show();
},
deleteCalendar:function(calid){
var check = confirm("Do you really want to delete this calendar?");
if(check == false){
return false;
}else{
$.post(OC.filePath('calendar', 'ajax', 'deletecalendar.php'), { calendarid: calid},
function(data) {
Calendar.UI.loadEvents();
$('#choosecalendar_dialog').dialog('destroy').remove();
Calendar.UI.Calendar.overview();
});
}
},
Calendar:{
overview:function(){
if($('#choosecalendar_dialog').dialog('isOpen') == true){
$('#choosecalendar_dialog').dialog('moveToTop');
}else{
$('#dialog_holder').load(oc_webroot + '/apps/calendar/ajax/choosecalendar.php', function(){
$('#dialog_holder').load(OC.filePath('calendar', 'ajax', 'choosecalendar.php'), function(){
$('#choosecalendar_dialog').dialog({
width : 600,
close : function(event, ui) {
@ -446,25 +470,54 @@ Calendar={
},
activation:function(checkbox, calendarid)
{
$.post(oc_webroot + "/apps/calendar/ajax/activation.php", { calendarid: calendarid, active: checkbox.checked?1:0 },
$.post(OC.filePath('calendar', 'ajax', 'activation.php'), { calendarid: calendarid, active: checkbox.checked?1:0 },
function(data) {
checkbox.checked = data == 1;
Calendar.UI.loadEvents();
});
},
new:function(object){
newCalendar:function(object){
var tr = $(document.createElement('tr'))
.load(oc_webroot + "/apps/calendar/ajax/newcalendar.php");
.load(OC.filePath('calendar', 'ajax', 'newcalendar.php'));
$(object).closest('tr').after(tr).hide();
},
edit:function(object, calendarid){
var tr = $(document.createElement('tr'))
.load(oc_webroot + "/apps/calendar/ajax/editcalendar.php?calendarid="+calendarid);
.load(OC.filePath('calendar', 'ajax', 'editcalendar.php') + "?calendarid="+calendarid,
function(){Calendar.UI.Calendar.colorPicker(this)});
$(object).closest('tr').after(tr).hide();
},
colorPicker:function(container){
// based on jquery-colorpicker at jquery.webspirited.com
var obj = $('.colorpicker', container);
var picker = $('<div class="calendar-colorpicker"></div>');
var size = 20;
//build an array of colors
var colors = {};
$(obj).children('option').each(function(i, elm) {
colors[i] = {};
colors[i].color = $(elm).val();
colors[i].label = $(elm).text();
});
for (var i in colors) {
picker.append('<span class="calendar-colorpicker-color ' + (colors[i].color == $(obj).children(":selected").val() ? ' active' : '') + '" rel="' + colors[i].label + '" style="background-color: #' + colors[i].color + '; width: ' + size + 'px; height: ' + size + 'px;"></span>');
}
picker.delegate(".calendar-colorpicker-color", "click", function() {
$(obj).val($(this).attr('rel'));
$(obj).change();
picker.children('.calendar-colorpicker-color.active').removeClass('active');
$(this).addClass('active');
});
$(obj).after(picker);
$(obj).css({
position: 'absolute',
left: -10000
});
},
submit:function(button, calendarid){
var displayname = $("#displayname_"+calendarid).val();
var active = $("#active_"+calendarid+":checked").length;
var active = $("#edit_active_"+calendarid+":checked").length;
var description = $("#description_"+calendarid).val();
var calendarcolor = $("#calendarcolor_"+calendarid).val();
@ -486,7 +539,7 @@ Calendar={
cancel:function(button, calendarid){
$(button).closest('tr').prev().show().next().remove();
},
},
},/*
OneDay:{
forward:function(){
Calendar.Date.forward_day();
@ -495,7 +548,7 @@ Calendar={
Calendar.Date.backward_day();
},
removeEvents:function(){
$("#onedayview .calendar_row").html("");
$("#onedayview .calendar_row").empty();
},
renderCal:function(){
$("#datecontrol_date").val(Calendar.UI.formatDayShort() + Calendar.space + Calendar.Date.current.getDate() + Calendar.space + Calendar.UI.formatMonthShort() + Calendar.space + Calendar.Date.current.getFullYear());
@ -516,7 +569,7 @@ Calendar={
return $(document.createElement('p'))
.html(time + event['description'])
},
},
},*/
OneWeek:{
forward:function(){
Calendar.Date.forward_week();
@ -526,7 +579,7 @@ Calendar={
},
removeEvents:function(){
for( i = 0; i <= 6; i++) {
$("#oneweekview ." + Calendar.UI.weekdays[i]).html("");
$("#oneweekview ." + Calendar.UI.weekdays[i]).empty();
}
$("#oneweekview .thisday").removeClass("thisday");
},
@ -535,7 +588,23 @@ Calendar={
var dates = this.generateDates();
var today = new Date();
for(var i = 0; i <= 6; i++){
$("#oneweekview th." + Calendar.UI.weekdays[i]).html(Calendar.UI.formatDayShort((i+1)%7) + Calendar.space + dates[i].getDate() + Calendar.space + Calendar.UI.formatMonthShort(dates[i].getMonth()));
$("#oneweekview th." + Calendar.UI.weekdays[i]).html(Calendar.UI.formatDayShort((i+Calendar.firstdayofweek)%7) + Calendar.space + dates[i].getDate() + Calendar.space + Calendar.UI.formatMonthShort(dates[i].getMonth()));
$("#oneweekview td." + Calendar.UI.weekdays[i] + ".allday").attr('title', dates[i].getDate() + "." + String(parseInt(dates[i].getMonth()) + 1) + "." + dates[i].getFullYear() + "-" + "allday");
$("#oneweekview td." + Calendar.UI.weekdays[i] + ".allday").droppable({
drop: function() {
Calendar.UI.moveevent(Calendar.UI.drageventid, this.title);
Calendar.UI.loadEvents();
}
});
for(var ii = 0;ii <= 23; ii++){
$("#oneweekview td." + Calendar.UI.weekdays[i] + "." + String(ii)).attr('title', dates[i].getDate() + "." + String(parseInt(dates[i].getMonth()) + 1) + "." + dates[i].getFullYear() + "-" + String(ii) + ":00");
$("#oneweekview td." + Calendar.UI.weekdays[i] + "." + String(ii)).droppable({
drop: function() {
Calendar.UI.moveevent(Calendar.UI.drageventid, this.title);
Calendar.UI.loadEvents();
}
});
}
if(dates[i].getDate() == today.getDate() && dates[i].getMonth() == today.getMonth() && dates[i].getFullYear() == today.getFullYear()){
$("#oneweekview ." + Calendar.UI.weekdays[i]).addClass("thisday");
}
@ -566,14 +635,18 @@ Calendar={
if(dayofweek == 0) {
dayofweek = 7;
}
date.setDate(date.getDate() - dayofweek + 1);
if(Calendar.firstdayofweek > dayofweek){
date.setDate(date.getDate() - dayofweek + Calendar.firstdayofweek - 7);
}else{
date.setDate(date.getDate() - dayofweek + Calendar.firstdayofweek);
}
for(var i = 0; i <= 6; i++) {
dates[i] = new Date(date)
date.setDate(date.getDate() + 1);
}
return dates;
},
},
},/*
FourWeeks:{
forward:function(){
Calendar.Date.forward_week();
@ -583,7 +656,7 @@ Calendar={
},
removeEvents:function(){
$('#fourweeksview .day.thisday').removeClass('thisday');
$('#fourweeksview .day .events').html('');
$('#fourweeksview .day .events').empty();
},
renderCal:function(){
var calw1 = Calendar.Date.calw();
@ -670,7 +743,7 @@ Calendar={
}
return dates;
},
},
},*/
OneMonth:{
forward:function(){
Calendar.Date.forward_month();
@ -680,7 +753,7 @@ Calendar={
},
removeEvents:function(){
$('#onemonthview .day.thisday').removeClass('thisday');
$('#onemonthview .day .events').html('');
$('#onemonthview .day .events').empty();
},
renderCal:function(){
$("#datecontrol_date").val(Calendar.UI.formatMonthLong() + Calendar.space + Calendar.Date.current.getFullYear());
@ -708,6 +781,13 @@ Calendar={
var month = dates[i].getMonth();
var year = dates[i].getFullYear();
$("#onemonthview .week_" + week + " ." + Calendar.UI.weekdays[weekday] + " .dateinfo").html(dayofmonth + Calendar.space + Calendar.UI.formatMonthShort(month));
$("#onemonthview .week_" + week + " ." + Calendar.UI.weekdays[weekday]).attr('title', dayofmonth + "." + String(parseInt(month) + 1) + "." + year);
$("#onemonthview .week_" + week + " ." + Calendar.UI.weekdays[weekday]).droppable({
drop: function() {
Calendar.UI.moveevent(Calendar.UI.drageventid, this.title);
Calendar.UI.loadEvents();
}
});
if(dayofmonth == today.getDate() && month == today.getMonth() && year == today.getFullYear()){
$("#onemonthview .week_" + week + " ." + Calendar.UI.weekdays[weekday]).addClass('thisday');
}
@ -772,7 +852,11 @@ Calendar={
dayofweek = 7;
this.rows++;
}
date.setDate(date.getDate() - dayofweek + 1);
if(Calendar.firstdayofweek > dayofweek){
date.setDate(date.getDate() - dayofweek + Calendar.firstdayofweek - 7);
}else{
date.setDate(date.getDate() - dayofweek + Calendar.firstdayofweek);
}
for(var i = 0; i <= 41; i++) {
dates[i] = new Date(date)
date.setDate(date.getDate() + 1);
@ -782,7 +866,7 @@ Calendar={
},
List:{
removeEvents:function(){
this.eventContainer = $('#listview #events').html('');
this.eventContainer = $('#listview #events').empty();
this.startdate = new Date();
this.enddate = new Date();
this.enddate.setDate(this.enddate.getDate());

View File

@ -0,0 +1,16 @@
function importdialog(directory, filename){
$("body").append("<div id=\"importdialogholder\"></div>");
$("#importdialogholder").load(OC.filePath('calendar', 'ajax', 'importdialog.php?filename=' + filename + '&path=' + directory));
}
$(document).ready(function(){
$('tr[data-file$=".ics"]').attr("data-mime", "text/calendar");
$('tr[data-file$=".vcs"]').attr("data-mime", "text/calendar");
$('tr[data-file$=".ical"]').attr("data-mime", "text/calendar");
if(typeof FileActions!=='undefined'){
FileActions.register('text/calendar','Import to Calendar','',function(filename){
importdialog($('#dir').val(),filename);
});
FileActions.setDefault('text/calendar','Import to Calendar');
}
});

View File

@ -3,9 +3,61 @@ $(document).ready(function(){
OC.msg.startSaving('#calendar .msg')
// Serialize the data
var post = $( "#timezone" ).serialize();
$.post( oc_webroot + '/apps/calendar/ajax/settimezone.php', post, function(data){
OC.msg.finishedSaving('#calendar .msg', data);
$.post( OC.filePath('calendar', 'ajax', 'settimezone.php'), post, function(data){
//OC.msg.finishedSaving('#calendar .msg', data);
});
return false;
});
$("#timezone").chosen();
$("#firstdayofweek").change( function(){
var data = $("#firstdayofweek").serialize();
$.post( OC.filePath('calendar', 'ajax', 'setfirstdayofweek.php'), data, function(data){
if(data == "error"){
console.log("saving first day of week failed");
}
});
});
$.getJSON(OC.filePath('calendar', 'ajax', 'firstdayofweek.php'), function(jsondata, status) {
$("#select_" + jsondata.firstdayofweek).attr('selected',true);
$("#firstdayofweek").chosen();
});
$.getJSON(OC.filePath('calendar', 'ajax', 'daysofweekend.php'), function(jsondata, status) {
for(day in jsondata){
if(jsondata[day] == "true"){
$("#selectweekend_" + day).attr('selected',true);
}
}
$("#weekend").chosen();
});
$("#timeformat").change( function(){
var data = $("#timeformat").serialize();
$.post( OC.filePath('calendar', 'ajax', 'settimeformat.php'), data, function(data){
if(data == "error"){
console.log("saving timeformat failed");
}
});
});
$.getJSON(OC.filePath('calendar', 'ajax', 'timeformat.php'), function(jsondata, status) {
$("#" + jsondata.timeformat).attr('selected',true);
$("#timeformat").chosen();
});
$("#duration").blur( function(){
var data = $("#duration").val();
$.post( OC.filePath('calendar', 'ajax', 'setduration.php'), {duration: data}, function(data){
if(data == "error"){
console.log("saving duration failed");
}
});
});
$.getJSON(OC.filePath('calendar', 'ajax', 'duration.php'), function(jsondata, status) {
$("#duration").val(jsondata.duration);
});
$("#weekend").change( function(){
var data = $("#weekend").serialize();
$.post( OC.filePath('calendar', 'ajax', 'setdaysofweekend.php'), data, function(data){
if(data == "error"){
console.log("saving days of weekend failed");
}
});
});
});

View File

@ -1 +0,0 @@
There are actually no known bugs

View File

@ -0,0 +1,83 @@
<?php $TRANSLATIONS = array(
"Authentication error" => "Проблем с идентификацията",
"Timezone changed" => "Часовата зона е сменена",
"Invalid request" => "Невалидна заявка",
"Calendar" => "Календар",
"Does not repeat" => "Не се повтаря",
"Daily" => "Дневно",
"Weekly" => "Седмично",
"Every Weekday" => "Всеки делничен ден",
"Bi-Weekly" => "Двуседмично",
"Monthly" => "Месечно",
"Yearly" => "Годишно",
"All day" => "Всички дни",
"Sunday" => "Неделя",
"Monday" => "Понеделник",
"Tuesday" => "Вторник",
"Wednesday" => "Сряда",
"Thursday" => "Четвъртък",
"Friday" => "Петък",
"Saturday" => "Събота",
"Sun." => "Нед.",
"Mon." => "Пон.",
"Tue." => "Втр.",
"Wed." => "Сря.",
"Thu." => "Чет.",
"Fri." => "Пет.",
"Sat." => "Съб.",
"January" => "Януари",
"February" => "Февруари",
"March" => "Март",
"April" => "Април",
"May" => "Май",
"June" => "Юни",
"July" => "Юли",
"August" => "Август",
"September" => "Септември",
"October" => "Октомври",
"November" => "Ноември",
"December" => "Декември",
"Jan." => "Ян.",
"Feb." => "Фв.",
"Mar." => "Март",
"Apr." => "Апр.",
"Jun." => "Юни",
"Jul." => "Юли",
"Aug." => "Авг.",
"Sep." => "Сеп.",
"Oct." => "Окт.",
"Nov." => "Ное.",
"Dec." => "Дек.",
"Week" => "Седмица",
"Weeks" => "Седмици",
"Day" => "Ден",
"Month" => "Месец",
"Today" => "Днес",
"Calendars" => "Календари",
"Time" => "Час",
"There was a fail, while parsing the file." => "Възникна проблем с разлистването на файла.",
"Choose active calendars" => "Изберете активен календар",
"Download" => "Изтегляне",
"Edit" => "Промяна",
"Edit calendar" => "Промени календар",
"Displayname" => "Екранно име",
"Active" => "Активен",
"Description" => "Описание",
"Calendar color" => "Цвят на календара",
"Submit" => "Продължи",
"Edit an event" => "Промяна на събитие",
"Title" => "Заглавие",
"Title of the Event" => "Наименование",
"Location" => "Локация",
"Location of the Event" => "Локация",
"Category" => "Категория",
"All Day Event" => "Целодневно събитие",
"From" => "От",
"To" => "До",
"Repeat" => "Повтори",
"Attendees" => "Присъстващи",
"Description of the Event" => "Описание",
"Close" => "Затвори",
"Create a new event" => "Ново събитие",
"Timezone" => "Часова зона"
);

83
apps/calendar/l10n/ca.php Normal file
View File

@ -0,0 +1,83 @@
<?php $TRANSLATIONS = array(
"Authentication error" => "Error d'autenticació",
"Timezone changed" => "La zona horària ha canviat",
"Invalid request" => "Sol.licitud no vàlida",
"Calendar" => "Calendari",
"Does not repeat" => "No es repeteix",
"Daily" => "Diari",
"Weekly" => "Mensual",
"Every Weekday" => "Cada setmana",
"Bi-Weekly" => "Bisetmanalment",
"Monthly" => "Mensualment",
"Yearly" => "Cada any",
"All day" => "Tot el dia",
"Sunday" => "Diumenge",
"Monday" => "Dilluns",
"Tuesday" => "Dimarts",
"Wednesday" => "Dimecres",
"Thursday" => "Dijous",
"Friday" => "Divendres",
"Saturday" => "Dissabte",
"Sun." => "dg.",
"Mon." => "dl.",
"Tue." => "dm.",
"Wed." => "dc.",
"Thu." => "dj.",
"Fri." => "dv.",
"Sat." => "ds.",
"January" => "Gener",
"February" => "Febrer",
"March" => "Març",
"April" => "Abril",
"May" => "Maig",
"June" => "Juny",
"July" => "Juliol",
"August" => "Agost",
"September" => "Setembre",
"October" => "Octubre",
"November" => "Novembre",
"December" => "Desembre",
"Jan." => "gen.",
"Feb." => "febr.",
"Mar." => "març",
"Apr." => "abr.",
"Jun." => "juny",
"Jul." => "jul.",
"Aug." => "ag.",
"Sep." => "set.",
"Oct." => "oct.",
"Nov." => "nov.",
"Dec." => "des.",
"Week" => "Setmana",
"Weeks" => "Setmanes",
"Day" => "Dia",
"Month" => "Mes",
"Today" => "Avui",
"Calendars" => "Calendaris",
"Time" => "Hora",
"There was a fail, while parsing the file." => "S'ha produït un error en analitzar el fitxer.",
"Choose active calendars" => "Seleccioneu calendaris actius",
"Download" => "Baixa",
"Edit" => "Edita",
"Edit calendar" => "Edita el calendari",
"Displayname" => "Mostra el nom",
"Active" => "Actiu",
"Description" => "Descripció",
"Calendar color" => "Color del calendari",
"Submit" => "Tramet",
"Edit an event" => "Edició d'un esdeveniment",
"Title" => "Títol",
"Title of the Event" => "Títol de l'esdeveniment",
"Location" => "Ubicació",
"Location of the Event" => "Ubicació de l'esdeveniment",
"Category" => "Categoria",
"All Day Event" => "Esdeveniment de tot el dia",
"From" => "Des de",
"To" => "Fins a",
"Repeat" => "Repeteix",
"Attendees" => "Assistents",
"Description of the Event" => "Descripció de l'esdeveniment",
"Close" => "Tanca",
"Create a new event" => "Crea un nou esdeveniment",
"Timezone" => "Zona horària"
);

108
apps/calendar/l10n/da.php Normal file
View File

@ -0,0 +1,108 @@
<?php $TRANSLATIONS = array(
"Authentication error" => "Godkendelsesfejl",
"Wrong calendar" => "Forkert kalender",
"Timezone changed" => "Tidszone ændret",
"Invalid request" => "Ugyldig forespørgsel",
"Calendar" => "Kalender",
"Birthday" => "Fødselsdag",
"Business" => "Forretning",
"Call" => "Ring",
"Clients" => "Kunder",
"Holidays" => "Helligdage",
"Ideas" => "Ideér",
"Journey" => "Rejse",
"Jubilee" => "Jubilæum",
"Meeting" => "Møde",
"Other" => "Andet",
"Personal" => "Privat",
"Projects" => "Projekter",
"Questions" => "Spørgsmål",
"Work" => "Arbejde",
"Does not repeat" => "Gentages ikke",
"Daily" => "Daglig",
"Weekly" => "Ugentlig",
"Every Weekday" => "Alle hverdage",
"Bi-Weekly" => "Bi-Ugentligt",
"Monthly" => "Månedlige",
"Yearly" => "Årlig",
"All day" => "Hele dagen",
"Sunday" => "Søndag",
"Monday" => "Mandag",
"Tuesday" => "Tirsdag",
"Wednesday" => "Onsdag",
"Thursday" => "Torsdag",
"Friday" => "Fredag",
"Saturday" => "Lørdag",
"Sun." => "Søn.",
"Mon." => "Man.",
"Tue." => "Tir.",
"Wed." => "Ons.",
"Thu." => "Tor.",
"Fri." => "Fre.",
"Sat." => "Lør.",
"January" => "Januar",
"February" => "Februar",
"March" => "Marts",
"April" => "April",
"May" => "Maj",
"June" => "Juni",
"July" => "Juli",
"August" => "August",
"September" => "September",
"October" => "Oktober",
"November" => "November",
"December" => "December",
"Jan." => "Jan.",
"Feb." => "Feb.",
"Mar." => "Mar.",
"Apr." => "Apr.",
"May." => "Maj.",
"Jun." => "Jun.",
"Jul." => "Jul.",
"Aug." => "Aug.",
"Sep." => "Sep.",
"Oct." => "Oct.",
"Nov." => "Nov.",
"Dec." => "Dec.",
"Week" => "Uge",
"Weeks" => "Uger",
"More before {startdate}" => "Mere før {startdate}",
"More after {enddate}" => "Mere efter {enddate}",
"Day" => "Dag",
"Month" => "Måned",
"List" => "Liste",
"Today" => "I dag",
"Calendars" => "Kalendere",
"Time" => "Tid",
"There was a fail, while parsing the file." => "Der opstod en fejl under gennemlæsning af filen.",
"Choose active calendars" => "Vælg aktiv kalendere",
"New Calendar" => "Ny Kalender",
"CalDav Link" => "CalDav Link",
"Download" => "Hent",
"Edit" => "Rediger",
"New calendar" => "Ny kalender",
"Edit calendar" => "Rediger kalender",
"Displayname" => "Visningsnavn",
"Active" => "Aktiv",
"Description" => "Beskrivelse",
"Calendar color" => "Kalender farve",
"Save" => "Gem",
"Submit" => "Send",
"Cancel" => "Annullér",
"Edit an event" => "Redigér en begivenhed",
"Title" => "Titel",
"Title of the Event" => "Titel på begivenheden",
"Location" => "Sted",
"Location of the Event" => "Placering af begivenheden",
"Category" => "Kategori",
"Select category" => "Vælg kategori",
"All Day Event" => "Heldagsarrangement",
"From" => "Fra",
"To" => "Til",
"Repeat" => "Gentag",
"Attendees" => "Deltagere",
"Description of the Event" => "Beskrivelse af begivenheden",
"Close" => "Luk",
"Create a new event" => "Opret en ny begivenhed",
"Timezone" => "Tidszone"
);

View File

@ -1,36 +1,47 @@
<?php $TRANSLATIONS = array(
"Authentication error" => "Anmeldefehler",
"Wrong calendar" => "Falscher Kalender",
"Timezone changed" => "Zeitzone geändert",
"Invalid request" => "Anfragefehler",
"Calendar" => "Kalender",
"Location" => "Ort",
"Category" => "Kategorie",
"Create a new event" => "Neuen Termin erstellen",
"Title of the Event" => "Titel des Termins",
"Location of the Event" => "Ort des Termins",
"All Day Event" => "Ganztägig",
"From" => "Von",
"To" => "Bis",
"Repeat" => "Wiederhol.",
"Attendees" => "Teilnehmer",
"Description" => "Beschreibung",
"Submit" => "Speichern",
"Save" => "Speichern",
"Cancel" => "Abbrechen",
"Title" => "Titel",
"Birthday" => "Geburtstag",
"Business" => "Geschäftlich",
"Call" => "Anruf",
"Clients" => "Kunden",
"Deliverer" => "Lieferant",
"Holidays" => "Urlaub",
"Ideas" => "Ideen",
"Journey" => "Reise",
"Jubilee" => "Jubiläum",
"Meeting" => "Treffen",
"Other" => "Anderes",
"Personal" => "Persönlich",
"Projects" => "Projekte",
"Questions" => "Fragen",
"Work" => "Arbeit",
"Does not repeat" => "einmalig",
"Daily" => "täglich",
"Weekly" => "wöchentlich",
"Every Weekday" => "jeden Wochentag",
"Bi-Weekly" => "jede zweite Woche",
"Monthly" => "monatlich",
"Yearly" => "jährlich",
"Not an array" => "Kein Feld",
"All day" => "Ganztags",
"Sunday" => "Sonntag",
"Monday" => "Montag",
"Tuesday" => "Dienstag",
"Wednesday" => "Mittwoch",
"Thursday" => "Donnerstag",
"Friday" => "Freitag",
"Saturday" => "Samstag",
"CW" => "KW",
"CWs" => "KW",
"Sun." => "So.",
"Mon." => "Mo.",
"Tue." => "Di.",
"Wed." => "Mi.",
"Thu." => "Do.",
"Fri." => "Fr.",
"Sat." => "Sa.",
"Wednesday" => "Mittwoch",
"Thursday" => "Donnerstag",
"Friday" => "Freitag",
"Saturday" => "Samstag",
"Sun." => "Son.",
"Mon." => "Mon.",
"Tue." => "Die.",
"Wed." => "Mit.",
"Thu." => "Don.",
"Fri." => "Fre.",
"Sat." => "Sam.",
"January" => "Januar",
"February" => "Februar",
"March" => "März",
@ -45,53 +56,55 @@
"December" => "Dezember",
"Jan." => "Jan.",
"Feb." => "Feb.",
"Mar." => "März",
"Mar." => "Mär.",
"Apr." => "Apr.",
"May" => "Mai",
"Jun." => "Juni",
"Jul." => "Juli",
"May." => "Mai",
"Jun." => "Jun.",
"Jul." => "Jul.",
"Aug." => "Aug.",
"Sep." => "Sep.",
"Oct." => "Okt.",
"Nov." => "Nov.",
"Dec." => "Dez.",
"Day" => "Tag",
"Week" => "Woche",
"Weeks" => "Wochen",
"More before {startdate}" => "Mehr vor {startdate}",
"More after {enddate}" => "Mehr nach {enddate}",
"Day" => "Tag",
"Month" => "Monat",
"Listview" => "Liste",
"List" => "Liste",
"Today" => "Heute",
"Calendars" => "Kalender",
"Time" => "Uhrzeit",
"All day" => "Ganztägig",
"Does not repeat" => "Keine Wiederholung",
"Daily" => "Täglich",
"Weekly" => "Wöchentlich",
"Every Weekday" => "jeden Wochentag",
"Bi-Weekly" => "jede 2. Woche",
"Monthly" => "Monatlich",
"Yearly" => "Jährlich",
"Description of the Event" => "Beschreibung des Termins",
"None" => "Keine",
"Birthday" => "Geburtstag",
"Business" => "Geschäftlich",
"Call" => "Anrufen",
"Clients" => "Kunden",
"Deliverer" => "Lieferanten",
"Holidays" => "Ferien",
"Ideas" => "Ideen",
"Journey" => "Reise",
"Jubilee" => "Jubiläum",
"Meeting" => "Treffen",
"Other" => "Andere",
"Personal" => "Persönlich",
"Projects" => "Projekte",
"Questions" => "Fragen",
"Work" => "Arbeit",
"Time" => "Zeit",
"There was a fail, while parsing the file." => "Fehler beim Einlesen der Datei.",
"Choose active calendars" => "Aktive Kalender wählen",
"New Calendar" => "Neuer Kalender",
"CalDav Link" => "CalDAV-Link",
"Download" => "Herunterladen",
"Edit" => "Bearbeiten",
"New calendar" => "Neuer Kalender",
"Edit calendar" => "Kalender bearbeiten",
"Displayname" => "Anzeigename",
"Active" => "Aktiv",
"Description" => "Beschreibung",
"Calendar color" => "Kalenderfarbe",
"" => "",
"" => ""
"Save" => "Speichern",
"Submit" => "Bestätigen",
"Cancel" => "Abbrechen",
"Edit an event" => "Ereignis bearbeiten",
"Title" => "Titel",
"Title of the Event" => "Name",
"Location" => "Ort",
"Location of the Event" => "Ort",
"Category" => "Kategorie",
"Select category" => "Kategorie auswählen",
"All Day Event" => "Ganztägiges Ereignis",
"From" => "von",
"To" => "bis",
"Repeat" => "wiederholen",
"Attendees" => "Teilnehmer",
"Description of the Event" => "Beschreibung",
"Close" => "Schließen",
"Create a new event" => "Neues Ereignis",
"Timezone" => "Zeitzone"
);
?>

102
apps/calendar/l10n/el.php Normal file
View File

@ -0,0 +1,102 @@
<?php $TRANSLATIONS = array(
"Authentication error" => "Σφάλμα ταυτοποίησης",
"Wrong calendar" => "Λάθος ημερολόγιο",
"Timezone changed" => "Η ζώνη ώρας άλλαξε",
"Invalid request" => "Μη έγκυρο αίτημα",
"Calendar" => "Ημερολόγιο",
"Birthday" => "Γενέθλια",
"Business" => "Επιχείρηση",
"Call" => "Κλήση",
"Clients" => "Πελάτες",
"Holidays" => "Διακοπές",
"Ideas" => "Ιδέες",
"Journey" => "Ταξίδι",
"Other" => "Άλλο",
"Personal" => "Προσωπικό",
"Projects" => "Έργα",
"Questions" => "Ερωτήσεις",
"Work" => "Εργασία",
"Does not repeat" => "Μη επαναλαμβανόμενο",
"Daily" => "Καθημερινά",
"Weekly" => "Εβδομαδιαία",
"Every Weekday" => "Κάθε μέρα",
"Bi-Weekly" => "Δύο φορές την εβδομάδα",
"Monthly" => "Μηνιαία",
"Yearly" => "Ετήσια",
"Not an array" => "Δεν είναι μια σειρά",
"All day" => "Ολοήμερο",
"Sunday" => "Κυριακή",
"Monday" => "Δευτέρα",
"Tuesday" => "Τρίτη",
"Wednesday" => "Τετάρτη",
"Thursday" => "Πέμπτη",
"Friday" => "Παρασκευή",
"Saturday" => "Σάββατο",
"Sun." => "Κυρ.",
"Mon." => "Δευτ.",
"Tue." => "Τρ.",
"Wed." => "Τετ.",
"Thu." => "Πέμ.",
"Fri." => "Παρ.",
"Sat." => "Σάβ.",
"January" => "Ιανουάριος",
"February" => "Φεβρουάριος",
"March" => "Μάρτιος",
"April" => "Απρίλιος",
"May" => "Μάιος",
"June" => "Ιούνιος",
"July" => "Ιούλιος",
"August" => "Αύγουστος",
"September" => "Σεπτέμβριος",
"October" => "Οκτώβριος",
"November" => "Νοέμβριος",
"December" => "Δεκέμβριος",
"Jan." => "Ιαν.",
"Feb." => "Φεβ.",
"Mar." => "Μαρ.",
"Apr." => "Απρ.",
"Jun." => "Ιούν.",
"Jul." => "Ιούλ.",
"Aug." => "Αύγ.",
"Sep." => "Σεπ.",
"Oct." => "Οκτ.",
"Nov." => "Νοέ.",
"Dec." => "Δεκ.",
"Week" => "Εβδομάδα",
"Weeks" => "Εβδομάδες",
"Day" => "Ημέρα",
"Month" => "Μήνας",
"List" => "Λίστα",
"Today" => "Σήμερα",
"Calendars" => "Ημερολόγια",
"Time" => "Ώρα",
"There was a fail, while parsing the file." => "Υπήρχε μια αποτυχία, κατά την ανάλυση του αρχείου.",
"Choose active calendars" => "Επιλέξτε τα ενεργά ημερολόγια",
"New Calendar" => "Νέα Ημερολόγιο",
"Download" => "Λήψη",
"Edit" => "Επεξεργασία",
"New calendar" => "Νέο ημερολόγιο",
"Edit calendar" => "Επεξεργασία ημερολογίου",
"Displayname" => "Προβολή ονόματος",
"Active" => "Ενεργό",
"Description" => "Περιγραφή",
"Calendar color" => "Χρώμα ημερολογίου",
"Submit" => "Υποβολή",
"Cancel" => "Ακύρωση",
"Edit an event" => "Επεξεργασία ενός γεγονότος",
"Title" => "Τίτλος",
"Title of the Event" => "Τίτλος συμβάντος",
"Location" => "Τοποθεσία",
"Location of the Event" => "Τοποθεσία συμβάντος",
"Category" => "Κατηγορία",
"Select category" => "Επιλέξτε κατηγορία",
"All Day Event" => "Ολοήμερο συμβάν",
"From" => "Από",
"To" => "Έως",
"Repeat" => "Επαναλαμβανόμενο",
"Attendees" => "Παρευρισκόμενοι",
"Description of the Event" => "Περιγραφή του συμβάντος",
"Close" => "Κλείσιμο",
"Create a new event" => "Δημιουργήστε ένα νέο συμβάν",
"Timezone" => "Ζώνη ώρας"
);

View File

@ -1,35 +1,44 @@
<?php $TRANSLATIONS = array(
"Authentication error" => "Error de autentificación",
"Wrong calendar" => "Calendario incorrecto",
"Timezone changed" => "Zona horaria cambiada",
"Invalid request" => "Petición no válida",
"Calendar" => "Calendario",
"Location" => "Lugar",
"Category" => "Categoría",
"Create a new event" => "Crea un plazo",
"Title of the Event" => "Título del plazo",
"Location of the Event" => "Lugar del plazo",
"All Day Event" => "todo el día",
"From" => "Desde",
"To" => "Hasta",
"Repeat" => "Repetición",
"Attendees" => "Participante",
"Description" => "Descripción",
"Submit" => "Guarda",
"Reset" => "Repone",
"Title" => "Título",
"Birthday" => "Cumpleaños",
"Business" => "Negocios",
"Clients" => "Clientes",
"Holidays" => "Feriados",
"Ideas" => "Ideas",
"Journey" => "Viaje",
"Jubilee" => "Aniversario",
"Meeting" => "Reunión",
"Other" => "Otro",
"Personal" => "Personal",
"Projects" => "Projectos",
"Questions" => "Preguntas",
"Work" => "Trabajo",
"Does not repeat" => "No se repite",
"Daily" => "Diariamente",
"Weekly" => "Semanalmente",
"Every Weekday" => "Una vez a la semana",
"Bi-Weekly" => "Dos veces a la semana",
"Monthly" => "Mensualmente",
"Yearly" => "Anualmente",
"All day" => "Todo el día",
"Sunday" => "Domingo",
"Monday" => "Lunes",
"Tuesday" => "Martes",
"Wednesday" => "Miércoles",
"Thursday" => "Jueves",
"Friday" => "Viernes",
"Saturday" => "Sábado",
"CW" => "Semana",
"CWs" => "Semanas",
"Sun." => "Do.",
"Mon." => "Lu.",
"Tue." => "Ma.",
"Wed." => "Mi.",
"Thu." => "Ju.",
"Fri." => "Vi.",
"Sat." => "Sá.",
"Wednesday" => "Miércoles",
"Thursday" => "Jueves",
"Friday" => "Viernes",
"Saturday" => "Sábado",
"Sun." => "Dom.",
"Mon." => "Lun.",
"Tue." => "Mar.",
"Wed." => "Mie.",
"Thu." => "Jue.",
"Fri." => "Vie.",
"Sat." => "Sáb.",
"January" => "Enero",
"February" => "Febrero",
"March" => "Marzo",
@ -41,28 +50,54 @@
"September" => "Septiembre",
"October" => "Octubre",
"November" => "Noviembre",
"December" => "Deciembre",
"December" => "Diciembre",
"Jan." => "Ene.",
"Feb." => "Feb.",
"Mar." => "Mär.",
"Mar." => "Mar.",
"Apr." => "Abr.",
"May" => "May.",
"Jun." => "Jun.",
"Jul." => "Jul.",
"Aug." => "Ago.",
"Sep." => "Sep.",
"Oct." => "Oct.",
"Nov." => "Nov.",
"Dec." => "Dec.",
"Day" => "Día",
"Dec." => "Dic.",
"Week" => "Semana",
"Weeks" => "Semanas",
"Day" => "Día",
"Month" => "Mes",
"Listview" => "Lista",
"List" => "Lista",
"Today" => "Hoy",
"Calendars" => "Calendarios",
"Time" => "Hora",
"All day" => "todo el día",
"" => ""
"There was a fail, while parsing the file." => "Hubo un fallo al analizar el archivo.",
"Choose active calendars" => "Elige los calendarios activos",
"New Calendar" => "Nuevo calendario",
"Download" => "Descargar",
"Edit" => "Editar",
"New calendar" => "Nuevo calendario",
"Edit calendar" => "Editar calendario",
"Displayname" => "Nombre",
"Active" => "Activo",
"Description" => "Descripción",
"Calendar color" => "Color del calendario",
"Save" => "Guardar",
"Submit" => "Guardar",
"Cancel" => "Cancelar",
"Edit an event" => "Editar un evento",
"Title" => "Título",
"Title of the Event" => "Título del evento",
"Location" => "Lugar",
"Location of the Event" => "Lugar del Evento",
"Category" => "Categoría",
"Select category" => "Seleccionar categoría",
"All Day Event" => "Todo el día",
"From" => "Desde",
"To" => "Hasta",
"Repeat" => "Repetir",
"Attendees" => "Asistentes",
"Description of the Event" => "Descripción del evento",
"Close" => "Cerrar",
"Create a new event" => "Crear un nuevo evento",
"Timezone" => "Zona horaria"
);
?>

View File

@ -0,0 +1,83 @@
<?php $TRANSLATIONS = array(
"Authentication error" => "Autentimise viga",
"Timezone changed" => "Ajavöönd on muudetud",
"Invalid request" => "Vigane päring",
"Calendar" => "Kalender",
"Does not repeat" => "Ei kordu",
"Daily" => "Iga päev",
"Weekly" => "Iga nädal",
"Every Weekday" => "Igal nädalapäeval",
"Bi-Weekly" => "Üle nädala",
"Monthly" => "Igal kuul",
"Yearly" => "Igal aastal",
"All day" => "Kogu päev",
"Sunday" => "Pühapäev",
"Monday" => "Esmaspäev",
"Tuesday" => "Teisipäev",
"Wednesday" => "Kolmapäev",
"Thursday" => "Neljapäev",
"Friday" => "Reede",
"Saturday" => "Laupäev",
"Sun." => "Pü.",
"Mon." => "Esm.",
"Tue." => "Teisip.",
"Wed." => "Kolmap.",
"Thu." => "Neljap.",
"Fri." => "Reede",
"Sat." => "Laup.",
"January" => "Jaanuar",
"February" => "Veebruar",
"March" => "Märts",
"April" => "Aprill",
"May" => "Mai",
"June" => "Juuni",
"July" => "Juuli",
"August" => "August",
"September" => "September",
"October" => "Oktoober",
"November" => "November",
"December" => "Detsember",
"Jan." => "Jan.",
"Feb." => "Veebr.",
"Mar." => "Märts",
"Apr." => "Apr.",
"Jun." => "Jun.",
"Jul." => "Jul.",
"Aug." => "Aug.",
"Sep." => "Sept.",
"Oct." => "Okt.",
"Nov." => "Nov.",
"Dec." => "Dets.",
"Week" => "Nädal",
"Weeks" => "Nädalat",
"Day" => "Päev",
"Month" => "Kuu",
"Today" => "Täna",
"Calendars" => "Kalendrid",
"Time" => "Kellaaeg",
"There was a fail, while parsing the file." => "Faili parsimisel tekkis viga.",
"Choose active calendars" => "Vali aktiivsed kalendrid",
"Download" => "Lae alla",
"Edit" => "Muuda",
"Edit calendar" => "Muuda kalendrit",
"Displayname" => "Näidatav nimi",
"Active" => "Aktiivne",
"Description" => "Kirjeldus",
"Calendar color" => "Kalendri värv",
"Submit" => "OK",
"Edit an event" => "Muuda sündmust",
"Title" => "Pealkiri",
"Title of the Event" => "Sündmuse pealkiri",
"Location" => "Asukoht",
"Location of the Event" => "Sündmuse toimumiskoht",
"Category" => "Kategooria",
"All Day Event" => "Kogu päeva sündmus",
"From" => "Alates",
"To" => "Kuni",
"Repeat" => "Korda",
"Attendees" => "Osalejad",
"Description of the Event" => "Sündmuse kirjeldus",
"Close" => "Sulge",
"Create a new event" => "Loo sündmus",
"Timezone" => "Ajavöönd"
);

Some files were not shown because too many files have changed in this diff Show More