[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: phpgwapi/setup setup.inc.php,1.37.2.6.2.3,1.37.
From: |
Ralf Becker <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: phpgwapi/setup setup.inc.php,1.37.2.6.2.3,1.37.2.6.2.4 tables_current.inc.php,1.32.2.6.2.2,1.32.2.6.2.3 tables_update.inc.php,1.53.2.9.2.5,1.53.2.9.2.6 |
Date: |
Tue, 29 Apr 2003 19:50:27 -0400 |
Update of /cvsroot/phpgroupware/phpgwapi/setup
In directory subversions:/tmp/cvs-serv1026
Modified Files:
Tag: Version-0_9_16-branch
setup.inc.php tables_current.inc.php tables_update.inc.php
Log Message:
reworked preferences:
- not set user-prefs use the default value, default values have been used only
for new accounts before
- preference-table has new column preference_app
- preferences got automaticaly quoted now, eg. its save to use single and
double quotes as well as backslashs
Index: setup.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/setup/setup.inc.php,v
retrieving revision 1.37.2.6.2.3
retrieving revision 1.37.2.6.2.4
diff -C2 -r1.37.2.6.2.3 -r1.37.2.6.2.4
*** setup.inc.php 27 Apr 2003 23:17:28 -0000 1.37.2.6.2.3
--- setup.inc.php 29 Apr 2003 23:50:25 -0000 1.37.2.6.2.4
***************
*** 16,20 ****
$setup_info['phpgwapi']['name'] = 'phpgwapi';
$setup_info['phpgwapi']['title'] = 'phpgwapi';
! $setup_info['phpgwapi']['version'] = '0.9.14.502';
$setup_info['phpgwapi']['versions']['current_header'] = '1.23';
$setup_info['phpgwapi']['enable'] = 3;
--- 16,20 ----
$setup_info['phpgwapi']['name'] = 'phpgwapi';
$setup_info['phpgwapi']['title'] = 'phpgwapi';
! $setup_info['phpgwapi']['version'] = '0.9.14.503';
$setup_info['phpgwapi']['versions']['current_header'] = '1.23';
$setup_info['phpgwapi']['enable'] = 3;
***************
*** 52,54 ****
--- 52,55 ----
$setup_info['notifywindow']['tables'] = '';
$setup_info['notifywindow']['hooks'][] = 'home';
+
Index: tables_current.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/setup/tables_current.inc.php,v
retrieving revision 1.32.2.6.2.2
retrieving revision 1.32.2.6.2.3
diff -C2 -r1.32.2.6.2.2 -r1.32.2.6.2.3
*** tables_current.inc.php 27 Apr 2003 23:17:28 -0000 1.32.2.6.2.2
--- tables_current.inc.php 29 Apr 2003 23:50:25 -0000 1.32.2.6.2.3
***************
*** 74,81 ****
'phpgw_preferences' => array(
'fd' => array(
! 'preference_owner' => array('type' =>
'varchar','precision' => '20','nullable' => False),
! 'preference_value' => array('type' => 'text')
),
! 'pk' => array('preference_owner'),
'fk' => array(),
'ix' => array(),
--- 74,82 ----
'phpgw_preferences' => array(
'fd' => array(
! 'preference_owner' => array('type' =>
'int','precision' => '4','nullable' => False),
! 'preference_app' => array('type' =>
'varchar','precision' => '25','nullable' => False),
! 'preference_value' => array('type' =>
'text','nullable' => False)
),
! 'pk' => array('preference_owner','preference_app'),
'fk' => array(),
'ix' => array(),
Index: tables_update.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/setup/tables_update.inc.php,v
retrieving revision 1.53.2.9.2.5
retrieving revision 1.53.2.9.2.6
diff -C2 -r1.53.2.9.2.5 -r1.53.2.9.2.6
*** tables_update.inc.php 27 Apr 2003 23:17:28 -0000 1.53.2.9.2.5
--- tables_update.inc.php 29 Apr 2003 23:50:25 -0000 1.53.2.9.2.6
***************
*** 60,63 ****
--- 60,70 ----
}
+ class phpgw
+ {
+ var $common;
+ var $accounts;
+ var $applications;
+ var $db;
+ }
$test[] = '0.9.13.004';
function phpgwapi_upgrade0_9_13_004()
***************
*** 67,77 ****
$phpgw_setup->oProc->AddColumn('phpgw_access_log','account_id',array('type' =>
'int', 'precision' => 4, 'default' => 0, 'nullable' => False));
- class phpgw
- {
- var $common;
- var $accounts;
- var $applications;
- var $db;
- }
$phpgw = new phpgw;
$phpgw->common = CreateObject('phpgwapi.common');
--- 74,77 ----
***************
*** 577,580 ****
--- 577,625 ----
$GLOBALS['setup_info']['phpgwapi']['currentver'] = '0.9.14.502';
+ return $GLOBALS['setup_info']['phpgwapi']['currentver'];
+ }
+
+
+ $test[] = '0.9.14.502';
+ function phpgwapi_upgrade0_9_14_502()
+ {
+
$GLOBALS['phpgw_setup']->oProc->RenameTable('phpgw_preferences','old_preferences');
+
+
$GLOBALS['phpgw_setup']->oProc->CreateTable('phpgw_preferences',array(
+ 'fd' => array(
+ 'preference_owner' => array('type' =>
'int','precision' => '4','nullable' => False),
+ 'preference_app' => array('type' =>
'varchar','precision' => '25','nullable' => False),
+ 'preference_value' => array('type' =>
'text','nullable' => False)
+ ),
+ 'pk' => array('preference_owner','preference_app'),
+ 'fk' => array(),
+ 'ix' => array(),
+ 'uc' => array()
+ ));
+ $db2 = $GLOBALS['phpgw_setup']->db; // we need a 2.
result-set
+ $GLOBALS['phpgw_setup']->oProc->query("SELECT * FROM
old_preferences");
+ while ($GLOBALS['phpgw_setup']->oProc->next_record())
+ {
+ $owner =
intval($GLOBALS['phpgw_setup']->oProc->f('preference_owner'));
+ $prefs =
unserialize($GLOBALS['phpgw_setup']->oProc->f('preference_value'));
+
+ if (is_array($prefs))
+ {
+ foreach ($prefs as $app => $pref)
+ {
+ if (!empty($app) && count($pref))
+ {
+ $app = addslashes($app);
+ $pref = serialize($pref);
+ $db2->query("INSERT INTO
phpgw_preferences".
+ "
(preference_owner,preference_app,preference_value)".
+ " VALUES
($owner,'$app','$pref')");
+ }
+ }
+ }
+ }
+ $GLOBALS['phpgw_setup']->oProc->DropTable('old_preferences');
+
+ $GLOBALS['setup_info']['phpgwapi']['currentver'] = '0.9.14.503';
return $GLOBALS['setup_info']['phpgwapi']['currentver'];
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: phpgwapi/setup setup.inc.php,1.37.2.6.2.3,1.37.2.6.2.4 tables_current.inc.php,1.32.2.6.2.2,1.32.2.6.2.3 tables_update.inc.php,1.53.2.9.2.5,1.53.2.9.2.6,
Ralf Becker <address@hidden> <=