0010056: Human readable export definition
authorAlexander Stintzing <a.stintzing@metaways.de>
Wed, 23 Jul 2014 13:49:18 +0000 (15:49 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Wed, 6 Aug 2014 14:57:13 +0000 (16:57 +0200)
The export definitions should have a label which is shown at the combo (translated).

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

Change-Id: I89ca7551f82e4577adc7db863270b0d21fc5f049
Reviewed-on: http://gerrit.tine20.com/customers/893
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Addressbook/Export/definitions/adb_default_ods.xml
tine20/Addressbook/Export/definitions/adb_default_xls.xml
tine20/Addressbook/translations/de.po
tine20/Addressbook/translations/template.pot
tine20/Tinebase/ImportExportDefinition.php
tine20/Tinebase/Model/ImportExportDefinition.php
tine20/Tinebase/Setup/Update/Release8.php
tine20/Tinebase/Setup/setup.xml
tine20/Tinebase/js/widgets/dialog/ExportDialog.js

index def781e..7716916 100644 (file)
@@ -4,6 +4,7 @@
     <name>adb_default_ods</name>
     <type>export</type>
     <plugin>Addressbook_Export_Ods</plugin>
+    <label>Default OpenDocument Export</label>
     <description>default ods contact export definition</description>
     <header>1</header>
     <headers>
index a434ddc..41c50a3 100644 (file)
@@ -4,6 +4,7 @@
     <name>adb_default_xls</name>
     <type>export</type>
     <plugin>Addressbook_Export_Xls</plugin>
+    <label>Default Excel Export</label>
     <description>default xls contact export definition</description>
     <header>1</header>
     <columns>
index aae8698..d42248f 100644 (file)
@@ -700,3 +700,10 @@ msgstr "Neuer Kontakt"
 #: Controller/Contact.php:330
 msgid "Uploaded new contact image."
 msgstr "Ein neues Kontaktbild wurde hochgeladen."
+
+msgid "Default Excel Export"
+msgstr "Standard Excel Export"
+
+msgid "Default OpenDocument Export"
+msgstr "Standard OpenDocument Export"
+
index 6955f89..abe1379 100644 (file)
@@ -692,3 +692,9 @@ msgstr ""
 #: Controller/Contact.php:330
 msgid "Uploaded new contact image."
 msgstr ""
+
+msgid "Default Excel Export"
+msgstr ""
+
+msgid "Default OpenDocument Export"
+msgstr ""
index 6ee8311..7e7952b 100644 (file)
@@ -112,6 +112,7 @@ class Tinebase_ImportExportDefinition extends Tinebase_Controller_Record_Abstrac
             $definition = new Tinebase_Model_ImportExportDefinition(array(
                 'application_id'              => $_applicationId,
                 'name'                        => $name,
+                'label'                       => $config->label,
                 'description'                 => $config->description,
                 'type'                        => $config->type,
                 'model'                       => $config->model,
@@ -179,7 +180,7 @@ class Tinebase_ImportExportDefinition extends Tinebase_Controller_Record_Abstrac
         try {
             $existing = $this->getByName($definition->name);
             Tinebase_Core::getLogger()->info(__METHOD__ . '::' . __LINE__ . ' Updating definition: ' . $definition->name);
-            $copyFields = array('filename', 'plugin_options', 'description');
+            $copyFields = array('filename', 'plugin_options', 'description', 'label');
             foreach ($copyFields as $field) {
                 $existing->{$field} = $definition->{$field};
             }
index f5adac0..30434d8 100644 (file)
@@ -44,6 +44,7 @@ class Tinebase_Model_ImportExportDefinition extends Tinebase_Record_Abstract
         'application_id'        => array(Zend_Filter_Input::ALLOW_EMPTY => false, 'presence'=>'required'),
         'model'                 => array(Zend_Filter_Input::ALLOW_EMPTY => false, 'presence'=>'required'),
         'name'                  => array(Zend_Filter_Input::ALLOW_EMPTY => false, 'presence'=>'required'),
+        'label'                 => array(Zend_Filter_Input::ALLOW_EMPTY => true),
         'description'           => array(Zend_Filter_Input::ALLOW_EMPTY => true),
         'type'                  => array(
             Zend_Filter_Input::ALLOW_EMPTY  => false, 
index 847b564..a6a98a1 100644 (file)
@@ -90,4 +90,24 @@ class Tinebase_Setup_Update_Release8 extends Setup_Update_Abstract
         $this->setTableVersion('accounts', '10');
         $this->setApplicationVersion('Tinebase', '8.3');
     }
+    
+    /**
+     * adds a label property to hold a humanreadable text
+     */
+    public function update_3()
+    {
+        $declaration = new Setup_Backend_Schema_Field_Xml('<field>
+            <name>label</name>
+            <type>text</type>
+            <length>128</length>
+            <notnull>false</notnull>
+        </field>');
+        
+        $this->_backend->addCol('importexport_definition', $declaration);
+        
+        Setup_Controller::getInstance()->createImportExportDefinitions(Tinebase_Application::getInstance()->getApplicationByName('Addressbook'));
+        
+        $this->setTableVersion('importexport_definition', '8');
+        $this->setApplicationVersion('Tinebase', '8.4');
+    }
 }
index e7a21b5..223aeac 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <application>
     <name>Tinebase</name>
-    <version>8.3</version>
+    <version>8.4</version>
     <tables>
         <table>
             <name>applications</name>
         </table>
         <table>
             <name>importexport_definition</name>
-            <version>7</version>
+            <version>8</version>
             <declaration>
                 <field>
                     <name>id</name>
                     <notnull>true</notnull>
                 </field>
                 <field>
+                    <name>label</name>
+                    <type>text</type>
+                    <length>128</length>
+                    <notnull>false</notnull>
+                </field>
+                <field>
                     <name>model</name>
                     <type>text</type>
                     <length>64</length>
index 04b3152..d8c474a 100644 (file)
@@ -62,7 +62,7 @@ Tine.widgets.dialog.ExportDialog = Ext.extend(Tine.widgets.dialog.EditDialog, {
                 var options = defData.plugin_options,
                     extension = options ? options.extension : null;
                 
-                defData.label = this.app.i18n._hidden(options && options.label ? options.label : defData.name);
+                defData.label = this.app.i18n._hidden(defData.label ? defData.label : defData.name);
                 this.definitionsStore.addSorted(new Tine.Tinebase.Model.ImportExportDefinition(defData, defData.id));
             }, this);
             this.definitionsStore.sort('label');