make customfield names varchar(64) and values text

This commit is contained in:
Ralf Becker 2008-04-19 10:20:40 +00:00
parent b08b584a76
commit 7bd9d6b253
3 changed files with 42 additions and 23 deletions

View File

@ -6,18 +6,18 @@
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de> * @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @package infolog * @package infolog
* @subpackage setup * @subpackage setup
* @copyright (c) 2003-6 by Ralf Becker <RalfBecker-AT-outdoor-training.de> * @copyright (c) 2003-8 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$ * @version $Id$
*/ */
$setup_info['infolog']['name'] = 'infolog'; $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']['app_order'] = 5;
$setup_info['infolog']['tables'] = array('egw_infolog','egw_infolog_extra'); $setup_info['infolog']['tables'] = array('egw_infolog','egw_infolog_extra');
$setup_info['infolog']['enable'] = 1; $setup_info['infolog']['enable'] = 1;
$setup_info['infolog']['author'] = $setup_info['infolog']['author'] =
$setup_info['infolog']['maintainer'] = array( $setup_info['infolog']['maintainer'] = array(
'name' => 'Ralf Becker', 'name' => 'Ralf Becker',
'email' => 'ralfbecker@outdoor-training.de' '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 entries may be viewed or added from InfoLog direct or from within
the contact/address, project or calendar view.</p> the contact/address, project or calendar view.</p>
<p>Other documents / files can be linked to InfoLog entries and are store in the VFS <p>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 (eGroupWare\'s virtual file system).</p>';
the files to a fileserver, instead of placeing a copy in the VFS
(<i>need to be configured in the admin-section</i>).
It is planed to include emails and faxes into InfoLog in the future.</p>';
$setup_info['infolog']['note'] = $setup_info['infolog']['note'] =
'<p>There is a <b>CSV import filter</b> (in the admin-section) to import existing data. '<p>There is a <b>CSV import filter</b> (in the admin-section) to import existing data.
It allows to interactivly assign fields, customize the values with regular 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).</p> (again) to the addressbook entrys).</p>
<p><b>More information</b> about InfoLog and the current development-status can be found on the <p><b>More information</b> about InfoLog and the current development-status can be found on the
<a href="http://www.egroupware.org/wiki/infolog" target="_blank">InfoLog page on our Website</a>.</p>'; <a href="http://www.egroupware.org/wiki/infolog" target="_blank">InfoLog page on our Website</a>.</p>';
@ -72,3 +69,4 @@ $setup_info['infolog']['depends'][] = array(
'appname' => 'etemplate', 'appname' => 'etemplate',
'versions' => Array('1.3','1.4','1.5') 'versions' => Array('1.3','1.4','1.5')
); );

View File

