Merge branch '2013.10' into 2014.09
authorPhilipp Schüle <p.schuele@metaways.de>
Thu, 13 Nov 2014 09:32:12 +0000 (10:32 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Thu, 13 Nov 2014 09:32:12 +0000 (10:32 +0100)
Conflicts:
tests/tine20/Calendar/Import/ICalTest.php
tine20/Addressbook/Convert/Contact/Json.php
tine20/Calendar/Import/Ical.php
tine20/Tinebase/Frontend/Json/Abstract.php

Change-Id: Ifa3cdf497987dc59708dc9ad15a90d4dd1da82dc

1  2 
tests/tine20/Calendar/Import/ICalTest.php
tine20/Addressbook/Convert/Contact/Json.php
tine20/Calendar/Backend/Sql.php
tine20/Calendar/Convert/Event/VCalendar/Abstract.php
tine20/Calendar/Frontend/Cli.php
tine20/Calendar/Import/Ical.php
tine20/Tinebase/Convert/Json.php
tine20/Tinebase/Frontend/Json/Abstract.php

@@@ -156,11 -128,11 +156,11 @@@ class Calendar_Import_ICalTest extends 
       * @param boolean $fromString
       * @return Tinebase_Record_RecordSet
       */
-     protected function _importHelper($filename, $expectedNumber = 1, $fromString = false)
+     protected function _importHelper($filename, $expectedNumber = 1, $fromString = false, $additionalOptions = array())
      {
-         $importer = new Calendar_Import_Ical(array(
 -        $importer = new Calendar_Import_Ical(array_merge($additionalOptions, array(
 -            'importContainerId' => $this->_testCalendar->getId(),
++        $importer = new Calendar_Import_Ical(array_merge($additionalOptions,array(
 +            'container_id' => $this->_getTestCalendar()->getId(),
-         ));
+         )));
          
          if ($fromString) {
              $icalData = file_get_contents(dirname(__FILE__) . '/files/' . $filename);
@@@ -16,7 -16,7 +16,7 @@@
   * @subpackage  Convert
   */
  class Addressbook_Convert_Contact_Json extends Tinebase_Convert_Json
--{   
++{
     /**
      * parent converts Tinebase_Record_RecordSet to external format
      * this resolves Image Paths
Simple merge
Simple merge
@@@ -41,13 -41,12 +41,19 @@@ class Calendar_Import_Ical extends Tine
           * container the events should be imported in
           * @var string
           */
 -        'importContainerId'     => NULL,
 +        'container_id'     => NULL,
 +        
 +        /**
 +         * Model to be used for import
 +         * @var string
 +         */
-         'model' => 'Calendar_Model_Event'
++        'model' => 'Calendar_Model_Event',
++        
+         /**
+          * import only basic data (i.e. without attendee, alarms, uid, ...)
+          * @var string
+          */
+         'onlyBasicData'         => NULL,
      );
      
      /**
Simple merge
@@@ -64,14 -64,75 +64,14 @@@ abstract class Tinebase_Frontend_Json_A
       */
      public function getRelatableModels()
      {
-         if (Tinebase_Core::isLogLevel(Zend_Log::NOTICE)) Tinebase_Core::getLogger()->notice(__METHOD__ . '::' . __LINE__ 
-                     . ' This method is deprecated and will be removed. Please use Tinebase_ModelFactory with Tinebase_ModelConfiguration!');
+         if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ 
+             . ' This method is deprecated and will be removed. Please use Tinebase_ModelFactory with Tinebase_ModelConfiguration!');
 -        $ret = array();
          
          if (property_exists($this, '_relatableModels') && is_array($this->_relatableModels)) {
 -            // iterates relatable models of this app
 -            foreach ($this->_relatableModels as $model) {
 -                
 -                $ownModel = explode('_Model_', $model);
 -                
 -                if (! class_exists($model) || $ownModel[0] != $this->_applicationName) {
 -                    continue;
 -                }
 -                $cItems = $model::getRelatableConfig();
 -                
 -                $ownModel = $ownModel[1];
 -                
 -                if (is_array($cItems)) {
 -                    foreach($cItems as $cItem) {
 -                        
 -                        if (! (isset($cItem['config']) || array_key_exists('config', $cItem))) {
 -                            continue;
 -                        }
 -                        
 -                        // own side
 -                        $ownConfigItem = $cItem;
 -                        $ownConfigItem['ownModel'] = $ownModel;
 -                        $ownConfigItem['ownApp'] = $this->_applicationName;
 -                        
 -                        $foreignConfigItem = array(
 -                            'reverted'     => true,
 -                            'ownApp'       => $cItem['relatedApp'],
 -                            'ownModel'     => $cItem['relatedModel'], 
 -                            'relatedModel' => $ownModel,
 -                            'relatedApp'   => $this->_applicationName,
 -                            'default'      => (isset($cItem['default']) || array_key_exists('default', $cItem)) ? $cItem['default'] : NULL
 -                        );
 -                        
 -                        // KeyfieldConfigs
 -                        if ((isset($cItem['keyfieldConfig']) || array_key_exists('keyfieldConfig', $cItem))) {
 -                            $foreignConfigItem['keyfieldConfig'] = $cItem['keyfieldConfig'];
 -                            if ($cItem['keyfieldConfig']['from']){
 -                                $foreignConfigItem['keyfieldConfig']['from'] = $cItem['keyfieldConfig']['from'] == 'foreign' ? 'own' : 'foreign';
 -                            }
 -                        }
 -                        
 -                        $j=0;
 -                        foreach ($cItem['config'] as $conf) {
 -                            $max = explode(':',$conf['max']);
 -                            $ownConfigItem['config'][$j]['max'] = $max[0];
 -                            
 -                            $foreignConfigItem['config'][$j] = $conf;
 -                            $foreignConfigItem['config'][$j]['max'] = $max[1];
 -                            if ($conf['degree'] == 'sibling') {
 -                                $foreignConfigItem['config'][$j]['degree'] = $conf['degree'];
 -                            } else {
 -                                $foreignConfigItem['config'][$j]['degree'] = $conf['degree'] == 'parent' ? 'child' : 'parent';
 -                            }
 -                            $j++;
 -                        }
 -                        
 -                        $ret[] = $ownConfigItem;
 -                        $ret[] = $foreignConfigItem;
 -                    }
 -                }
 -            }
 +            return Tinebase_Relations::getConstraintsConfigs($this->_relatableModels);
 +        } else {
 +            return array();
          }
 -        
 -        return $ret;
      }
      
      /**