phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: phpgwapi/setup setup.inc.php,1.43,1.44 tables_up


From: Miles Lott <address@hidden>
Subject: [Phpgroupware-cvs] CVS: phpgwapi/setup setup.inc.php,1.43,1.44 tables_update.inc.php,1.56,1.57 tables_update_0_9_10.inc.php,1.1,1.2
Date: Sun, 19 May 2002 18:52:36 -0400

Update of /cvsroot/phpgroupware/phpgwapi/setup
In directory subversions:/tmp/cvs-serv31872

Modified Files:
        setup.inc.php tables_update.inc.php 
        tables_update_0_9_10.inc.php 
Log Message:
WARNING - changes preference_owner field to integer (was varchar(20)); also
found potential problem with 0.9.10 upgrade series re: db object usage



Index: setup.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/setup/setup.inc.php,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -r1.43 -r1.44
*** setup.inc.php       14 May 2002 22:55:56 -0000      1.43
--- setup.inc.php       19 May 2002 22:52:34 -0000      1.44
***************
*** 15,19 ****
        $setup_info['phpgwapi']['name']      = 'phpgwapi';
        $setup_info['phpgwapi']['title']     = 'phpgwapi';
!       $setup_info['phpgwapi']['version']   = '0.9.15.002';
        $setup_info['phpgwapi']['versions']['current_header'] = '1.21';
        $setup_info['phpgwapi']['enable']    = 3;
--- 15,19 ----
        $setup_info['phpgwapi']['name']      = 'phpgwapi';
        $setup_info['phpgwapi']['title']     = 'phpgwapi';
!       $setup_info['phpgwapi']['version']   = '0.9.15.003';
        $setup_info['phpgwapi']['versions']['current_header'] = '1.21';
        $setup_info['phpgwapi']['enable']    = 3;

Index: tables_update.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/setup/tables_update.inc.php,v
retrieving revision 1.56
retrieving revision 1.57
diff -C2 -r1.56 -r1.57
*** tables_update.inc.php       1 Mar 2002 11:30:59 -0000       1.56
--- tables_update.inc.php       19 May 2002 22:52:34 -0000      1.57
***************
*** 42,44 ****
--- 42,81 ----
                return $GLOBALS['setup_info']['phpgwapi']['currentver'];
        }
+ 
+       $test[] = '0.9.15.002';
+       function phpgwapi_upgrade0_9_15_002()
+       {
+               $GLOBALS['phpgw_setup']->oProc->CreateTable(
+                       'phpgw_newprefs', array(
+                               'fd' => array(
+                                       'preference_owner' => array('type' => 
'int', 'precision' => 4, 'nullable' => False),
+                                       'preference_value' => array('type' => 
'text')
+                               ),
+                               'pk' => array('preference_owner'),
+                               'fk' => array(),
+                               'ix' => array(),
+                               'uc' => array()
+                       )
+               );
+ 
+               $GLOBALS['phpgw_setup']->oProc->query('SELECT * FROM 
phpgw_preferences',__LINE__,__FILE__);
+               $db2 = $GLOBALS['phpgw_setup']->db;
+ 
+               while($GLOBALS['phpgw_setup']->oProc->next_record())
+               {
+                       $accountid = 
$GLOBALS['phpgw_setup']->oProc->f('preference_owner');
+                       settype($accountid,'integer');
+ 
+                       $db2->query('INSERT INTO phpgw_newprefs 
(preference_owner,preference_value) VALUES('
+                               . $accountid . ",'"
+                               . 
$GLOBALS['phpgw_setup']->oProc->f('preference_value') . "')",
+                               __LINE__,__FILE__);
+               }
+ 
+               $GLOBALS['phpgw_setup']->oProc->DropTable('phpgw_preferences');
+               
$GLOBALS['phpgw_setup']->oProc->RenameTable('phpgw_newprefs','phpgw_preferences');
+ 
+               $setup_info['phpgwapi']['currentver'] = '0.9.15.003';
+               return $setup_info['phpgwapi']['currentver'];
+       }
  ?>

Index: tables_update_0_9_10.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/setup/tables_update_0_9_10.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** tables_update_0_9_10.inc.php        8 Jan 2002 03:32:04 -0000       1.1
--- tables_update_0_9_10.inc.php        19 May 2002 22:52:34 -0000      1.2
***************
*** 79,83 ****
                global $setup_info, $phpgw_setup;
  
!               $db2 = $phpgw_setup->oProc;
  
                $phpgw_setup->oProc->query("SELECT account_groups,account_id 
FROM accounts",__LINE__,__FILE__);
--- 79,83 ----
                global $setup_info, $phpgw_setup;
  
!               $db2 = $phpgw_setup->db;
  
                $phpgw_setup->oProc->query("SELECT account_groups,account_id 
FROM accounts",__LINE__,__FILE__);
***************
*** 191,196 ****
                global $setup_info, $phpgw_setup;
  
!               $db2 = $phpgw_setup->oProc;
!               $db3 = $phpgw_setup->oProc;
  
                $phpgw_setup->oProc->query("SELECT MAX(group_id) FROM 
groups",__LINE__,__FILE__);
--- 191,196 ----
                global $setup_info, $phpgw_setup;
  
!               $db2 = $phpgw_setup->db;
!               $db3 = $phpgw_setup->db;
  
                $phpgw_setup->oProc->query("SELECT MAX(group_id) FROM 
groups",__LINE__,__FILE__);
***************
*** 224,228 ****
                                $new_group_id = mt_rand ($max_group_id, 60000);
                                $db2->query("SELECT account_id FROM 
phpgw_accounts WHERE account_id=$new_group_id",__LINE__,__FILE__);
!                               if(!$db2->num_rows()) { break; }
                        }
                        $db2->query("SELECT account_lid FROM phpgw_accounts 
WHERE account_lid='$group_name'",__LINE__,__FILE__);
--- 224,231 ----
                                $new_group_id = mt_rand ($max_group_id, 60000);
                                $db2->query("SELECT account_id FROM 
phpgw_accounts WHERE account_id=$new_group_id",__LINE__,__FILE__);
!                               if(!$db2->num_rows())
!                               {
!                                       break;
!                               }
                        }
                        $db2->query("SELECT account_lid FROM phpgw_accounts 
WHERE account_lid='$group_name'",__LINE__,__FILE__);




reply via email to

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