@ -6,7 +6,7 @@
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de> * @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @package infolog * @package infolog
* @subpackage setup * @subpackage setup
* @copyright (c) 2003-6 by Ralf Becker <RalfBecker-AT-outdoor-training.de> * @copyright (c) 2003-8 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$ * @version $Id$
*/ */
@ -51,8 +51,8 @@
'egw_infolog_extra' => array( 'egw_infolog_extra' => array(
'fd' => array( 'fd' => array(
'info_id' => array('type' => 'int','precision' => '4','nullable' => False), 'info_id' => array('type' => 'int','precision' => '4','nullable' => False),
'info_extra_name' => array('type' => 'varchar','precision' => '32','nullable' => False), 'info_extra_name' => array('type' => 'varchar','precision' => '64','nullable' => False),
'info_extra_value' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '') 'info_extra_value' => array('type' => 'text','nullable' => False)
), ),
'pk' => array('info_id','info_extra_name'), 'pk' => array('info_id','info_extra_name'),
'fk' => array(), 'fk' => array(),

View File

@ -6,7 +6,7 @@
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de> * @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @package infolog * @package infolog
* @subpackage setup * @subpackage setup
* @copyright (c) 2003-6 by Ralf Becker <RalfBecker-AT-outdoor-training.de> * @copyright (c) 2003-8 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$ * @version $Id$
*/ */
@ -216,14 +216,14 @@
$GLOBALS['setup_info']['infolog']['currentver'] = '0.9.15.004'; $GLOBALS['setup_info']['infolog']['currentver'] = '0.9.15.004';
return $GLOBALS['setup_info']['infolog']['currentver']; return $GLOBALS['setup_info']['infolog']['currentver'];
} }
$test[] = '0.9.15.004'; $test[] = '0.9.15.004';
function infolog_upgrade0_9_15_004() function infolog_upgrade0_9_15_004()
{ {
// this update correctes wrong escapes of ' and " in the past // this update correctes wrong escapes of ' and " in the past
// //
$db2 = $GLOBALS['phpgw_setup']->db; // we need a 2. result-set $db2 = $GLOBALS['phpgw_setup']->db; // we need a 2. result-set
$to_correct = array('info_from','info_subject','info_des'); $to_correct = array('info_from','info_subject','info_des');
foreach ($to_correct as $col) foreach ($to_correct as $col)
{ {
@ -234,7 +234,7 @@
"' WHERE info_id=".$GLOBALS['phpgw_setup']->oProc->f('info_id')); "' WHERE info_id=".$GLOBALS['phpgw_setup']->oProc->f('info_id'));
} }
} }
$GLOBALS['setup_info']['infolog']['currentver'] = '0.9.15.005'; $GLOBALS['setup_info']['infolog']['currentver'] = '0.9.15.005';
return $GLOBALS['setup_info']['infolog']['currentver']; 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')), '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() 'uc' => array()
)); ));
// we dont need to do update 0.9.15.008, as UpdateSequenze is called now by RefreshTable // 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'; $GLOBALS['setup_info']['infolog']['currentver'] = '1.0.0';
return $GLOBALS['setup_info']['infolog']['currentver']; return $GLOBALS['setup_info']['infolog']['currentver'];
} }
$test[] = '0.9.15.008'; $test[] = '0.9.15.008';
function infolog_upgrade0_9_15_008() function infolog_upgrade0_9_15_008()
{ {
@ -395,7 +395,7 @@
'nullable' => False, 'nullable' => False,
'default' => '0' 'default' => '0'
)); ));
// setting numerical priority 3=urgent, 2=high, 1=normal, 0= // setting numerical priority 3=urgent, 2=high, 1=normal, 0=
$GLOBALS['phpgw_setup']->oProc->AddColumn('phpgw_infolog','info_priority',array( $GLOBALS['phpgw_setup']->oProc->AddColumn('phpgw_infolog','info_priority',array(
'type' => 'int', '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')), '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() 'uc' => array()
),'info_pri'); ),'info_pri');
$GLOBALS['phpgw_setup']->oProc->RenameTable('phpgw_infolog','egw_infolog'); $GLOBALS['phpgw_setup']->oProc->RenameTable('phpgw_infolog','egw_infolog');
$GLOBALS['phpgw_setup']->oProc->RenameTable('phpgw_infolog_extra','egw_infolog_extra'); $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 // 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', 'type' => 'varchar',
'precision' => '255' 'precision' => '255'
)); ));
// all not explicit named stati have the default percent 0 // 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=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__); $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__); "' 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__); $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 // remove the percentages from the custom stati, if they exist
$config =& CreateObject('phpgwapi.config','infolog'); $config =& CreateObject('phpgwapi.config','infolog');
$config->read_repository(); $config->read_repository();
@ -530,10 +530,10 @@
$test[] = '1.2.002'; $test[] = '1.2.002';
function infolog_upgrade1_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='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__); $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 // remove the call and will-call from the custom stati, if they exist
$config =& CreateObject('phpgwapi.config','infolog'); $config =& CreateObject('phpgwapi.config','infolog');
$config->read_repository(); $config->read_repository();
@ -611,3 +611,24 @@
} }
return $GLOBALS['setup_info']['infolog']['currentver'] = '1.5.002'; 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';
}