From 3a5699e2040501b937b041d2e67c4a8ab4daccd2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 14 Sep 2004 21:14:20 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20Compatibilit=E9=20anciennes=20versions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/database-tables-contraintes.php | 11 +++++----- htdocs/admin/system/database-tables.php | 18 +++++++++------- htdocs/admin/system/database.php | 21 ++++++++++--------- 3 files changed, 27 insertions(+), 23 deletions(-) diff --git a/htdocs/admin/system/database-tables-contraintes.php b/htdocs/admin/system/database-tables-contraintes.php index 8a1fd635b06..4025c7f2b79 100644 --- a/htdocs/admin/system/database-tables-contraintes.php +++ b/htdocs/admin/system/database-tables-contraintes.php @@ -2,7 +2,7 @@ /* Copyright (C) 2003 Rodolphe Quiedeville * Copyright (C) 2004 Laurent Destailleur * Copyright (C) 2004 Sebastien Di Cintio - * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2004 Benoit Mortier * * 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 @@ -22,13 +22,13 @@ * $Source$ */ -/*! \file htdocs/admin/system/mysql-tables-contraintes.php +/*! \file htdocs/admin/system/database-tables-contraintes.php \brief Page d'info des contraintes de la base \version $Revision$ */ require("./pre.inc.php"); -include_once $dolibarr_main_document_root."/lib/${dolibarr_main_db_type}.lib.php"; +include_once $dolibarr_main_document_root."/lib/".$conf->db->type.".lib.php"; $langs->load("admin"); @@ -42,12 +42,13 @@ llxHeader(); print_titre($langs->trans("Constraints")); -if($dolibarr_main_db_type=="mysql") +if ($conf->db->type == 'mysql') { $sql = "SHOW TABLE STATUS"; $base=1; } -else + +if ($conf->db->type == 'pgsql') { $sql = "select conname,contype from pg_constraint;"; $base=2; diff --git a/htdocs/admin/system/database-tables.php b/htdocs/admin/system/database-tables.php index 1baa2ebf68b..4c057e4403a 100644 --- a/htdocs/admin/system/database-tables.php +++ b/htdocs/admin/system/database-tables.php @@ -2,7 +2,7 @@ /* Copyright (C) 2003 Rodolphe Quiedeville * Copyright (C) 2004 Laurent Destailleur * Copyright (C) 2004 Sebastien Di Cintio - * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2004 Benoit Mortier * * 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 @@ -22,13 +22,13 @@ * $Source$ */ -/*! \file htdocs/admin/system/mysql-tables.php +/*! \file htdocs/admin/system/database-tables.php \brief Page d'infos des tables de la base \version $Revision$ */ require("./pre.inc.php"); -include_once $dolibarr_main_document_root."/lib/${dolibarr_main_db_type}.lib.php"; +include_once $dolibarr_main_document_root."/lib/".$conf->db->type.".lib.php"; $langs->load("admin"); @@ -44,9 +44,9 @@ if ($_GET["action"] == 'convert') llxHeader(); -print_titre($langs->trans("Tables")." ".ucfirst($dolibarr_main_db_type)); +print_titre($langs->trans("Tables")." ".ucfirst($conf->db->type)); -if($dolibarr_main_db_type=="mysql") +if($conf->db->type == 'mysql') { print '
'; print ''; @@ -74,13 +74,13 @@ if($dolibarr_main_db_type=="mysql") { $row = $db->fetch_row($i); $var=!$var; - print ""; + print ""; print ''; print ''; if ($row[1] == "MyISAM") { - print ''; + print ''; } else { @@ -98,7 +98,8 @@ if($dolibarr_main_db_type=="mysql") } } } -else + +if($conf->db->type == 'pgsql') { print '
'; print '
'.$row[0].''.$row[1].'ConvertirConvertir
'; @@ -135,5 +136,6 @@ else } print '
'; } + llxFooter(); ?> diff --git a/htdocs/admin/system/database.php b/htdocs/admin/system/database.php index 807291044ce..b05cc2de91f 100644 --- a/htdocs/admin/system/database.php +++ b/htdocs/admin/system/database.php @@ -2,7 +2,7 @@ /* Copyright (C) 2003 Rodolphe Quiedeville * Copyright (C) 2004 Laurent Destailleur * Copyright (C) 2004 Sebastien Di Cintio - * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2004 Benoit Mortier * * 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 @@ -22,13 +22,13 @@ * $Source$ */ -/*! \file htdocs/admin/system/mysql.php +/*! \file htdocs/admin/system/database.php \brief Page des infos système de la base de donnée \version $Revision$ */ require("./pre.inc.php"); -include_once $dolibarr_main_document_root."/lib/${dolibarr_main_db_type}.lib.php"; +include_once $dolibarr_main_document_root."/lib/".$conf->db->type.".lib.php"; $langs->load("admin"); @@ -39,15 +39,16 @@ llxHeader(); print_titre($langs->trans("DatabaseConfiguration")); -if($dolibarr_main_db_type=="mysql") +if ($conf->db->type == 'mysql') { - $sql = "SHOW VARIABLES"; - $base=1; + $sql = "SHOW VARIABLES"; + $base=1; } -else + +if ($conf->db->type == 'pgsql') { - $sql = "select name,setting from pg_settings;"; - $base=2; + $sql = "select name,setting from pg_settings;"; + $base=2; } print '
'; @@ -69,7 +70,7 @@ if ($result) $objp = $db->fetch_object( $i); $var=!$var; print ""; - if($base==1) + if ($base==1) print ''.$objp->Variable_name.''.$objp->Value.''; else print ''.$objp->name.''.$objp->setting.'';