Finished DB compare against stddb/tables.sql (need testing)
authorThomas Hempel <thomas.hempel@typo3.org>
Thu, 13 Dec 2007 16:10:10 +0000 (16:10 +0000)
committerThomas Hempel <thomas.hempel@typo3.org>
Thu, 13 Dec 2007 16:10:10 +0000 (16:10 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@2825 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/install/modules/database/class.tx_install_module_database.php
typo3/sysext/install/modules/database/locallang.xml
typo3/sysext/install/modules/setup/class.tx_install_module_setup.php
typo3/sysext/install/modules/setup/res/styles.css

index 375dc6e..1067f6f 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2007-12-13     Thomas Hempel  <thomas@typo3-unleashed.net>
+
+       * Finished DB compare against stddb/tables.sql (need testing)
+
 2007-12-12     Thomas Hempel  <thomas@typo3-unleashed.net>
 
        * Bugfix: Invalid call to viewObj
index 0fa3caa..a959548 100755 (executable)
@@ -382,6 +382,12 @@ class tx_install_module_database extends tx_install_module_base    {
                return $this->pObj->getViewObject()->render($formConfig);
        }
        
+       /**
+        * Processes the request for a new admin user. This might become obsolete in the next days!
+        *
+        * @param unknown_type $staticFields
+        * @return unknown
+        */
        public function createAdminProcess($staticFields)       {
                if (ereg('[^[:alnum:]_-]', $this->env['createadmin_username'])) {
                        $this->addError(sprintf($this->get_LL('msg_warning_invalidusername'), $this->env['createadmin_username']), FATAL, 'fields', 'createadmin_username');
@@ -473,7 +479,7 @@ class tx_install_module_database extends tx_install_module_base     {
 
                        // Load default SQL file as a basis for comparison
                // $tblFileContent = t3lib_div::getUrl(PATH_t3lib.'stddb/tables.sql');
-//             reset($GLOBALS['TYPO3_LOADED_EXT']);
+               // reset($GLOBALS['TYPO3_LOADED_EXT']);
 
                        // Get all create table statements
                $fileContent = implode($t3lib_install->getStatementArray($tblFileContent, 1, '^CREATE TABLE '), chr(10));
@@ -487,27 +493,24 @@ class tx_install_module_database extends tx_install_module_base   {
                
                        // Updating database...
                if ($this->env['action'] == 'performUpdate')    {
-                       // debug($this->env);
                        /*
                         * Here the script has to perform the update of the database. The code is pasted from old install class.
                         */
                        
-                       /*
-                       $FDdb = $this->getFieldDefinitions_database();
-                       $diff = $this->getDatabaseExtra($FDfile, $FDdb);
-                       $update_statements = $this->getUpdateSuggestions($diff);
-                       $diff = $this->getDatabaseExtra($FDdb, $FDfile);
-                       $remove_statements = $this->getUpdateSuggestions($diff,'remove');
+                       $FDdb = $t3lib_install->getFieldDefinitions_database();
+                       $diff = $t3lib_install->getDatabaseExtra($FDfile, $FDdb);
+                       $update_statements = $t3lib_install->getUpdateSuggestions($diff);
+                       $diff = $t3lib_install->getDatabaseExtra($FDdb, $FDfile);
+                       $remove_statements = $t3lib_install->getUpdateSuggestions($diff,'remove');
 
-                       $this->performUpdateQueries($update_statements['add'],$this->INSTALL['database_update']);
-                       $this->performUpdateQueries($update_statements['change'],$this->INSTALL['database_update']);
-                       $this->performUpdateQueries($remove_statements['change'],$this->INSTALL['database_update']);
-                       $this->performUpdateQueries($remove_statements['drop'],$this->INSTALL['database_update']);
+                       $t3lib_install->performUpdateQueries($update_statements['add'], $this->env);
+                       $t3lib_install->performUpdateQueries($update_statements['change'], $this->env);
+                       $t3lib_install->performUpdateQueries($remove_statements['change'], $this->env);
+                       $t3lib_install->performUpdateQueries($remove_statements['drop'], $this->env);
 
-                       $this->performUpdateQueries($update_statements['create_table'],$this->INSTALL['database_update']);
-                       $this->performUpdateQueries($remove_statements['change_table'],$this->INSTALL['database_update']);
-                       $this->performUpdateQueries($remove_statements['drop_table'],$this->INSTALL['database_update']);
-                       */
+                       $t3lib_install->performUpdateQueries($update_statements['create_table'], $this->env);
+                       $t3lib_install->performUpdateQueries($remove_statements['change_table'], $this->env);
+                       $t3lib_install->performUpdateQueries($remove_statements['drop_table'], $this->env);
                }
 
                
@@ -517,22 +520,11 @@ class tx_install_module_database extends tx_install_module_base   {
                $update_statements = $t3lib_install->getUpdateSuggestions($diff);
                        
 
+                       // render form and / or message depending on result of DB compare
                if ($remove_statements || $update_statements)   {
-                       $formContent = $this->generateUpdateDatabaseForm($update_statements, $remove_statements);
-                       /*
-                       $this->message($tLabel,'Table and field definitions should be updated',"
-                       There seems to be a number of differencies between the database and the selected SQL-file.
-                       Please select which statements you want to execute in order to update your database:<br /><br />
-                       ".$formContent."
-                       ",2);
-                       */
+                       $formContent = $this->get_LL('msg_database_updateneeded').'<br />'.$this->generateUpdateDatabaseForm($update_statements, $remove_statements);
                } else {
-                       $formContent = $this->generateUpdateDatabaseForm($update_statements, $remove_statements);
-                       /*
-                       $this->message($tLabel,'Table and field definitions are OK.',"
-                       The tables and fields in the current database corresponds perfectly to the database in the selected SQL-file.
-                       ",-1);
-                       */
+                       $formContent = $this->get_LL('msg_database_noupdateneeded');
                }
                
                return $formContent;
index 891ae68..e51467f 100755 (executable)
                        <label index="msg_database_error_cantselectdb">FATAL: Can't select database "%s"</label>
                        <label index="msg_database_error_couldnotcreate">Could not create database with name "%s"</label>
                        <label index="msg_database_error_filenotfound">The compare-file "%s" was not found!</label>
-                       <label index="msg_analyze_error_nocreatedefinitions">There were no "CREATE TABLE" definitions in the provided file: %s</label>
+                       <label index="msg_database_error_nocreatedefinitions">There were no "CREATE TABLE" definitions in the provided file: %s</label>
 
                        <label index="msg_database_warning_selectdb">Please select a database or fill in a name for a new database.</label>
                        <label index="msg_database_warning_invalidname">The NEW database name "%s" was not alphanumeric, a-zA-Z0-9_-</label>
+                       
+                       <label index="msg_database_updateneeded">Table and field definitions should be updated!&lt;br /&gt; There seems to be a number of differencies between the database and the selected SQL-file. Please select which statements you want to execute in order to update your database:</label>
+                       <label index="msg_database_noupdateneeded">Table and field definitions are OK.&lt;br /&gt;The tables and fields in the current database corresponds perfectly to the database in the selected SQL-file.</label>
                </languageKey>
        </data>
 </T3locallang>
\ No newline at end of file
index 32dea96..2c4d579 100644 (file)
@@ -231,15 +231,21 @@ class tx_install_module_setup extends tx_install_module_base      {
                                                                        } else {
                                                                                $target = $name.'_result';
                                                                                list($module, $method) = t3lib_div::trimExplode(':', $modConfig['method']);
-                                                                               $deliverableContent = '<a href="#" onclick="executeMethod(\''.$module.'\', \''.$method.'\',  {target:\''.$target.'\'}, displayMethodResult)">'.$this->get_LL('label_execute').'</a>
-                                                                                       <div id="'.$target.'"></div>';
+                                                                               $headerContent = '&nbsp;[<a href="#" onclick="executeMethod(\''.$module.'\', \''.$method.'\',  {target:\''.$target.'\'}, displayMethodResult)">'.$this->get_LL('label_execute').'</a>]';
+                                                                               $deliverableContent = '<div id="'.$target.'"></div>';
                                                                        }
                                                                        break;
                                                        }
                                                        
+                                                       
                                                        if ($modConfig['elementType'] == 'checkbox')    {
+                                                                       // draw checkboxes in front of the caption
                                                                $deliverableBox = $this->pObj->getViewObject()->renderTag('h3', $deliverableContent.$this->get_LL($modConfig['title']).' '.(($helpData) ? $helpData['button'] : '')).(($helpData) ? $helpData['container'] : '').$descr;
+                                                       } elseif ($deliverable == 'methods') {
+                                                                       // draw "execute" link after caption and target div under caption
+                                                               $deliverableBox = $this->pObj->getViewObject()->renderTag('h3', $this->get_LL($modConfig['title']).$headerContent.' '.(($helpData) ? $helpData['button'] : '')).(($helpData) ? $helpData['container'] : '').$descr.$deliverableContent;
                                                        } else {
+                                                                       // draw caption and content under it (default)
                                                                $deliverableBox = $this->pObj->getViewObject()->renderTag('h3', $this->get_LL($modConfig['title']).' '.(($helpData) ? $helpData['button'] : '')).(($helpData) ? $helpData['container'] : '').$descr.$deliverableContent;
                                                        }
                                                        
index c0cdf6a..fc5a207 100644 (file)
@@ -17,7 +17,7 @@ h3    {
        border-bottom: 1px #c0c0c0 dashed;
 }
 
-fieldset       {
+fieldset legend        {
        font-weight: bold;
 }