egroupware_official/importexport/setup/tables_update.inc.php

168 lines
4.3 KiB
PHP
Raw Normal View History

<?php
2010-09-05 17:24:34 +02:00
/**
* EGroupware - Setup
*
* @link http://www.egroupware.org
2010-09-05 17:24:34 +02:00
* Created by eTemplates DB-Tools written by ralfbecker@outdoor-training.de
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package importexport
* @subpackage setup
*/
2010-09-05 17:24:34 +02:00
function importexport_upgrade0_002()
{
$GLOBALS['egw_setup']->oProc->AddColumn('egw_importexport_definitions','description',array(
'type' => 'varchar',
'precision' => '255'
));
return $GLOBALS['setup_info']['importexport']['currentver'] = '0.003';
}
function importexport_upgrade0_003()
{
return $GLOBALS['setup_info']['importexport']['currentver'] = '1.4';
}
function importexport_upgrade1_4()
{
$sql = 'UPDATE egw_importexport_definitions SET plugin = CONCAT(application, "_", plugin)';
$GLOBALS['egw_setup']->db->query($sql, __LINE__, __FILE__);
return $GLOBALS['setup_info']['importexport']['currentver'] = '1.7.001';
}
function importexport_upgrade1_7_001()
{
return $GLOBALS['setup_info']['importexport']['currentver'] = '1.8';
}
function importexport_upgrade1_8()
{
$GLOBALS['egw_setup']->oProc->AlterColumn('egw_importexport_definitions','definition_id',array(
'type' => 'auto',
'nullable' => False
));
$GLOBALS['egw_setup']->oProc->AddColumn('egw_importexport_definitions','modified',array(
'type' => 'timestamp'
));
return $GLOBALS['setup_info']['importexport']['currentver'] = '1.9.001';
}
function importexport_upgrade1_9_001()
{
2011-03-21 16:07:52 +01:00
// Not needed - did it wrong
return $GLOBALS['setup_info']['importexport']['currentver'] = '1.9.002';
}
function importexport_upgrade1_9_002()
{
$GLOBALS['egw_setup']->oProc->AddColumn('egw_importexport_definitions','filter',array(
'type' => 'longtext'
));
$sql = 'UPDATE egw_importexport_definitions SET allowed_users = '.
$GLOBALS['egw_setup']->db->concat("','", 'allowed_users', "','");
$GLOBALS['egw_setup']->oProc->query($sql, __LINE__, __FILE__);
2011-06-07 17:29:50 +02:00
// import i/e defintions
if (extension_loaded('dom'))
{
require_once(EGW_INCLUDE_ROOT. '/importexport/inc/class.importexport_definitions_bo.inc.php');
// This sets up $GLOBALS['egw']->accounts and $GLOBALS['egw']->db
$GLOBALS['egw_setup']->setup_account_object();
// step through every source code intstalled app
$egwdir = dir(EGW_INCLUDE_ROOT);
while (false !== ($appdir = $egwdir->read())) {
$defdir = EGW_INCLUDE_ROOT. "/$appdir/setup/";
if ( !is_dir( $defdir ) ) continue;
// step through each file in defdir of app
$d = dir($defdir);
while (false !== ($entry = $d->read())) {
2013-08-12 23:11:18 +02:00
try
{
$file = $defdir. '/'. $entry;
list( $filename, $extension) = explode('.',$entry);
if ( $extension != 'xml' ) continue;
importexport_definitions_bo::import( $file );
}
catch (Exception $e)
{
error_log($e->getMessage());
error_log("Unable to import definition file $file, skipping it.");
}
2011-06-07 17:29:50 +02:00
}
}
}
// give Default and Admins group rights for ImportExport
foreach(array('Default' => 'Default','Admins' => 'Admin') as $account_lid => $name)
{
$account_id = $GLOBALS['egw_setup']->add_account($account_lid,$name,'Group',False,False);
$GLOBALS['egw_setup']->add_acl('importexport','run',$account_id);
}
return $GLOBALS['setup_info']['importexport']['currentver'] = '1.9.004';
}
function importexport_upgrade1_9_003()
{
$GLOBALS['egw_setup']->oProc->AddColumn('egw_importexport_definitions','filter',array(
'type' => 'longtext'
));
return $GLOBALS['setup_info']['importexport']['currentver'] = '1.9.004';
}
2014-06-24 12:00:50 +02:00
function importexport_upgrade1_9_004()
{
return $GLOBALS['setup_info']['importexport']['currentver'] = '14.1';
}
2017-10-22 12:56:58 +02:00
2016-05-10 00:49:20 +02:00
function importexport_upgrade14_1()
{
return $GLOBALS['setup_info']['importexport']['currentver'] = '16.1';
2017-10-22 12:56:58 +02:00
}
function importexport_upgrade16_1()
{
return $GLOBALS['setup_info']['importexport']['currentver'] = '17.1';
}
2019-07-16 10:46:59 +02:00
/**
* Bump version to 19.1
*
* @return string
*/
function importexport_upgrade17_1()
{
return $GLOBALS['setup_info']['importexport']['currentver'] = '19.1';
}
2020-06-28 10:04:21 +02:00
/**
* Bump version to 20.1
*
* @return string
*/
function importexport_upgrade19_1()
{
return $GLOBALS['setup_info']['importexport']['currentver'] = '20.1';
}
2021-05-08 15:02:24 +02:00
/**
* Bump version to 21.1
*
* @return string
*/
function importexport_upgrade20_1()
{
return $GLOBALS['setup_info']['importexport']['currentver'] = '21.1';
}