Add cli function for ImportExportDefinition update
authorsstamer <s.stamer@metaways.de>
Wed, 27 May 2015 10:38:26 +0000 (12:38 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Wed, 27 May 2015 11:04:40 +0000 (13:04 +0200)
Change-Id: Ie0e4535bb0fabeb2b5c4b6a7dc46c5cd7c5d6529
Reviewed-on: http://gerrit.tine20.com/customers/1952
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Setup/Frontend/Cli.php
tine20/Setup/Server/Cli.php

index 1de248f..b087d44 100644 (file)
@@ -74,6 +74,8 @@ class Setup_Frontend_Cli
             $this->_getConfig($_opts);
         } elseif(isset($_opts->reset_demodata)) {
             $this->_resetDemodata($_opts);
+        } elseif(isset($_opts->updateAllImportExportDefinitions)) {
+            $this->_updateAllImportExportDefinitions($_opts);
         }
         
         if ($exitAfterHandle) {
@@ -370,6 +372,18 @@ class Setup_Frontend_Cli
     }
 
     /**
+     * Update Import Export Definitions for all applications
+     */
+    protected function _updateAllImportExportDefinitions(Zend_Console_Getopt $_opts){
+        //get all applications
+        $applications = Tinebase_Application::getInstance()->getApplications(NULL, 'id');
+        foreach ($applications as $application) {
+            Setup_Controller::getInstance()->createImportExportDefinitions($application);
+            echo "Update definitions for " . $application->name . "...\n";
+        }
+    }
+    
+    /**
      * list installed apps
      */
     protected function _listInstalled()
index 1deaecc..ef9b0f7 100644 (file)
@@ -51,8 +51,8 @@ class Setup_Server_Cli implements Tinebase_Server_Interface
                 'egw14import'               => 'Import user and groups from egw14
                          Examples: 
                           setup.php --egw14import /path/to/config.ini',
-                'reset_demodata'            => 'reinstall applications and install Demodata (Needs Admin user)'
-                    
+                'reset_demodata'            => 'reinstall applications and install Demodata (Needs Admin user)',
+                'updateAllImportExportDefinitions' => 'update ImportExport definitions for all applications'
             ));
             $opts->parse();
         } catch (Zend_Console_Getopt_Exception $e) {
@@ -71,6 +71,7 @@ class Setup_Server_Cli implements Tinebase_Server_Interface
             empty($opts->egw14import) && 
             empty($opts->check_requirements) && 
             empty($opts->reset_demodata) &&
+            empty($opts->updateAllImportExportDefinitions) &&
             empty($opts->create_admin) && 
             empty($opts->setconfig) && 
             empty($opts->getconfig)))