Added breadcrumb and control bar.
This commit is contained in:
commit
02d7b1a1fc
|
@ -28,3 +28,8 @@ RCS/*
|
||||||
# eclipse
|
# eclipse
|
||||||
.project
|
.project
|
||||||
.settings
|
.settings
|
||||||
|
|
||||||
|
# netbeans
|
||||||
|
nbproject
|
||||||
|
|
||||||
|
.DS_Store
|
|
@ -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
|
* 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 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 $principalUri
|
||||||
* @param string $calendarUri
|
* @param string $calendarUri
|
||||||
* @param array $properties
|
* @param array $properties
|
||||||
* @return string|int
|
* @return void
|
||||||
*/
|
*/
|
||||||
abstract function createCalendar($principalUri,$calendarUri,array $properties);
|
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
|
* and the array value for the property value. In the case a property
|
||||||
* should be deleted, the property value will be null.
|
* 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.
|
* (424 Failed Dependency) because the request needs to be atomic.
|
||||||
*
|
*
|
||||||
* @param string $calendarId
|
* @param string $calendarId
|
||||||
* @param array $properties
|
* @param array $mutations
|
||||||
* @return bool|array
|
* @return bool|array
|
||||||
*/
|
*/
|
||||||
public function updateCalendar($calendarId, array $properties) {
|
public function updateCalendar($calendarId, array $mutations) {
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -97,7 +94,7 @@ abstract class Sabre_CalDAV_Backend_Abstract {
|
||||||
abstract function deleteCalendar($calendarId);
|
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:
|
* Every item contains an array with the following keys:
|
||||||
* * id - unique identifier which will be used for subsequent updates
|
* * id - unique identifier which will be used for subsequent updates
|
||||||
|
|
|
@ -129,7 +129,6 @@ class Sabre_CalDAV_Backend_PDO extends Sabre_CalDAV_Backend_Abstract {
|
||||||
* @param string $principalUri
|
* @param string $principalUri
|
||||||
* @param string $calendarUri
|
* @param string $calendarUri
|
||||||
* @param array $properties
|
* @param array $properties
|
||||||
* @return mixed
|
|
||||||
*/
|
*/
|
||||||
public function createCalendar($principalUri,$calendarUri, array $properties) {
|
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
|
* and the array value for the property value. In the case a property
|
||||||
* should be deleted, the property value will be null.
|
* 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.
|
* (424 Failed Dependency) because the request needs to be atomic.
|
||||||
*
|
*
|
||||||
* @param string $calendarId
|
* @param string $calendarId
|
||||||
* @param array $properties
|
* @param array $mutations
|
||||||
* @return bool|array
|
* @return bool|array
|
||||||
*/
|
*/
|
||||||
public function updateCalendar($calendarId, array $properties) {
|
public function updateCalendar($calendarId, array $mutations) {
|
||||||
|
|
||||||
$newValues = array();
|
$newValues = array();
|
||||||
$result = array(
|
$result = array(
|
||||||
|
@ -219,13 +218,13 @@ class Sabre_CalDAV_Backend_PDO extends Sabre_CalDAV_Backend_Abstract {
|
||||||
|
|
||||||
$hasError = false;
|
$hasError = false;
|
||||||
|
|
||||||
foreach($properties as $propertyName=>$propertyValue) {
|
foreach($mutations as $propertyName=>$propertyValue) {
|
||||||
|
|
||||||
// We don't know about this property.
|
// We don't know about this property.
|
||||||
if (!isset($this->propertyMap[$propertyName])) {
|
if (!isset($this->propertyMap[$propertyName])) {
|
||||||
$hasError = true;
|
$hasError = true;
|
||||||
$result[403][$propertyName] = null;
|
$result[403][$propertyName] = null;
|
||||||
unset($properties[$propertyName]);
|
unset($mutations[$propertyName]);
|
||||||
continue;
|
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 there were any errors we need to fail the request
|
||||||
if ($hasError) {
|
if ($hasError) {
|
||||||
// Properties has the remaining properties
|
// Properties has the remaining properties
|
||||||
foreach($properties as $propertyName=>$propertyValue) {
|
foreach($mutations as $propertyName=>$propertyValue) {
|
||||||
$result[424][$propertyName] = null;
|
$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:
|
* Every item contains an array with the following keys:
|
||||||
* * id - unique identifier which will be used for subsequent updates
|
* * id - unique identifier which will be used for subsequent updates
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
* @author Evert Pot (http://www.rooftopsolutions.nl/)
|
* @author Evert Pot (http://www.rooftopsolutions.nl/)
|
||||||
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
|
* @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
|
* 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) {
|
public function createFile($name,$calendarData = null) {
|
||||||
|
|
||||||
$calendarData = stream_get_contents($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'];
|
$supportedComponents = $this->calendarInfo['{' . Sabre_CalDAV_Plugin::NS_CALDAV . '}supported-calendar-component-set'];
|
||||||
if ($supportedComponents) {
|
if ($supportedComponents) {
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
* @author Evert Pot (http://www.rooftopsolutions.nl/)
|
* @author Evert Pot (http://www.rooftopsolutions.nl/)
|
||||||
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
|
* @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
|
* Sabre_CalDAV_Backend_Abstract
|
||||||
|
@ -93,6 +93,9 @@ class Sabre_CalDAV_CalendarObject extends Sabre_DAV_File implements Sabre_DAVACL
|
||||||
if (is_resource($calendarData))
|
if (is_resource($calendarData))
|
||||||
$calendarData = stream_get_contents($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'];
|
$supportedComponents = $this->calendarInfo['{' . Sabre_CalDAV_Plugin::NS_CALDAV . '}supported-calendar-component-set'];
|
||||||
if ($supportedComponents) {
|
if ($supportedComponents) {
|
||||||
$supportedComponents = $supportedComponents->getValue();
|
$supportedComponents = $supportedComponents->getValue();
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -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 {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -114,7 +114,7 @@ class Sabre_CalDAV_Plugin extends Sabre_DAV_ServerPlugin {
|
||||||
public function getSupportedReportSet($uri) {
|
public function getSupportedReportSet($uri) {
|
||||||
|
|
||||||
$node = $this->server->tree->getNodeForPath($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(
|
return array(
|
||||||
'{' . self::NS_CALDAV . '}calendar-multiget',
|
'{' . self::NS_CALDAV . '}calendar-multiget',
|
||||||
'{' . self::NS_CALDAV . '}calendar-query',
|
'{' . 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->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_ProxyRead'] = '{http://calendarserver.org/ns/}calendar-proxy-read';
|
||||||
$server->resourceTypeMapping['Sabre_CalDAV_Principal_ProxyWrite'] = '{http://calendarserver.org/ns/}calendar-proxy-write';
|
$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
|
} // 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'
|
// The calendar-data property is not supposed to be a 'real'
|
||||||
// property, but in large chunks of the spec it does act as such.
|
// property, but in large chunks of the spec it does act as such.
|
||||||
// Therefore we simply expose it as a property.
|
// Therefore we simply expose it as a property.
|
||||||
|
|
|
@ -14,7 +14,7 @@ class Sabre_CalDAV_Version {
|
||||||
/**
|
/**
|
||||||
* Full version number
|
* Full version number
|
||||||
*/
|
*/
|
||||||
const VERSION = '1.5.0';
|
const VERSION = '1.5.3';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stability : alpha, beta, stable
|
* Stability : alpha, beta, stable
|
||||||
|
|
|
@ -112,6 +112,8 @@ class Sabre_CardDAV_AddressBook extends Sabre_DAV_Collection implements Sabre_Ca
|
||||||
public function createFile($name,$vcardData = null) {
|
public function createFile($name,$vcardData = null) {
|
||||||
|
|
||||||
$vcardData = stream_get_contents($vcardData);
|
$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);
|
$this->carddavBackend->createCard($this->addressBookInfo['id'],$name,$vcardData);
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,9 @@ class Sabre_CardDAV_Backend_PDO extends Sabre_CardDAV_Backend_Abstract {
|
||||||
'principaluri' => $row['principaluri'],
|
'principaluri' => $row['principaluri'],
|
||||||
'{DAV:}displayname' => $row['displayname'],
|
'{DAV:}displayname' => $row['displayname'],
|
||||||
'{' . Sabre_CardDAV_Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'],
|
'{' . 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(),
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,6 +88,9 @@ class Sabre_CardDAV_Card extends Sabre_DAV_File implements Sabre_CardDAV_ICard,
|
||||||
if (is_resource($cardData))
|
if (is_resource($cardData))
|
||||||
$cardData = stream_get_contents($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->carddavBackend->updateCard($this->addressBookInfo['id'],$this->cardData['uri'],$cardData);
|
||||||
$this->cardData['carddata'] = $cardData;
|
$this->cardData['carddata'] = $cardData;
|
||||||
|
|
||||||
|
|
|
@ -95,9 +95,10 @@ class Sabre_CardDAV_Plugin extends Sabre_DAV_ServerPlugin {
|
||||||
public function getSupportedReportSet($uri) {
|
public function getSupportedReportSet($uri) {
|
||||||
|
|
||||||
$node = $this->server->tree->getNodeForPath($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(
|
return array(
|
||||||
'{' . self::NS_CARDDAV . '}addressbook-multiget',
|
'{' . self::NS_CARDDAV . '}addressbook-multiget',
|
||||||
|
'{' . self::NS_CARDDAV . '}addressbook-query',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return array();
|
return array();
|
||||||
|
|
|
@ -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);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -18,11 +18,11 @@ class Sabre_CardDAV_Version {
|
||||||
/**
|
/**
|
||||||
* Full version number
|
* Full version number
|
||||||
*/
|
*/
|
||||||
const VERSION = '0.2';
|
const VERSION = '1.5.3';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stability : alpha, beta, stable
|
* Stability : alpha, beta, stable
|
||||||
*/
|
*/
|
||||||
const STABILITY = 'alpha';
|
const STABILITY = 'stable';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,9 +68,16 @@ class Sabre_DAV_Browser_Plugin extends Sabre_DAV_ServerPlugin {
|
||||||
public function httpGetInterceptor($method, $uri) {
|
public function httpGetInterceptor($method, $uri) {
|
||||||
|
|
||||||
if ($method!='GET') return true;
|
if ($method!='GET') return true;
|
||||||
|
|
||||||
$node = $this->server->tree->getNodeForPath($uri);
|
try {
|
||||||
if ($node instanceof Sabre_DAV_IFile) return true;
|
$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->sendStatus(200);
|
||||||
$this->server->httpResponse->setHeader('Content-Type','text/html; charset=utf-8');
|
$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',
|
'{DAV:}getlastmodified',
|
||||||
),1);
|
),1);
|
||||||
|
|
||||||
|
$parent = $this->server->tree->getNodeForPath($path);
|
||||||
|
|
||||||
|
|
||||||
if ($path) {
|
if ($path) {
|
||||||
|
|
||||||
|
@ -189,6 +198,7 @@ class Sabre_DAV_Browser_Plugin extends Sabre_DAV_ServerPlugin {
|
||||||
|
|
||||||
$type = null;
|
$type = null;
|
||||||
|
|
||||||
|
|
||||||
if (isset($file[200]['{DAV:}resourcetype'])) {
|
if (isset($file[200]['{DAV:}resourcetype'])) {
|
||||||
$type = $file[200]['{DAV:}resourcetype']->getValue();
|
$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>";
|
$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="">
|
$html.= '<tr><td><form method="post" action="">
|
||||||
<h3>Create new folder</h3>
|
<h3>Create new folder</h3>
|
||||||
<input type="hidden" name="sabreAction" value="mkcol" />
|
<input type="hidden" name="sabreAction" value="mkcol" />
|
||||||
|
|
|
@ -738,6 +738,34 @@ class Sabre_DAV_Server {
|
||||||
|
|
||||||
$body = $this->httpRequest->getBody();
|
$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
|
// Intercepting the Finder problem
|
||||||
if (($expected = $this->httpRequest->getHeader('X-Expected-Entity-Length')) && $expected > 0) {
|
if (($expected = $this->httpRequest->getHeader('X-Expected-Entity-Length')) && $expected > 0) {
|
||||||
|
|
||||||
|
@ -798,7 +826,10 @@ class Sabre_DAV_Server {
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// If we got here, the resource didn't exist yet.
|
// 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->setHeader('Content-Length','0');
|
||||||
$this->httpResponse->sendStatus(201);
|
$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).
|
* 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,
|
* It was important to get this done through a centralized function,
|
||||||
* allowing plugins to intercept this using the beforeCreateFile event.
|
* allowing plugins to intercept this using the beforeCreateFile event.
|
||||||
|
*
|
||||||
|
* This method will return true if the file was actually created
|
||||||
*
|
*
|
||||||
* @param string $uri
|
* @param string $uri
|
||||||
* @param resource $data
|
* @param resource $data
|
||||||
* @return void
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function createFile($uri,$data) {
|
public function createFile($uri,$data) {
|
||||||
|
|
||||||
list($dir,$name) = Sabre_DAV_URLUtil::splitPath($uri);
|
list($dir,$name) = Sabre_DAV_URLUtil::splitPath($uri);
|
||||||
|
|
||||||
if (!$this->broadcastEvent('beforeBind',array($uri))) return;
|
if (!$this->broadcastEvent('beforeBind',array($uri))) return false;
|
||||||
if (!$this->broadcastEvent('beforeCreateFile',array($uri,$data))) return;
|
if (!$this->broadcastEvent('beforeCreateFile',array($uri,$data))) return false;
|
||||||
|
|
||||||
$parent = $this->tree->getNodeForPath($dir);
|
$parent = $this->tree->getNodeForPath($dir);
|
||||||
$parent->createFile($name,$data);
|
$parent->createFile($name,$data);
|
||||||
$this->tree->markDirty($dir);
|
$this->tree->markDirty($dir);
|
||||||
|
|
||||||
$this->broadcastEvent('afterBind',array($uri));
|
$this->broadcastEvent('afterBind',array($uri));
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,9 +30,14 @@ class Sabre_DAV_URLUtil {
|
||||||
*/
|
*/
|
||||||
static function encodePath($path) {
|
static function encodePath($path) {
|
||||||
|
|
||||||
$path = explode('/',$path);
|
$valid_chars = '/ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-.~()';
|
||||||
return implode('/',array_map(array('Sabre_DAV_URLUtil','encodePathSegment'), $path));
|
$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) {
|
static function encodePathSegment($pathSegment) {
|
||||||
|
|
||||||
|
$valid_chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-.~()';
|
||||||
$newStr = '';
|
$newStr = '';
|
||||||
for($i=0;$i<strlen($pathSegment);$i++) {
|
for( $i=0; isset($pathSegment[$i]); ++$i ) {
|
||||||
$c = ord($pathSegment[$i]);
|
if( strpos($valid_chars,($c=$pathSegment[$i]))===false ) $newStr .= '%'.sprintf('%02x',ord($c));
|
||||||
|
else $newStr .= $c;
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
return $newStr;
|
return $newStr;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -103,6 +86,7 @@ class Sabre_DAV_URLUtil {
|
||||||
|
|
||||||
case 'ISO-8859-1' :
|
case 'ISO-8859-1' :
|
||||||
$path = utf8_encode($path);
|
$path = utf8_encode($path);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $path;
|
return $path;
|
||||||
|
|
|
@ -14,11 +14,11 @@ class Sabre_DAV_Version {
|
||||||
/**
|
/**
|
||||||
* Full version number
|
* Full version number
|
||||||
*/
|
*/
|
||||||
const VERSION = '1.5.0';
|
const VERSION = '1.5.3';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stability : alpha, beta, stable
|
* Stability : alpha, beta, stable
|
||||||
*/
|
*/
|
||||||
const STABILITY = 'alpha';
|
const STABILITY = 'stable';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,12 +68,19 @@ class Sabre_DAVACL_Principal extends Sabre_DAV_Node implements Sabre_DAVACL_IPri
|
||||||
*/
|
*/
|
||||||
public function getAlternateUriSet() {
|
public function getAlternateUriSet() {
|
||||||
|
|
||||||
if (isset($this->principalProperties['{http://sabredav.org/ns}email-address'])) {
|
$uris = array();
|
||||||
return array('mailto:' . $this->principalProperties['{http://sabredav.org/ns}email-address']);
|
if (isset($this->principalProperties['{DAV:}alternate-URI-set'])) {
|
||||||
} else {
|
|
||||||
return array();
|
$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);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -14,7 +14,7 @@ class Sabre_DAVACL_Version {
|
||||||
/**
|
/**
|
||||||
* Full version number
|
* Full version number
|
||||||
*/
|
*/
|
||||||
const VERSION = '1.4.4';
|
const VERSION = '1.5.2';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stability : alpha, beta, stable
|
* Stability : alpha, beta, stable
|
||||||
|
|
|
@ -23,7 +23,7 @@ class Sabre_HTTP_Response {
|
||||||
100 => 'Continue',
|
100 => 'Continue',
|
||||||
101 => 'Switching Protocols',
|
101 => 'Switching Protocols',
|
||||||
102 => 'Processing',
|
102 => 'Processing',
|
||||||
200 => 'Ok',
|
200 => 'OK',
|
||||||
201 => 'Created',
|
201 => 'Created',
|
||||||
202 => 'Accepted',
|
202 => 'Accepted',
|
||||||
203 => 'Non-Authorative Information',
|
203 => 'Non-Authorative Information',
|
||||||
|
|
|
@ -14,7 +14,7 @@ class Sabre_HTTP_Version {
|
||||||
/**
|
/**
|
||||||
* Full version number
|
* Full version number
|
||||||
*/
|
*/
|
||||||
const VERSION = '1.4.1';
|
const VERSION = '1.5.3';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stability : alpha, beta, stable
|
* Stability : alpha, beta, stable
|
||||||
|
|
|
@ -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 {{{ */
|
/* ArrayAccess interface {{{ */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -42,16 +42,10 @@ class Sabre_VObject_Reader {
|
||||||
*/
|
*/
|
||||||
static function read($data) {
|
static function read($data) {
|
||||||
|
|
||||||
// Detecting line endings
|
// Normalizing newlines
|
||||||
if (strpos($data,"\r\n")!==false) {
|
$data = str_replace(array("\r","\n\n"), array("\n","\n"), $data);
|
||||||
$newLine = "\r\n";
|
|
||||||
} elseif (strpos($data,"\r")) {
|
|
||||||
$newLine = "\r";
|
|
||||||
} else {
|
|
||||||
$newLine = "\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$lines = explode($newLine, $data);
|
$lines = explode("\n", $data);
|
||||||
|
|
||||||
// Unfolding lines
|
// Unfolding lines
|
||||||
$lines2 = array();
|
$lines2 = array();
|
||||||
|
|
|
@ -14,7 +14,7 @@ class Sabre_VObject_Version {
|
||||||
/**
|
/**
|
||||||
* Full version number
|
* Full version number
|
||||||
*/
|
*/
|
||||||
const VERSION = '1.2.0';
|
const VERSION = '1.2.2';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stability : alpha, beta, stable
|
* Stability : alpha, beta, stable
|
||||||
|
|
|
@ -10,6 +10,7 @@ select.chzn-select {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
zoom: 1;
|
zoom: 1;
|
||||||
*display: inline;
|
*display: inline;
|
||||||
|
vertical-align: bottom;
|
||||||
}
|
}
|
||||||
.chzn-container .chzn-drop {
|
.chzn-container .chzn-drop {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
|
|
2
README
2
README
|
@ -4,7 +4,7 @@ It is alpha software in development and should be treated accordingly.
|
||||||
|
|
||||||
http://ownCloud.org
|
http://ownCloud.org
|
||||||
|
|
||||||
Installation instructions: http://owncloud.org/index.php/Installation
|
Installation instructions: http://owncloud.org/install
|
||||||
Source code: http://gitorious.org/owncloud
|
Source code: http://gitorious.org/owncloud
|
||||||
|
|
||||||
Mailing list: http://mail.kde.org/mailman/listinfo/owncloud
|
Mailing list: http://mail.kde.org/mailman/listinfo/owncloud
|
||||||
|
|
|
@ -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'
|
||||||
|
);
|
|
@ -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>
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -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>
|
|
@ -25,6 +25,7 @@ require_once('../../lib/base.php');
|
||||||
|
|
||||||
// Check if we are a user
|
// Check if we are a user
|
||||||
OC_Util::checkLoggedIn();
|
OC_Util::checkLoggedIn();
|
||||||
|
OC_Util::checkAppEnabled('bookmarks');
|
||||||
|
|
||||||
require_once('bookmarksHelper.php');
|
require_once('bookmarksHelper.php');
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@ require_once('../../../lib/base.php');
|
||||||
|
|
||||||
// Check if we are a user
|
// Check if we are a user
|
||||||
OC_JSON::checkLoggedIn();
|
OC_JSON::checkLoggedIn();
|
||||||
|
OC_JSON::checkAppEnabled('bookmarks');
|
||||||
|
|
||||||
$CONFIG_DBTYPE = OC_Config::getValue( "dbtype", "sqlite" );
|
$CONFIG_DBTYPE = OC_Config::getValue( "dbtype", "sqlite" );
|
||||||
if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){
|
if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){
|
||||||
|
|
|
@ -28,6 +28,7 @@ require_once('../../../lib/base.php');
|
||||||
|
|
||||||
// Check if we are a user
|
// Check if we are a user
|
||||||
OC_JSON::checkLoggedIn();
|
OC_JSON::checkLoggedIn();
|
||||||
|
OC_JSON::checkAppEnabled('bookmarks');
|
||||||
|
|
||||||
$params=array(
|
$params=array(
|
||||||
htmlspecialchars_decode($_GET["url"]),
|
htmlspecialchars_decode($_GET["url"]),
|
||||||
|
|
|
@ -28,6 +28,7 @@ require_once('../../../lib/base.php');
|
||||||
|
|
||||||
// Check if we are a user
|
// Check if we are a user
|
||||||
OC_JSON::checkLoggedIn();
|
OC_JSON::checkLoggedIn();
|
||||||
|
OC_JSON::checkAppEnabled('bookmarks');
|
||||||
|
|
||||||
$CONFIG_DBTYPE = OC_Config::getValue( "dbtype", "sqlite" );
|
$CONFIG_DBTYPE = OC_Config::getValue( "dbtype", "sqlite" );
|
||||||
if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){
|
if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){
|
||||||
|
|
|
@ -28,6 +28,7 @@ require_once('../../../lib/base.php');
|
||||||
|
|
||||||
// Check if we are a user
|
// Check if we are a user
|
||||||
OC_JSON::checkLoggedIn();
|
OC_JSON::checkLoggedIn();
|
||||||
|
OC_JSON::checkAppEnabled('bookmarks');
|
||||||
|
|
||||||
// $metadata = array();
|
// $metadata = array();
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@ require_once('../../../lib/base.php');
|
||||||
|
|
||||||
// Check if we are a user
|
// Check if we are a user
|
||||||
OC_JSON::checkLoggedIn();
|
OC_JSON::checkLoggedIn();
|
||||||
|
OC_JSON::checkAppEnabled('bookmarks');
|
||||||
|
|
||||||
$query = OC_DB::prepare("
|
$query = OC_DB::prepare("
|
||||||
UPDATE *PREFIX*bookmarks
|
UPDATE *PREFIX*bookmarks
|
||||||
|
|
|
@ -28,6 +28,7 @@ require_once('../../../lib/base.php');
|
||||||
|
|
||||||
// Check if we are a user
|
// Check if we are a user
|
||||||
OC_JSON::checkLoggedIn();
|
OC_JSON::checkLoggedIn();
|
||||||
|
OC_JSON::checkAppEnabled('bookmarks');
|
||||||
|
|
||||||
$params=array(OC_User::getUser());
|
$params=array(OC_User::getUser());
|
||||||
$CONFIG_DBTYPE = OC_Config::getValue( 'dbtype', 'sqlite' );
|
$CONFIG_DBTYPE = OC_Config::getValue( 'dbtype', 'sqlite' );
|
||||||
|
|
|
@ -25,6 +25,7 @@ require_once('../../lib/base.php');
|
||||||
|
|
||||||
// Check if we are a user
|
// Check if we are a user
|
||||||
OC_Util::checkLoggedIn();
|
OC_Util::checkLoggedIn();
|
||||||
|
OC_Util::checkAppEnabled('bookmarks');
|
||||||
|
|
||||||
OC_App::setActiveNavigationEntry( 'bookmarks_index' );
|
OC_App::setActiveNavigationEntry( 'bookmarks_index' );
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<div class="bookmarks_addBm">
|
<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"><?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">Title</label><input type="text" id="bookmark_add_title" class="bookmarks_input" value="<? echo $_['TITLE']; ?>" /></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">Description</label><input type="text" id="bookmark_add_description" class="bookmarks_input" value="<? echo $_['DESCRIPTION']; ?>" /></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">Tags</label><input type="text" id="bookmark_add_tags" class="bookmarks_input" /></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">Hint: Use space to separate tags.</label></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" id="bookmark_add_submit" /></p>
|
<p><label class="bookmarks_label"></label><input type="submit" value="<?php echo $l->t('Add bookmark'); ?>" id="bookmark_add_submit" /></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,30 +1,27 @@
|
||||||
<input type="hidden" id="bookmarkFilterTag" value="<?php if(isset($_GET['tag'])) echo htmlentities($_GET['tag']); ?>" />
|
<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">
|
<div class="bookmarks_menu">
|
||||||
<input type="button" class="bookmarks_addBtn" value="Add Bookmark"/>
|
<input type="button" class="bookmarks_addBtn" value="<?php echo $l->t('Add bookmark'); ?>"/>
|
||||||
<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>
|
<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>
|
||||||
<div class="bookmarks_add">
|
<div class="bookmarks_add">
|
||||||
<input type="hidden" id="bookmark_add_id" value="0" />
|
<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"><?php echo $l->t('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('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>
|
<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>
|
<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"><?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">Hint: Use space to separate tags.</label></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" id="bookmark_add_submit" /></p>
|
<p><label class="bookmarks_label"></label><input type="submit" value="<?php echo $l->t('Add bookmark'); ?>" id="bookmark_add_submit" /></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="bookmarks_sorting pager">
|
<div class="bookmarks_sorting pager">
|
||||||
<ul>
|
<ul>
|
||||||
<li class="bookmarks_sorting_recent">Recent Bookmarks</li>
|
<li class="bookmarks_sorting_recent"><?php echo $l->t('Recent Bookmarks'); ?></li>
|
||||||
<li class="bookmarks_sorting_clicks">Most clicks</li>
|
<li class="bookmarks_sorting_clicks"><?php echo $l->t('Most clicks'); ?></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
<div class="bookmarks_list">
|
<div class="bookmarks_list">
|
||||||
<noscript>
|
<?php echo $l->t('You have no bookmarks'); ?>
|
||||||
JavaScript is needed to display your Bookmarks
|
|
||||||
</noscript>
|
|
||||||
You have no bookmarks
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -10,6 +10,7 @@ require_once ("../../../lib/base.php");
|
||||||
if(!OC_USER::isLoggedIn()) {
|
if(!OC_USER::isLoggedIn()) {
|
||||||
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
|
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
|
||||||
}
|
}
|
||||||
|
OC_JSON::checkAppEnabled('calendar');
|
||||||
$calendarid = $_POST['calendarid'];
|
$calendarid = $_POST['calendarid'];
|
||||||
OC_Calendar_Calendar::setCalendarActive($calendarid, $_POST['active']);
|
OC_Calendar_Calendar::setCalendarActive($calendarid, $_POST['active']);
|
||||||
$cal = OC_Calendar_Calendar::findCalendar($calendarid);
|
$cal = OC_Calendar_Calendar::findCalendar($calendarid);
|
||||||
|
|
|
@ -10,6 +10,7 @@ require_once ("../../../lib/base.php");
|
||||||
if(!OC_USER::isLoggedIn()) {
|
if(!OC_USER::isLoggedIn()) {
|
||||||
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
|
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
|
||||||
}
|
}
|
||||||
|
OC_JSON::checkAppEnabled('calendar');
|
||||||
$currentview = $_GET["v"];
|
$currentview = $_GET["v"];
|
||||||
OC_Preferences::setValue(OC_USER::getUser(), "calendar", "currentview", $currentview);
|
OC_Preferences::setValue(OC_USER::getUser(), "calendar", "currentview", $currentview);
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -11,6 +11,7 @@ $l10n = new OC_L10N('calendar');
|
||||||
if(!OC_USER::isLoggedIn()) {
|
if(!OC_USER::isLoggedIn()) {
|
||||||
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
|
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
|
||||||
}
|
}
|
||||||
|
OC_JSON::checkAppEnabled('calendar');
|
||||||
$output = new OC_TEMPLATE("calendar", "part.choosecalendar");
|
$output = new OC_TEMPLATE("calendar", "part.choosecalendar");
|
||||||
$output -> printpage();
|
$output -> printpage();
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -12,6 +12,7 @@ $l10n = new OC_L10N('calendar');
|
||||||
|
|
||||||
// Check if we are a user
|
// Check if we are a user
|
||||||
OC_JSON::checkLoggedIn();
|
OC_JSON::checkLoggedIn();
|
||||||
|
OC_JSON::checkAppEnabled('calendar');
|
||||||
|
|
||||||
$userid = OC_User::getUser();
|
$userid = OC_User::getUser();
|
||||||
$calendarid = OC_Calendar_Calendar::addCalendar($userid, $_POST['name'], $_POST['description'], 'VEVENT,VTODO,VJOURNAL', null, 0, $_POST['color']);
|
$calendarid = OC_Calendar_Calendar::addCalendar($userid, $_POST['name'], $_POST['description'], 'VEVENT,VTODO,VJOURNAL', null, 0, $_POST['color']);
|
||||||
|
|
|
@ -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"}');
|
||||||
|
?>
|
|
@ -12,6 +12,7 @@ $l10n = new OC_L10N('calendar');
|
||||||
if(!OC_USER::isLoggedIn()) {
|
if(!OC_USER::isLoggedIn()) {
|
||||||
die('<script type="text/javascript">document.location = oc_webroot;</script>');
|
die('<script type="text/javascript">document.location = oc_webroot;</script>');
|
||||||
}
|
}
|
||||||
|
OC_JSON::checkAppEnabled('calendar');
|
||||||
|
|
||||||
$cal = $_POST["calendarid"];
|
$cal = $_POST["calendarid"];
|
||||||
$calendar = OC_Calendar_Calendar::findCalendar($cal);
|
$calendar = OC_Calendar_Calendar::findCalendar($cal);
|
||||||
|
|
|
@ -12,6 +12,7 @@ $l10n = new OC_L10N('calendar');
|
||||||
if(!OC_USER::isLoggedIn()) {
|
if(!OC_USER::isLoggedIn()) {
|
||||||
die('<script type="text/javascript">document.location = oc_webroot;</script>');
|
die('<script type="text/javascript">document.location = oc_webroot;</script>');
|
||||||
}
|
}
|
||||||
|
OC_JSON::checkAppEnabled('calendar');
|
||||||
|
|
||||||
$id = $_POST['id'];
|
$id = $_POST['id'];
|
||||||
$data = OC_Calendar_Object::find($id);
|
$data = OC_Calendar_Object::find($id);
|
||||||
|
|
|
@ -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));
|
||||||
|
?>
|
|
@ -11,9 +11,21 @@ $l10n = new OC_L10N('calendar');
|
||||||
if(!OC_USER::isLoggedIn()) {
|
if(!OC_USER::isLoggedIn()) {
|
||||||
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
|
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']);
|
$calendar = OC_Calendar_Calendar::findCalendar($_GET['calendarid']);
|
||||||
$tmpl = new OC_Template("calendar", "part.editcalendar");
|
$tmpl = new OC_Template("calendar", "part.editcalendar");
|
||||||
$tmpl->assign('new', false);
|
$tmpl->assign('new', false);
|
||||||
|
$tmpl->assign('calendarcolor_options', $calendarcolor_options);
|
||||||
$tmpl->assign('calendar', $calendar);
|
$tmpl->assign('calendar', $calendar);
|
||||||
$tmpl->printPage();
|
$tmpl->printPage();
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -13,6 +13,7 @@ $l10n = new OC_L10N('calendar');
|
||||||
if(!OC_USER::isLoggedIn()) {
|
if(!OC_USER::isLoggedIn()) {
|
||||||
die('<script type="text/javascript">document.location = oc_webroot;</script>');
|
die('<script type="text/javascript">document.location = oc_webroot;</script>');
|
||||||
}
|
}
|
||||||
|
OC_JSON::checkAppEnabled('calendar');
|
||||||
|
|
||||||
$errarr = OC_Calendar_Object::validateRequest($_POST);
|
$errarr = OC_Calendar_Object::validateRequest($_POST);
|
||||||
if($errarr){
|
if($errarr){
|
||||||
|
|
|
@ -13,6 +13,7 @@ $l10n = new OC_L10N('calendar');
|
||||||
if(!OC_USER::isLoggedIn()) {
|
if(!OC_USER::isLoggedIn()) {
|
||||||
die('<script type="text/javascript">document.location = oc_webroot;</script>');
|
die('<script type="text/javascript">document.location = oc_webroot;</script>');
|
||||||
}
|
}
|
||||||
|
OC_JSON::checkAppEnabled('calendar');
|
||||||
|
|
||||||
$calendar_options = OC_Calendar_Calendar::allCalendars(OC_User::getUser());
|
$calendar_options = OC_Calendar_Calendar::allCalendars(OC_User::getUser());
|
||||||
$category_options = OC_Calendar_Object::getCategoryOptions($l10n);
|
$category_options = OC_Calendar_Object::getCategoryOptions($l10n);
|
||||||
|
@ -28,9 +29,10 @@ if($calendar['userid'] != OC_User::getUser()){
|
||||||
$object = Sabre_VObject_Reader::read($data['calendardata']);
|
$object = Sabre_VObject_Reader::read($data['calendardata']);
|
||||||
$vevent = $object->VEVENT;
|
$vevent = $object->VEVENT;
|
||||||
$dtstart = $vevent->DTSTART;
|
$dtstart = $vevent->DTSTART;
|
||||||
$dtend = $vevent->DTEND;
|
$dtend = OC_Calendar_Object::getDTEndFromVEvent($vevent);
|
||||||
switch($dtstart->getDateType()) {
|
switch($dtstart->getDateType()) {
|
||||||
case Sabre_VObject_Element_DateTime::LOCALTZ:
|
case Sabre_VObject_Element_DateTime::LOCALTZ:
|
||||||
|
case Sabre_VObject_Element_DateTime::LOCAL:
|
||||||
$startdate = $dtstart->getDateTime()->format('d-m-Y');
|
$startdate = $dtstart->getDateTime()->format('d-m-Y');
|
||||||
$starttime = $dtstart->getDateTime()->format('H:i');
|
$starttime = $dtstart->getDateTime()->format('H:i');
|
||||||
$enddate = $dtend->getDateTime()->format('d-m-Y');
|
$enddate = $dtend->getDateTime()->format('d-m-Y');
|
||||||
|
@ -54,6 +56,11 @@ if (isset($vevent->CATEGORIES)){
|
||||||
$categories = explode(',', $vevent->CATEGORIES->value);
|
$categories = explode(',', $vevent->CATEGORIES->value);
|
||||||
$categories = array_map('trim', $categories);
|
$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 : '';
|
$repeat = isset($vevent->CATEGORY) ? $vevent->CATEGORY->value : '';
|
||||||
$description = isset($vevent->DESCRIPTION) ? $vevent->DESCRIPTION->value : '';
|
$description = isset($vevent->DESCRIPTION) ? $vevent->DESCRIPTION->value : '';
|
||||||
|
|
||||||
|
|
|
@ -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));
|
||||||
|
?>
|
|
@ -10,6 +10,61 @@ require_once ("../../../lib/base.php");
|
||||||
if(!OC_USER::isLoggedIn()) {
|
if(!OC_USER::isLoggedIn()) {
|
||||||
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
|
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
|
||||||
}
|
}
|
||||||
$output = new OC_TEMPLATE("calendar", "part.getcal");
|
OC_JSON::checkAppEnabled('calendar');
|
||||||
$output -> printpage();
|
|
||||||
?>
|
$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))
|
||||||
|
continue;
|
||||||
|
$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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
OC_JSON::encodedPrint($return);
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
<?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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
?>
|
|
|
@ -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
|
||||||
|
?>
|
|
@ -11,11 +11,12 @@ $l10n = new OC_L10N('calendar');
|
||||||
if(!OC_USER::isLoggedIn()) {
|
if(!OC_USER::isLoggedIn()) {
|
||||||
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
|
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
|
||||||
}
|
}
|
||||||
|
OC_JSON::checkAppEnabled('calendar');
|
||||||
$calendar = array(
|
$calendar = array(
|
||||||
'id' => 'new',
|
'id' => 'new',
|
||||||
'displayname' => 'Test',
|
'displayname' => '',
|
||||||
'description' => 'Test calendar',
|
'description' => '',
|
||||||
'calendarcolor' => 'black',
|
'calendarcolor' => '',
|
||||||
);
|
);
|
||||||
$tmpl = new OC_Template('calendar', 'part.editcalendar');
|
$tmpl = new OC_Template('calendar', 'part.editcalendar');
|
||||||
$tmpl->assign('new', true);
|
$tmpl->assign('new', true);
|
||||||
|
|
|
@ -13,6 +13,7 @@ $l10n = new OC_L10N('calendar');
|
||||||
if(!OC_USER::isLoggedIn()) {
|
if(!OC_USER::isLoggedIn()) {
|
||||||
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
|
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
|
||||||
}
|
}
|
||||||
|
OC_JSON::checkAppEnabled('calendar');
|
||||||
|
|
||||||
$errarr = OC_Calendar_Object::validateRequest($_POST);
|
$errarr = OC_Calendar_Object::validateRequest($_POST);
|
||||||
if($errarr){
|
if($errarr){
|
||||||
|
|
|
@ -13,6 +13,7 @@ $l10n = new OC_L10N('calendar');
|
||||||
if(!OC_USER::isLoggedIn()) {
|
if(!OC_USER::isLoggedIn()) {
|
||||||
die('<script type="text/javascript">document.location = oc_webroot;</script>');
|
die('<script type="text/javascript">document.location = oc_webroot;</script>');
|
||||||
}
|
}
|
||||||
|
OC_JSON::checkAppEnabled('calendar');
|
||||||
|
|
||||||
$calendar_options = OC_Calendar_Calendar::allCalendars(OC_User::getUser());
|
$calendar_options = OC_Calendar_Calendar::allCalendars(OC_User::getUser());
|
||||||
$category_options = OC_Calendar_Object::getCategoryOptions($l10n);
|
$category_options = OC_Calendar_Object::getCategoryOptions($l10n);
|
||||||
|
@ -28,21 +29,21 @@ if($starttime != 'undefined' && !is_nan($starttime) && !$allday){
|
||||||
$starttime = '0';
|
$starttime = '0';
|
||||||
$startminutes = '00';
|
$startminutes = '00';
|
||||||
}else{
|
}else{
|
||||||
$starttime = date('H');
|
$starttime = date('G');
|
||||||
|
|
||||||
$startminutes = date('i');
|
$startminutes = date('i');
|
||||||
}
|
}
|
||||||
|
|
||||||
$endday = $startday;
|
$datetimestamp = mktime($starttime, $startminutes, 0, $startmonth, $startday, $startyear);
|
||||||
$endmonth = $startmonth;
|
$duration = OC_Preferences::getValue( OC_User::getUser(), 'calendar', 'duration', "60");
|
||||||
$endyear = $startyear;
|
$datetimestamp = $datetimestamp + ($duration * 60);
|
||||||
$endtime = $starttime;
|
$endmonth = date("m", $datetimestamp);
|
||||||
$endminutes = $startminutes;
|
$endday = date("d", $datetimestamp);
|
||||||
if($endtime == 23) {
|
$endyear = date("Y", $datetimestamp);
|
||||||
$endday++;
|
$endtime = date("G", $datetimestamp);
|
||||||
$endtime = 0;
|
$endminutes = date("i", $datetimestamp);
|
||||||
} else {
|
|
||||||
$endtime++;
|
|
||||||
}
|
|
||||||
|
|
||||||
$tmpl = new OC_Template('calendar', 'part.newevent');
|
$tmpl = new OC_Template('calendar', 'part.newevent');
|
||||||
$tmpl->assign('calendar_options', $calendar_options);
|
$tmpl->assign('calendar_options', $calendar_options);
|
||||||
|
|
|
@ -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();
|
||||||
|
?>
|
|
@ -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();
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
|
@ -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();
|
||||||
|
}
|
||||||
|
?>
|
|
@ -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();
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
|
@ -13,6 +13,7 @@ $l=new OC_L10N('calendar');
|
||||||
|
|
||||||
// Check if we are a user
|
// Check if we are a user
|
||||||
OC_JSON::checkLoggedIn();
|
OC_JSON::checkLoggedIn();
|
||||||
|
OC_JSON::checkAppEnabled('calendar');
|
||||||
|
|
||||||
// Get data
|
// Get data
|
||||||
if( isset( $_POST['timezone'] ) ){
|
if( isset( $_POST['timezone'] ) ){
|
||||||
|
|
|
@ -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));
|
||||||
|
?>
|
|
@ -12,6 +12,7 @@ $l10n = new OC_L10N('calendar');
|
||||||
|
|
||||||
// Check if we are a user
|
// Check if we are a user
|
||||||
OC_JSON::checkLoggedIn();
|
OC_JSON::checkLoggedIn();
|
||||||
|
OC_JSON::checkAppEnabled('calendar');
|
||||||
|
|
||||||
$calendarid = $_POST['id'];
|
$calendarid = $_POST['id'];
|
||||||
OC_Calendar_Calendar::editCalendar($calendarid, $_POST['name'], $_POST['description'], null, null, null, $_POST['color']);
|
OC_Calendar_Calendar::editCalendar($calendarid, $_POST['name'], $_POST['description'], null, null, null, $_POST['color']);
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
$RUNTIME_NOSETUPFS = true;
|
$RUNTIME_NOSETUPFS = true;
|
||||||
|
|
||||||
require_once('../../lib/base.php');
|
require_once('../../lib/base.php');
|
||||||
|
OC_Util::checkAppEnabled('calendar');
|
||||||
|
|
||||||
// Backends
|
// Backends
|
||||||
$authBackend = new OC_Connector_Sabre_Auth();
|
$authBackend = new OC_Connector_Sabre_Auth();
|
||||||
|
|
|
@ -45,6 +45,7 @@
|
||||||
.weekend_thead, .weekend_row{height: 20px;text-align: center;text-align: center;background: #F3F3F3;}
|
.weekend_thead, .weekend_row{height: 20px;text-align: center;text-align: center;background: #F3F3F3;}
|
||||||
.thisday{background: #FFFABC;}
|
.thisday{background: #FFFABC;}
|
||||||
.event {position:relative;}
|
.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%;}
|
.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;}
|
.event_popup {width: 280px; height: 40px; padding: 10px;}
|
||||||
|
|
||||||
|
@ -57,3 +58,6 @@ color:#A9A9A9;
|
||||||
}
|
}
|
||||||
select#category{width:140px;}
|
select#category{width:140px;}
|
||||||
button.category{margin:0 3px;}
|
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;}
|
||||||
|
|
|
@ -8,16 +8,31 @@
|
||||||
|
|
||||||
require_once ("../../lib/base.php");
|
require_once ("../../lib/base.php");
|
||||||
OC_Util::checkLoggedIn();
|
OC_Util::checkLoggedIn();
|
||||||
|
OC_Util::checkAppEnabled('calendar');
|
||||||
$cal = $_GET["calid"];
|
$cal = $_GET["calid"];
|
||||||
$calendar = OC_Calendar_Calendar::findCalendar($cal);
|
$event = $_GET["eventid"];
|
||||||
if($calendar["userid"] != OC_User::getUser()){
|
if(isset($cal)){
|
||||||
header( 'Location: '.OC_Helper::linkTo('', 'index.php'));
|
$calendar = OC_Calendar_Calendar::findCalendar($cal);
|
||||||
exit;
|
if($calendar["userid"] != OC_User::getUser()){
|
||||||
}
|
OC_JSON::error();
|
||||||
$calobjects = OC_Calendar_Object::all($cal);
|
exit;
|
||||||
header("Content-Type: text/Calendar");
|
}
|
||||||
header("Content-Disposition: inline; filename=calendar.ics");
|
$calobjects = OC_Calendar_Object::all($cal);
|
||||||
for($i = 0;$i <= count($calobjects); $i++){
|
header("Content-Type: text/Calendar");
|
||||||
echo $calobjects[$i]["calendardata"] . "\n";
|
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"];
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
require_once ('../../lib/base.php');
|
require_once ('../../lib/base.php');
|
||||||
OC_Util::checkLoggedIn();
|
OC_Util::checkLoggedIn();
|
||||||
|
OC_Util::checkAppEnabled('calendar');
|
||||||
// Create default calendar ...
|
// Create default calendar ...
|
||||||
$calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser());
|
$calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser());
|
||||||
if( count($calendars) == 0){
|
if( count($calendars) == 0){
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
|
|
||||||
Calendar={
|
Calendar={
|
||||||
space:' ',
|
space:' ',
|
||||||
|
firstdayofweek: '',
|
||||||
|
weekend: '',
|
||||||
Date:{
|
Date:{
|
||||||
normal_year_cal: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
|
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],
|
leap_year_cal: [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
|
||||||
|
@ -79,7 +81,7 @@ Calendar={
|
||||||
|
|
||||||
},
|
},
|
||||||
UI:{
|
UI:{
|
||||||
weekdays: ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"],
|
weekdays: '',
|
||||||
formatDayShort:function(day){
|
formatDayShort:function(day){
|
||||||
if (typeof(day) == 'undefined'){
|
if (typeof(day) == 'undefined'){
|
||||||
day = Calendar.Date.current.getDay();
|
day = Calendar.Date.current.getDay();
|
||||||
|
@ -124,7 +126,7 @@ Calendar={
|
||||||
$('#'+this.currentview + "_radio").removeClass('active');
|
$('#'+this.currentview + "_radio").removeClass('active');
|
||||||
this.currentview = view;
|
this.currentview = view;
|
||||||
//sending ajax request on every change 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
|
//not necessary to check whether the response is true or not
|
||||||
switch(view) {
|
switch(view) {
|
||||||
case "onedayview":
|
case "onedayview":
|
||||||
|
@ -153,6 +155,7 @@ Calendar={
|
||||||
Calendar.UI.updateView()
|
Calendar.UI.updateView()
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
drageventid: '',
|
||||||
updateDate:function(direction){
|
updateDate:function(direction){
|
||||||
if(direction == 'forward' && this.current.forward) {
|
if(direction == 'forward' && this.current.forward) {
|
||||||
this.current.forward();
|
this.current.forward();
|
||||||
|
@ -178,18 +181,19 @@ Calendar={
|
||||||
if( typeof (this.events[year]) == "undefined") {
|
if( typeof (this.events[year]) == "undefined") {
|
||||||
this.events[year] = []
|
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") {
|
if(status == "nosession") {
|
||||||
alert("You are not logged in. That can happen if you don't use owncloud for a long time.");
|
alert("You are not logged in. That can happen if you don't use owncloud for a long time.");
|
||||||
document.location(oc_webroot);
|
document.location(oc_webroot);
|
||||||
}
|
}
|
||||||
if(status == "parsingfail" || typeof (newevents) == "undefined") {
|
if(status == "parsingfail" || typeof (jsondata) == "undefined") {
|
||||||
$.ready(function() {
|
$.ready(function() {
|
||||||
$( "#parsingfail_dialog" ).dialog();
|
$( "#parsingfail_dialog" ).dialog();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (typeof(newevents[year]) != 'undefined'){
|
if (typeof(jsondata[year]) != 'undefined'){
|
||||||
Calendar.UI.events[year] = newevents[year];
|
Calendar.UI.calendars = jsondata['calendars'];
|
||||||
|
Calendar.UI.events[year] = jsondata[year];
|
||||||
}
|
}
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
Calendar.UI.updateView();
|
Calendar.UI.updateView();
|
||||||
|
@ -218,7 +222,7 @@ Calendar={
|
||||||
if (!events) {
|
if (!events) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var weekday = (date.getDay()+6)%7;
|
var weekday = (date.getDay()+7-Calendar.firstdayofweek)%7;
|
||||||
if( typeof (events["allday"]) != "undefined") {
|
if( typeof (events["allday"]) != "undefined") {
|
||||||
var eventnumber = 1;
|
var eventnumber = 1;
|
||||||
var eventcontainer = this.current.getEventContainer(week, weekday, "allday");
|
var eventcontainer = this.current.getEventContainer(week, weekday, "allday");
|
||||||
|
@ -244,7 +248,17 @@ Calendar={
|
||||||
.data('event_info', event)
|
.data('event_info', event)
|
||||||
.hover(this.createEventPopup,
|
.hover(this.createEventPopup,
|
||||||
this.hideEventPopup)
|
this.hideEventPopup)
|
||||||
|
.draggable({
|
||||||
|
drag: function() {
|
||||||
|
Calendar.UI.drageventid = event.id;
|
||||||
|
}
|
||||||
|
})
|
||||||
.click(this.editEvent);
|
.click(this.editEvent);
|
||||||
|
var color = this.calendars[event['calendarid']]['color'];
|
||||||
|
if (color){
|
||||||
|
event_holder.css('background-color', color)
|
||||||
|
.addClass('colored');
|
||||||
|
}
|
||||||
eventcontainer.append(event_holder);
|
eventcontainer.append(event_holder);
|
||||||
},
|
},
|
||||||
startEventDialog:function(){
|
startEventDialog:function(){
|
||||||
|
@ -286,7 +300,7 @@ Calendar={
|
||||||
// TODO: save event
|
// TODO: save event
|
||||||
$('#event').dialog('destroy').remove();
|
$('#event').dialog('destroy').remove();
|
||||||
}else{
|
}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){
|
editEvent:function(event){
|
||||||
|
@ -297,12 +311,12 @@ Calendar={
|
||||||
// TODO: save event
|
// TODO: save event
|
||||||
$('#event').dialog('destroy').remove();
|
$('#event').dialog('destroy').remove();
|
||||||
}else{
|
}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){
|
submitDeleteEventForm:function(url){
|
||||||
var post = $( "#event_form" ).serialize();
|
var post = $( "#event_form" ).serialize();
|
||||||
$("#errorbox").html("");
|
$("#errorbox").empty();
|
||||||
$.post(url, post, function(data){
|
$.post(url, post, function(data){
|
||||||
if(data.status == 'success'){
|
if(data.status == 'success'){
|
||||||
$('#event').dialog('destroy').remove();
|
$('#event').dialog('destroy').remove();
|
||||||
|
@ -315,7 +329,7 @@ Calendar={
|
||||||
},
|
},
|
||||||
validateEventForm:function(url){
|
validateEventForm:function(url){
|
||||||
var post = $( "#event_form" ).serialize();
|
var post = $( "#event_form" ).serialize();
|
||||||
$("#errorbox").html("");
|
$("#errorbox").empty();
|
||||||
$.post(url, post,
|
$.post(url, post,
|
||||||
function(data){
|
function(data){
|
||||||
if(data.status == "error"){
|
if(data.status == "error"){
|
||||||
|
@ -352,6 +366,12 @@ Calendar={
|
||||||
}
|
}
|
||||||
},"json");
|
},"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(){
|
showadvancedoptions:function(){
|
||||||
$("#advanced_options").css("display", "block");
|
$("#advanced_options").css("display", "block");
|
||||||
$("#advanced_options_button").css("display", "none");
|
$("#advanced_options_button").css("display", "none");
|
||||||
|
@ -425,7 +445,7 @@ Calendar={
|
||||||
if(check == false){
|
if(check == false){
|
||||||
return false;
|
return false;
|
||||||
}else{
|
}else{
|
||||||
$.post(oc_webroot + "/apps/calendar/ajax/deletecalendar.php", { calendarid: calid},
|
$.post(OC.filePath('calendar', 'ajax', 'deletecalendar.php'), { calendarid: calid},
|
||||||
function(data) {
|
function(data) {
|
||||||
Calendar.UI.loadEvents();
|
Calendar.UI.loadEvents();
|
||||||
$('#choosecalendar_dialog').dialog('destroy').remove();
|
$('#choosecalendar_dialog').dialog('destroy').remove();
|
||||||
|
@ -438,7 +458,7 @@ Calendar={
|
||||||
if($('#choosecalendar_dialog').dialog('isOpen') == true){
|
if($('#choosecalendar_dialog').dialog('isOpen') == true){
|
||||||
$('#choosecalendar_dialog').dialog('moveToTop');
|
$('#choosecalendar_dialog').dialog('moveToTop');
|
||||||
}else{
|
}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({
|
$('#choosecalendar_dialog').dialog({
|
||||||
width : 600,
|
width : 600,
|
||||||
close : function(event, ui) {
|
close : function(event, ui) {
|
||||||
|
@ -450,7 +470,7 @@ Calendar={
|
||||||
},
|
},
|
||||||
activation:function(checkbox, calendarid)
|
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) {
|
function(data) {
|
||||||
checkbox.checked = data == 1;
|
checkbox.checked = data == 1;
|
||||||
Calendar.UI.loadEvents();
|
Calendar.UI.loadEvents();
|
||||||
|
@ -458,14 +478,43 @@ Calendar={
|
||||||
},
|
},
|
||||||
newCalendar:function(object){
|
newCalendar:function(object){
|
||||||
var tr = $(document.createElement('tr'))
|
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();
|
$(object).closest('tr').after(tr).hide();
|
||||||
},
|
},
|
||||||
edit:function(object, calendarid){
|
edit:function(object, calendarid){
|
||||||
var tr = $(document.createElement('tr'))
|
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();
|
$(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){
|
submit:function(button, calendarid){
|
||||||
var displayname = $("#displayname_"+calendarid).val();
|
var displayname = $("#displayname_"+calendarid).val();
|
||||||
var active = $("#edit_active_"+calendarid+":checked").length;
|
var active = $("#edit_active_"+calendarid+":checked").length;
|
||||||
|
@ -490,7 +539,7 @@ Calendar={
|
||||||
cancel:function(button, calendarid){
|
cancel:function(button, calendarid){
|
||||||
$(button).closest('tr').prev().show().next().remove();
|
$(button).closest('tr').prev().show().next().remove();
|
||||||
},
|
},
|
||||||
},
|
},/*
|
||||||
OneDay:{
|
OneDay:{
|
||||||
forward:function(){
|
forward:function(){
|
||||||
Calendar.Date.forward_day();
|
Calendar.Date.forward_day();
|
||||||
|
@ -499,7 +548,7 @@ Calendar={
|
||||||
Calendar.Date.backward_day();
|
Calendar.Date.backward_day();
|
||||||
},
|
},
|
||||||
removeEvents:function(){
|
removeEvents:function(){
|
||||||
$("#onedayview .calendar_row").html("");
|
$("#onedayview .calendar_row").empty();
|
||||||
},
|
},
|
||||||
renderCal:function(){
|
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());
|
$("#datecontrol_date").val(Calendar.UI.formatDayShort() + Calendar.space + Calendar.Date.current.getDate() + Calendar.space + Calendar.UI.formatMonthShort() + Calendar.space + Calendar.Date.current.getFullYear());
|
||||||
|
@ -520,7 +569,7 @@ Calendar={
|
||||||
return $(document.createElement('p'))
|
return $(document.createElement('p'))
|
||||||
.html(time + event['description'])
|
.html(time + event['description'])
|
||||||
},
|
},
|
||||||
},
|
},*/
|
||||||
OneWeek:{
|
OneWeek:{
|
||||||
forward:function(){
|
forward:function(){
|
||||||
Calendar.Date.forward_week();
|
Calendar.Date.forward_week();
|
||||||
|
@ -530,7 +579,7 @@ Calendar={
|
||||||
},
|
},
|
||||||
removeEvents:function(){
|
removeEvents:function(){
|
||||||
for( i = 0; i <= 6; i++) {
|
for( i = 0; i <= 6; i++) {
|
||||||
$("#oneweekview ." + Calendar.UI.weekdays[i]).html("");
|
$("#oneweekview ." + Calendar.UI.weekdays[i]).empty();
|
||||||
}
|
}
|
||||||
$("#oneweekview .thisday").removeClass("thisday");
|
$("#oneweekview .thisday").removeClass("thisday");
|
||||||
},
|
},
|
||||||
|
@ -539,7 +588,23 @@ Calendar={
|
||||||
var dates = this.generateDates();
|
var dates = this.generateDates();
|
||||||
var today = new Date();
|
var today = new Date();
|
||||||
for(var i = 0; i <= 6; i++){
|
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()){
|
if(dates[i].getDate() == today.getDate() && dates[i].getMonth() == today.getMonth() && dates[i].getFullYear() == today.getFullYear()){
|
||||||
$("#oneweekview ." + Calendar.UI.weekdays[i]).addClass("thisday");
|
$("#oneweekview ." + Calendar.UI.weekdays[i]).addClass("thisday");
|
||||||
}
|
}
|
||||||
|
@ -570,14 +635,18 @@ Calendar={
|
||||||
if(dayofweek == 0) {
|
if(dayofweek == 0) {
|
||||||
dayofweek = 7;
|
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++) {
|
for(var i = 0; i <= 6; i++) {
|
||||||
dates[i] = new Date(date)
|
dates[i] = new Date(date)
|
||||||
date.setDate(date.getDate() + 1);
|
date.setDate(date.getDate() + 1);
|
||||||
}
|
}
|
||||||
return dates;
|
return dates;
|
||||||
},
|
},
|
||||||
},
|
},/*
|
||||||
FourWeeks:{
|
FourWeeks:{
|
||||||
forward:function(){
|
forward:function(){
|
||||||
Calendar.Date.forward_week();
|
Calendar.Date.forward_week();
|
||||||
|
@ -587,7 +656,7 @@ Calendar={
|
||||||
},
|
},
|
||||||
removeEvents:function(){
|
removeEvents:function(){
|
||||||
$('#fourweeksview .day.thisday').removeClass('thisday');
|
$('#fourweeksview .day.thisday').removeClass('thisday');
|
||||||
$('#fourweeksview .day .events').html('');
|
$('#fourweeksview .day .events').empty();
|
||||||
},
|
},
|
||||||
renderCal:function(){
|
renderCal:function(){
|
||||||
var calw1 = Calendar.Date.calw();
|
var calw1 = Calendar.Date.calw();
|
||||||
|
@ -674,7 +743,7 @@ Calendar={
|
||||||
}
|
}
|
||||||
return dates;
|
return dates;
|
||||||
},
|
},
|
||||||
},
|
},*/
|
||||||
OneMonth:{
|
OneMonth:{
|
||||||
forward:function(){
|
forward:function(){
|
||||||
Calendar.Date.forward_month();
|
Calendar.Date.forward_month();
|
||||||
|
@ -684,7 +753,7 @@ Calendar={
|
||||||
},
|
},
|
||||||
removeEvents:function(){
|
removeEvents:function(){
|
||||||
$('#onemonthview .day.thisday').removeClass('thisday');
|
$('#onemonthview .day.thisday').removeClass('thisday');
|
||||||
$('#onemonthview .day .events').html('');
|
$('#onemonthview .day .events').empty();
|
||||||
},
|
},
|
||||||
renderCal:function(){
|
renderCal:function(){
|
||||||
$("#datecontrol_date").val(Calendar.UI.formatMonthLong() + Calendar.space + Calendar.Date.current.getFullYear());
|
$("#datecontrol_date").val(Calendar.UI.formatMonthLong() + Calendar.space + Calendar.Date.current.getFullYear());
|
||||||
|
@ -712,6 +781,13 @@ Calendar={
|
||||||
var month = dates[i].getMonth();
|
var month = dates[i].getMonth();
|
||||||
var year = dates[i].getFullYear();
|
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] + " .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()){
|
if(dayofmonth == today.getDate() && month == today.getMonth() && year == today.getFullYear()){
|
||||||
$("#onemonthview .week_" + week + " ." + Calendar.UI.weekdays[weekday]).addClass('thisday');
|
$("#onemonthview .week_" + week + " ." + Calendar.UI.weekdays[weekday]).addClass('thisday');
|
||||||
}
|
}
|
||||||
|
@ -776,7 +852,11 @@ Calendar={
|
||||||
dayofweek = 7;
|
dayofweek = 7;
|
||||||
this.rows++;
|
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++) {
|
for(var i = 0; i <= 41; i++) {
|
||||||
dates[i] = new Date(date)
|
dates[i] = new Date(date)
|
||||||
date.setDate(date.getDate() + 1);
|
date.setDate(date.getDate() + 1);
|
||||||
|
@ -786,7 +866,7 @@ Calendar={
|
||||||
},
|
},
|
||||||
List:{
|
List:{
|
||||||
removeEvents:function(){
|
removeEvents:function(){
|
||||||
this.eventContainer = $('#listview #events').html('');
|
this.eventContainer = $('#listview #events').empty();
|
||||||
this.startdate = new Date();
|
this.startdate = new Date();
|
||||||
this.enddate = new Date();
|
this.enddate = new Date();
|
||||||
this.enddate.setDate(this.enddate.getDate());
|
this.enddate.setDate(this.enddate.getDate());
|
||||||
|
|
|
@ -3,9 +3,61 @@ $(document).ready(function(){
|
||||||
OC.msg.startSaving('#calendar .msg')
|
OC.msg.startSaving('#calendar .msg')
|
||||||
// Serialize the data
|
// Serialize the data
|
||||||
var post = $( "#timezone" ).serialize();
|
var post = $( "#timezone" ).serialize();
|
||||||
$.post( oc_webroot + '/apps/calendar/ajax/settimezone.php', post, function(data){
|
$.post( OC.filePath('calendar', 'ajax', 'settimezone.php'), post, function(data){
|
||||||
OC.msg.finishedSaving('#calendar .msg', data);
|
//OC.msg.finishedSaving('#calendar .msg', data);
|
||||||
});
|
});
|
||||||
return false;
|
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");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -286,6 +286,30 @@ class OC_Calendar_Object{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getDTEndFromVEvent($vevent)
|
||||||
|
{
|
||||||
|
if ($vevent->DTEND) {
|
||||||
|
$dtend = $vevent->DTEND;
|
||||||
|
}else{
|
||||||
|
$dtend = clone $vevent->DTSTART;
|
||||||
|
if ($vevent->DURATION){
|
||||||
|
$duration = strval($vevent->DURATION);
|
||||||
|
$invert = 0;
|
||||||
|
if ($duration[0] == '-'){
|
||||||
|
$duration = substr($duration, 1);
|
||||||
|
$invert = 1;
|
||||||
|
}
|
||||||
|
if ($duration[0] == '+'){
|
||||||
|
$duration = substr($duration, 1);
|
||||||
|
}
|
||||||
|
$interval = new DateInterval($duration);
|
||||||
|
$interval->invert = $invert;
|
||||||
|
$dtend->getDateTime()->add($interval);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $dtend;
|
||||||
|
}
|
||||||
|
|
||||||
public static function getCategoryOptions($l10n)
|
public static function getCategoryOptions($l10n)
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
|
@ -482,6 +506,7 @@ class OC_Calendar_Object{
|
||||||
}
|
}
|
||||||
$vevent->DTSTART = $dtstart;
|
$vevent->DTSTART = $dtstart;
|
||||||
$vevent->DTEND = $dtend;
|
$vevent->DTEND = $dtend;
|
||||||
|
unset($vevent->DURATION);
|
||||||
|
|
||||||
if($location != ""){
|
if($location != ""){
|
||||||
$vevent->LOCATION = $location;
|
$vevent->LOCATION = $location;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
$hours = array(
|
$hours24 = array(
|
||||||
'allday' => $l->t('All day'),
|
'allday' => $l->t('All day'),
|
||||||
0 => '0',
|
0 => '0',
|
||||||
1 => '1',
|
1 => '1',
|
||||||
|
@ -26,9 +26,58 @@ $hours = array(
|
||||||
22 => '22',
|
22 => '22',
|
||||||
23 => '23',
|
23 => '23',
|
||||||
);
|
);
|
||||||
$weekdays = array('monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday');
|
$hoursampm = array(
|
||||||
|
'allday' => $l->t('All day'),
|
||||||
|
0 => '12 a.m.',
|
||||||
|
1 => '1 a.m.',
|
||||||
|
2 => '2 a.m.',
|
||||||
|
3 => '3 a.m.',
|
||||||
|
4 => '4 a.m.',
|
||||||
|
5 => '5 a.m.',
|
||||||
|
6 => '6 a.m.',
|
||||||
|
7 => '7 a.m.',
|
||||||
|
8 => '8 a.m.',
|
||||||
|
9 => '9 a.m.',
|
||||||
|
10 => '10 a.m.',
|
||||||
|
11 => '11 a.m.',
|
||||||
|
12 => '12 p.m.',
|
||||||
|
13 => '1 p.m.',
|
||||||
|
14 => '2 p.m.',
|
||||||
|
15 => '3 p.m.',
|
||||||
|
16 => '4 p.m.',
|
||||||
|
17 => '5 p.m.',
|
||||||
|
18 => '6 p.m.',
|
||||||
|
19 => '7 p.m.',
|
||||||
|
20 => '8 p.m.',
|
||||||
|
21 => '9 p.m.',
|
||||||
|
22 => '10 p.m.',
|
||||||
|
23 => '11 p.m.',
|
||||||
|
);
|
||||||
|
if(OC_Preferences::getValue( OC_User::getUser(), 'calendar', 'timeformat', "24") == "24"){
|
||||||
|
$hours = $hours24;
|
||||||
|
}else{
|
||||||
|
$hours = $hoursampm;
|
||||||
|
}
|
||||||
|
$weekdaynames = array('sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday');
|
||||||
|
$dayforgenerator = OC_Preferences::getValue( OC_User::getUser(), 'calendar', 'firstdayofweek', "1");
|
||||||
|
$weekdays = array();
|
||||||
|
for($i = 0;$i <= 6; $i++){
|
||||||
|
$weekdays[$i] = $weekdaynames[$dayforgenerator];
|
||||||
|
if($dayforgenerator == 6){
|
||||||
|
$dayforgenerator = 0;
|
||||||
|
}else{
|
||||||
|
$dayforgenerator++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$weekendjson = OC_Preferences::getValue( OC_User::getUser(), 'calendar', 'weekend', '{"Monday":"false","Tuesday":"false","Wednesday":"false","Thursday":"false","Friday":"false","Saturday":"true","Sunday":"true"}');
|
||||||
|
$weekend = json_decode($weekendjson, true);
|
||||||
|
$weekenddays = array("sunday"=>$weekend["Sunday"], "monday"=>$weekend["Monday"], "tuesday"=>$weekend["Tuesday"], "wednesday"=>$weekend["Wednesday"], "thursday"=>$weekend["Thursday"], "friday"=>$weekend["Friday"], "saturday"=>$weekend["Saturday"]);
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
<?php
|
||||||
|
echo "var weekdays = new Array('".$weekdays[0]."','".$weekdays[1]."','".$weekdays[2]."','".$weekdays[3]."','".$weekdays[4]."','".$weekdays[5]."','".$weekdays[6]."');\n";
|
||||||
|
?>
|
||||||
|
Calendar.UI.weekdays = weekdays;
|
||||||
Calendar.UI.daylong = new Array("<?php echo $l -> t("Sunday");?>", "<?php echo $l -> t("Monday");?>", "<?php echo $l -> t("Tuesday");?>", "<?php echo $l -> t("Wednesday");?>", "<?php echo $l -> t("Thursday");?>", "<?php echo $l -> t("Friday");?>", "<?php echo $l -> t("Saturday");?>");
|
Calendar.UI.daylong = new Array("<?php echo $l -> t("Sunday");?>", "<?php echo $l -> t("Monday");?>", "<?php echo $l -> t("Tuesday");?>", "<?php echo $l -> t("Wednesday");?>", "<?php echo $l -> t("Thursday");?>", "<?php echo $l -> t("Friday");?>", "<?php echo $l -> t("Saturday");?>");
|
||||||
Calendar.UI.dayshort = new Array("<?php echo $l -> t("Sun.");?>", "<?php echo $l -> t("Mon.");?>", "<?php echo $l -> t("Tue.");?>", "<?php echo $l -> t("Wed.");?>", "<?php echo $l -> t("Thu.");?>", "<?php echo $l -> t("Fri.");?>", "<?php echo $l -> t("Sat.");?>");
|
Calendar.UI.dayshort = new Array("<?php echo $l -> t("Sun.");?>", "<?php echo $l -> t("Mon.");?>", "<?php echo $l -> t("Tue.");?>", "<?php echo $l -> t("Wed.");?>", "<?php echo $l -> t("Thu.");?>", "<?php echo $l -> t("Fri.");?>", "<?php echo $l -> t("Sat.");?>");
|
||||||
Calendar.UI.monthlong = new Array("<?php echo $l -> t("January");?>", "<?php echo $l -> t("February");?>", "<?php echo $l -> t("March");?>", "<?php echo $l -> t("April");?>", "<?php echo $l -> t("May");?>", "<?php echo $l -> t("June");?>", "<?php echo $l -> t("July");?>", "<?php echo $l -> t("August");?>", "<?php echo $l -> t("September");?>", "<?php echo $l -> t("October");?>", "<?php echo $l -> t("November");?>", "<?php echo $l -> t("December");?>");
|
Calendar.UI.monthlong = new Array("<?php echo $l -> t("January");?>", "<?php echo $l -> t("February");?>", "<?php echo $l -> t("March");?>", "<?php echo $l -> t("April");?>", "<?php echo $l -> t("May");?>", "<?php echo $l -> t("June");?>", "<?php echo $l -> t("July");?>", "<?php echo $l -> t("August");?>", "<?php echo $l -> t("September");?>", "<?php echo $l -> t("October");?>", "<?php echo $l -> t("November");?>", "<?php echo $l -> t("December");?>");
|
||||||
|
@ -37,6 +86,7 @@ $weekdays = array('monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'satur
|
||||||
Calendar.UI.cws_label = "<?php echo $l->t("Weeks");?>";
|
Calendar.UI.cws_label = "<?php echo $l->t("Weeks");?>";
|
||||||
Calendar.UI.more_before = String('<?php echo $l->t('More before {startdate}') ?>');
|
Calendar.UI.more_before = String('<?php echo $l->t('More before {startdate}') ?>');
|
||||||
Calendar.UI.more_after = String('<?php echo $l->t('More after {enddate}') ?>');
|
Calendar.UI.more_after = String('<?php echo $l->t('More after {enddate}') ?>');
|
||||||
|
Calendar.firstdayofweek = parseInt("<?php echo OC_Preferences::getValue( OC_User::getUser(), 'calendar', 'firstdayofweek', "1"); ?>");
|
||||||
//use last view as default on the next
|
//use last view as default on the next
|
||||||
Calendar.UI.setCurrentView("<?php echo OC_Preferences::getValue(OC_USER::getUser(), "calendar", "currentview", "onemonthview") ?>");
|
Calendar.UI.setCurrentView("<?php echo OC_Preferences::getValue(OC_USER::getUser(), "calendar", "currentview", "onemonthview") ?>");
|
||||||
var totalurl = "<?php echo OC_Helper::linkTo('calendar', 'caldav.php', null, true) . '/calendars'; ?>";
|
var totalurl = "<?php echo OC_Helper::linkTo('calendar', 'caldav.php', null, true) . '/calendars'; ?>";
|
||||||
|
@ -93,7 +143,7 @@ $weekdays = array('monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'satur
|
||||||
<tr>
|
<tr>
|
||||||
<th class="calendar_time"><?php echo $l->t("Time");?></th>
|
<th class="calendar_time"><?php echo $l->t("Time");?></th>
|
||||||
<?php foreach($weekdays as $weekdaynr => $weekday): ?>
|
<?php foreach($weekdays as $weekdaynr => $weekday): ?>
|
||||||
<th class="calendar_row <?php echo $weekday ?> <?php echo $weekdaynr > 4 ? 'weekend_thead' : '' ?>" onclick="Calendar.UI.newEvent('#oneweekview th.<?php echo $weekday ?>');"></th>
|
<th class="calendar_row <?php echo $weekday ?> <?php echo $weekenddays[$weekday] == "true" ? 'weekend_thead' : '' ?>" onclick="Calendar.UI.newEvent('#oneweekview th.<?php echo $weekday ?>');"></th>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
@ -102,7 +152,7 @@ $weekdays = array('monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'satur
|
||||||
<tr>
|
<tr>
|
||||||
<td class="calendar_time"><?php echo $time_label?></td>
|
<td class="calendar_time"><?php echo $time_label?></td>
|
||||||
<?php foreach($weekdays as $weekdaynr => $weekday): ?>
|
<?php foreach($weekdays as $weekdaynr => $weekday): ?>
|
||||||
<td class="<?php echo $weekday ?> <?php echo $time ?> calendar_row <?php echo $weekdaynr > 4 ? 'weekend_row' : '' ?>" onclick="Calendar.UI.newEvent('#oneweekview th.<?php echo $weekday ?>', '<?php echo $time ?>');"></td>
|
<td class="<?php echo $weekday ?> <?php echo $time ?> calendar_row <?php echo $weekenddays[$weekday] == "true" ? 'weekend_row' : '' ?>" onclick="Calendar.UI.newEvent('#oneweekview th.<?php echo $weekday ?>', '<?php echo $time ?>');"></td>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
@ -139,7 +189,7 @@ $weekdays = array('monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'satur
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<?php foreach($weekdays as $weekdaynr => $weekday): ?>
|
<?php foreach($weekdays as $weekdaynr => $weekday): ?>
|
||||||
<th class="calendar_row <?php echo $weekdaynr > 4 ? 'weekend_thead' : '' ?> <?php echo $weekday ?>"><?php echo $l->t(ucfirst($weekday));?></th>
|
<th class="calendar_row <?php echo $weekenddays[$weekday] == "true" ? 'weekend_thead' : '' ?> <?php echo $weekday ?>"><?php echo $l->t(ucfirst($weekday));?></th>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
@ -147,7 +197,7 @@ $weekdays = array('monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'satur
|
||||||
<?php foreach(range(1, 6) as $week): ?>
|
<?php foreach(range(1, 6) as $week): ?>
|
||||||
<tr class="week_<?php echo $week ?>">
|
<tr class="week_<?php echo $week ?>">
|
||||||
<?php foreach($weekdays as $weekdaynr => $weekday): ?>
|
<?php foreach($weekdays as $weekdaynr => $weekday): ?>
|
||||||
<td class="day <?php echo $weekday ?> <?php echo $weekdaynr > 4 ? 'weekend' : '' ?>" onclick="Calendar.UI.newEvent('#onemonthview .week_<?php echo $week ?> .<?php echo $weekday ?>')">
|
<td class="day <?php echo $weekday ?> <?php echo $weekenddays[$weekday] == "true" ? 'weekend' : '' ?>" onclick="Calendar.UI.newEvent('#onemonthview .week_<?php echo $week ?> .<?php echo $weekday ?>')">
|
||||||
<div class="dateinfo"></div>
|
<div class="dateinfo"></div>
|
||||||
<div class="events"></div>
|
<div class="events"></div>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -11,12 +11,12 @@ for($i = 0; $i < count($option_calendars); $i++){
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="4">
|
<td colspan="6">
|
||||||
<a href="#" onclick="Calendar.UI.Calendar.newCalendar(this);"><?php echo $l->t('New Calendar') ?></a>
|
<a href="#" onclick="Calendar.UI.Calendar.newCalendar(this);"><?php echo $l->t('New Calendar') ?></a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="4">
|
<td colspan="6">
|
||||||
<p style="margin: 0 auto;width: 90%;"><input style="display:none;width: 90%;float: left;" type="text" id="caldav_url" onmouseover="$('#caldav_url').select();" title="<?php echo $l->t("CalDav Link"); ?>"><img id="caldav_url_close" style="height: 20px;vertical-align: middle;display: none;" src="../../core/img/actions/delete.svg" alt="close" onclick="$('#caldav_url').hide();$('#caldav_url_close').hide();"/></p>
|
<p style="margin: 0 auto;width: 90%;"><input style="display:none;width: 90%;float: left;" type="text" id="caldav_url" onmouseover="$('#caldav_url').select();" title="<?php echo $l->t("CalDav Link"); ?>"><img id="caldav_url_close" style="height: 20px;vertical-align: middle;display: none;" src="../../core/img/actions/delete.svg" alt="close" onclick="$('#caldav_url').hide();$('#caldav_url_close').hide();"/></p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* See the COPYING-README file.
|
* See the COPYING-README file.
|
||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
<td id="<?php echo $_['new'] ? 'new' : 'edit' ?>calendar_dialog" title="<?php echo $_['new'] ? $l->t("New calendar") : $l->t("Edit calendar"); ?>" colspan="4">
|
<td id="<?php echo $_['new'] ? 'new' : 'edit' ?>calendar_dialog" title="<?php echo $_['new'] ? $l->t("New calendar") : $l->t("Edit calendar"); ?>" colspan="6">
|
||||||
<table width="100%" style="border: 0;">
|
<table width="100%" style="border: 0;">
|
||||||
<tr>
|
<tr>
|
||||||
<th><?php echo $l->t('Displayname') ?></th>
|
<th><?php echo $l->t('Displayname') ?></th>
|
||||||
|
@ -34,7 +34,14 @@
|
||||||
<tr>
|
<tr>
|
||||||
<th><?php echo $l->t('Calendar color') ?></th>
|
<th><?php echo $l->t('Calendar color') ?></th>
|
||||||
<td>
|
<td>
|
||||||
<input id="calendarcolor_<?php echo $_['calendar']['id'] ?>" type="text" value="<?php echo $_['calendar']['calendarcolor'] ?>">
|
<select id="calendarcolor_<?php echo $_['calendar']['id'] ?>" class="colorpicker">
|
||||||
|
<?php
|
||||||
|
if (!isset($_['calendar']['calendarcolor'])) {$_['calendar']['calendarcolor'] = false;}
|
||||||
|
foreach($_['calendarcolor_options'] as $color){
|
||||||
|
echo '<option value="' . $color . '"' . ($_['calendar']['calendarcolor'] == $color ? ' selected="selected"' : '') . '>' . $color . '</option>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
<span id="actions">
|
<span id="actions">
|
||||||
<input type="button" class="submit" style="float: left;" value="<?php echo $l->t("Submit");?>" onclick="Calendar.UI.validateEventForm('ajax/editevent.php');">
|
<input type="button" class="submit" style="float: left;" value="<?php echo $l->t("Submit");?>" onclick="Calendar.UI.validateEventForm('ajax/editevent.php');">
|
||||||
<input type="button" class="submit" style="float: left;" name="delete" value="<?php echo $l->t("Delete");?>" onclick="Calendar.UI.submitDeleteEventForm('ajax/deleteevent.php');">
|
<input type="button" class="submit" style="float: left;" name="delete" value="<?php echo $l->t("Delete");?>" onclick="Calendar.UI.submitDeleteEventForm('ajax/deleteevent.php');">
|
||||||
|
<input type="button" class="submit" style="float: right;" name="export" value="<?php echo $l->t("Export");?>" onclick="window.location='export.php?eventid=<?php echo $_['id'] ?>';">
|
||||||
</span>
|
</span>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
<td>
|
<td>
|
||||||
<select id="category" name="categories[]" multiple="multiple" title="<?php echo $l->t("Select category") ?>">
|
<select id="category" name="categories[]" multiple="multiple" title="<?php echo $l->t("Select category") ?>">
|
||||||
<?php
|
<?php
|
||||||
|
if (!isset($_['categories'])) {$_['categories'] = array();}
|
||||||
foreach($_['category_options'] as $category){
|
foreach($_['category_options'] as $category){
|
||||||
if (!isset($_['categories'])) {$_['categories'] = array();}
|
|
||||||
echo '<option value="' . $category . '"' . (in_array($category, $_['categories']) ? ' selected="selected"' : '') . '>' . $category . '</option>';
|
echo '<option value="' . $category . '"' . (in_array($category, $_['categories']) ? ' selected="selected"' : '') . '>' . $category . '</option>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -22,8 +22,8 @@
|
||||||
<td>
|
<td>
|
||||||
<select style="width:140px;" name="calendar">
|
<select style="width:140px;" name="calendar">
|
||||||
<?php
|
<?php
|
||||||
|
if (!isset($_['calendar'])) {$_['calendar'] = false;}
|
||||||
foreach($_['calendar_options'] as $calendar){
|
foreach($_['calendar_options'] as $calendar){
|
||||||
if (!isset($_['calendar'])) {$_['calendar'] = false;}
|
|
||||||
echo '<option value="' . $calendar['id'] . '"' . ($_['calendar'] == $calendar['id'] ? ' selected="selected"' : '') . '>' . $calendar['displayname'] . '</option>';
|
echo '<option value="' . $calendar['id'] . '"' . ($_['calendar'] == $calendar['id'] ? ' selected="selected"' : '') . '>' . $calendar['displayname'] . '</option>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -1,57 +0,0 @@
|
||||||
<?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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
$calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser(), 1);
|
|
||||||
$events = array();
|
|
||||||
foreach($calendars as $calendar) {
|
|
||||||
$tmp = OC_Calendar_Object::all($calendar['id']);
|
|
||||||
$events = array_merge($events, $tmp);
|
|
||||||
}
|
|
||||||
$select_year = $_GET["year"];
|
|
||||||
$return_events = array();
|
|
||||||
$user_timezone = OC_Preferences::getValue(OC_USER::getUser(), "calendar", "timezone", "Europe/London");
|
|
||||||
foreach($events as $event)
|
|
||||||
{
|
|
||||||
if ($select_year != substr($event['startdate'], 0, 4))
|
|
||||||
continue;
|
|
||||||
$start_dt = new DateTime($event['startdate'], new DateTimeZone('UTC'));
|
|
||||||
$start_dt->setTimezone(new DateTimeZone($user_timezone));
|
|
||||||
$end_dt = new DateTime($event['enddate'], new DateTimeZone('UTC'));
|
|
||||||
$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');
|
|
||||||
|
|
||||||
// hack
|
|
||||||
if (strstr($event['calendardata'], 'DTSTART;VALUE=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_events[$year][$month][$day][$hour]))
|
|
||||||
{
|
|
||||||
$return_events[$year][$month][$day][$hour][] = $return_event;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$return_events[$year][$month][$day][$hour] = array(1 => $return_event);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
OC_JSON::encodedPrint($return_events);
|
|
||||||
?>
|
|
|
@ -1,15 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2011 Bart Visscher <bartv@thisnet.nl>
|
* Copyright (c) 2011 Bart Visscher <bartv@thisnet.nl>
|
||||||
|
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
|
||||||
* This file is licensed under the Affero General Public License version 3 or
|
* This file is licensed under the Affero General Public License version 3 or
|
||||||
* later.
|
* later.
|
||||||
* See the COPYING-README file.
|
* See the COPYING-README file.
|
||||||
*/
|
*/
|
||||||
|
OC_UTIL::addScript('', 'jquery.multiselect');
|
||||||
|
OC_UTIL::addStyle('', 'jquery.multiselect');
|
||||||
?>
|
?>
|
||||||
<form id="calendar">
|
<form id="calendar">
|
||||||
<fieldset class="personalblock">
|
<fieldset class="personalblock">
|
||||||
<label for="timezone"><strong><?php echo $l->t('Timezone');?></strong></label>
|
<label for="timezone"><strong><?php echo $l->t('Timezone');?></strong></label>
|
||||||
<select id="timezone" name="timezone">
|
<select style="display: none;" id="timezone" name="timezone">
|
||||||
<?php
|
<?php
|
||||||
$continent = '';
|
$continent = '';
|
||||||
foreach($_['timezones'] as $timezone):
|
foreach($_['timezones'] as $timezone):
|
||||||
|
@ -24,6 +27,34 @@
|
||||||
echo '<option value="'.$timezone.'"'.($_['timezone'] == $timezone?' selected="selected"':'').'>'.$city.'</option>';
|
echo '<option value="'.$timezone.'"'.($_['timezone'] == $timezone?' selected="selected"':'').'>'.$city.'</option>';
|
||||||
endif;
|
endif;
|
||||||
endforeach;?>
|
endforeach;?>
|
||||||
</select><span class="msg"></span>
|
</select>
|
||||||
|
<label for="timeformat"><strong><?php echo $l->t('Timeformat');?></strong></label>
|
||||||
|
<select style="display: none;" id="timeformat" title="<?php echo "timeformat"; ?>" name="timeformat">
|
||||||
|
<option value="24" id="24h"><?php echo $l->t("24h"); ?></option>
|
||||||
|
<option value="ampm" id="ampm"><?php echo $l->t("12h"); ?></option>
|
||||||
|
</select><br />
|
||||||
|
<label for="firstdayofweek"><strong><?php echo $l->t('First day of the week');?></strong></label>
|
||||||
|
<select style="display: none;" id="firstdayofweek" name="firstdayofweek">
|
||||||
|
<?php
|
||||||
|
$weekdays = array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
|
||||||
|
for($i = 0;$i <= 6;$i++){
|
||||||
|
echo '<option value="'.$i.'" id="select_'.$i.'">' . $l->t($weekdays[$i]) . '</option>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</select><br />
|
||||||
|
<label for="weekend"><strong><?php echo $l->t('Days of weekend');?></strong></label>
|
||||||
|
<select id="weekend" name="weekend[]" style="width: 50%;" multiple="multiple" title="<?php echo $l->t("Weekend"); ?>">
|
||||||
|
<?php
|
||||||
|
$weekdays = array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
|
||||||
|
for($i = 0;$i <= 6;$i++){
|
||||||
|
echo '<option value="'.$weekdays[$i].'" id="selectweekend_' . $weekdays[$i] . '">' . $l->t($weekdays[$i]) . '</option>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</select><br />
|
||||||
|
<label for="duration"><strong><?php echo $l->t('Event duration');?></strong></label>
|
||||||
|
<input type="text" maxlength="3" size="3" style="width: 2em;" id="duration" name="duration" /> <?php echo $l->t("Minutes");?>
|
||||||
|
<br />
|
||||||
|
<?php echo $l->t('Calendar CalDAV syncing address:');?>
|
||||||
|
<?php echo OC_Helper::linkTo('apps/calendar', 'caldav.php', null, true); ?><br />
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -28,6 +28,7 @@ $l10n = new OC_L10N('contacts');
|
||||||
|
|
||||||
// Check if we are a user
|
// Check if we are a user
|
||||||
OC_JSON::checkLoggedIn();
|
OC_JSON::checkLoggedIn();
|
||||||
|
OC_JSON::checkAppEnabled('contacts');
|
||||||
|
|
||||||
$addressbook = OC_Contacts_Addressbook::find( $aid );
|
$addressbook = OC_Contacts_Addressbook::find( $aid );
|
||||||
if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){
|
if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){
|
||||||
|
|
|
@ -28,6 +28,7 @@ $l10n = new OC_L10N('contacts');
|
||||||
|
|
||||||
// Check if we are a user
|
// Check if we are a user
|
||||||
OC_JSON::checkLoggedIn();
|
OC_JSON::checkLoggedIn();
|
||||||
|
OC_JSON::checkAppEnabled('contacts');
|
||||||
|
|
||||||
$card = OC_Contacts_VCard::find( $id );
|
$card = OC_Contacts_VCard::find( $id );
|
||||||
if( $card === false ){
|
if( $card === false ){
|
||||||
|
|
|
@ -29,6 +29,7 @@ $l10n = new OC_L10N('contacts');
|
||||||
|
|
||||||
// Check if we are a user
|
// Check if we are a user
|
||||||
OC_JSON::checkLoggedIn();
|
OC_JSON::checkLoggedIn();
|
||||||
|
OC_JSON::checkAppEnabled('contacts');
|
||||||
|
|
||||||
$addressbook = OC_Contacts_Addressbook::find( $id );
|
$addressbook = OC_Contacts_Addressbook::find( $id );
|
||||||
if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){
|
if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){
|
||||||
|
|
|
@ -29,6 +29,7 @@ $l10n = new OC_L10N('contacts');
|
||||||
|
|
||||||
// Check if we are a user
|
// Check if we are a user
|
||||||
OC_JSON::checkLoggedIn();
|
OC_JSON::checkLoggedIn();
|
||||||
|
OC_JSON::checkAppEnabled('contacts');
|
||||||
|
|
||||||
$card = OC_Contacts_VCard::find( $id );
|
$card = OC_Contacts_VCard::find( $id );
|
||||||
if( $card === false ){
|
if( $card === false ){
|
||||||
|
|
|
@ -31,6 +31,7 @@ $l10n = new OC_L10N('contacts');
|
||||||
|
|
||||||
// Check if we are a user
|
// Check if we are a user
|
||||||
OC_JSON::checkLoggedIn();
|
OC_JSON::checkLoggedIn();
|
||||||
|
OC_JSON::checkAppEnabled('contacts');
|
||||||
|
|
||||||
$card = OC_Contacts_VCard::find( $id );
|
$card = OC_Contacts_VCard::find( $id );
|
||||||
if( $card === false ){
|
if( $card === false ){
|
||||||
|
|
|
@ -29,6 +29,7 @@ $l10n = new OC_L10N('contacts');
|
||||||
|
|
||||||
// Check if we are a user
|
// Check if we are a user
|
||||||
OC_JSON::checkLoggedIn();
|
OC_JSON::checkLoggedIn();
|
||||||
|
OC_JSON::checkAppEnabled('contacts');
|
||||||
|
|
||||||
|
|
||||||
$card = OC_Contacts_VCard::find( $id );
|
$card = OC_Contacts_VCard::find( $id );
|
||||||
|
|
|
@ -29,6 +29,7 @@ $l10n = new OC_L10N('contacts');
|
||||||
|
|
||||||
// Check if we are a user
|
// Check if we are a user
|
||||||
OC_JSON::checkLoggedIn();
|
OC_JSON::checkLoggedIn();
|
||||||
|
OC_JSON::checkAppEnabled('contacts');
|
||||||
|
|
||||||
$card = OC_Contacts_VCard::find( $id );
|
$card = OC_Contacts_VCard::find( $id );
|
||||||
if( $card === false ){
|
if( $card === false ){
|
||||||
|
|
|
@ -27,6 +27,7 @@ $l10n = new OC_L10N('contacts');
|
||||||
|
|
||||||
// Check if we are a user
|
// Check if we are a user
|
||||||
OC_JSON::checkLoggedIn();
|
OC_JSON::checkLoggedIn();
|
||||||
|
OC_JSON::checkAppEnabled('contacts');
|
||||||
|
|
||||||
$addressbooks = OC_Contacts_Addressbook::all(OC_USER::getUser());
|
$addressbooks = OC_Contacts_Addressbook::all(OC_USER::getUser());
|
||||||
$tmpl = new OC_Template('contacts','part.addcardform');
|
$tmpl = new OC_Template('contacts','part.addcardform');
|
||||||
|
|
|
@ -28,6 +28,7 @@ $l10n = new OC_L10N('contacts');
|
||||||
|
|
||||||
// Check if we are a user
|
// Check if we are a user
|
||||||
OC_JSON::checkLoggedIn();
|
OC_JSON::checkLoggedIn();
|
||||||
|
OC_JSON::checkAppEnabled('contacts');
|
||||||
|
|
||||||
$card = OC_Contacts_VCard::find( $id );
|
$card = OC_Contacts_VCard::find( $id );
|
||||||
if( $card === false ){
|
if( $card === false ){
|
||||||
|
|
|
@ -29,6 +29,7 @@ $l10n = new OC_L10N('contacts');
|
||||||
|
|
||||||
// Check if we are a user
|
// Check if we are a user
|
||||||
OC_JSON::checkLoggedIn();
|
OC_JSON::checkLoggedIn();
|
||||||
|
OC_JSON::checkAppEnabled('contacts');
|
||||||
|
|
||||||
$card = OC_Contacts_VCard::find( $id );
|
$card = OC_Contacts_VCard::find( $id );
|
||||||
if( $card === false ){
|
if( $card === false ){
|
||||||
|
|
|
@ -17,3 +17,6 @@ OC_App::addNavigationEntry( array(
|
||||||
'href' => OC_Helper::linkTo( 'contacts', 'index.php' ),
|
'href' => OC_Helper::linkTo( 'contacts', 'index.php' ),
|
||||||
'icon' => OC_Helper::imagePath( 'settings', 'users.svg' ),
|
'icon' => OC_Helper::imagePath( 'settings', 'users.svg' ),
|
||||||
'name' => 'Contacts' ));
|
'name' => 'Contacts' ));
|
||||||
|
|
||||||
|
|
||||||
|
OC_APP::registerPersonal('contacts','settings');
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
$RUNTIME_NOSETUPFS = true;
|
$RUNTIME_NOSETUPFS = true;
|
||||||
|
|
||||||
require_once('../../lib/base.php');
|
require_once('../../lib/base.php');
|
||||||
|
OC_Util::checkAppEnabled('contacts');
|
||||||
|
|
||||||
// Backends
|
// Backends
|
||||||
$authBackend = new OC_Connector_Sabre_Auth();
|
$authBackend = new OC_Connector_Sabre_Auth();
|
||||||
|
|
|
@ -29,6 +29,7 @@ require_once('../../lib/base.php');
|
||||||
|
|
||||||
// Check if we are a user
|
// Check if we are a user
|
||||||
OC_Util::checkLoggedIn();
|
OC_Util::checkLoggedIn();
|
||||||
|
OC_Util::checkAppEnabled('contacts');
|
||||||
|
|
||||||
// Check if the user has an addressbook
|
// Check if the user has an addressbook
|
||||||
$addressbooks = OC_Contacts_Addressbook::all(OC_User::getUser());
|
$addressbooks = OC_Contacts_Addressbook::all(OC_User::getUser());
|
||||||
|
|
|
@ -34,7 +34,7 @@ $(document).ready(function(){
|
||||||
if(jsondata.status == 'success'){
|
if(jsondata.status == 'success'){
|
||||||
$('#leftcontent [data-id="'+jsondata.data.id+'"]').remove();
|
$('#leftcontent [data-id="'+jsondata.data.id+'"]').remove();
|
||||||
$('#rightcontent').data('id','');
|
$('#rightcontent').data('id','');
|
||||||
$('#rightcontent').html('');
|
$('#rightcontent').empty();
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
alert(jsondata.data.message);
|
alert(jsondata.data.message);
|
||||||
|
|
|
@ -22,18 +22,13 @@
|
||||||
|
|
||||||
// Init owncloud
|
// Init owncloud
|
||||||
require_once('../../lib/base.php');
|
require_once('../../lib/base.php');
|
||||||
|
OC_Util::checkLoggedIn();
|
||||||
|
OC_Util::checkAppEnabled('contacts');
|
||||||
|
|
||||||
$id = $_GET['id'];
|
$id = $_GET['id'];
|
||||||
|
|
||||||
$l10n = new OC_L10N('contacts');
|
$l10n = new OC_L10N('contacts');
|
||||||
|
|
||||||
// Check if we are a user
|
|
||||||
if( !OC_User::isLoggedIn()){
|
|
||||||
echo $l10n->t('You need to log in.');
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$card = OC_Contacts_VCard::find( $id );
|
$card = OC_Contacts_VCard::find( $id );
|
||||||
if( $card === false ){
|
if( $card === false ){
|
||||||
echo $l10n->t('Contact could not be found.');
|
echo $l10n->t('Contact could not be found.');
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$tmpl = new OC_Template( 'contacts', 'settings');
|
||||||
|
|
||||||
|
return $tmpl->fetchPage();
|
||||||
|
?>
|
|
@ -0,0 +1,7 @@
|
||||||
|
<form id="mediaform">
|
||||||
|
<fieldset class="personalblock">
|
||||||
|
<strong>Contacts</strong><br />
|
||||||
|
CardDAV syncing address:
|
||||||
|
<?php echo OC_Helper::linkTo('apps/contacts', 'carddav.php', null, true); ?><br />
|
||||||
|
</fieldset>
|
||||||
|
</form>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue