0010020: Allow to define the default export definition
authorAlexander Stintzing <a.stintzing@metaways.de>
Fri, 11 Jul 2014 09:23:21 +0000 (11:23 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Fri, 11 Jul 2014 09:45:01 +0000 (11:45 +0200)
 - fix

the default export definition should be configurable in preferences

https://forge.tine20.org/mantisbt/view.php?id=10020

Change-Id: Ice102c533b5d609fa6840dc0697e8676716ac4e3
Reviewed-on: http://gerrit.tine20.com/customers/850
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Jenkins CI (http://ci.tine20.com/)
tine20/Addressbook/Preference.php

index 3d75201..83c7a68 100644 (file)
@@ -139,21 +139,24 @@ class Addressbook_Preference extends Tinebase_Preference_Abstract
     protected function _getSpecialOptions($_value)
     {
         $translate = Tinebase_Translation::getTranslation($this->_application);
-    
         $result = array();
+        
         switch($_value) {
             case self::DEFAULT_CONTACT_ODS_EXPORTCONFIG:
             case self::DEFAULT_CONTACT_XLS_EXPORTCONFIG:
-                if ($value == self::DEFAULT_CONTACT_XLS_EXPORTCONFIG) {
+                if ($_value == self::DEFAULT_CONTACT_XLS_EXPORTCONFIG) {
                     $plugin = 'Addressbook_Export_Xls';
                 } else {
                     $plugin = 'Addressbook_Export_Ods';
                 }
+                
                 // get names from import export definitions
                 $filter = new Tinebase_Model_ImportExportDefinitionFilter(array(
-                array('field' => 'plugin', 'operator' => 'equals', 'value' => $plugin),
+                    array('field' => 'plugin', 'operator' => 'equals', 'value' => $plugin),
                 ));
+                
                 $configs = Tinebase_ImportExportDefinition::getInstance()->search($filter);
+                
                 if (! empty($configs)) {
                     foreach($configs as $tsConfig) {
                         $result[] = array($tsConfig->name, $tsConfig->name);