phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: setup/inc class.schema_proc_array.inc.php,1.1,1.


From: Miles Lott <address@hidden>
Subject: [Phpgroupware-cvs] CVS: setup/inc class.schema_proc_array.inc.php,1.1,1.2 class.schema_proc_mssql.inc.php,1.1,1.2 class.schema_proc_mysql.inc.php,1.5,1.6 class.schema_proc_pgsql.inc.php,1.9,1.10 class.setup.inc.php,1.17,1.18 class.setup_detection.inc.php,1.6,1.7 class.setup_html.inc.php,1.6,1.7 class.setup_process.inc.php,1.7,1.8 functions.inc.php,1.40,1.41
Date: Thu, 10 Jan 2002 22:41:02 -0500

Update of /cvsroot/phpgroupware/setup/inc
In directory subversions:/tmp/cvs-serv24606

Modified Files:
        class.schema_proc_array.inc.php 
        class.schema_proc_mssql.inc.php 
        class.schema_proc_mysql.inc.php 
        class.schema_proc_pgsql.inc.php class.setup.inc.php 
        class.setup_detection.inc.php class.setup_html.inc.php 
        class.setup_process.inc.php functions.inc.php 
Log Message:
Formatting and comment adjustment



Index: class.schema_proc_array.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/setup/inc/class.schema_proc_array.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** class.schema_proc_array.inc.php     30 Jul 2001 15:59:25 -0000      1.1
--- class.schema_proc_array.inc.php     11 Jan 2002 03:40:59 -0000      1.2
***************
*** 21,25 ****
                }
  
!               // Return a type suitable for DDL abstracted array
                function TranslateType($sType, $iPrecision = 0, $iScale = 0, 
&$sTranslated)
                {
--- 21,25 ----
                }
  
