Tinebase_Export some fixes
authorPaul Mehrer <p.mehrer@metaways.de>
Tue, 11 Jul 2017 14:36:06 +0000 (16:36 +0200)
committerPaul Mehrer <p.mehrer@metaways.de>
Wed, 12 Jul 2017 08:13:18 +0000 (10:13 +0200)
Change-Id: Ia4772facb89d4c9c9886e8782113261f47c857c4
Reviewed-on: http://gerrit.tine20.com/customers/5101
Reviewed-by: Paul Mehrer <p.mehrer@metaways.de>
Tested-by: Paul Mehrer <p.mehrer@metaways.de>
tine20/Calendar/Export/Doc.php
tine20/Tinebase/Export/Abstract.php

index 00b0236..573b3a8 100644 (file)
@@ -49,10 +49,11 @@ class Calendar_Export_Doc extends Tinebase_Export_Doc
      */
     protected function _getTwigContext(array $context)
     {
+        $tz = Tinebase_Core::getUserTimezone();
         return array_merge(parent::_getTwigContext($context), array(
             'calendar'      => array(
-                'from'          => $this->_from,
-                'until'         => $this->_until,
+                'from'          => null !== $this->_from ? $this->_from->getClone()->setTimezone($tz) : null,
+                'until'         => null !== $this->_until ? $this->_until->getClone()->setTimezone($tz) : null,
             )
         ));
     }
index d54b069..a7a524d 100644 (file)
@@ -832,7 +832,12 @@ abstract class Tinebase_Export_Abstract implements Tinebase_Record_IteratableInt
                     $this->_logoPath = '/' . $this->_logoPath;
                 }
 
-                $this->_logoPath = 'file://' . dirname(dirname(__DIR__)) . $this->_logoPath;
+                $baseDir = dirname(dirname(__DIR__));
+                if (0 === strpos($this->_logoPath, $baseDir)) {
+                    $this->_logoPath = 'file://' . $this->_logoPath;
+                } else {
+                    $this->_logoPath = 'file://' . $baseDir . $this->_logoPath;
+                }
 
                 if (!is_file($this->_logoPath)) {
                     if (Tinebase_Core::isLogLevel(Zend_Log::WARN)) Tinebase_Core::getLogger()->warn(__METHOD__ . '::' . __LINE__ . ' can not find branding logo. Config: ' . Tinebase_Config::getInstance()->{Tinebase_Config::BRANDING_LOGO} . ' path: ' . $this->_logoPath);