mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-24 15:49:06 +01:00
Fix old setup bug with tables_current output and extra comma
This commit is contained in:
parent
f023e56ff8
commit
e5cf023559
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare - Setup *
|
||||
* http://www.phpgroupware.org *
|
||||
* eGroupWare - Setup *
|
||||
* http://www.egroupware.org *
|
||||
* -------------------------------------------- *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms of the GNU General Public License as published by the *
|
||||
@ -134,7 +134,10 @@
|
||||
|
||||
function printout($template)
|
||||
{
|
||||
global $download,$appname,$table,$showall;
|
||||
$download = get_var('download',array('POST','GET'));
|
||||
$appname = get_var('appname',array('POST','GET'));
|
||||
$table = get_var('table','GLOBALS');
|
||||
$showall = get_var('showall',array('POST','GET'));
|
||||
|
||||
if($download)
|
||||
{
|
||||
@ -155,7 +158,6 @@
|
||||
|
||||
function download_handler($dlstring,$fn='tables_current.inc.php')
|
||||
{
|
||||
//include( PHPGW_SERVER_ROOT . '/phpgwapi/inc/class.browser.inc.php');
|
||||
$b = CreateObject('phpgwapi.browser');
|
||||
$b->content_header($fn);
|
||||
echo $dlstring;
|
||||
@ -182,10 +184,17 @@
|
||||
$term = ',';
|
||||
$dlstring .= printout('sqlheader');
|
||||
|
||||
$db = $GLOBALS['phpgw_setup']->db;
|
||||
copyobj($GLOBALS['phpgw_setup']->db,$db);
|
||||
$db->query('SHOW TABLES');
|
||||
$i = 0;
|
||||
$tbls = $db->num_rows();
|
||||
while($db->next_record())
|
||||
{
|
||||
$i++;
|
||||
if($i == $tbls)
|
||||
{
|
||||
$term = '';
|
||||
}
|
||||
$table = $db->f(0);
|
||||
parse_vars($table,$term);
|
||||
$dlstring .= printout('sqlbody');
|
||||
@ -201,20 +210,23 @@
|
||||
if(!$setup_info[$appname]['tables'])
|
||||
{
|
||||
$f = PHPGW_SERVER_ROOT . '/' . $appname . '/setup/setup.inc.php';
|
||||
if (file_exists ($f)) { include($f); }
|
||||
if(file_exists($f))
|
||||
{
|
||||
include($f);
|
||||
}
|
||||
}
|
||||
|
||||
//$tables = explode(',',$setup_info[$appname]['tables']);
|
||||
$tables = $setup_info[$appname]['tables'];
|
||||
/* $i = 1; */
|
||||
$i = 0;
|
||||
$tbls = count($tables);
|
||||
while(list($key,$table) = @each($tables))
|
||||
{
|
||||
/*
|
||||
if($i == count($tables))
|
||||
$i++;
|
||||
if($i == $tbls)
|
||||
{
|
||||
$term = '';
|
||||
}
|
||||
*/
|
||||
parse_vars($table,$term);
|
||||
$dlstring .= printout('sqlbody');
|
||||
/* $i++; */
|
||||
@ -250,7 +262,10 @@
|
||||
while($entry = $d->read())
|
||||
{
|
||||
$f = PHPGW_SERVER_ROOT . '/' . $entry . '/setup/setup.inc.php';
|
||||
if (file_exists ($f)) { include($f); }
|
||||
if(file_exists($f))
|
||||
{
|
||||
include($f);
|
||||
}
|
||||
}
|
||||
|
||||
while(list($key,$data) = @each($setup_info))
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!-- BEGIN sqlheader --><?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare - Setup *
|
||||
* http://www.phpgroupware.org *
|
||||
* eGroupWare - Setup *
|
||||
* http://www.egroupware.org *
|
||||
* -------------------------------------------- *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms of the GNU General Public License as published by the *
|
||||
@ -19,16 +19,18 @@
|
||||
/* table array for {appname} */
|
||||
$phpgw_baseline = array(
|
||||
<!-- END sqlheader -->
|
||||
|
||||
<!-- BEGIN sqlbody -->
|
||||
'{table}' => array(
|
||||
'fd' => array(
|
||||
{arr} ){term}
|
||||
{arr} ),
|
||||
'pk' => array({pks}),
|
||||
'fk' => array({fks}),
|
||||
'ix' => array({ixs}),
|
||||
'uc' => array({ucs})
|
||||
){term}
|
||||
<!-- END sqlbody -->
|
||||
|
||||
<!-- BEGIN sqlfooter -->
|
||||
);
|
||||
?>
|
||||
|
@ -5,16 +5,18 @@
|
||||
<pre>
|
||||
$phpgw_baseline = array(
|
||||
<!-- END sqlheader -->
|
||||
|
||||
<!-- BEGIN sqlbody -->
|
||||
'{table}' => array(
|
||||
'fd' => array(
|
||||
{arr} ){term}
|
||||
{arr} ),
|
||||
'pk' => array({pks}),
|
||||
'fk' => array({fks}),
|
||||
'ix' => array({ixs}),
|
||||
'uc' => array({ucs})
|
||||
){term}
|
||||
<!-- END sqlbody -->
|
||||
|
||||
<!-- BEGIN sqlfooter -->
|
||||
);
|
||||
</pre>
|
||||
|
Loading…
Reference in New Issue
Block a user