!               /* Return a type suitable for DDL abstracted array */
                function TranslateType($sType, $iPrecision = 0, $iScale = 0, 
&$sTranslated)
                {

Index: class.schema_proc_mssql.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/setup/inc/class.schema_proc_mssql.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** class.schema_proc_mssql.inc.php     30 Jul 2001 15:59:25 -0000      1.1
--- class.schema_proc_mssql.inc.php     11 Jan 2002 03:40:59 -0000      1.2
***************
*** 12,342 ****
    /* $Id$ */
  
! class schema_proc_mssql
! {
!       var $m_sStatementTerminator;
!               // Following added to convert sql to array
!       var $sCol = array();
!       var $pk = array();
!       var $fk = array();
!       var $ix = array();
!       var $uc = array();
! 
!       function schema_proc_mssql()
        {
!               $this->m_sStatementTerminator = ";";
!       }
  
!               // Return a type suitable for DDL
!       function TranslateType($sType, $iPrecision = 0, $iScale = 0, 
&$sTranslated)
!       {
!               $sTranslated = "";
!               switch($sType)
                {
!                       case "auto":
!                               $sTranslated = "int identity(1,1)";
!                               break;
!                       case "blob":
!                               $sTranslated = "image"; // wonder how well PHP 
will support this???
!                               break;
!                       case "char":
!                               if ($iPrecision > 0 && $iPrecision < 256)
!                               {
!                                       $sTranslated =  sprintf("char(%d)", 
$iPrecision);
!                               }
!                               if ($iPrecision > 255)
!                               {
!                                       $sTranslated =  "text";
!                               }
!                               break;
!                       case "date":
!                               $sTranslated =  "smalldatetime";
!                               break;
!                       case "decimal":
!                               $sTranslated =  sprintf("decimal(%d,%d)", 
$iPrecision, $iScale);
!                               break;
!                       case "float":
!                               switch ($iPrecision)
!                               {
!                                       case 4:
!                                               $sTranslated = "float";
!                                               break;
!                                       case 8:
!                                               $sTranslated = "real";
!                                               break;
!                               }
!                               break;
!                       case "int":
!                               switch ($iPrecision)
!                               {
!                                       case 2:
!                                               $sTranslated = "smallint";
!                                               break;
!                                       case 4:
!                                       case 8:
!                                               $sTranslated = "int";
!                                               break;
!                               }
!                               break;
!                       case "longtext":
!                               $sTranslated = "longtext";
!                               break;
!                       case "text":
!                               $sTranslated = "text";
!                               break;
!                       case "timestamp":
!                               $sTranslated = "datetime";
!                               break;
!                       case "varchar":
!                               if ($iPrecision > 0 && $iPrecision < 256)
!                               {
!                                       $sTranslated =  sprintf("varchar(%d)", 
$iPrecision);
!                               }
!                               if ($iPrecision > 255)
!                               {
!                                       $sTranslated =  "text";
!                               }
!                               break;
                }
  
!               return (strlen($sTranslated) > 0);
!       }
! 
!       function TranslateDefault($sDefault)
!       {
!               switch ($sDefault)
                {
!                       case "current_date":
!                       case "current_timestamp":
!                               return "GetDate()";
!               }
  
!               return $sDefault;
!       }
  
!               // Inverse of above, convert sql column types to array info
!       function rTranslateType($sType, $iPrecision = 0, $iScale = 0, 
&$sTranslated)
!       {
!               $sTranslated = '';
!               if ($sType == 'int' || $sType == 'tinyint' ||  $sType == 
'smallint')
                {
!                       if ($iPrecision > 8)
                        {
!                               $iPrecision = 8;
                        }
!                       elseif($iPrecision > 4)
                        {
!                               $iPrecision = 4;
                        }
!                       else
                        {
!                               $iPrecision = 2;
                        }
                }
!               switch($sType)
                {
!                       case "tinyint":
!                       case "smallint":
!                               $sTranslated = "'type' => 'int', 'precision' => 
2";
!                               break;
!                       case "int":
!                               $sTranslated = "'type' => 'int', 'precision' => 
4";
!                               break;
!                       case "char":
!                               if ($iPrecision > 0 && $iPrecision < 256)
!                               {
!                                       $sTranslated = "'type' => 'char', 
'precision' => $iPrecision";
!                               }
!                               if ($iPrecision > 255)
!                               {
!                                       $sTranslated =  "'type' => 'text'";
!                               }
!                               break;
!                       case "decimal":
!                               $sTranslated = "'type' => 'decimal', 
'precision' => $iPrecision, 'scale' => $iScale";
!                               break;
!                       case "float":
!                       case "double":
!                               $sTranslated = "'type' => 'float', 'precision' 
=> $iPrecision";
!                               break;
!                       case "smalldatetime":
!                               $sTranslated = "'type' => 'date'";
!                               break;
!                       case "datetime":
!                               $sTranslated = "'type' => 'timestamp'";
!                               break;
!                       case "varchar":
!                               if ($iPrecision > 0 && $iPrecision < 256)
!                               {
!                                       $sTranslated =  "'type' => 'varchar', 
'precision' => $iPrecision";
!                               }
!                               if ($iPrecision > 255)
!                               {
!                                       $sTranslated =  "'type' => 'text'";
!                               }
!                               break;
!                       case "image":
!                               $sTranslated = "'type' => 'blob'";
!                               break;
!                       case "text":
!                               $sTranslated = "'type' => '$sType'";
!                               break;
                }
  
!               return (strlen($sTranslated) > 0);
!       }
! 
!       function GetPKSQL($sFields)
!       {
!               return "PRIMARY KEY($sFields)";
!       }
! 
!       function GetUCSQL($sFields)
!       {
!               return "UNIQUE($sFields)";
!       }
  
!       function _GetColumns($oProc, $sTableName, &$sColumns, $sDropColumn = "")
!       {
!               $sColumns = "";
!               $this->pk = array();
!               $this->fk = array();
!               $this->ix = array();
!               $this->uc = array();
  
                        // Field, Type, Null, Key, Default, Extra
!               $oProc->m_odb->query("exec sp_columns '$sTableName'");
!               while ($oProc->m_odb->next_record())
!               {
!                       $type = $default = $null = $nullcomma = $prec = $scale 
= $ret = $colinfo = $scales = '';
!                       if ($sColumns != "")
                        {
!                               $sColumns .= ",";
!                       }
!                       $sColumns .= $oProc->m_odb->f(0);
  
                                // The rest of this is used only for SQL->array
!                       $colinfo = explode('(',$oProc->m_odb->f(1));
!                       $prec = ereg_replace(')','',$colinfo[1]);
!                       $scales = explode(',',$prec);
!                       if ($scales[1])
!                       {
!                               $prec  = $scales[0];
!                               $scale = $scales[1];
!                       }
!                       $this->rTranslateType($colinfo[0], $prec, $scale, 
&$type);
  
!                       if ($oProc->m_odb->f(2) == 'YES')
!                       {
!                               $null = "'nullable' => True";
!                       }
!                       else
!                       {
!                               $null = "'nullable' => False";
!                       }
!                       if ($oProc->m_odb->f(4))
!                       {
!                               $default = "'default' => 
'".$oProc->m_odb->f(4)."'";
!                               $nullcomma = ',';
!                       }
!                       else
!                       {
!                               $default = '';
!                               $nullcomma = '';
!                       }
!                       if ($oProc->m_odb->f(5))
!                       {
!                               $type = "'type' => 'auto'";
!                       }
!                       $this->sCol[] = "\t\t\t\t'" . $oProc->m_odb->f(0)."' => 
array(" . $type . ',' . $null . $nullcomma . $default . '),' . "\n";
!                       if ($oProc->m_odb->f(3) == 'PRI')
!                       {
!                               $this->pk[] = $oProc->m_odb->f(0);
!                       }
!                       if ($oProc->m_odb->f(3) == 'UNI')
!                       {
!                               $this->uc[] = $oProc->m_odb->f(0);
!                       }
!                               // Hmmm, MUL could also mean unique, or not...
!                       if ($oProc->m_odb->f(3) == 'MUL')
!                       {
!                               $this->ix[] = $oProc->m_odb->f(0);
                        }
!               }
!                       // ugly as heck, but is here to chop the trailing comma 
on the last element (for php3)
!               $this->sCol[count($this->sCol) - 1] = 
substr($this->sCol[count($this->sCol) - 1],0,-2) . "\n";
  
!               return false;
!       }
  
!       function DropTable($oProc, &$aTables, $sTableName)
!       {
!               return !!($oProc->m_odb->query("DROP TABLE " . $sTableName));
!       }
  
!       function DropColumn($oProc, &$aTables, $sTableName, $aNewTableDef, 
$sColumnName, $bCopyData = true)
!       {
!               return !!($oProc->m_odb->query("ALTER TABLE $sTableName DROP 
COLUMN $sColumnName"));
!       }
  
!       function RenameTable($oProc, &$aTables, $sOldTableName, $sNewTableName)
!       {
!               return !!($oProc->m_odb->query("EXEC sp_rename 
'$sOldTableName', '$sNewTableName'"));
!       }
  
!       function RenameColumn($oProc, &$aTables, $sTableName, $sOldColumnName, 
$sNewColumnName, $bCopyData = true)
!       {
                        // This really needs testing - it can affect primary 
keys, and other table-related objects
                        // like sequences and such
!               global $DEBUG;
!               if ($DEBUG) { echo '<br>RenameColumn: calling _GetFieldSQL for 
' . $sNewColumnName; }
!               if 
($oProc->_GetFieldSQL($aTables[$sTableName]["fd"][$sNewColumnName], 
$sNewColumnSQL))
!               {
!                       return !!($oProc->m_odb->query("EXEC sp_rename 
'$sTableName.$sOldColumnName', '$sNewColumnName'"));
                }
-               return false;
-       }
  
!       function AlterColumn($oProc, &$aTables, $sTableName, $sColumnName, 
&$aColumnDef, $bCopyData = true)
!       {
!               global $DEBUG;
!               if ($DEBUG) { echo '<br>AlterColumn: calling _GetFieldSQL for ' 
. $sNewColumnName; }
!               if 
($oProc->_GetFieldSQL($aTables[$sTableName]["fd"][$sColumnName], 
$sNewColumnSQL))
                {
!                       return !!($oProc->m_odb->query("ALTER TABLE $sTableName 
ALTER COLUMN $sColumnName " . $sNewColumnSQL));
!               }
  
!               return false;
!       }
  
!       function AddColumn($oProc, &$aTables, $sTableName, $sColumnName, 
&$aColumnDef)
!       {
!               $oProc->_GetFieldSQL($aColumnDef, $sFieldSQL);
!               $query = "ALTER TABLE $sTableName ADD COLUMN $sColumnName 
$sFieldSQL";
  
!               return !!($oProc->m_odb->query($query));
!       }
  
!       function GetSequenceSQL($sTableName, &$sSequenceSQL)
!       {
!               $sSequenceSQL = "";
!               return true;
!       }
  
!       function CreateTable($oProc, &$aTables, $sTableName, $aTableDef)
!       {
!               if ($oProc->_GetTableSQL($sTableName, $aTableDef, $sTableSQL, 
$sSequenceSQL))
                {
!                               // create sequence first since it will be 
needed for default
!                       if ($sSequenceSQL != "")
                        {
!                               $oProc->m_odb->query($sSequenceSQL);
                        }
  
!                       $query = "CREATE TABLE $sTableName ($sTableSQL)";
!                       return !!($oProc->m_odb->query($query));
                }
! 
!               return false;
!       }       
! }
  ?>
--- 12,342 ----
    /* $Id$ */
  
!       class schema_proc_mssql
        {
!               var $m_sStatementTerminator;
!               /* Following added to convert sql to array */
!               var $sCol = array();
!               var $pk = array();
!               var $fk = array();
!               var $ix = array();
!               var $uc = array();
  
!               function schema_proc_mssql()
                {
!                       $this->m_sStatementTerminator = ';';
                }
  
!               /* Return a type suitable for DDL */
!               function TranslateType($sType, $iPrecision = 0, $iScale = 0, 
&$sTranslated)
                {
!                       $sTranslated = '';
!                       switch($sType)
!                       {
!                               case 'auto':
!                                       $sTranslated = 'int identity(1,1)';
!                                       break;
!                               case 'blob':
!                                       $sTranslated = 'image'; /* wonder how 
well PHP will support this??? */
!                                       break;
!                               case 'char':
!                                       if ($iPrecision > 0 && $iPrecision < 
256)
!                                       {
!                                               $sTranslated =  
sprintf("char(%d)", $iPrecision);
!                                       }
!                                       if ($iPrecision > 255)
!                                       {
!                                               $sTranslated =  'text';
!                                       }
!                                       break;
!                               case 'date':
!                                       $sTranslated = 'smalldatetime';
!                                       break;
!                               case 'decimal':
!                                       $sTranslated =  
sprintf("decimal(%d,%d)", $iPrecision, $iScale);
!                                       break;
!                               case 'float':
!                                       switch ($iPrecision)
!                                       {
!                                               case 4:
!                                                       $sTranslated = 'float';
!                                                       break;
!                                               case 8:
!                                                       $sTranslated = 'real';
!                                                       break;
!                                       }
!                                       break;
!                               case 'int':
!                                       switch ($iPrecision)
!                                       {
!                                               case 2:
!                                                       $sTranslated = 
'smallint';
!                                                       break;
!                                               case 4:
!                                               case 8:
!                                                       $sTranslated = 'int';
!                                                       break;
!                                       }
!                                       break;
!                               case 'longtext':
!                                       $sTranslated = 'longtext';
!                                       break;
!                               case 'text':
!                                       $sTranslated = 'text';
!                                       break;
!                               case 'timestamp':
!                                       $sTranslated = 'datetime';
!                                       break;
!                               case 'varchar':
!                                       if ($iPrecision > 0 && $iPrecision < 
256)
!                                       {
!                                               $sTranslated =  
sprintf("varchar(%d)", $iPrecision);
!                                       }
!                                       if ($iPrecision > 255)
!                                       {
!                                               $sTranslated =  'text';
!                                       }
!                                       break;
!                       }
  
!                       return (strlen($sTranslated) > 0);
!               }
  
!               function TranslateDefault($sDefault)
                {
!                       switch ($sDefault)
                        {
!                               case 'current_date':
!                               case 'current_timestamp':
!                               return 'GetDate()';
                        }
! 
!                       return $sDefault;
!               }
! 
!               // Inverse of above, convert sql column types to array info
!               function rTranslateType($sType, $iPrecision = 0, $iScale = 0, 
&$sTranslated)
!               {
!                       $sTranslated = '';
!                       if ($sType == 'int' || $sType == 'tinyint' ||  $sType 
== 'smallint')
                        {
!                               if ($iPrecision > 8)
!                               {
!                                       $iPrecision = 8;
!                               }
!                               elseif($iPrecision > 4)
!                               {
!                                       $iPrecision = 4;
!                               }
!                               else
!                               {
!                                       $iPrecision = 2;
!                               }
                        }
!                       switch($sType)
                        {
!                               case 'tinyint':
!                               case 'smallint':
!                                       $sTranslated = "'type' => 'int', 
'precision' => 2";
!                                       break;
!                               case 'int':
!                                       $sTranslated = "'type' => 'int', 
'precision' => 4";
!                                       break;
!                               case 'char':
!                                       if ($iPrecision > 0 && $iPrecision < 
256)
!                                       {
!                                               $sTranslated = "'type' => 
'char', 'precision' => $iPrecision";
!                                       }
!                                       if ($iPrecision > 255)
!                                       {
!                                               $sTranslated =  "'type' => 
'text'";
!                                       }
!                                       break;
!                               case 'decimal':
!                                       $sTranslated = "'type' => 'decimal', 
'precision' => $iPrecision, 'scale' => $iScale";
!                                       break;
!                               case 'float':
!                               case 'double':
!                                       $sTranslated = "'type' => 'float', 
'precision' => $iPrecision";
!                                       break;
!                               case 'smalldatetime':
!                                       $sTranslated = "'type' => 'date'";
!                                       break;
!                               case 'datetime':
!                                       $sTranslated = "'type' => 'timestamp'";
!                                       break;
!                               case 'varchar':
!                                       if ($iPrecision > 0 && $iPrecision < 
256)
!                                       {
!                                               $sTranslated =  "'type' => 
'varchar', 'precision' => $iPrecision";
!                                       }
!                                       if ($iPrecision > 255)
!                                       {
!                                               $sTranslated =  "'type' => 
'text'";
!                                       }
!                                       break;
!                               case 'image':
!                                       $sTranslated = "'type' => 'blob'";
!                                       break;
!                               case 'text':
!                                       $sTranslated = "'type' => '$sType'";
!                                       break;
                        }
+ 
+                       return (strlen($sTranslated) > 0);
                }
! 
!               function GetPKSQL($sFields)
                {
!                       return "PRIMARY KEY($sFields)";
                }
  
!               function GetUCSQL($sFields)
!               {
!                       return "UNIQUE($sFields)";
!               }
  
!               function _GetColumns($oProc, $sTableName, &$sColumns, 
$sDropColumn = '')
!               {
!                       $sColumns = '';
!                       $this->pk = array();
!                       $this->fk = array();
!                       $this->ix = array();
!                       $this->uc = array();
  
                        // Field, Type, Null, Key, Default, Extra
!                       $oProc->m_odb->query("exec sp_columns '$sTableName'");
!                       while ($oProc->m_odb->next_record())
                        {
!                               $type = $default = $null = $nullcomma = $prec = 
$scale = $ret = $colinfo = $scales = '';
!                               if ($sColumns != '')
!                               {
!                                       $sColumns .= ',';
!                               }
!                               $sColumns .= $oProc->m_odb->f(0);
  
                                // The rest of this is used only for SQL->array
!                               $colinfo = explode('(',$oProc->m_odb->f(1));
!                               $prec = ereg_replace(')','',$colinfo[1]);
!                               $scales = explode(',',$prec);
!                               if ($scales[1])
!                               {
!                                       $prec  = $scales[0];
!                                       $scale = $scales[1];
!                               }
!                               $this->rTranslateType($colinfo[0], $prec, 
$scale, &$type);
  
!                               if ($oProc->m_odb->f(2) == 'YES')
!                               {
!                                       $null = "'nullable' => True";
!                               }
!                               else
!                               {
!                                       $null = "'nullable' => False";
!                               }
!                               if ($oProc->m_odb->f(4))
!                               {
!                                       $default = "'default' => 
'".$oProc->m_odb->f(4)."'";
!                                       $nullcomma = ',';
!                               }
!                               else
!                               {
!                                       $default = '';
!                                       $nullcomma = '';
!                               }
!                               if ($oProc->m_odb->f(5))
!                               {
!                                       $type = "'type' => 'auto'";
!                               }
!                               $this->sCol[] = "\t\t\t\t'" . 
$oProc->m_odb->f(0)."' => array(" . $type . ',' . $null . $nullcomma . $default 
. '),' . "\n";
!                               if ($oProc->m_odb->f(3) == 'PRI')
!                               {
!                                       $this->pk[] = $oProc->m_odb->f(0);
!                               }
!                               if ($oProc->m_odb->f(3) == 'UNI')
!                               {
!                                       $this->uc[] = $oProc->m_odb->f(0);
!                               }
!                               /* Hmmm, MUL could also mean unique, or not... 
*/
!                               if ($oProc->m_odb->f(3) == 'MUL')
!                               {
!                                       $this->ix[] = $oProc->m_odb->f(0);
!                               }
                        }
!                       /* ugly as heck, but is here to chop the trailing comma 
on the last element (for php3) */
!                       $this->sCol[count($this->sCol) - 1] = 
substr($this->sCol[count($this->sCol) - 1],0,-2) . "\n";
  
!                       return false;
!               }
  
!               function DropTable($oProc, &$aTables, $sTableName)
!               {
!                       return !!($oProc->m_odb->query("DROP TABLE " . 
$sTableName));
!               }
  
!               function DropColumn($oProc, &$aTables, $sTableName, 
$aNewTableDef, $sColumnName, $bCopyData = true)
!               {
!                       return !!($oProc->m_odb->query("ALTER TABLE $sTableName 
DROP COLUMN $sColumnName"));
!               }
  
!               function RenameTable($oProc, &$aTables, $sOldTableName, 
$sNewTableName)
!               {
!                       return !!($oProc->m_odb->query("EXEC sp_rename 
'$sOldTableName', '$sNewTableName'"));
!               }
  
!               function RenameColumn($oProc, &$aTables, $sTableName, 
$sOldColumnName, $sNewColumnName, $bCopyData = true)
!               {
                        // This really needs testing - it can affect primary 
keys, and other table-related objects
                        // like sequences and such
!                       global $DEBUG;
!                       if ($DEBUG) { echo '<br>RenameColumn: calling 
_GetFieldSQL for ' . $sNewColumnName; }
!                       if 
($oProc->_GetFieldSQL($aTables[$sTableName]["fd"][$sNewColumnName], 
$sNewColumnSQL))
!                       {
!                               return !!($oProc->m_odb->query("EXEC sp_rename 
'$sTableName.$sOldColumnName', '$sNewColumnName'"));
!                       }
!                       return false;
                }
  
!               function AlterColumn($oProc, &$aTables, $sTableName, 
$sColumnName, &$aColumnDef, $bCopyData = true)
                {
!                       global $DEBUG;
!                       if ($DEBUG) { echo '<br>AlterColumn: calling 
_GetFieldSQL for ' . $sNewColumnName; }
!                       if 
($oProc->_GetFieldSQL($aTables[$sTableName]["fd"][$sColumnName], 
$sNewColumnSQL))
!                       {
!                               return !!($oProc->m_odb->query("ALTER TABLE 
$sTableName ALTER COLUMN $sColumnName " . $sNewColumnSQL));
!                       }
  
!                       return false;
!               }
  
!               function AddColumn($oProc, &$aTables, $sTableName, 
$sColumnName, &$aColumnDef)
!               {
!                       $oProc->_GetFieldSQL($aColumnDef, $sFieldSQL);
!                       $query = "ALTER TABLE $sTableName ADD COLUMN 
$sColumnName $sFieldSQL";
  
!                       return !!($oProc->m_odb->query($query));
!               }
  
!               function GetSequenceSQL($sTableName, &$sSequenceSQL)
!               {
!                       $sSequenceSQL = '';
!                       return true;
!               }
  
!               function CreateTable($oProc, &$aTables, $sTableName, $aTableDef)
                {
!                       if ($oProc->_GetTableSQL($sTableName, $aTableDef, 
$sTableSQL, $sSequenceSQL))
                        {
!                               // create sequence first since it will be 
needed for default
!                               if ($sSequenceSQL != '')
!                               {
!                                       $oProc->m_odb->query($sSequenceSQL);
!                               }
! 
!                               $query = "CREATE TABLE $sTableName 
($sTableSQL)";
!                               return !!($oProc->m_odb->query($query));
                        }
  
!                       return false;
                }
!       }
  ?>

Index: class.schema_proc_mysql.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/setup/inc/class.schema_proc_mysql.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** class.schema_proc_mysql.inc.php     18 Oct 2001 01:02:49 -0000      1.5
--- class.schema_proc_mysql.inc.php     11 Jan 2002 03:40:59 -0000      1.6
***************
*** 15,19 ****
        {
                var $m_sStatementTerminator;
!               // Following added to convert sql to array
                var $sCol = array();
                var $pk = array();
--- 15,19 ----
        {
                var $m_sStatementTerminator;
!               /* Following added to convert sql to array */
                var $sCol = array();
                var $pk = array();
***************
*** 27,31 ****
                }
  
!               // Return a type suitable for DDL
                function TranslateType($sType, $iPrecision = 0, $iScale = 0, 
&$sTranslated)
                {
--- 27,31 ----
                }
  
!               /* Return a type suitable for DDL */
                function TranslateType($sType, $iPrecision = 0, $iScale = 0, 
&$sTranslated)
                {
***************
*** 116,120 ****
                }
  
!               // Inverse of above, convert sql column types to array info
                function rTranslateType($sType, $iPrecision = 0, $iScale = 0, 
&$sTranslated)
                {
--- 116,120 ----
                }
  
!               /* Inverse of above, convert sql column types to array info */
                function rTranslateType($sType, $iPrecision = 0, $iScale = 0, 
&$sTranslated)
                {
***************
*** 167,171 ****
                                        break;
                                case 'enum':
!                                       // Here comes a nasty assumption
                                        $sTranslated =  "'type' => 'varchar', 
'precision' => 255";
                                        break;
--- 167,171 ----
                                        break;
                                case 'enum':
!                                       /* Here comes a nasty assumption */
                                        $sTranslated =  "'type' => 'varchar', 
'precision' => 255";
                                        break;
***************
*** 209,213 ****
                        $this->uc = array();
                        
!                       // Field, Type, Null, Key, Default, Extra
                        $oProc->m_odb->query("describe $sTableName");
                        while ($oProc->m_odb->next_record())
--- 209,213 ----
                        $this->uc = array();
                        
!                       /* Field, Type, Null, Key, Default, Extra */
                        $oProc->m_odb->query("describe $sTableName");
                        while ($oProc->m_odb->next_record())
***************
*** 220,224 ****
                                $sColumns .= $oProc->m_odb->f(0);
  
!                               // The rest of this is used only for SQL->array
                                $colinfo = explode('(',$oProc->m_odb->f(1));
                                $prec = ereg_replace(')','',$colinfo[1]);
--- 220,224 ----
                                $sColumns .= $oProc->m_odb->f(0);
  
!                               /* The rest of this is used only for SQL->array 
*/
                                $colinfo = explode('(',$oProc->m_odb->f(1));
                                $prec = ereg_replace(')','',$colinfo[1]);
***************
*** 262,266 ****
                                        $this->uc[] = $oProc->m_odb->f(0);
                                }
!                               // Hmmm, MUL could also mean unique, or not...
                                if ($oProc->m_odb->f(3) == 'MUL')
                                {
--- 262,266 ----
                                        $this->uc[] = $oProc->m_odb->f(0);
                                }
!                               /* Hmmm, MUL could also mean unique, or not... 
*/
                                if ($oProc->m_odb->f(3) == 'MUL')
                                {
***************
*** 268,272 ****
                                }
                        }
!                       // ugly as heck, but is here to chop the trailing comma 
on the last element (for php3)
                        $this->sCol[count($this->sCol) - 1] = 
substr($this->sCol[count($this->sCol) - 1],0,-2) . "\n";
  
--- 268,272 ----
                                }
                        }
!                       /* ugly as heck, but is here to chop the trailing comma 
on the last element (for php3) */
                        $this->sCol[count($this->sCol) - 1] = 
substr($this->sCol[count($this->sCol) - 1],0,-2) . "\n";
  
***************
*** 291,296 ****
                function RenameColumn($oProc, &$aTables, $sTableName, 
$sOldColumnName, $sNewColumnName, $bCopyData = true)
                {
!                       // This really needs testing - it can affect primary 
keys, and other table-related objects
!                       // like sequences and such
                        global $DEBUG;
                        if ($DEBUG) { echo '<br>RenameColumn: calling 
_GetFieldSQL for ' . $sNewColumnName; }
--- 291,298 ----
                function RenameColumn($oProc, &$aTables, $sTableName, 
$sOldColumnName, $sNewColumnName, $bCopyData = true)
                {
!                       /*
!                        TODO: This really needs testing - it can affect 
primary keys, and other table-related objects
!                        like sequences and such
!                       */
                        global $DEBUG;
                        if ($DEBUG) { echo '<br>RenameColumn: calling 
_GetFieldSQL for ' . $sNewColumnName; }
***************
*** 333,337 ****
                        if ($oProc->_GetTableSQL($sTableName, $aTableDef, 
$sTableSQL, $sSequenceSQL))
                        {
!                               // create sequence first since it will be 
needed for default
                                if ($sSequenceSQL != '')
                                {
--- 335,339 ----
                        if ($oProc->_GetTableSQL($sTableName, $aTableDef, 
$sTableSQL, $sSequenceSQL))
                        {
!                               /* create sequence first since it will be 
needed for default */
                                if ($sSequenceSQL != '')
                                {

Index: class.schema_proc_pgsql.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/setup/inc/class.schema_proc_pgsql.inc.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** class.schema_proc_pgsql.inc.php     8 Jan 2002 14:03:29 -0000       1.9
--- class.schema_proc_pgsql.inc.php     11 Jan 2002 03:40:59 -0000      1.10
***************
*** 19,23 ****
        {
                var $m_sStatementTerminator;
!               // Following added to convert sql to array
                var $sCol = array();
                var $pk = array();
--- 19,23 ----
        {
                var $m_sStatementTerminator;
!               /* Following added to convert sql to array */
                var $sCol = array();
                var $pk = array();
***************
*** 31,35 ****
                }
  
!               // Return a type suitable for DDL
                function TranslateType($sType, $iPrecision = 0, $iScale = 0, 
&$sTranslated)
                {
--- 31,35 ----
                }
  
!               /* Return a type suitable for DDL */
                function TranslateType($sType, $iPrecision = 0, $iScale = 0, 
&$sTranslated)
                {
***************
*** 106,110 ****
                }
  
!               // Inverse of above, convert sql column types to array info
                function rTranslateType($sType, $iPrecision = 0, $iScale = 0, 
&$sTranslated)
                {
--- 106,110 ----
                }
  
!               /* Inverse of above, convert sql column types to array info */
                function rTranslateType($sType, $iPrecision = 0, $iScale = 0, 
&$sTranslated)
                {
***************
*** 235,239 ****
                                        and a.atttypid = t.oid
                                        ORDER BY a.attnum";
!                       // attnum field type length lengthvar notnull(Yes/No)
                        $sdb->query($sql_get_fields);
                        while ($sdb->next_record())
--- 235,239 ----
                                        and a.atttypid = t.oid
                                        ORDER BY a.attnum";
!                       /* attnum field type length lengthvar notnull(Yes/No) */
                        $sdb->query($sql_get_fields);
                        while ($sdb->next_record())
***************
*** 342,346 ****
                                }
                        }
!                       // ugly as heck, but is here to chop the trailing comma 
on the last element (for php3)
                        $this->sCol[count($this->sCol) - 1] = 
substr($this->sCol[count($this->sCol) - 1],0,-2) . "\n";
  
--- 342,346 ----
                                }
                        }
!                       /* ugly as heck, but is here to chop the trailing comma 
on the last element (for php3) */
                        $this->sCol[count($this->sCol) - 1] = 
substr($this->sCol[count($this->sCol) - 1],0,-2) . "\n";
  
***************
*** 527,532 ****
                function RenameColumn($oProc, &$aTables, $sTableName, 
$sOldColumnName, $sNewColumnName, $bCopyData = true)
                {
!                       // This really needs testing - it can affect primary 
keys, and other table-related objects
!                       // like sequences and such
                        if ($bCopyData)
                        {
--- 527,534 ----
                function RenameColumn($oProc, &$aTables, $sTableName, 
$sOldColumnName, $sNewColumnName, $bCopyData = true)
                {
!                       /*
!                        This really needs testing - it can affect primary 
keys, and other table-related objects
!                        like sequences and such
!                       */
                        if ($bCopyData)
                        {
***************
*** 566,573 ****
                        $this->_GetColumns($oProc, $sTableName . "_tmp", 
$sColumns, '', $sColumnName, $aColumnDef['type'] == 'auto' ? 'int4' : 
$aColumnDef['type']);
  
!                       // TODO: analyze the type of change and determine if 
this is used or _CopyAlteredTable
!                       // this is a performance consideration only, 
_CopyAlteredTable should be safe
!                       //$query = "INSERT INTO $sTableName SELECT $sColumns 
FROM $sTableName" . "_tmp";
!                       //$bRet = !!($oProc->m_odb->query($query));
  
                        $bRet = $this->_CopyAlteredTable($oProc, $aTables, 
$sTableName . '_tmp', $sTableName);
--- 568,577 ----
                        $this->_GetColumns($oProc, $sTableName . "_tmp", 
$sColumns, '', $sColumnName, $aColumnDef['type'] == 'auto' ? 'int4' : 
$aColumnDef['type']);
  
!                       /*
!                        TODO: analyze the type of change and determine if this 
is used or _CopyAlteredTable
!                        this is a performance consideration only, 
_CopyAlteredTable should be safe
!                        $query = "INSERT INTO $sTableName SELECT $sColumns 
FROM $sTableName" . "_tmp";
!                        $bRet = !!($oProc->m_odb->query($query));
!                       */
  
                        $bRet = $this->_CopyAlteredTable($oProc, $aTables, 
$sTableName . '_tmp', $sTableName);
***************
*** 595,599 ****
                        if ($oProc->_GetTableSQL($sTableName, $aTableDef, 
$sTableSQL, $sSequenceSQL))
                        {
!                               // create sequence first since it will be 
needed for default
                                if ($bCreateSequence && $sSequenceSQL != '')
                                {
--- 599,603 ----
                        if ($oProc->_GetTableSQL($sTableName, $aTableDef, 
$sTableSQL, $sSequenceSQL))
                        {
!                               /* create sequence first since it will be 
needed for default */
                                if ($bCreateSequence && $sSequenceSQL != '')
                                {

Index: class.setup.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/setup/inc/class.setup.inc.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** class.setup.inc.php 7 Jan 2002 10:50:42 -0000       1.17
--- class.setup.inc.php 11 Jan 2002 03:40:59 -0000      1.18
***************
*** 41,45 ****
                        }
                        include($GLOBALS['phpgw_info']['server']['api_inc'] . 
'/class.db_'.$GLOBALS['phpgw_domain'][$ConfigDomain]['db_type'].'.inc.php');
!                       $this->db               = new db;
                        $this->db->Host     = 
$GLOBALS['phpgw_domain'][$ConfigDomain]['db_host'];
                        $this->db->Type     = 
$GLOBALS['phpgw_domain'][$ConfigDomain]['db_type'];
--- 41,45 ----
                        }
                        include($GLOBALS['phpgw_info']['server']['api_inc'] . 
'/class.db_'.$GLOBALS['phpgw_domain'][$ConfigDomain]['db_type'].'.inc.php');
!                       $this->db           = new db;
                        $this->db->Host     = 
$GLOBALS['phpgw_domain'][$ConfigDomain]['db_host'];
                        $this->db->Type     = 
$GLOBALS['phpgw_domain'][$ConfigDomain]['db_type'];
***************
*** 76,81 ****
                                        $FormLogout == 'sqltoarray')
                                {
!                                       setcookie('ConfigPW');  // scrub the 
old one
!                                       setcookie('ConfigDomain');  // scrub 
the old one
                                        setcookie('ConfigLang');
                                        
$GLOBALS['phpgw_info']['setup']['ConfigLoginMSG'] = 'You have successfully 
logged out';
--- 76,81 ----
                                        $FormLogout == 'sqltoarray')
                                {
!                                       setcookie('ConfigPW');  /* scrub the 
old one */
!                                       setcookie('ConfigDomain');  /* scrub 
the old one */
                                        setcookie('ConfigLang');
                                        
$GLOBALS['phpgw_info']['setup']['ConfigLoginMSG'] = 'You have successfully 
logged out';
***************
*** 84,88 ****
                                elseif($FormLogout == 'header')
                                {
!                                       setcookie('HeaderPW');  // scrub the 
old one
                                        
$GLOBALS['phpgw_info']['setup']['HeaderLoginMSG'] = 'You have successfully 
logged out';
                                        return False;
--- 84,88 ----
                                elseif($FormLogout == 'header')
                                {
!                                       setcookie('HeaderPW');  /* scrub the 
old one */
                                        
$GLOBALS['phpgw_info']['setup']['HeaderLoginMSG'] = 'You have successfully 
logged out';
                                        return False;
***************
*** 93,98 ****
                                if ($ConfigPW != 
$GLOBALS['phpgw_domain'][$ConfigDomain]['config_passwd'] && $auth_type == 
'Config')
                                {
!                                       setcookie('ConfigPW');  // scrub the 
old one
!                                       setcookie('ConfigDomain');  // scrub 
the old one
                                        setcookie('ConfigLang');
                                        
$GLOBALS['phpgw_info']['setup']['ConfigLoginMSG'] = 'Invalid session cookie 
(cookies must be enabled)';
--- 93,98 ----
                                if ($ConfigPW != 
$GLOBALS['phpgw_domain'][$ConfigDomain]['config_passwd'] && $auth_type == 
'Config')
                                {
!                                       setcookie('ConfigPW');  /* scrub the 
old one */
!                                       setcookie('ConfigDomain');  /* scrub 
the old one */
                                        setcookie('ConfigLang');
                                        
$GLOBALS['phpgw_info']['setup']['ConfigLoginMSG'] = 'Invalid session cookie 
(cookies must be enabled)';
***************
*** 110,114 ****
                                        if ($FormPW == 
$GLOBALS['phpgw_domain'][$FormDomain]['config_passwd'] && $auth_type == 
'Config')
                                        {
!                                               setcookie('HeaderPW');  // 
scrub the old one
                                                setcookie('ConfigPW',$FormPW);
                                                
setcookie('ConfigDomain',$FormDomain);
--- 110,114 ----
                                        if ($FormPW == 
$GLOBALS['phpgw_domain'][$FormDomain]['config_passwd'] && $auth_type == 
'Config')
                                        {
!                                               setcookie('HeaderPW');  /* 
scrub the old one */
                                                setcookie('ConfigPW',$FormPW);
                                                
setcookie('ConfigDomain',$FormDomain);
***************
*** 141,145 ****
                                if ($HeaderPW != 
$GLOBALS['phpgw_info']['server']['header_admin_password'] && $auth_type == 
'Header')
                                {
!                                       setcookie('HeaderPW');  // scrub the 
old one
                                        
$GLOBALS['phpgw_info']['setup']['HeaderLoginMSG'] = 'Invalid session cookie 
(cookies must be enabled)';
                                        return False;
--- 141,145 ----
                                if ($HeaderPW != 
$GLOBALS['phpgw_info']['server']['header_admin_password'] && $auth_type == 
'Header')
                                {
!                                       setcookie('HeaderPW');  /* scrub the 
old one */
                                        
$GLOBALS['phpgw_info']['setup']['HeaderLoginMSG'] = 'Invalid session cookie 
(cookies must be enabled)';
                                        return False;
***************
*** 233,237 ****
                        {
                                echo '<br>register_app(): ' . $appname . ', 
version: ' . $setup_info[$appname]['version'] . ', table: ' . $appstbl . '<br>';
!                               //var_dump($setup_info[$appname]);
                        }
  
--- 233,237 ----
                        {
                                echo '<br>register_app(): ' . $appname . ', 
version: ' . $setup_info[$appname]['version'] . ', table: ' . $appstbl . '<br>';
!                               // _debug_array($setup_info[$appname]);
                        }
  
***************
*** 299,303 ****
                        {
                                echo '<br>app_registered(): checking ' . 
$appname . ', table: ' . $appstbl;
!                               //var_dump($setup_info[$appname]);
                        }
  
--- 299,303 ----
                        {
                                echo '<br>app_registered(): checking ' . 
$appname . ', table: ' . $appstbl;
!                               // _debug_array($setup_info[$appname]);
                        }
  
***************
*** 346,350 ****
                        {
                                echo '<br>update_app(): ' . $appname . ', 
version: ' . $setup_info[$appname]['currentver'] . ', table: ' . $appstbl . 
'<br>';
!                               //var_dump($setup_info[$appname]);
                        }
  
--- 346,350 ----
                        {
                                echo '<br>update_app(): ' . $appname . ', 
version: ' . $setup_info[$appname]['currentver'] . ', table: ' . $appstbl . 
'<br>';
!                               // _debug_array($setup_info[$appname]);
                        }
  
***************
*** 454,458 ****
                        if 
($this->alessthanb($setup_info['phpgwapi']['currentver'],'0.9.8pre5') && 
($setup_info['phpgwapi']['currentver'] != ''))
                        {
!                               // No phpgw_hooks table yet.
                                return False;
                        }
--- 454,458 ----
                        if 
($this->alessthanb($setup_info['phpgwapi']['currentver'],'0.9.8pre5') && 
($setup_info['phpgwapi']['currentver'] != ''))
                        {
!                               /* No phpgw_hooks table yet. */
                                return False;
                        }
***************
*** 497,501 ****
                        if 
($this->alessthanb($setup_info['phpgwapi']['currentver'],'0.9.8pre5'))
                        {
!                               // No phpgw_hooks table yet.
                                return False;
                        }
--- 497,501 ----
                        if 
($this->alessthanb($setup_info['phpgwapi']['currentver'],'0.9.8pre5'))
                        {
!                               /* No phpgw_hooks table yet. */
                                return False;
                        }
***************
*** 599,603 ****
                                        if ($i<3)
                                        {
!                                               // Ensure that this is 
definitely smaller
                                                if ($DEBUG) { echo"  This is 
the $num[$i] octet, so A is definitely less than B."; }
                                                $less = 5;
--- 599,603 ----
                                        if ($i<3)
                                        {
!                                               /* Ensure that this is 
definitely smaller */
                                                if ($DEBUG) { echo"  This is 
the $num[$i] octet, so A is definitely less than B."; }
                                                $less = 5;
***************
*** 611,615 ****
                                        if ($i<2)
                                        {
!                                               // Ensure that this is 
definitely greater
                                                if ($DEBUG) { echo"  This is 
the $num[$i] octet, so A is definitely greater than B."; }
                                                $less = -5;
--- 611,615 ----
                                        if ($i<2)
                                        {
!                                               /* Ensure that this is 
definitely greater */
                                                if ($DEBUG) { echo"  This is 
the $num[$i] octet, so A is definitely greater than B."; }
                                                $less = -5;
***************
*** 680,684 ****
                                        if ($i<3)
                                        {
!                                               // Ensure that this is 
definitely greater
                                                if ($DEBUG) { echo"  This is 
the $num[$i] octet, so A is definitely greater than B."; }
                                                $less = 5;
--- 680,684 ----
                                        if ($i<3)
                                        {
!                                               /* Ensure that this is 
definitely greater */
                                                if ($DEBUG) { echo"  This is 
the $num[$i] octet, so A is definitely greater than B."; }
                                                $less = 5;
***************
*** 692,696 ****
                                        if ($i<2)
                                        {
!                                               // Ensure that this is 
definitely smaller
                                                if ($DEBUG) { echo"  This is 
the $num[$i] octet, so A is definitely less than B."; }
                                                $less = -5;
--- 692,696 ----
                                        if ($i<2)
                                        {
!                                               /* Ensure that this is 
definitely smaller */
                                                if ($DEBUG) { echo"  This is 
the $num[$i] octet, so A is definitely less than B."; }
                                                $less = -5;

Index: class.setup_detection.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/setup/inc/class.setup_detection.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** class.setup_detection.inc.php       7 Jan 2002 10:50:42 -0000       1.6
--- class.setup_detection.inc.php       11 Jan 2002 03:40:59 -0000      1.7
***************
*** 62,66 ****
                                                
$setup_info[$this->db->f('app_name')]['enabled'] = $this->db->f('app_enabled');
                                        }
!                                       // This is to catch old setup installs 
that did not have phpgwapi listed as an app
                                        if 
(!$setup_info['phpgwapi']['currentver'])
                                        {
--- 62,66 ----
                                                
$setup_info[$this->db->f('app_name')]['enabled'] = $this->db->f('app_enabled');
                                        }
!                                       /* This is to catch old setup installs 
that did not have phpgwapi listed as an app */
                                        if 
(!$setup_info['phpgwapi']['currentver'])
                                        {
***************
*** 107,111 ****
                        {
                                //echo 
'<br>'.$setup_info[$key]['name'].'STATUS: '.$setup_info[$key]['status'];
!                               // Only set this if it has not already failed 
to upgrade - Milosch
                                if (!( ($setup_info[$key]['status'] == 'F') || 
($setup_info[$key]['status'] == 'C') ))
                                {
--- 107,111 ----
                        {
                                //echo 
'<br>'.$setup_info[$key]['name'].'STATUS: '.$setup_info[$key]['status'];
!                               /* Only set this if it has not already failed 
to upgrade - Milosch */
                                if (!( ($setup_info[$key]['status'] == 'F') || 
($setup_info[$key]['status'] == 'C') ))
                                {
***************
*** 119,123 ****
                                                $setup_info[$key]['status'] = 
'C';
                                        }
-                                       //elseif 
($setup_info[$key]['currentver'] < $setup_info[$key]['version'])
                                        elseif 
($this->alessthanb($setup_info[$key]['currentver'],$setup_info[$key]['version']))
                                        {
--- 119,122 ----
***************
*** 152,158 ****
                                                {
                                                        $major = 
$this->get_major($setup_info[$value['depends'][$depkey]['appname']]['currentver']);
-                                                       //echo $major;
                                                        if ($major == 
$depsvalue)
-                                                       //if 
($setup_info[$value['depends'][$depkey]['appname']]['currentver'] == $depsvalue 
)
                                                        {
                                                                
$setup_info['depends'][$depkey]['status'] = True;
--- 151,155 ----
***************
*** 163,168 ****
                                                }
                                        }
!                                       /* Finally I will loop thru the 
dependencies again look for apps that still have a failure status */
!                                       /* If we find one we set the apps 
overall status as a dependency failure */
                                        reset ($value['depends']);
                                        while (list ($depkey, $depvalue) = each 
($value['depends']))
--- 160,167 ----
                                                }
                                        }
!                                       /*
!                                        Finally, we loop through the 
dependencies again to look for apps that still have a failure status
!                                        If we find one, we set the apps 
overall status as a dependency failure.
!                                       */
                                        reset ($value['depends']);
                                        while (list ($depkey, $depvalue) = each 
($value['depends']))
***************
*** 170,174 ****
                                                if 
($setup_info['depends'][$depkey]['status'] == False)
                                                {
!                                                       // Only set this if it 
has not already failed to upgrade - Milosch
                                                        if (!( 
($setup_info[$key]['status'] == 'F') || ($setup_info[$key]['status'] == 'C') ))
                                                        {
--- 169,173 ----
                                                if 
($setup_info['depends'][$depkey]['status'] == False)
                                                {
!                                                       /* Only set this if it 
has not already failed to upgrade - Milosch */
                                                        if (!( 
($setup_info[$key]['status'] == 'F') || ($setup_info[$key]['status'] == 'C') ))
                                                        {
***************
*** 243,247 ****
                                if (! $this->db->Errno)
                                {
-                                       //if (isset($isdb)){
                                        $this->db->query('DROP TABLE 
phpgw_testrights');
                                        
$GLOBALS['phpgw_info']['setup']['header_msg'] = 'Stage 3 (Install 
Applications)';
--- 242,245 ----
***************
*** 259,265 ****
                {
                        $this->db->Halt_On_Error = 'no';
!                       if ($GLOBALS['phpgw_info']['setup']['stage']['db'] != 
10){return '';}
  
!                       // Since 0.9.10pre6 config table is named as 
phpgw_config
                        $config_table = 'config';
                        $ver = 
explode('.',$GLOBALS['phpgw_info']['server']['versions']['phpgwapi']);
--- 257,266 ----
                {
                        $this->db->Halt_On_Error = 'no';
!                       if ($GLOBALS['phpgw_info']['setup']['stage']['db'] != 
10)
!                       {
!                               return '';
!                       }
  
!                       /* Since 0.9.10pre6 config table is named as 
phpgw_config */
                        $config_table = 'config';
                        $ver = 
explode('.',$GLOBALS['phpgw_info']['server']['versions']['phpgwapi']);
***************
*** 333,337 ****
                        if($setup_info[$appname]['tables'])
                        {
!                               // Make a copy, else we send some callers into 
an infinite loop
                                $copy = $setup_info;
                                $this->db->Halt_On_Error = 'no';
--- 334,338 ----
                        if($setup_info[$appname]['tables'])
                        {
!                               /* Make a copy, else we send some callers into 
an infinite loop */
                                $copy = $setup_info;
                                $this->db->Halt_On_Error = 'no';

Index: class.setup_html.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/setup/inc/class.setup_html.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** class.setup_html.inc.php    27 Sep 2001 23:59:39 -0000      1.6
--- class.setup_html.inc.php    11 Jan 2002 03:40:59 -0000      1.7
***************
*** 17,21 ****
                @function generate_header
                @abstract generate header.inc.php file output - NOT a generic 
html header function
!               */      
                function generate_header()
                {
--- 17,21 ----
                @function generate_header
                @abstract generate header.inc.php file output - NOT a generic 
html header function
!               */
                function generate_header()
                {
***************
*** 32,36 ****
                function setup_tpl_dir($app_name='setup')
                {
!                       // hack to get tpl dir
                        if (is_dir(PHPGW_SERVER_ROOT))
                        {
--- 32,36 ----
                function setup_tpl_dir($app_name='setup')
                {
!                       /* hack to get tpl dir */
                        if (is_dir(PHPGW_SERVER_ROOT))
                        {
***************
*** 72,76 ****
                        
$GLOBALS['setup_tpl']->set_var('logoutbutton',$btn_logout);
                        $GLOBALS['setup_tpl']->pparse('out','T_head');
!                       //$setup_tpl->set_var('T_head','');
                }
  
--- 72,76 ----
                        
$GLOBALS['setup_tpl']->set_var('logoutbutton',$btn_logout);
                        $GLOBALS['setup_tpl']->pparse('out','T_head');
!                       /* $setup_tpl->set_var('T_head',''); */
                }
  
***************
*** 112,116 ****
                function login_form()
                {
!                       // begin use TEMPLATE login_main.tpl
                        
$GLOBALS['setup_tpl']->set_var('ConfigLoginMSG',$GLOBALS['phpgw_info']['setup']['ConfigLoginMSG']);
                        
$GLOBALS['setup_tpl']->set_var('HeaderLoginMSG',$GLOBALS['phpgw_info']['setup']['HeaderLoginMSG']);
--- 112,116 ----
                function login_form()
                {
!                       /* begin use TEMPLATE login_main.tpl */
                        
$GLOBALS['setup_tpl']->set_var('ConfigLoginMSG',$GLOBALS['phpgw_info']['setup']['ConfigLoginMSG']);
                        
$GLOBALS['setup_tpl']->set_var('HeaderLoginMSG',$GLOBALS['phpgw_info']['setup']['HeaderLoginMSG']);
***************
*** 118,123 ****
                        if ($GLOBALS['phpgw_info']['setup']['stage']['header'] 
== '10')
                        {
!                               // begin use SUB-TEMPLATE login_stage_header,
!                               // fills V_login_stage_header used inside of 
login_main.tpl
                                
$GLOBALS['setup_tpl']->set_var('lang_select',lang_select());
                                if (count($GLOBALS['phpgw_domain']) > 1)
--- 118,125 ----
                        if ($GLOBALS['phpgw_info']['setup']['stage']['header'] 
== '10')
                        {
!                               /*
!                                Begin use SUB-TEMPLATE login_stage_header,
!                                fills V_login_stage_header used inside of 
login_main.tpl
!                               */
                                
$GLOBALS['setup_tpl']->set_var('lang_select',lang_select());
                                if (count($GLOBALS['phpgw_domain']) > 1)
***************
*** 133,155 ****
                                        $default_domain = 
each($GLOBALS['phpgw_domain']);
                                        
$GLOBALS['setup_tpl']->set_var('default_domain_zero',$default_domain[0]);
!                                       
!                                       // use BLOCK B_single_domain inside of 
login_stage_header
                                        
$GLOBALS['setup_tpl']->parse('V_single_domain','B_single_domain');
!                                       // // in this case, the multi domain 
block needs to be nothing
                                        
$GLOBALS['setup_tpl']->set_var('V_multi_domain','');
                                }
!                               // end use SUB-TEMPLATE login_stage_header
!                               // put all this into V_login_stage_header for 
use inside login_main
                                
$GLOBALS['setup_tpl']->parse('V_login_stage_header','T_login_stage_header');
                        }
                        else
                        {
!                               // begin SKIP SUB-TEMPLATE login_stage_header
                                
$GLOBALS['setup_tpl']->set_var('V_multi_domain','');
                                
$GLOBALS['setup_tpl']->set_var('V_single_domain','');
                                
$GLOBALS['setup_tpl']->set_var('V_login_stage_header','');
                        }
!                       // end use TEMPLATE login_main.tpl
!                       // now out the login_main template
                        $GLOBALS['setup_tpl']->pparse('out','T_login_main');
                }
--- 135,161 ----
                                        $default_domain = 
each($GLOBALS['phpgw_domain']);
                                        
$GLOBALS['setup_tpl']->set_var('default_domain_zero',$default_domain[0]);
! 
!                                       /* Use BLOCK B_single_domain inside of 
login_stage_header */
                                        
$GLOBALS['setup_tpl']->parse('V_single_domain','B_single_domain');
!                                       /* in this case, the multi domain block 
needs to be nothing */
                                        
$GLOBALS['setup_tpl']->set_var('V_multi_domain','');
                                }
!                               /*
!                                End use SUB-TEMPLATE login_stage_header
!                                put all this into V_login_stage_header for use 
inside login_main
!                               */
                                
$GLOBALS['setup_tpl']->parse('V_login_stage_header','T_login_stage_header');
                        }
                        else
                        {
!                               /* begin SKIP SUB-TEMPLATE login_stage_header */
                                
$GLOBALS['setup_tpl']->set_var('V_multi_domain','');
                                
$GLOBALS['setup_tpl']->set_var('V_single_domain','');
                                
$GLOBALS['setup_tpl']->set_var('V_login_stage_header','');
                        }
!                       /*
!                        end use TEMPLATE login_main.tpl
!                        now out the login_main template
!                       */
                        $GLOBALS['setup_tpl']->pparse('out','T_login_main');
                }
***************
*** 158,163 ****
                {
                        $d = dir(PHPGW_SERVER_ROOT . '/phpgwapi/templates');
!                       //$list['user_choice']['name'] = 'user_choice';
!                       //$list['user_choice']['title'] = 'Users Choice';
                        while($entry=$d->read())
                        {
--- 164,168 ----
                {
                        $d = dir(PHPGW_SERVER_ROOT . '/phpgwapi/templates');
! 
                        while($entry=$d->read())
                        {

Index: class.setup_process.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/setup/inc/class.setup_process.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** class.setup_process.inc.php 7 Jan 2002 10:50:42 -0000       1.7
--- class.setup_process.inc.php 11 Jan 2002 03:40:59 -0000      1.8
***************
*** 153,157 ****
  
                                $i++;
!                               if ($i == 20) // Then oops it broke
                                {
                                        echo '<br>Setup failure: excess looping 
in process_pass():'."\n";
--- 153,157 ----
  
                                $i++;
!                               if ($i == 20) /* Then oops it broke */
                                {
                                        echo '<br>Setup failure: excess looping 
in process_pass():'."\n";
***************
*** 166,170 ****
                        }
  
!                       // now return the list
                        @reset($passed);
                        while(list($key,$value) = @each($passed))
--- 166,170 ----
                        }
  
!                       /* now return the list */
                        @reset($passed);
                        while(list($key,$value) = @each($passed))
***************
*** 189,193 ****
                        $this->oProc->m_bDeltaOnly = False;
  
!                       // The following is built so below we won't try to drop 
a table that isn't there
                        $tablenames = $this->db->table_names();
                        while(list($key,$val) = @each($tablenames))
--- 189,193 ----
                        $this->oProc->m_bDeltaOnly = False;
  
!                       /* The following is built so below we won't try to drop 
a table that isn't there. */
                        $tablenames = $this->db->table_names();
                        while(list($key,$val) = @each($tablenames))
***************
*** 215,227 ****
                        }
  
!                       // Done, return current status
                        return ($setup_info);
                }
  
-               // NOTE: This duplicates the old newtables behavior, using 
schema_proc
                /*!
                @function process_current
                @abstract process current table setup in each application/setup 
dir
                @param $appinfo array of application info from setup.inc.php 
files, etc.
                */
                function process_current($setup_info,$DEBUG=False)
--- 215,227 ----
                        }
  
!                       /* Done, return current status */
                        return ($setup_info);
                }
  
                /*!
                @function process_current
                @abstract process current table setup in each application/setup 
dir
                @param $appinfo array of application info from setup.inc.php 
files, etc.
+               @discussion This duplicates the old newtables behavior, using 
schema_proc
                */
                function process_current($setup_info,$DEBUG=False)
***************
*** 266,270 ****
                                        else
                                        {
!                                               // script processing failed
                                                if($DEBUG) { echo 
'<br>process_current(): Failed for ' . $appname . ',status: '. 
$setup_info[$key]['status']; }
                                                $setup_info[$key]['status'] = 
'F';
--- 266,270 ----
                                        else
                                        {
!                                               /* script processing failed */
                                                if($DEBUG) { echo 
'<br>process_current(): Failed for ' . $appname . ',status: '. 
$setup_info[$key]['status']; }
                                                $setup_info[$key]['status'] = 
'F';
***************
*** 274,279 ****
                                {
                                        if($DEBUG) { echo 
'<br>process_current(): No current tables for ' . $apptitle . "\n"; }
!                                       // add the app, but disable it if it 
has tables defined
!                                       // a manual sql script install is 
needed, but we do add the hooks
                                        $enabled = 99;
                                        if ($setup_info[$key]['tables'][0] != 
'')
--- 274,281 ----
                                {
                                        if($DEBUG) { echo 
'<br>process_current(): No current tables for ' . $apptitle . "\n"; }
!                                       /*
!                                        Add the app, but disable it if it has 
tables defined.
!                                        A manual sql script install is needed, 
but we do add the hooks
!                                       */
                                        $enabled = 99;
                                        if ($setup_info[$key]['tables'][0] != 
'')
***************
*** 296,300 ****
                        }
  
!                       // Done, return current status
                        return ($setup_info);
                }
--- 298,302 ----
                        }
  
!                       /* Done, return current status */
                        return ($setup_info);
                }
***************
*** 330,337 ****
                                        
$this->oProc->m_odb->transaction_commit();
                                }
!                               //$setup_info[$key]['status'] = 'C';
                        }
  
!                       // Done, return current status
                        return ($setup_info);
                }
--- 332,339 ----
                                        
$this->oProc->m_odb->transaction_commit();
                                }
!                               /* $setup_info[$key]['status'] = 'C'; */
                        }
  
!                       /* Done, return current status */
                        return ($setup_info);
                }
***************
*** 355,359 ****
                                }
                        }
!                       // Done, return current status
                        return ($setup_info);
                }
--- 357,361 ----
                                }
                        }
!                       /* Done, return current status */
                        return ($setup_info);
                }
***************
*** 377,381 ****
                                }
                        }
!                       // Done, return current status
                        return ($setup_info);
                }
--- 379,383 ----
                                }
                        }
!                       /* Done, return current status */
                        return ($setup_info);
                }
***************
*** 405,409 ****
                                }
                        }
!                       // Done, return current status
                        return ($setup_info);
                }
--- 407,411 ----
                                }
                        }
!                       /* Done, return current status */
                        return ($setup_info);
                }
***************
*** 441,445 ****
                        }
  
!                       // Done, return current status
                        return ($setup_info);
                }
--- 443,447 ----
                        }
  
!                       /* Done, return current status */
                        return ($setup_info);
                }
***************
*** 473,478 ****
                                        
$this->post_process($phpgw_baseline,$DEBUG);
  
!                                       // Update the array values for return 
below
!                                       //$setup_info[$key]['status'] = 'R';
                                }
                                else
--- 475,480 ----
                                        
$this->post_process($phpgw_baseline,$DEBUG);
  
!                                       /* Update the array values for return 
below */
!                                       /* $setup_info[$key]['status'] = 'R'; */
                                }
                                else
***************
*** 486,490 ****
                        }
  
!                       // Done, return current status
                        return ($setup_info);
                }
--- 488,492 ----
                        }
  
!                       /* Done, return current status */
                        return ($setup_info);
                }
***************
*** 552,556 ****
                                                include 
($appdir.'tables_baseline.inc.php');
                                                $this->oProc->m_aTables = 
$phpgw_baseline;
!                                               
//$this->oProc->GenerateScripts($phpgw_baseline, $DEBUG);
                                        }
                                        else
--- 554,558 ----
                                                include 
($appdir.'tables_baseline.inc.php');
                                                $this->oProc->m_aTables = 
$phpgw_baseline;
!                                               /* 
$this->oProc->GenerateScripts($phpgw_baseline, $DEBUG); */
                                        }
                                        else
***************
*** 569,573 ****
                                                $this->updateincluded[$appname] 
= True;
  
!                                               // $test array comes from 
update file, it is a list of available upgrade functions
                                                @reset($test);
                                                while (list($x,$value) = 
@each($test))
--- 571,575 ----
                                                $this->updateincluded[$appname] 
= True;
  
!                                               /* $test array comes from 
update file.  It is a list of available upgrade functions */
                                                @reset($test);
                                                while (list($x,$value) = 
@each($test))
***************
*** 591,595 ****
                                                        {
                                                                
$this->oProc->m_bDeltaOnly = False;
!                                                               // Done 
upgrading
                                                                if($DEBUG)
                                                                {
--- 593,597 ----
                                                        {
                                                                
$this->oProc->m_bDeltaOnly = False;
!                                                               /* Done 
upgrading */
                                                                if($DEBUG)
                                                                {
***************
*** 612,622 ****
                                                        }
                                                        elseif (($value == 
$currentver) || !$currentver)
-                                                       //elseif 
($this->alessthanb($value,$targetver,True) &&
-                                                       //              
$this->alessthanb($currentver,$value,True))
                                                        {
!                                                               // start 
upgrading db in addition to baseline
                                                                
$this->oProc->m_bDeltaOnly = False;
                                                                if ($DEBUG) { 
echo '<br>process_upgrade(): running ' . $function; }
!                                                               // run upgrade 
function
                                                                $success = 
$function();
                                                                if ($success != 
False)
--- 614,622 ----
                                                        }
                                                        elseif (($value == 
$currentver) || !$currentver)
                                                        {
!                                                               /* start 
upgrading db in addition to baseline */
                                                                
$this->oProc->m_bDeltaOnly = False;
                                                                if ($DEBUG) { 
echo '<br>process_upgrade(): running ' . $function; }
!                                                               /* run upgrade 
function */
                                                                $success = 
$function();
                                                                if ($success != 
False)
***************
*** 718,722 ****
                                }
  
!                               // Done with this app, update status
                                $setup_info[$key]['status'] = $appstatus;
                                if ($DEBUG)
--- 718,722 ----
                                }
  
!                               /* Done with this app, update status */
                                $setup_info[$key]['status'] = $appstatus;
                                if ($DEBUG)
***************
*** 726,731 ****
                        }
  
!                       // Done, return current status
! 
                        return ($setup_info);
                }
--- 726,730 ----
                        }
  
!                       /* Done, return current status */
                        return ($setup_info);
                }
***************
*** 763,768 ****
                /*!
                @function sql_to_array
!               @abstract send this a table name, returns printable column spec 
and keys for the table from
!                       schema_proc
                @param  $tablename      table whose array you want to see
                */
--- 762,766 ----
                /*!
                @function sql_to_array
!               @abstract send this a table name, returns printable column spec 
and keys for the table from schema_proc
                @param  $tablename      table whose array you want to see
                */

Index: functions.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/setup/inc/functions.inc.php,v
retrieving revision 1.40
retrieving revision 1.41
diff -C2 -r1.40 -r1.41
*** functions.inc.php   5 Jan 2002 18:07:11 -0000       1.40
--- functions.inc.php   11 Jan 2002 03:40:59 -0000      1.41
***************
*** 234,238 ****
        if(file_exists(PHPGW_SERVER_ROOT.'/phpgwapi/setup/setup.inc.php'))
        {
!               include(PHPGW_SERVER_ROOT.'/phpgwapi/setup/setup.inc.php'); // 
To set the current core version
                /* This will change to just use setup_info */
                $GLOBALS['phpgw_info']['server']['versions']['current_header'] 
= $setup_info['phpgwapi']['versions']['current_header'];
--- 234,238 ----
        if(file_exists(PHPGW_SERVER_ROOT.'/phpgwapi/setup/setup.inc.php'))
        {
!               include(PHPGW_SERVER_ROOT.'/phpgwapi/setup/setup.inc.php'); /* 
To set the current core version */
                /* This will change to just use setup_info */
                $GLOBALS['phpgw_info']['server']['versions']['current_header'] 
= $setup_info['phpgwapi']['versions']['current_header'];




reply via email to

[Prev in Thread] Current Thread [Next in Thread]