diff --git a/.gitignore b/.gitignore index cc4d3bf03b..68c48822e9 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,7 @@ nbproject # Mac OS .DS_Store + +# WebFinger +.well-known +/.buildpath diff --git a/.htaccess b/.htaccess index bd2f42d665..b181f8b845 100644 --- a/.htaccess +++ b/.htaccess @@ -5,8 +5,6 @@ php_value post_max_size 512M php_value memory_limit 512M SetEnv htaccessWorking true - RewriteEngine on RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization},last] - Options -Indexes diff --git a/3rdparty/Sabre.includes.php b/3rdparty/Sabre.includes.php index 9d389288c7..d41b287b77 100644 --- a/3rdparty/Sabre.includes.php +++ b/3rdparty/Sabre.includes.php @@ -71,6 +71,7 @@ include 'Sabre/DAV/IExtendedCollection.php'; /* Node abstract implementations */ include 'Sabre/DAV/Node.php'; include 'Sabre/DAV/File.php'; +include 'Sabre/DAV/Collection.php'; include 'Sabre/DAV/Directory.php'; /* Utilities */ @@ -124,4 +125,3 @@ include 'Sabre/DAV/Auth/Backend/PDO.php'; /* DavMount plugin */ include 'Sabre/DAV/Mount/Plugin.php'; - diff --git a/3rdparty/Sabre/CardDAV/AddressBook.php b/3rdparty/Sabre/CardDAV/AddressBook.php index 3333480ea8..471ca7b338 100644 --- a/3rdparty/Sabre/CardDAV/AddressBook.php +++ b/3rdparty/Sabre/CardDAV/AddressBook.php @@ -1,7 +1,9 @@ extensionMap[$extension])) return $this->extensionMap[$extension]; diff --git a/3rdparty/Sabre/DAV/Server.php b/3rdparty/Sabre/DAV/Server.php index b99866dad5..3d76d4f191 100644 --- a/3rdparty/Sabre/DAV/Server.php +++ b/3rdparty/Sabre/DAV/Server.php @@ -821,7 +821,7 @@ class Sabre_DAV_Server { $node->put($body); $this->httpResponse->setHeader('Content-Length','0'); - $this->httpResponse->sendStatus(200); + $this->httpResponse->sendStatus(204); } else { diff --git a/3rdparty/Sabre/DAV/Version.php b/3rdparty/Sabre/DAV/Version.php index e7f7f83e6f..6bece1985e 100644 --- a/3rdparty/Sabre/DAV/Version.php +++ b/3rdparty/Sabre/DAV/Version.php @@ -14,7 +14,7 @@ class Sabre_DAV_Version { /** * Full version number */ - const VERSION = '1.5.3'; + const VERSION = '1.5.4'; /** * Stability : alpha, beta, stable diff --git a/3rdparty/Sabre/DAVACL/Exception/NeedPrivileges.php b/3rdparty/Sabre/DAVACL/Exception/NeedPrivileges.php index 640ab8efff..024ab6641f 100644 --- a/3rdparty/Sabre/DAVACL/Exception/NeedPrivileges.php +++ b/3rdparty/Sabre/DAVACL/Exception/NeedPrivileges.php @@ -2,6 +2,9 @@ /** * NeedPrivileges + * + * The 403-need privileges is thrown when a user didn't have the appropriate + * permissions to perform an operation * * @package Sabre * @subpackage DAVACL @@ -10,13 +13,6 @@ * @author Evert Pot (http://www.rooftopsolutions.nl/) * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License */ - -/** - * NeedPrivileges - * - * The 403-need privileges is thrown when a user didn't have the appropriate - * permissions to perform an operation - */ class Sabre_DAVACL_Exception_NeedPrivileges extends Sabre_DAV_Exception_Forbidden { /** diff --git a/3rdparty/Sabre/DAVACL/PrincipalCollection.php b/3rdparty/Sabre/DAVACL/PrincipalCollection.php index 3cc0ae8462..4d22bf8aa7 100644 --- a/3rdparty/Sabre/DAVACL/PrincipalCollection.php +++ b/3rdparty/Sabre/DAVACL/PrincipalCollection.php @@ -9,7 +9,7 @@ * The users are instances of Sabre_DAV_Auth_Principal * * @package Sabre - * @subpackage DAV + * @subpackage DAVACL * @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 diff --git a/3rdparty/Sabre/LICENCE b/3rdparty/Sabre/LICENCE new file mode 100644 index 0000000000..3d07eaace8 --- /dev/null +++ b/3rdparty/Sabre/LICENCE @@ -0,0 +1,27 @@ +Copyright (C) 2007-2011 Rooftop Solutions. +Copyright (C) 2007-2009 FileMobile inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the SabreDAV nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. diff --git a/3rdparty/Sabre/VObject/Component.php b/3rdparty/Sabre/VObject/Component.php index 3d5a3d7563..47cf9f3d81 100644 --- a/3rdparty/Sabre/VObject/Component.php +++ b/3rdparty/Sabre/VObject/Component.php @@ -83,13 +83,16 @@ class Sabre_VObject_Component extends Sabre_VObject_Element { if (!is_null($itemValue)) { throw new InvalidArgumentException('The second argument must not be specified, when passing a VObject'); } + $item->parent = $this; $this->children[] = $item; } elseif(is_string($item)) { if (!is_scalar($itemValue)) { throw new InvalidArgumentException('The second argument must be scalar'); } - $this->children[] = new Sabre_VObject_Property($item,$itemValue); + $item = new Sabre_VObject_Property($item,$itemValue); + $item->parent = $this; + $this->children[] = $item; } else { @@ -208,16 +211,19 @@ class Sabre_VObject_Component extends Sabre_VObject_Element { $overWrite = count($matches)?key($matches):null; if ($value instanceof Sabre_VObject_Component || $value instanceof Sabre_VObject_Property) { + $value->parent = $this; if (!is_null($overWrite)) { $this->children[$overWrite] = $value; } else { $this->children[] = $value; } } elseif (is_scalar($value)) { + $property = new Sabre_VObject_Property($name,$value); + $property->parent = $this; if (!is_null($overWrite)) { - $this->children[$overWrite] = new Sabre_VObject_Property($name,$value); + $this->children[$overWrite] = $property; } else { - $this->children[] = new Sabre_VObject_Property($name,$value); + $this->children[] = $property; } } else { throw new InvalidArgumentException('You must pass a Sabre_VObject_Component, Sabre_VObject_Property or scalar type'); @@ -237,6 +243,7 @@ class Sabre_VObject_Component extends Sabre_VObject_Element { foreach($matches as $k=>$child) { unset($this->children[$k]); + $child->parent = null; } diff --git a/3rdparty/Sabre/VObject/Element/DateTime.php b/3rdparty/Sabre/VObject/Element/DateTime.php index 30e5c6ca86..3350ec02c8 100644 --- a/3rdparty/Sabre/VObject/Element/DateTime.php +++ b/3rdparty/Sabre/VObject/Element/DateTime.php @@ -70,7 +70,7 @@ class Sabre_VObject_Element_DateTime extends Sabre_VObject_Property { $this->setValue($dt->format('Ymd\\THis')); $this->offsetUnset('VALUE'); $this->offsetUnset('TZID'); - $this->offsetSet('VALUE','DATE-TIME'); + $this->offsetSet('VALUE','DATE-TIME'); break; case self::UTC : $dt->setTimeZone(new DateTimeZone('UTC')); @@ -116,7 +116,7 @@ class Sabre_VObject_Element_DateTime extends Sabre_VObject_Property { list( $this->dateType, $this->dateTime - ) = self::parseData($this->value, $this->offsetGet('TZID')); + ) = self::parseData($this->value, $this); return $this->dateTime; } @@ -137,7 +137,7 @@ class Sabre_VObject_Element_DateTime extends Sabre_VObject_Property { list( $this->dateType, $this->dateTime, - ) = self::parseData($this->value, $this->offsetGet('TZID')); + ) = self::parseData($this->value, $this); return $this->dateType; } @@ -151,12 +151,12 @@ class Sabre_VObject_Element_DateTime extends Sabre_VObject_Property { * 2. A DateTime object (or null) * * @param string|null $propertyValue The string to parse (yymmdd or - * ymmddThhmmss, etc..) - * @param string|null $tzid The value of the 'TZID' property. + * ymmddThhmmss, etc..) + * @param Sabre_VObject_Property|null $property The instance of the + * property we're parsing. * @return array */ - static public function parseData($propertyValue, $tzid) { - + static public function parseData($propertyValue, Sabre_VObject_Property $property = null) { if (is_null($propertyValue)) { return array(null, null); @@ -195,6 +195,8 @@ class Sabre_VObject_Element_DateTime extends Sabre_VObject_Property { ); } + // Finding the timezone. + $tzid = $property['TZID']; if (!$tzid) { return array( self::LOCAL, @@ -202,7 +204,32 @@ class Sabre_VObject_Element_DateTime extends Sabre_VObject_Property { ); } - $tz = new DateTimeZone($tzid->value); + try { + $tz = new DateTimeZone($tzid->value); + } catch (Exception $e) { + + // The id was invalid, we're going to try to find the information + // through the VTIMEZONE object. + + // First we find the root object + $root = $property; + while($root->parent) { + $root = $root->parent; + } + + if (isset($root->VTIMEZONE)) { + foreach($root->VTIMEZONE as $vtimezone) { + if (((string)$vtimezone->TZID) == $tzid) { + if (isset($vtimezone->{'X-LIC-LOCATION'})) { + $tzid = (string)$vtimezone->{'X-LIC-LOCATION'}; + } + } + } + } + + $tz = new DateTimeZone($tzid); + + } $dt = new DateTime($dateStr, $tz); $dt->setTimeZone($tz); diff --git a/3rdparty/Sabre/VObject/Element/MultiDateTime.php b/3rdparty/Sabre/VObject/Element/MultiDateTime.php index 5e677f5e5b..dc6ca5abb8 100644 --- a/3rdparty/Sabre/VObject/Element/MultiDateTime.php +++ b/3rdparty/Sabre/VObject/Element/MultiDateTime.php @@ -60,7 +60,7 @@ class Sabre_VObject_Element_MultiDateTime extends Sabre_VObject_Property { $val[] = $i->format('Ymd\\THis'); } $this->setValue(implode(',',$val)); - $this->offsetSet('VALUE','DATE-TIME'); + $this->offsetSet('VALUE','DATE-TIME'); break; case Sabre_VObject_Element_DateTime::UTC : $val = array(); @@ -121,7 +121,7 @@ class Sabre_VObject_Element_MultiDateTime extends Sabre_VObject_Property { list( $type, $dt - ) = Sabre_VObject_Element_DateTime::parseData($val, $this->offsetGet('TZID')); + ) = Sabre_VObject_Element_DateTime::parseData($val, $this); $dts[] = $dt; $this->dateType = $type; } @@ -154,7 +154,7 @@ class Sabre_VObject_Element_MultiDateTime extends Sabre_VObject_Property { list( $type, $dt - ) = Sabre_VObject_Element_DateTime::parseData($val, $this->offsetGet('TZID')); + ) = Sabre_VObject_Element_DateTime::parseData($val, $this); $dts[] = $dt; $this->dateType = $type; } diff --git a/3rdparty/Sabre/VObject/Node.php b/3rdparty/Sabre/VObject/Node.php index efc7f76da7..7100b62f1c 100644 --- a/3rdparty/Sabre/VObject/Node.php +++ b/3rdparty/Sabre/VObject/Node.php @@ -25,6 +25,13 @@ abstract class Sabre_VObject_Node implements IteratorAggregate, ArrayAccess, Cou */ protected $iterator = null; + /** + * A link to the parent node + * + * @var Sabre_VObject_Node + */ + protected $parent = null; + /* {{{ IteratorAggregator interface */ /** diff --git a/3rdparty/Sabre/VObject/Property.php b/3rdparty/Sabre/VObject/Property.php index 624dd4b8a5..0605822904 100644 --- a/3rdparty/Sabre/VObject/Property.php +++ b/3rdparty/Sabre/VObject/Property.php @@ -149,13 +149,16 @@ class Sabre_VObject_Property extends Sabre_VObject_Element { if (!is_null($itemValue)) { throw new InvalidArgumentException('The second argument must not be specified, when passing a VObject'); } + $item->parent = $this; $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); + $parameter = new Sabre_VObject_Parameter($item,$itemValue); + $parameter->parent = $this; + $this->parameters[] = $parameter; } else { @@ -231,12 +234,15 @@ class Sabre_VObject_Property extends Sabre_VObject_Element { throw new InvalidArgumentException('A parameter name must be specified. This means you cannot use the $array[]="string" to add parameters.'); $this->offsetUnset($name); - $this->parameters[] = new Sabre_VObject_Parameter($name, $value); + $parameter = new Sabre_VObject_Parameter($name, $value); + $parameter->parent = $this; + $this->parameters[] = $parameter; } elseif ($value instanceof Sabre_VObject_Parameter) { if (!is_null($name)) throw new InvalidArgumentException('Don\'t specify a parameter name if you\'re passing a Sabre_VObject_Parameter. Add using $array[]=$parameterObject.'); - + + $value->parent = $this; $this->parameters[] = $value; } else { throw new InvalidArgumentException('You can only add parameters to the property object'); @@ -258,6 +264,7 @@ class Sabre_VObject_Property extends Sabre_VObject_Element { $result = array(); foreach($this->parameters as $key=>$parameter) { if ($parameter->name == $name) { + $parameter->parent = null; unset($this->parameters[$key]); } diff --git a/3rdparty/Sabre/VObject/Reader.php b/3rdparty/Sabre/VObject/Reader.php index c38afbfb63..7d1c282838 100644 --- a/3rdparty/Sabre/VObject/Reader.php +++ b/3rdparty/Sabre/VObject/Reader.php @@ -95,7 +95,7 @@ class Sabre_VObject_Reader { while(stripos($nextLine,"END:")!==0) { - $obj->children[] = self::readLine($lines); + $obj->add(self::readLine($lines)); $nextLine = current($lines); if ($nextLine===false) @@ -117,7 +117,7 @@ class Sabre_VObject_Reader { //$result = preg_match('/(?P[A-Z0-9-]+)(?:;(?P^(?([^:^\"]|\"([^\"]*)\")*))?"; $regex = "/^(?P$token)$parameters:(?P.*)$/i"; @@ -140,7 +140,9 @@ class Sabre_VObject_Reader { if ($matches['parameters']) { - $obj->parameters = self::readParameters($matches['parameters']); + foreach(self::readParameters($matches['parameters']) as $param) { + $obj->add($param); + } } return $obj; diff --git a/3rdparty/Sabre/VObject/Version.php b/3rdparty/Sabre/VObject/Version.php index 950c1c5110..937c367e22 100644 --- a/3rdparty/Sabre/VObject/Version.php +++ b/3rdparty/Sabre/VObject/Version.php @@ -14,7 +14,7 @@ class Sabre_VObject_Version { /** * Full version number */ - const VERSION = '1.2.2'; + const VERSION = '1.2.4'; /** * Stability : alpha, beta, stable diff --git a/3rdparty/css/chosen/chosen-sprite.png b/3rdparty/css/chosen/chosen-sprite.png index f20db4439e..9edce05a6a 100644 Binary files a/3rdparty/css/chosen/chosen-sprite.png and b/3rdparty/css/chosen/chosen-sprite.png differ diff --git a/3rdparty/css/chosen/chosen.css b/3rdparty/css/chosen/chosen.css index 247d07bf02..b9c6d88028 100644 --- a/3rdparty/css/chosen/chosen.css +++ b/3rdparty/css/chosen/chosen.css @@ -1,9 +1,4 @@ /* @group Base */ -select.chzn-select { - visibility: hidden; - height: 28px !important; - min-height: 28px !important; -} .chzn-container { font-size: 13px; position: relative; @@ -60,9 +55,21 @@ select.chzn-select { white-space: nowrap; -o-text-overflow: ellipsis; -ms-text-overflow: ellipsis; - -moz-binding: url('/xml/ellipsis.xml#ellipsis'); text-overflow: ellipsis; } +.chzn-container-single .chzn-single abbr { + display: block; + position: absolute; + right: 26px; + top: 8px; + width: 12px; + height: 13px; + font-size: 1px; + background: url(chosen-sprite.png) right top no-repeat; +} +.chzn-container-single .chzn-single abbr:hover { + background-position: right -11px; +} .chzn-container-single .chzn-single div { -webkit-border-radius: 0 4px 4px 0; -moz-border-radius : 0 4px 4px 0; @@ -94,18 +101,19 @@ select.chzn-select { } .chzn-container-single .chzn-search { padding: 3px 4px; + position: relative; margin: 0; white-space: nowrap; } .chzn-container-single .chzn-search input { - background: #fff url('chosen-sprite.png') no-repeat 100% -20px; - background: url('chosen-sprite.png') no-repeat 100% -20px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee)); - background: url('chosen-sprite.png') no-repeat 100% -20px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%); - background: url('chosen-sprite.png') no-repeat 100% -20px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%); - background: url('chosen-sprite.png') no-repeat 100% -20px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%); - background: url('chosen-sprite.png') no-repeat 100% -20px, -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%); - background: url('chosen-sprite.png') no-repeat 100% -20px, -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%); - background: url('chosen-sprite.png') no-repeat 100% -20px, linear-gradient(top, #ffffff 85%,#eeeeee 99%); + background: #fff url('chosen-sprite.png') no-repeat 100% -22px; + background: url('chosen-sprite.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee)); + background: url('chosen-sprite.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%); + background: url('chosen-sprite.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%); + background: url('chosen-sprite.png') no-repeat 100% -22px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%); + background: url('chosen-sprite.png') no-repeat 100% -22px, -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%); + background: url('chosen-sprite.png') no-repeat 100% -22px, -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%); + background: url('chosen-sprite.png') no-repeat 100% -22px, linear-gradient(top, #ffffff 85%,#eeeeee 99%); margin: 1px 0; padding: 4px 20px 4px 5px; outline: 0; @@ -123,6 +131,11 @@ select.chzn-select { } /* @end */ +.chzn-container-single-nosearch .chzn-search input { + position: absolute; + left: -9000px; +} + /* @group Multi Chosen */ .chzn-container-multi .chzn-choices { background-color: #fff; @@ -197,18 +210,18 @@ select.chzn-select { .chzn-container-multi .chzn-choices .search-choice .search-choice-close { display: block; position: absolute; - right: 5px; - top: 6px; - width: 8px; - height: 9px; + right: 3px; + top: 4px; + width: 12px; + height: 13px; font-size: 1px; background: url(chosen-sprite.png) right top no-repeat; } .chzn-container-multi .chzn-choices .search-choice .search-choice-close:hover { - background-position: right -9px; + background-position: right -11px; } .chzn-container-multi .chzn-choices .search-choice-focus .search-choice-close { - background-position: right -9px; + background-position: right -11px; } /* @end */ @@ -226,6 +239,7 @@ select.chzn-select { padding: 0; } .chzn-container .chzn-results li { + display: none; line-height: 80%; padding: 7px 7px 8px; margin: 0; @@ -233,6 +247,7 @@ select.chzn-select { } .chzn-container .chzn-results .active-result { cursor: pointer; + display: list-item; } .chzn-container .chzn-results .highlighted { background: #3875d7; @@ -247,6 +262,7 @@ select.chzn-select { } .chzn-container .chzn-results .no-results { background: #f4f4f4; + display: list-item; } .chzn-container .chzn-results .group-result { cursor: default; @@ -309,6 +325,18 @@ select.chzn-select { } /* @end */ +/* @group Disabled Support */ +.chzn-disabled { + cursor: default; + opacity:0.5 !important; +} +.chzn-disabled .chzn-single { + cursor: default; +} +.chzn-disabled .chzn-choices .search-choice .search-choice-close { + cursor: default; +} + /* @group Right to Left */ .chzn-rtl { direction:rtl;text-align: right; } .chzn-rtl .chzn-single { padding-left: 0; padding-right: 8px; } @@ -327,14 +355,14 @@ select.chzn-select { .chzn-rtl .chzn-results .group-option { padding-left: 0; padding-right: 20px; } .chzn-rtl.chzn-container-active .chzn-single-with-drop div { border-right: none; } .chzn-rtl .chzn-search input { - background: url('chosen-sprite.png') no-repeat -38px -20px, #ffffff; - background: url('chosen-sprite.png') no-repeat -38px -20px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee)); - background: url('chosen-sprite.png') no-repeat -38px -20px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%); - background: url('chosen-sprite.png') no-repeat -38px -20px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%); - background: url('chosen-sprite.png') no-repeat -38px -20px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%); - background: url('chosen-sprite.png') no-repeat -38px -20px, -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%); - background: url('chosen-sprite.png') no-repeat -38px -20px, -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%); - background: url('chosen-sprite.png') no-repeat -38px -20px, linear-gradient(top, #ffffff 85%,#eeeeee 99%); + background: url('chosen-sprite.png') no-repeat -38px -22px, #ffffff; + background: url('chosen-sprite.png') no-repeat -38px -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee)); + background: url('chosen-sprite.png') no-repeat -38px -22px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%); + background: url('chosen-sprite.png') no-repeat -38px -22px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%); + background: url('chosen-sprite.png') no-repeat -38px -22px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%); + background: url('chosen-sprite.png') no-repeat -38px -22px, -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%); + background: url('chosen-sprite.png') no-repeat -38px -22px, -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%); + background: url('chosen-sprite.png') no-repeat -38px -22px, linear-gradient(top, #ffffff 85%,#eeeeee 99%); padding: 4px 5px 4px 20px; } /* @end */ \ No newline at end of file diff --git a/3rdparty/fullcalendar/GPL-LICENSE.txt b/3rdparty/fullcalendar/GPL-LICENSE.txt new file mode 100644 index 0000000000..11dddd00ef --- /dev/null +++ b/3rdparty/fullcalendar/GPL-LICENSE.txt @@ -0,0 +1,278 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. diff --git a/3rdparty/fullcalendar/MIT-LICENSE.txt b/3rdparty/fullcalendar/MIT-LICENSE.txt new file mode 100644 index 0000000000..46d4754496 --- /dev/null +++ b/3rdparty/fullcalendar/MIT-LICENSE.txt @@ -0,0 +1,20 @@ +Copyright (c) 2009 Adam Shaw + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/3rdparty/fullcalendar/changelog.txt b/3rdparty/fullcalendar/changelog.txt new file mode 100644 index 0000000000..50d0880fd7 --- /dev/null +++ b/3rdparty/fullcalendar/changelog.txt @@ -0,0 +1,313 @@ + +version 1.5.2 (8/21/11) + - correctly process UTC "Z" ISO8601 date strings (issue 750) + +version 1.5.1 (4/9/11) + - more flexible ISO8601 date parsing (issue 814) + - more flexible parsing of UNIX timestamps (issue 826) + - FullCalendar now buildable from source on a Mac (issue 795) + - FullCalendar QA'd in FF4 (issue 883) + - upgraded to jQuery 1.5.2 (which supports IE9) and jQuery UI 1.8.11 + +version 1.5 (3/19/11) + - slicker default styling for buttons + - reworked a lot of the calendar's HTML and accompanying CSS + (solves issues 327 and 395) + - more printer-friendly (fullcalendar-print.css) + - fullcalendar now inherits styles from jquery-ui themes differently. + styles for buttons are distinct from styles for calendar cells. + (solves issue 299) + - can now color events through FullCalendar options and Event-Object properties (issue 117) + THIS IS NOW THE PREFERRED METHOD OF COLORING EVENTS (as opposed to using className and CSS) + - FullCalendar options: + - eventColor (changes both background and border) + - eventBackgroundColor + - eventBorderColor + - eventTextColor + - Event-Object options: + - color (changes both background and border) + - backgroundColor + - borderColor + - textColor + - can now specify an event source as an *object* with a `url` property (json feed) or + an `events` property (function or array) with additional properties that will + be applied to the entire event source: + - color (changes both background and border) + - backgroudColor + - borderColor + - textColor + - className + - editable + - allDayDefault + - ignoreTimezone + - startParam (for a feed) + - endParam (for a feed) + - ANY OF THE JQUERY $.ajax OPTIONS + allows for easily changing from GET to POST and sending additional parameters (issue 386) + allows for easily attaching ajax handlers such as `error` (issue 754) + allows for turning caching on (issue 355) + - Google Calendar feeds are now specified differently: + - specify a simple string of your feed's URL + - specify an *object* with a `url` property of your feed's URL. + you can include any of the new Event-Source options in this object. + - the old `$.fullCalendar.gcalFeed` method still works + - no more IE7 SSL popup (issue 504) + - remove `cacheParam` - use json event source `cache` option instead + - latest jquery/jquery-ui + +version 1.4.11 (2/22/11) + - fixed rerenderEvents bug (issue 790) + - fixed bug with faulty dragging of events from all-day slot in agenda views + - bundled with jquery 1.5 and jquery-ui 1.8.9 + +version 1.4.10 (1/2/11) + - fixed bug with resizing event to different week in 5-day month view (issue 740) + - fixed bug with events not sticking after a removeEvents call (issue 757) + - fixed bug with underlying parseTime method, and other uses of parseInt (issue 688) + +version 1.4.9 (11/16/10) + - new algorithm for vertically stacking events (issue 111) + - resizing an event to a different week (issue 306) + - bug: some events not rendered with consecutive calls to addEventSource (issue 679) + +version 1.4.8 (10/16/10) + - ignoreTimezone option (set to `false` to process UTC offsets in ISO8601 dates) + - bugfixes + - event refetching not being called under certain conditions (issues 417, 554) + - event refetching being called multiple times under certain conditions (issues 586, 616) + - selection cannot be triggered by right mouse button (issue 558) + - agenda view left axis sized incorrectly (issue 465) + - IE js error when calendar is too narrow (issue 517) + - agenda view looks strange when no scrollbars (issue 235) + - improved parsing of ISO8601 dates with UTC offsets + - $.fullCalendar.version + - an internal refactor of the code, for easier future development and modularity + +version 1.4.7 (7/5/10) + - "dropping" external objects onto the calendar + - droppable (boolean, to turn on/off) + - dropAccept (to filter which events the calendar will accept) + - drop (trigger) + - selectable options can now be specified with a View Option Hash + - bugfixes + - dragged & reverted events having wrong time text (issue 406) + - bug rendering events that have an endtime with seconds, but no hours/minutes (issue 477) + - gotoDate date overflow bug (issue 429) + - wrong date reported when clicking on edge of last column in agenda views (412) + - support newlines in event titles + - select/unselect callbacks now passes native js event + +version 1.4.6 (5/31/10) + - "selecting" days or timeslots + - options: selectable, selectHelper, unselectAuto, unselectCancel + - callbacks: select, unselect + - methods: select, unselect + - when dragging an event, the highlighting reflects the duration of the event + - code compressing by Google Closure Compiler + - bundled with jQuery 1.4.2 and jQuery UI 1.8.1 + +version 1.4.5 (2/21/10) + - lazyFetching option, which can force the calendar to fetch events on every view/date change + - scroll state of agenda views are preserved when switching back to view + - bugfixes + - calling methods on an uninitialized fullcalendar throws error + - IE6/7 bug where an entire view becomes invisible (issue 320) + - error when rendering a hidden calendar (in jquery ui tabs for example) in IE (issue 340) + - interconnected bugs related to calendar resizing and scrollbars + - when switching views or clicking prev/next, calendar would "blink" (issue 333) + - liquid-width calendar's events shifted (depending on initial height of browser) (issue 341) + - more robust underlying algorithm for calendar resizing + +version 1.4.4 (2/3/10) + - optimized event rendering in all views (events render in 1/10 the time) + - gotoDate() does not force the calendar to unnecessarily rerender + - render() method now correctly readjusts height + +version 1.4.3 (12/22/09) + - added destroy method + - Google Calendar event pages respect currentTimezone + - caching now handled by jQuery's ajax + - protection from setting aspectRatio to zero + - bugfixes + - parseISO8601 and DST caused certain events to display day before + - button positioning problem in IE6 + - ajax event source removed after recently being added, events still displayed + - event not displayed when end is an empty string + - dynamically setting calendar height when no events have been fetched, throws error + +version 1.4.2 (12/02/09) + - eventAfterRender trigger + - getDate & getView methods + - height & contentHeight options (explicitly sets the pixel height) + - minTime & maxTime options (restricts shown hours in agenda view) + - getters [for all options] and setters [for height, contentHeight, and aspectRatio ONLY! stay tuned..] + - render method now readjusts calendar's size + - bugfixes + - lightbox scripts that use iframes (like fancybox) + - day-of-week classNames were off when firstDay=1 + - guaranteed space on right side of agenda events (even when stacked) + - accepts ISO8601 dates with a space (instead of 'T') + +version 1.4.1 (10/31/09) + - can exclude weekends with new 'weekends' option + - gcal feed 'currentTimezone' option + - bugfixes + - year/month/date option sometimes wouldn't set correctly (depending on current date) + - daylight savings issue caused agenda views to start at 1am (for BST users) + - cleanup of gcal.js code + +version 1.4 (10/19/09) + - agendaWeek and agendaDay views + - added some options for agenda views: + - allDaySlot + - allDayText + - firstHour + - slotMinutes + - defaultEventMinutes + - axisFormat + - modified some existing options/triggers to work with agenda views: + - dragOpacity and timeFormat can now accept a "View Hash" (a new concept) + - dayClick now has an allDay parameter + - eventDrop now has an an allDay parameter + (this will affect those who use revertFunc, adjust parameter list) + - added 'prevYear' and 'nextYear' for buttons in header + - minor change for theme users, ui-state-hover not applied to active/inactive buttons + - added event-color-changing example in docs + - better defaults for right-to-left themed button icons + +version 1.3.2 (10/13/09) + - Bugfixes (please upgrade from 1.3.1!) + - squashed potential infinite loop when addMonths and addDays + is called with an invalid date + - $.fullCalendar.parseDate() now correctly parses IETF format + - when switching views, the 'today' button sticks inactive, fixed + - gotoDate now can accept a single Date argument + - documentation for changes in 1.3.1 and 1.3.2 now on website + +version 1.3.1 (9/30/09) + - Important Bugfixes (please upgrade from 1.3!) + - When current date was late in the month, for long months, and prev/next buttons + were clicked in month-view, some months would be skipped/repeated + - In certain time zones, daylight savings time would cause certain days + to be misnumbered in month-view + - Subtle change in way week interval is chosen when switching from month to basicWeek/basicDay view + - Added 'allDayDefault' option + - Added 'changeView' and 'render' methods + +version 1.3 (9/21/09) + - different 'views': month/basicWeek/basicDay + - more flexible 'header' system for buttons + - themable by jQuery UI themes + - resizable events (require jQuery UI resizable plugin) + - rescoped & rewritten CSS, enhanced default look + - cleaner css & rendering techniques for right-to-left + - reworked options & API to support multiple views / be consistent with jQuery UI + - refactoring of entire codebase + - broken into different JS & CSS files, assembled w/ build scripts + - new test suite for new features, uses firebug-lite + - refactored docs + - Options + + date + + defaultView + + aspectRatio + + disableResizing + + monthNames (use instead of $.fullCalendar.monthNames) + + monthNamesShort (use instead of $.fullCalendar.monthAbbrevs) + + dayNames (use instead of $.fullCalendar.dayNames) + + dayNamesShort (use instead of $.fullCalendar.dayAbbrevs) + + theme + + buttonText + + buttonIcons + x draggable -> editable/disableDragging + x fixedWeeks -> weekMode + x abbrevDayHeadings -> columnFormat + x buttons/title -> header + x eventDragOpacity -> dragOpacity + x eventRevertDuration -> dragRevertDuration + x weekStart -> firstDay + x rightToLeft -> isRTL + x showTime (use 'allDay' CalEvent property instead) + - Triggered Actions + + eventResizeStart + + eventResizeStop + + eventResize + x monthDisplay -> viewDisplay + x resize -> windowResize + 'eventDrop' params changed, can revert if ajax cuts out + - CalEvent Properties + x showTime -> allDay + x draggable -> editable + 'end' is now INCLUSIVE when allDay=true + 'url' now produces a real tag, more native clicking/tab behavior + - Methods: + + renderEvent + x prevMonth -> prev + x nextMonth -> next + x prevYear/nextYear -> moveDate + x refresh -> rerenderEvents/refetchEvents + x removeEvent -> removeEvents + x getEventsByID -> clientEvents + - Utilities: + 'formatDate' format string completely changed (inspired by jQuery UI datepicker + datejs) + 'formatDates' added to support date-ranges + - Google Calendar Options: + x draggable -> editable + - Bugfixes + - gcal extension fetched 25 results max, now fetches all + +version 1.2.1 (6/29/09) + - bugfixes + - allows and corrects invalid end dates for events + - doesn't throw an error in IE while rendering when display:none + - fixed 'loading' callback when used w/ multiple addEventSource calls + - gcal className can now be an array + +version 1.2 (5/31/09) + - expanded API + - 'className' CalEvent attribute + - 'source' CalEvent attribute + - dynamically get/add/remove/update events of current month + - locale improvements: change month/day name text + - better date formatting ($.fullCalendar.formatDate) + - multiple 'event sources' allowed + - dynamically add/remove event sources + - options for prevYear and nextYear buttons + - docs have been reworked (include addition of Google Calendar docs) + - changed behavior of parseDate for number strings + (now interpets as unix timestamp, not MS times) + - bugfixes + - rightToLeft month start bug + - off-by-one errors with month formatting commands + - events from previous months sticking when clicking prev/next quickly + - Google Calendar API changed to work w/ multiple event sources + - can also provide 'className' and 'draggable' options + - date utilties moved from $ to $.fullCalendar + - more documentation in source code + - minified version of fullcalendar.js + - test suit (available from svn) + - top buttons now use + + + + + + +
+ -
- -
t('Nothing in here. Upload something!')?>
- + +
t('Nothing in here. Upload something!')?>
+ @@ -46,7 +48,7 @@ if (isset($_['files'])) { - +
t( 'Modified' ); ?><?php echo $l->t('Delete')?>" />
diff --git a/files/templates/part.list.php b/files/templates/part.list.php index 6bf5efe2fb..46830ba3a3 100644 --- a/files/templates/part.list.php +++ b/files/templates/part.list.php @@ -5,7 +5,7 @@ $relative_modified_date = relative_modified_date($file['mtime']); $relative_date_color = round((time()-$file['mtime'])/60/60/24*14); // the older the file, the brighter the shade of grey; days*14 if($relative_date_color>200) $relative_date_color = 200; ?> - '> + '> diff --git a/index.php b/index.php index 558733e1cd..2d759d68d7 100644 --- a/index.php +++ b/index.php @@ -88,7 +88,7 @@ else { if(defined("DEBUG") && DEBUG) { OC_Log::write('core','Setting remember login to cookie',OC_Log::DEBUG); } - $token = md5($_POST["user"].time()); + $token = md5($_POST["user"].time().$_POST['password']); OC_Preferences::setValue($_POST['user'], 'login', 'token', $token); OC_User::setMagicInCookie($_POST["user"], $token); } diff --git a/l10n/templates/calendar.pot b/l10n/templates/calendar.pot index 66cc90a4bf..56fce2285e 100644 --- a/l10n/templates/calendar.pot +++ b/l10n/templates/calendar.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-24 23:05+0200\n" +"POT-Creation-Date: 2011-10-22 13:05+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,318 +17,180 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: ajax/createcalendar.php:18 ajax/settimezone.php:19 -#: ajax/updatecalendar.php:18 -msgid "Authentication error" -msgstr "" - -#: ajax/editeventform.php:25 +#: ajax/editeventform.php:26 msgid "Wrong calendar" msgstr "" -#: ajax/settimezone.php:27 +#: ajax/settimezone.php:22 msgid "Timezone changed" msgstr "" -#: ajax/settimezone.php:29 +#: ajax/settimezone.php:24 msgid "Invalid request" msgstr "" -#: appinfo/app.php:19 templates/part.eventform.php:27 -#: templates/part.eventinfo.php:18 +#: appinfo/app.php:21 templates/calendar.php:11 +#: templates/part.eventform.php:21 msgid "Calendar" msgstr "" -#: lib/object.php:292 +#: js/calendar.js:153 +msgid "ddd d MMMM[ yyyy]{ -[ddd d] MMMM yyyy}" +msgstr "" + +#: js/calendar.js:155 +msgid "ddd d MMMM[ yyyy] HH:mm{ -[ ddd d MMMM yyyy] HH:mm}" +msgstr "" + +#: lib/object.php:344 msgid "Birthday" msgstr "" -#: lib/object.php:293 +#: lib/object.php:345 msgid "Business" msgstr "" -#: lib/object.php:294 +#: lib/object.php:346 msgid "Call" msgstr "" -#: lib/object.php:295 +#: lib/object.php:347 msgid "Clients" msgstr "" -#: lib/object.php:296 +#: lib/object.php:348 msgid "Deliverer" msgstr "" -#: lib/object.php:297 +#: lib/object.php:349 msgid "Holidays" msgstr "" -#: lib/object.php:298 +#: lib/object.php:350 msgid "Ideas" msgstr "" -#: lib/object.php:299 +#: lib/object.php:351 msgid "Journey" msgstr "" -#: lib/object.php:300 +#: lib/object.php:352 msgid "Jubilee" msgstr "" -#: lib/object.php:301 +#: lib/object.php:353 msgid "Meeting" msgstr "" -#: lib/object.php:302 +#: lib/object.php:354 msgid "Other" msgstr "" -#: lib/object.php:303 +#: lib/object.php:355 msgid "Personal" msgstr "" -#: lib/object.php:304 +#: lib/object.php:356 msgid "Projects" msgstr "" -#: lib/object.php:305 +#: lib/object.php:357 msgid "Questions" msgstr "" -#: lib/object.php:306 +#: lib/object.php:358 msgid "Work" msgstr "" -#: lib/object.php:313 +#: lib/object.php:365 msgid "Does not repeat" msgstr "" -#: lib/object.php:314 +#: lib/object.php:366 msgid "Daily" msgstr "" -#: lib/object.php:315 +#: lib/object.php:367 msgid "Weekly" msgstr "" -#: lib/object.php:316 +#: lib/object.php:368 msgid "Every Weekday" msgstr "" -#: lib/object.php:317 +#: lib/object.php:369 msgid "Bi-Weekly" msgstr "" -#: lib/object.php:318 +#: lib/object.php:370 msgid "Monthly" msgstr "" -#: lib/object.php:319 +#: lib/object.php:371 msgid "Yearly" msgstr "" -#: lib/object.php:337 +#: lib/object.php:389 msgid "Not an array" msgstr "" -#: templates/calendar.php:3 +#: templates/calendar.php:8 msgid "All day" msgstr "" -#: templates/calendar.php:32 -msgid "Sunday" +#: templates/calendar.php:9 +msgid "Missing fields" msgstr "" -#: templates/calendar.php:32 -msgid "Monday" +#: templates/calendar.php:10 templates/part.eventform.php:3 +msgid "Title" msgstr "" -#: templates/calendar.php:32 -msgid "Tuesday" +#: templates/calendar.php:12 +msgid "From Date" msgstr "" -#: templates/calendar.php:32 -msgid "Wednesday" +#: templates/calendar.php:13 +msgid "From Time" msgstr "" -#: templates/calendar.php:32 -msgid "Thursday" +#: templates/calendar.php:14 +msgid "To Date" msgstr "" -#: templates/calendar.php:32 -msgid "Friday" +#: templates/calendar.php:15 +msgid "To Time" msgstr "" -#: templates/calendar.php:32 -msgid "Saturday" +#: templates/calendar.php:16 +msgid "The event ends before it starts" msgstr "" -#: templates/calendar.php:33 -msgid "Sun." +#: templates/calendar.php:17 +msgid "There was a database fail" msgstr "" -#: templates/calendar.php:33 -msgid "Mon." -msgstr "" - -#: templates/calendar.php:33 -msgid "Tue." -msgstr "" - -#: templates/calendar.php:33 -msgid "Wed." -msgstr "" - -#: templates/calendar.php:33 -msgid "Thu." -msgstr "" - -#: templates/calendar.php:33 -msgid "Fri." -msgstr "" - -#: templates/calendar.php:33 -msgid "Sat." -msgstr "" - -#: templates/calendar.php:34 -msgid "January" -msgstr "" - -#: templates/calendar.php:34 -msgid "February" -msgstr "" - -#: templates/calendar.php:34 -msgid "March" -msgstr "" - -#: templates/calendar.php:34 -msgid "April" -msgstr "" - -#: templates/calendar.php:34 -msgid "May" -msgstr "" - -#: templates/calendar.php:34 -msgid "June" -msgstr "" - -#: templates/calendar.php:34 -msgid "July" -msgstr "" - -#: templates/calendar.php:34 -msgid "August" -msgstr "" - -#: templates/calendar.php:34 -msgid "September" -msgstr "" - -#: templates/calendar.php:34 -msgid "October" -msgstr "" - -#: templates/calendar.php:34 -msgid "November" -msgstr "" - -#: templates/calendar.php:34 -msgid "December" -msgstr "" - -#: templates/calendar.php:35 -msgid "Jan." -msgstr "" - -#: templates/calendar.php:35 -msgid "Feb." -msgstr "" - -#: templates/calendar.php:35 -msgid "Mar." -msgstr "" - -#: templates/calendar.php:35 -msgid "Apr." -msgstr "" - -#: templates/calendar.php:35 -msgid "May." -msgstr "" - -#: templates/calendar.php:35 -msgid "Jun." -msgstr "" - -#: templates/calendar.php:35 -msgid "Jul." -msgstr "" - -#: templates/calendar.php:35 -msgid "Aug." -msgstr "" - -#: templates/calendar.php:35 -msgid "Sep." -msgstr "" - -#: templates/calendar.php:35 -msgid "Oct." -msgstr "" - -#: templates/calendar.php:35 -msgid "Nov." -msgstr "" - -#: templates/calendar.php:35 -msgid "Dec." -msgstr "" - -#: templates/calendar.php:36 templates/calendar.php:50 -#: templates/calendar.php:116 +#: templates/calendar.php:23 msgid "Week" msgstr "" -#: templates/calendar.php:37 templates/calendar.php:51 -msgid "Weeks" -msgstr "" - -#: templates/calendar.php:38 -msgid "More before {startdate}" -msgstr "" - -#: templates/calendar.php:39 -msgid "More after {enddate}" -msgstr "" - -#: templates/calendar.php:49 -msgid "Day" -msgstr "" - -#: templates/calendar.php:52 +#: templates/calendar.php:24 msgid "Month" msgstr "" -#: templates/calendar.php:53 +#: templates/calendar.php:25 msgid "List" msgstr "" -#: templates/calendar.php:58 +#: templates/calendar.php:30 msgid "Today" msgstr "" -#: templates/calendar.php:59 +#: templates/calendar.php:31 msgid "Calendars" msgstr "" -#: templates/calendar.php:76 templates/calendar.php:94 -msgid "Time" -msgstr "" - -#: templates/calendar.php:169 +#: templates/calendar.php:48 msgid "There was a fail, while parsing the file." msgstr "" @@ -350,7 +212,6 @@ msgid "Download" msgstr "" #: templates/part.choosecalendar.rowfields.php:4 -#: templates/part.eventinfo.php:64 msgid "Edit" msgstr "" @@ -367,7 +228,7 @@ msgstr "" msgid "Edit calendar" msgstr "" -#: templates/part.editcalendar.php:12 +#: templates/part.editcalendar.php:12 templates/part.import.php:29 msgid "Displayname" msgstr "" @@ -375,88 +236,135 @@ msgstr "" msgid "Active" msgstr "" -#: templates/part.editcalendar.php:29 templates/part.eventform.php:88 -#: templates/part.eventinfo.php:58 -msgid "Description" -msgstr "" - -#: templates/part.editcalendar.php:35 +#: templates/part.editcalendar.php:29 msgid "Calendar color" msgstr "" -#: templates/part.editcalendar.php:41 +#: templates/part.editcalendar.php:42 msgid "Save" msgstr "" -#: templates/part.editcalendar.php:41 templates/part.editevent.php:7 +#: templates/part.editcalendar.php:42 templates/part.editevent.php:7 #: templates/part.newevent.php:6 msgid "Submit" msgstr "" -#: templates/part.editcalendar.php:42 +#: templates/part.editcalendar.php:43 msgid "Cancel" msgstr "" -#: templates/part.editevent.php:1 templates/part.eventinfo.php:1 +#: templates/part.editevent.php:1 msgid "Edit an event" msgstr "" -#: templates/part.eventform.php:3 templates/part.eventinfo.php:4 -msgid "Title" +#: templates/part.editevent.php:9 +msgid "Export" msgstr "" #: templates/part.eventform.php:5 msgid "Title of the Event" msgstr "" -#: templates/part.eventform.php:9 templates/part.eventinfo.php:9 -msgid "Location" -msgstr "" - #: templates/part.eventform.php:11 -msgid "Location of the Event" -msgstr "" - -#: templates/part.eventform.php:17 templates/part.eventinfo.php:16 msgid "Category" msgstr "" -#: templates/part.eventform.php:19 +#: templates/part.eventform.php:13 msgid "Select category" msgstr "" -#: templates/part.eventform.php:45 templates/part.eventinfo.php:28 +#: templates/part.eventform.php:39 msgid "All Day Event" msgstr "" -#: templates/part.eventform.php:49 templates/part.eventinfo.php:31 +#: templates/part.eventform.php:43 msgid "From" msgstr "" -#: templates/part.eventform.php:57 templates/part.eventinfo.php:38 +#: templates/part.eventform.php:51 msgid "To" msgstr "" -#: templates/part.eventform.php:65 templates/part.eventinfo.php:44 +#: templates/part.eventform.php:59 +msgid "Advanced options" +msgstr "" + +#: templates/part.eventform.php:64 msgid "Repeat" msgstr "" -#: templates/part.eventform.php:81 templates/part.eventinfo.php:51 +#: templates/part.eventform.php:80 msgid "Attendees" msgstr "" +#: templates/part.eventform.php:87 +msgid "Location" +msgstr "" + #: templates/part.eventform.php:89 +msgid "Location of the Event" +msgstr "" + +#: templates/part.eventform.php:95 +msgid "Description" +msgstr "" + +#: templates/part.eventform.php:96 msgid "Description of the Event" msgstr "" -#: templates/part.eventinfo.php:63 -msgid "Close" +#: templates/part.import.php:1 +msgid "Import Ical File" +msgstr "" + +#: templates/part.import.php:4 +msgid "How to import the new calendar?" +msgstr "" + +#: templates/part.import.php:6 +msgid "Import into an existing calendar" +msgstr "" + +#: templates/part.import.php:7 +msgid "Import into a new calendar" +msgstr "" + +#: templates/part.import.php:10 +msgid "Please choose the calendar" +msgstr "" + +#: templates/part.import.php:20 templates/part.import.php:37 +msgid "Import" +msgstr "" + +#: templates/part.import.php:22 templates/part.import.php:39 +msgid "Back" +msgstr "" + +#: templates/part.import.php:25 +msgid "Please fill out the form" msgstr "" #: templates/part.newevent.php:1 msgid "Create a new event" msgstr "" -#: templates/settings.php:11 +#: templates/settings.php:13 msgid "Timezone" msgstr "" + +#: templates/settings.php:32 +msgid "Timeformat" +msgstr "" + +#: templates/settings.php:34 +msgid "24h" +msgstr "" + +#: templates/settings.php:35 +msgid "12h" +msgstr "" + +#: templates/settings.php:41 +msgid "Calendar CalDAV syncing address:" +msgstr "" diff --git a/lib/app.php b/lib/app.php index 30ebcf032b..b1aa8ba354 100644 --- a/lib/app.php +++ b/lib/app.php @@ -100,11 +100,11 @@ class OC_App{ } /** - * @brief enables an app + * @brief disables an app * @param $app app * @returns true/false * - * This function set an app as enabled in appconfig. + * This function set an app as disabled in appconfig. */ public static function disable( $app ){ OC_Appconfig::setValue( $app, 'enabled', 'no' ); @@ -223,7 +223,7 @@ class OC_App{ // admin apps menu $settings[] = array( "id" => "core_apps", "order" => 3, "href" => OC_Helper::linkTo( "settings", "apps.php?installed" ), "name" => $l->t("Apps"), "icon" => OC_Helper::imagePath( "settings", "apps.svg" )); // admin log menu - $settings[] = array( "id" => "core_log", "order" => 4, "href" => OC_Helper::linkTo( "settings", "log.php" ), "name" => $l->t("Log"), "icon" => OC_Helper::imagePath( "log", "apps.svg" )); + $settings[] = array( "id" => "core_log", "order" => 4, "href" => OC_Helper::linkTo( "settings", "log.php" ), "name" => $l->t("Log"), "icon" => OC_Helper::imagePath( "settings", "log.svg" )); $settings[]=array( "id" => "admin", "order" => 1000, "href" => OC_Helper::linkTo( "settings", "admin.php" ), "name" => $l->t("Admin"), "icon" => OC_Helper::imagePath( "settings", "admin.svg" )); } diff --git a/lib/base.php b/lib/base.php index d5fff1e0a7..700236c96c 100644 --- a/lib/base.php +++ b/lib/base.php @@ -77,6 +77,9 @@ class OC{ // set some stuff //ob_start(); error_reporting(E_ALL | E_STRICT); + if (defined('DEBUG') && DEBUG){ + ini_set('display_errors', 1); + } date_default_timezone_set('Europe/Berlin'); ini_set('arg_separator.output','&'); @@ -89,6 +92,14 @@ class OC{ $_SERVER['PHP_AUTH_PW'] = strip_tags($password); } + //set http auth headers for apache+php-cgi work around if variable gets renamed by apache + if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION']) && preg_match('/Basic\s+(.*)$/i', $_SERVER['REDIRECT_HTTP_AUTHORIZATION'], $matches)) + { + list($name, $password) = explode(':', base64_decode($matches[1])); + $_SERVER['PHP_AUTH_USER'] = strip_tags($name); + $_SERVER['PHP_AUTH_PW'] = strip_tags($password); + } + // calculate the documentroot OC::$DOCUMENTROOT=realpath($_SERVER['DOCUMENT_ROOT']); OC::$SERVERROOT=str_replace("\\",'/',substr(__FILE__,0,-13)); diff --git a/lib/config.php b/lib/config.php index 2c82036257..8d03271b3e 100644 --- a/lib/config.php +++ b/lib/config.php @@ -94,7 +94,6 @@ class OC_Config{ // Write changes self::writeData(); - return true; } diff --git a/lib/connector/sabre/file.php b/lib/connector/sabre/file.php index b049f39c17..98661dbb18 100644 --- a/lib/connector/sabre/file.php +++ b/lib/connector/sabre/file.php @@ -29,7 +29,7 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D */ public function get() { - return OC_Filesystem::file_get_contents($this->path); + return OC_Filesystem::fopen($this->path,'r'); } diff --git a/lib/db.php b/lib/db.php index 421b08c232..bcfe320665 100644 --- a/lib/db.php +++ b/lib/db.php @@ -224,6 +224,7 @@ class OC_DB { /** * @brief gets last value of autoincrement + * @param $table string The optional table name (will replace *PREFIX*) and add sequence suffix * @returns id * * MDB2 lastInsertID() @@ -231,9 +232,14 @@ class OC_DB { * Call this method right after the insert command or other functions may * cause trouble! */ - public static function insertid(){ + public static function insertid($table=null){ self::connect(); - return self::$connection->lastInsertId(); + if($table !== null){ + $prefix = OC_Config::getValue( "dbtableprefix", "oc_" ); + $suffix = OC_Config::getValue( "dbsequencesuffix", "_id_seq" ); + $table = str_replace( '*PREFIX*', $prefix, $table ); + } + return self::$connection->lastInsertId($table.$suffix); } /** @@ -486,7 +492,7 @@ class PDOStatementWrapper{ } /** - * make exucute return the result instead of a bool + * make execute return the result instead of a bool */ public function execute($input=array()){ $this->lastArguments=$input; diff --git a/lib/filestorage/local.php b/lib/filestorage/local.php index 01523b6b0b..9e29f85071 100644 --- a/lib/filestorage/local.php +++ b/lib/filestorage/local.php @@ -84,6 +84,11 @@ class OC_Filestorage_Local extends OC_Filestorage{ return $return; } public function rename($path1,$path2){ + if(! $this->file_exists($path1)){ + OC_Log::write('core','unable to rename, file does not exists : '.$path1,OC_Log::ERROR); + return false; + } + if($return=rename($this->datadir.$path1,$this->datadir.$path2)){ $this->clearFolderSizeCache($path1); $this->clearFolderSizeCache($path2); diff --git a/lib/helper.php b/lib/helper.php index 5b3e394caf..24d436225b 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -160,24 +160,25 @@ class OC_Helper { */ public static function computerFileSize( $str ){ $bytes = 0; + $str=strtolower($str); $bytes_array = array( - 'B' => 1, - 'K' => 1024, - 'KB' => 1024, - 'MB' => 1024 * 1024, - 'M' => 1024 * 1024, - 'GB' => 1024 * 1024 * 1024, - 'G' => 1024 * 1024 * 1024, - 'TB' => 1024 * 1024 * 1024 * 1024, - 'T' => 1024 * 1024 * 1024 * 1024, - 'PB' => 1024 * 1024 * 1024 * 1024 * 1024, - 'P' => 1024 * 1024 * 1024 * 1024 * 1024, + 'b' => 1, + 'k' => 1024, + 'kb' => 1024, + 'mb' => 1024 * 1024, + 'm' => 1024 * 1024, + 'gb' => 1024 * 1024 * 1024, + 'g' => 1024 * 1024 * 1024, + 'tb' => 1024 * 1024 * 1024 * 1024, + 't' => 1024 * 1024 * 1024 * 1024, + 'pb' => 1024 * 1024 * 1024 * 1024 * 1024, + 'p' => 1024 * 1024 * 1024 * 1024 * 1024, ); $bytes = floatval($str); - if (preg_match('#([KMGTP]?B?)$#si', $str, $matches) && !empty($bytes_array[$matches[1]])) { + if (preg_match('#([kmgtp]?b?)$#si', $str, $matches) && !empty($bytes_array[$matches[1]])) { $bytes *= $bytes_array[$matches[1]]; } diff --git a/lib/hook.php b/lib/hook.php index b069a7da6c..83a16106bf 100644 --- a/lib/hook.php +++ b/lib/hook.php @@ -20,7 +20,7 @@ class OC_Hook{ * TODO: write example */ static public function connect( $signalclass, $signalname, $slotclass, $slotname ){ - // Cerate the data structure + // Create the data structure if( !array_key_exists( $signalclass, self::$registered )){ self::$registered[$signalclass] = array(); } diff --git a/lib/l10n.php b/lib/l10n.php index 54331d44ae..a5544eb3a2 100644 --- a/lib/l10n.php +++ b/lib/l10n.php @@ -109,6 +109,22 @@ class OC_L10N{ return vsprintf($text, $parameters); } + /** + * @brief Translating + * @param $textArray The text array we need a translation for + * @returns Translation or the same text + * + * Returns the translation. If no translation is found, $textArray will be + * returned. + */ + public function tA($textArray){ + $result = array(); + foreach($textArray as $key => $text){ + $result[$key] = $this->t($text); + } + return $result; + } + /** * @brief getTranslations * @returns Fetch all translations diff --git a/lib/log.php b/lib/log.php index 98333be54f..446ddd4884 100644 --- a/lib/log.php +++ b/lib/log.php @@ -59,6 +59,9 @@ class OC_Log{ return array(); } $fh=fopen($logFile,'r'); + if($fh === false){ // Unable to read log file! + return array(); + } while(!feof($fh)){ $line=fgets($fh); if($line){ diff --git a/lib/ocsclient.php b/lib/ocsclient.php index 654c5e0527..072fd236fe 100644 --- a/lib/ocsclient.php +++ b/lib/ocsclient.php @@ -108,6 +108,7 @@ class OC_OCSClient{ $xml=@file_get_contents($url); if($xml==FALSE){ + OC_Log::write('core','Unable to parse OCS content',OC_Log::FATAL); return NULL; } $data=simplexml_load_string($xml); @@ -143,6 +144,7 @@ class OC_OCSClient{ $kbe=array(); $xml=@file_get_contents($url); if($xml==FALSE){ + OC_Log::write('core','Unable to parse knowledgebase content',OC_Log::FATAL); return NULL; } $data=simplexml_load_string($xml); diff --git a/lib/setup.php b/lib/setup.php index 2dcedb9b82..8afe0070e9 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -77,12 +77,14 @@ class OC_Setup { OC_Config::setValue('datadirectory', $datadir); OC_Config::setValue('dbtype', $dbtype); OC_Config::setValue('version',implode('.',OC_Util::getVersion())); + OC_Config::setValue('installedat',microtime(true)); + OC_Config::setValue('lastupdatedat',microtime(true)); if($dbtype == 'mysql') { $dbuser = $options['dbuser']; $dbpass = $options['dbpass']; $dbname = $options['dbname']; $dbhost = $options['dbhost']; - $dbtableprefix = OC_Config::getValue('dbtableprefix','oc_'); + $dbtableprefix = $options['dbtableprefix']; OC_Config::setValue('dbname', $dbname); OC_Config::setValue('dbhost', $dbhost); OC_Config::setValue('dbtableprefix', $dbtableprefix); @@ -135,7 +137,7 @@ class OC_Setup { $dbpass = $options['dbpass']; $dbname = $options['dbname']; $dbhost = $options['dbhost']; - $dbtableprefix = OC_Config::getValue('dbtableprefix','oc_'); + $dbtableprefix = $options['dbtableprefix']; OC_CONFIG::setValue('dbname', $dbname); OC_CONFIG::setValue('dbhost', $dbhost); OC_CONFIG::setValue('dbtableprefix', $dbtableprefix); diff --git a/lib/template.php b/lib/template.php index 440b62003e..881d2a27b1 100644 --- a/lib/template.php +++ b/lib/template.php @@ -98,6 +98,33 @@ function relative_modified_date($timestamp) { else { return $l->t('years ago'); } } +function html_select_options($options, $selected, $params=array()) { + if (!is_array($selected)){ + $selected=array($selected); + } + if (isset($params['combine']) && $params['combine']){ + $options = array_combine($options, $options); + } + $value_name = $label_name = false; + if (isset($params['value'])){ + $value_name = $params['value']; + } + if (isset($params['label'])){ + $label_name = $params['label']; + } + $html = ''; + foreach($options as $value => $label){ + if ($value_name && is_array($label)){ + $value = $label[$value_name]; + } + if ($label_name && is_array($label)){ + $label = $label[$label_name]; + } + $select = in_array($value, $selected) ? ' selected="selected"' : ''; + $html .= ''."\n"; + } + return $html; +} /** * This class provides the templates for owncloud. diff --git a/lib/updater.php b/lib/updater.php new file mode 100644 index 0000000000..cc4a460253 --- /dev/null +++ b/lib/updater.php @@ -0,0 +1,81 @@ +. + * + */ + +/** + * Class that handels autoupdating of ownCloud + */ +class OC_Updater{ + + /** + * Check if a new version is available + */ + public static function check(){ + OC_Config::setValue('lastupdatedat',microtime(true)); + + $updaterurl='http://apps.owncloud.com/updater.php'; + $version=OC_Util::getVersion(); + $version['installed']=OC_Config::getValue( "installedat"); + $version['updated']=OC_Config::getValue( "lastupdatedat"); + $version['updatechannel']='stable'; + $versionstring=implode('x',$version); + + //fetch xml data from updater + $url=$updaterurl.'?version='.$versionstring; + $xml=@file_get_contents($url); + if($xml==FALSE){ + return array(); + } + $data=@simplexml_load_string($xml); + + $tmp=array(); + $tmp['version'] = $data->version; + $tmp['versionstring'] = $data->versionstring; + $tmp['url'] = $data->url; + $tmp['web'] = $data->web; + + return $tmp; + } + + public static function ShowUpdatingHint(){ + $data=OC_Updater::check(); + if(isset($data['version']) and $data['version']<>'') { + $txt=''.$data['versionstring'].' is available. Please click here for more information'; + }else{ + $txt='Your ownCloud is up to date'; + } + return($txt); + } + + /** + * do ownCloud update + */ + public static function doUpdate(){ + + //update ownCloud core + + //update all apps + + //update version in config + + } +} +?> diff --git a/lib/util.php b/lib/util.php index 14313569a1..0f79948bc2 100644 --- a/lib/util.php +++ b/lib/util.php @@ -180,7 +180,6 @@ class OC_Util { } $CONFIG_DBTYPE = OC_Config::getValue( "dbtype", "sqlite" ); $CONFIG_DBNAME = OC_Config::getValue( "dbname", "owncloud" ); - $serverUser=OC_Util::checkWebserverUser(); //common hint for all file permissons error messages $permissionsHint="Permissions can usually be fixed by giving the webserver write access to the ownCloud directory"; @@ -239,21 +238,6 @@ class OC_Util { OC_Template::printGuestPage("", "login", $parameters); } - /** - * Try to get the username the httpd server runs on, used in hints - */ - public static function checkWebserverUser(){ - if(is_callable('posix_getuid')){ - $serverUser=posix_getpwuid(posix_getuid()); - $serverUser='\''.$serverUser['name'].'\''; - }elseif(exec('whoami')){ - $serverUser=exec('whoami'); - }else{ - $serverUser='\'www-data\' for ubuntu/debian'; //TODO: try to detect the distro and give a guess based on that - } - return $serverUser; - } - /** * Check if the app is enabled, send json error msg if not diff --git a/lib/vobject.php b/lib/vobject.php new file mode 100644 index 0000000000..e3479fc6d3 --- /dev/null +++ b/lib/vobject.php @@ -0,0 +1,207 @@ +. + * + */ + +/** + * This class provides a streamlined interface to the Sabre VObject classes + */ +class OC_VObject{ + /** @var Sabre_VObject_Component */ + protected $vobject; + + /** + * @returns Sabre_VObject_Component + */ + public function getVObject(){ + return $this->vobject; + } + + /** + * @brief Parses the VObject + * @param string VObject as string + * @returns Sabre_VObject or null + */ + public static function parse($data){ + try { + Sabre_VObject_Reader::$elementMap['LAST-MODIFIED'] = 'Sabre_VObject_Element_DateTime'; + $vobject = Sabre_VObject_Reader::read($data); + if ($vobject instanceof Sabre_VObject_Component){ + $vobject = new OC_VObject($vobject); + } + return $vobject; + } catch (Exception $e) { + OC_Log::write('vobject', $e->getMessage(), OC_Log::ERROR); + return null; + } + } + + /** + * @brief Escapes semicolons + * @param string $value + * @return string + */ + public static function escapeSemicolons($value){ + foreach($value as &$i ){ + $i = implode("\\\\;", explode(';', $i)); + } + return implode(';',$value); + } + + /** + * @brief Creates an array out of a multivalue property + * @param string $value + * @return array + */ + public static function unescapeSemicolons($value){ + $array = explode(';',$value); + for($i=0;$ivobject = $vobject_or_name; + } else { + $this->vobject = new Sabre_VObject_Component($vobject_or_name); + } + } + + public function add($item, $itemValue = null){ + if ($item instanceof OC_VObject){ + $item = $item->getVObject(); + } + $this->vobject->add($item, $itemValue); + } + + /** + * @brief Add property to vobject + * @param object $name of property + * @param object $value of property + * @param object $parameters of property + * @returns Sabre_VObject_Property newly created + */ + public function addProperty($name, $value, $parameters=array()){ + if(is_array($value)){ + $value = OC_VObject::escapeSemicolons($value); + } + $property = new Sabre_VObject_Property( $name, $value ); + foreach($parameters as $name => $value){ + $property->parameters[] = new Sabre_VObject_Parameter($name, $value); + } + + $this->vobject->add($property); + return $property; + } + + public function setUID(){ + $uid = substr(md5(rand().time()),0,10); + $this->vobject->add('UID',$uid); + } + + public function setString($name, $string){ + if ($string != ''){ + $string = strtr($string, array("\r\n"=>"\n")); + $this->vobject->__set($name, $string); + }else{ + $this->vobject->__unset($name); + } + } + + /** + * Sets or unsets the Date and Time for a property. + * When $datetime is set to 'now', use the current time + * When $datetime is null, unset the property + * + * @param string property name + * @param DateTime $datetime + * @param int $dateType + * @return void + */ + public function setDateTime($name, $datetime, $dateType=Sabre_VObject_Element_DateTime::LOCALTZ){ + if ($datetime == 'now'){ + $datetime = new DateTime(); + } + if ($datetime instanceof DateTime){ + $datetime_element = new Sabre_VObject_Element_DateTime($name); + $datetime_element->setDateTime($datetime, $dateType); + $this->vobject->__set($name, $datetime_element); + }else{ + $this->vobject->__unset($name); + } + } + + public function getAsString($name){ + return $this->vobject->__isset($name) ? + $this->vobject->__get($name)->value : + ''; + } + + public function getAsArray($name){ + $values = array(); + if ($this->vobject->__isset($name)){ + $values = explode(',', $this->getAsString($name)); + $values = array_map('trim', $values); + } + return $values; + } + + public function &__get($name){ + if ($name == 'children'){ + return $this->vobject->children; + } + $return = $this->vobject->__get($name); + if ($return instanceof Sabre_VObject_Component){ + $return = new OC_VObject($return); + } + return $return; + } + + public function __set($name, $value){ + return $this->vobject->__set($name, $value); + } + + public function __unset($name){ + return $this->vobject->__unset($name); + } + + public function __isset($name){ + return $this->vobject->__isset($name); + } + + public function __call($function,$arguments){ + return call_user_func_array(array($this->vobject, $function), $arguments); + } +} diff --git a/settings/ajax/setquota.php b/settings/ajax/setquota.php index edbf5b7451..5c07285cfc 100644 --- a/settings/ajax/setquota.php +++ b/settings/ajax/setquota.php @@ -10,6 +10,6 @@ $quota= OC_Helper::computerFileSize($_POST["quota"]); // Return Success story OC_Preferences::setValue($username,'files','quota',$quota); -OC_JSON::success(array("data" => array( "username" => $username ,'quota'=>$quota))); +OC_JSON::success(array("data" => array( "username" => $username ,'quota'=>OC_Helper::humanFileSize($quota)))); ?> diff --git a/settings/apps.php b/settings/apps.php index 27b4c17f9e..12a7bf7720 100644 --- a/settings/apps.php +++ b/settings/apps.php @@ -43,6 +43,14 @@ foreach($registeredApps as $app){ } } +function app_sort($a, $b){ + if ($a['active'] != $b['active']){ + return $b['active'] - $a['active']; + } + return strcmp($a['name'], $b['name']); +} +usort($apps, 'app_sort'); + // dissabled for now // $catagoryNames=OC_OCSClient::getCategories(); // if(is_array($catagoryNames)){ diff --git a/settings/js/users.js b/settings/js/users.js index 684fee21c6..4fea52e4a1 100644 --- a/settings/js/users.js +++ b/settings/js/users.js @@ -101,8 +101,11 @@ $(document).ready(function(){ if($(this).val().length>0){ $.post( OC.filePath('settings','ajax','setquota.php'), - {username:uid,quota:$(this).val()}, - function(result){} + {username:uid,quota:$(this).val()}, + function(result){ + img.parent().children('span').text(result.data.quota) + $(this).parent().attr('data-quota',result.data.quota); + } ); input.blur(); }else{ diff --git a/settings/templates/help.php b/settings/templates/help.php index 4e3cdd7b90..754bf8b637 100644 --- a/settings/templates/help.php +++ b/settings/templates/help.php @@ -9,7 +9,10 @@ printPage(); + if($pageNavi) + { + $pageNavi->printPage(); + } ?> diff --git a/settings/templates/personal.php b/settings/templates/personal.php index 54487165f3..8c5de5ccf2 100644 --- a/settings/templates/personal.php +++ b/settings/templates/personal.php @@ -50,7 +50,9 @@ };?>

- ownCloud , source code licensed freely under AGPL + ownCloud
+
+ source code licensed freely under AGPL