From 7bd9d6b253d112eac7938ed137ac04edb3bd940a Mon Sep 17 00:00:00 2001
From: Ralf Becker
Date: Sat, 19 Apr 2008 10:20:40 +0000
Subject: [PATCH] make customfield names varchar(64) and values text
---
infolog/setup/setup.inc.php | 14 ++++-----
infolog/setup/tables_current.inc.php | 6 ++--
infolog/setup/tables_update.inc.php | 45 ++++++++++++++++++++--------
3 files changed, 42 insertions(+), 23 deletions(-)
diff --git a/infolog/setup/setup.inc.php b/infolog/setup/setup.inc.php
index 07f3903fe3..a727979678 100755
--- a/infolog/setup/setup.inc.php
+++ b/infolog/setup/setup.inc.php
@@ -6,18 +6,18 @@
* @author Ralf Becker
* @package infolog
* @subpackage setup
- * @copyright (c) 2003-6 by Ralf Becker
+ * @copyright (c) 2003-8 by Ralf Becker
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
$setup_info['infolog']['name'] = 'infolog';
-$setup_info['infolog']['version'] = '1.5.002';
+$setup_info['infolog']['version'] = '1.5.003';
$setup_info['infolog']['app_order'] = 5;
$setup_info['infolog']['tables'] = array('egw_infolog','egw_infolog_extra');
$setup_info['infolog']['enable'] = 1;
-$setup_info['infolog']['author'] =
+$setup_info['infolog']['author'] =
$setup_info['infolog']['maintainer'] = array(
'name' => 'Ralf Becker',
'email' => 'ralfbecker@outdoor-training.de'
@@ -34,14 +34,11 @@ $setup_info['infolog']['description'] =
The entries may be viewed or added from InfoLog direct or from within
the contact/address, project or calendar view.
Other documents / files can be linked to InfoLog entries and are store in the VFS
- (eGroupWare\'s virtual file system). An extension of the VFS allows to symlink
- the files to a fileserver, instead of placeing a copy in the VFS
- (need to be configured in the admin-section).
- It is planed to include emails and faxes into InfoLog in the future.
';
+ (eGroupWare\'s virtual file system).';
$setup_info['infolog']['note'] =
'There is a CSV import filter (in the admin-section) to import existing data.
It allows to interactivly assign fields, customize the values with regular
- expressions and direct calls to php-functions (e.g. to link the phone calls
+ expressions and direct calls to php-functions (e.g. to link the phone calls
(again) to the addressbook entrys).
More information about InfoLog and the current development-status can be found on the
InfoLog page on our Website.
';
@@ -72,3 +69,4 @@ $setup_info['infolog']['depends'][] = array(
'appname' => 'etemplate',
'versions' => Array('1.3','1.4','1.5')
);
+
diff --git a/infolog/setup/tables_current.inc.php b/infolog/setup/tables_current.inc.php
index f2e9dfd8dd..d3ad57dc47 100644
--- a/infolog/setup/tables_current.inc.php
+++ b/infolog/setup/tables_current.inc.php
@@ -6,7 +6,7 @@
* @author Ralf Becker
* @package infolog
* @subpackage setup
- * @copyright (c) 2003-6 by Ralf Becker
+ * @copyright (c) 2003-8 by Ralf Becker
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
@@ -51,8 +51,8 @@
'egw_infolog_extra' => array(
'fd' => array(
'info_id' => array('type' => 'int','precision' => '4','nullable' => False),
- 'info_extra_name' => array('type' => 'varchar','precision' => '32','nullable' => False),
- 'info_extra_value' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '')
+ 'info_extra_name' => array('type' => 'varchar','precision' => '64','nullable' => False),
+ 'info_extra_value' => array('type' => 'text','nullable' => False)
),
'pk' => array('info_id','info_extra_name'),
'fk' => array(),
diff --git a/infolog/setup/tables_update.inc.php b/infolog/setup/tables_update.inc.php
index 5b65637219..1cf2b83b18 100644
--- a/infolog/setup/tables_update.inc.php
+++ b/infolog/setup/tables_update.inc.php
@@ -6,7 +6,7 @@
* @author Ralf Becker
* @package infolog
* @subpackage setup
- * @copyright (c) 2003-6 by Ralf Becker
+ * @copyright (c) 2003-8 by Ralf Becker
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
@@ -216,14 +216,14 @@
$GLOBALS['setup_info']['infolog']['currentver'] = '0.9.15.004';
return $GLOBALS['setup_info']['infolog']['currentver'];
}
-
+
$test[] = '0.9.15.004';
function infolog_upgrade0_9_15_004()
{
// this update correctes wrong escapes of ' and " in the past
//
$db2 = $GLOBALS['phpgw_setup']->db; // we need a 2. result-set
-
+
$to_correct = array('info_from','info_subject','info_des');
foreach ($to_correct as $col)
{
@@ -234,7 +234,7 @@
"' WHERE info_id=".$GLOBALS['phpgw_setup']->oProc->f('info_id'));
}
}
-
+
$GLOBALS['setup_info']['infolog']['currentver'] = '0.9.15.005';
return $GLOBALS['setup_info']['infolog']['currentver'];
}
@@ -320,13 +320,13 @@
'ix' => array(array('info_owner','info_responsible','info_status','info_startdate'),array('info_id_parent','info_owner','info_responsible','info_status','info_startdate')),
'uc' => array()
));
-
+
// we dont need to do update 0.9.15.008, as UpdateSequenze is called now by RefreshTable
$GLOBALS['setup_info']['infolog']['currentver'] = '1.0.0';
return $GLOBALS['setup_info']['infolog']['currentver'];
}
-
+
$test[] = '0.9.15.008';
function infolog_upgrade0_9_15_008()
{
@@ -395,7 +395,7 @@
'nullable' => False,
'default' => '0'
));
-
+
// setting numerical priority 3=urgent, 2=high, 1=normal, 0=
$GLOBALS['phpgw_setup']->oProc->AddColumn('phpgw_infolog','info_priority',array(
'type' => 'int',
@@ -433,7 +433,7 @@
'ix' => array(array('info_owner','info_responsible','info_status','info_startdate'),array('info_id_parent','info_owner','info_responsible','info_status','info_startdate')),
'uc' => array()
),'info_pri');
-
+
$GLOBALS['phpgw_setup']->oProc->RenameTable('phpgw_infolog','egw_infolog');
$GLOBALS['phpgw_setup']->oProc->RenameTable('phpgw_infolog_extra','egw_infolog_extra');
// only rename links table, if it has not been moved into the API and therefor been already renamed by the API update
@@ -502,7 +502,7 @@
'type' => 'varchar',
'precision' => '255'
));
-
+
// all not explicit named stati have the default percent 0
$GLOBALS['egw_setup']->oProc->query("UPDATE egw_infolog SET info_percent=10 WHERE info_status='ongoing'",__LINE__,__FILE__);
$GLOBALS['egw_setup']->oProc->query("UPDATE egw_infolog SET info_percent=50 WHERE info_status='will-call'",__LINE__,__FILE__);
@@ -513,7 +513,7 @@
"' WHERE info_status = '$p%'",__LINE__,__FILE__);
}
$GLOBALS['egw_setup']->oProc->query("UPDATE egw_infolog SET info_datecompleted=info_datemodified,info_percent=100 WHERE info_status IN ('done','billed','100%')",__LINE__,__FILE__);
-
+
// remove the percentages from the custom stati, if they exist
$config =& CreateObject('phpgwapi.config','infolog');
$config->read_repository();
@@ -530,10 +530,10 @@
$test[] = '1.2.002';
function infolog_upgrade1_2_002()
{
- // change the phone-status: call --> not-started, will-call --> ongoing to be able to sync them
+ // change the phone-status: call --> not-started, will-call --> ongoing to be able to sync them
$GLOBALS['egw_setup']->oProc->query("UPDATE egw_infolog SET info_status='not-started' WHERE info_status='call'",__LINE__,__FILE__);
$GLOBALS['egw_setup']->oProc->query("UPDATE egw_infolog SET info_status='ongoing' WHERE info_status='will-call'",__LINE__,__FILE__);
-
+
// remove the call and will-call from the custom stati, if they exist
$config =& CreateObject('phpgwapi.config','infolog');
$config->read_repository();
@@ -611,3 +611,24 @@
}
return $GLOBALS['setup_info']['infolog']['currentver'] = '1.5.002';
}
+
+ $test[] = '1.5.002';
+ /**
+ * make customfield names varchar(64) and values text
+ *
+ * @return string version
+ */
+ function infolog_upgrade1_5_002()
+ {
+ $GLOBALS['egw_setup']->oProc->AlterColumn('egw_infolog_extra','info_extra_name',array(
+ 'type' => 'varchar',
+ 'precision' => '64',
+ 'nullable' => False
+ ));
+ $GLOBALS['egw_setup']->oProc->AlterColumn('egw_infolog_extra','info_extra_value',array(
+ 'type' => 'text',
+ 'nullable' => False
+ ));
+
+ return $GLOBALS['setup_info']['infolog']['currentver'] = '1.5.003';
+ }