Skip to content
Snippets Groups Projects
Commit b398463a authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

More info on utf8 setup in database

parent e7e7b357
Branches
Tags
No related merge requests found
<?php
/* Copyright (C) 2007 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2007-2008 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
......@@ -14,15 +14,12 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*/
/**
\file htdocs/admin/limits.php
\brief Page de configuration des limites
\version $Revision$
\version $Id$
*/
require("./pre.inc.php");
......
......@@ -17,15 +17,12 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*/
/**
\file htdocs/admin/system/database-tables.php
\brief Page d'infos des tables de la base
\version $Revision$
\version $Id$
*/
require("./pre.inc.php");
......@@ -93,6 +90,7 @@ else
print '<td>Index_length</td>';
print '<td>Increment</td>';
print '<td>Last check</td>';
print '<td>Collation</td>';
print "</tr>\n";
$sql = "SHOW TABLE STATUS";
......@@ -127,6 +125,7 @@ else
print '<td align="right">'.$obj->Index_length.'</td>';
print '<td align="right">'.$obj->Auto_increment.'</td>';
print '<td align="right">'.$obj->Check_time.'</td>';
print '<td align="right">'.$obj->Collation.'</td>';
print '</tr>';
$i++;
}
......
......@@ -17,15 +17,12 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*/
/**
\file htdocs/admin/system/database.php
\brief Page des infos systme de la base de donne
\version $Revision$
* \file htdocs/admin/system/database.php
* \brief Page des infos systme de la base de donne
* \version $Id$
*/
require("./pre.inc.php");
......@@ -42,6 +39,8 @@ if (!$user->admin)
* Afficahge page
*/
$html=new Form($db);
llxHeader();
print_fiche_titre($langs->trans("DatabaseConfiguration"),'','setup');
......@@ -84,6 +83,18 @@ else
print '<td>'.$langs->trans("Value").'</td>';
print "</tr>\n";
// arraytest is an array of test to do
$arraytest=array();
if (eregi('mysql',$db->type))
{
$arraytest=array(
"character_set_connection"=>'character_set_client',
'character_set_database'=>'dolibarr_main_db_character_set',
'collation_connection'=>"character_set_client",
'collation_database'=>'dolibarr_main_db_collation'
);
}
$resql = $db->query($sql);
if ($resql)
{
......@@ -92,7 +103,22 @@ else
{
$var=!$var;
print "<tr $bc[$var]>";
print '<td>'.$row[0].'</td><td>'.$row[1]."</td></tr>\n";
print '<td>';
print $row[0];
print '</td>';
print '<td>';
$show=0;$text='';
foreach($arraytest as $key => $val)
{
if ($key != $row[0]) continue;
$text='Should be in line with value of param <b>'.$val.'</b> thas is <b>'.${$val}.'</b>';
$show=1;
}
if ($show==0) print $row[1];
if ($show==1) print $html->textwithhelp($row[1],$text);
if ($show==2) print $html->textwithwarning($row[1],$text);
print '</td>';
print "</tr>\n";
}
$db->free($resql);
}
......
......@@ -229,14 +229,14 @@ if (! $error && $db->connected)
$listOfCharacterSet=$db->getListOfCharacterSet();
$listOfCollation=$db->getListOfCollation();
// Choice of character_set_database
// Choice of dolibarr_main_db_charaster_set
?>
<tr>
<td valign="top" class="label"><?php echo $langs->trans("CharacterSetDatabase"); ?></td>
<td valign="top" class="label"><?php
if (sizeof($listOfCharacterSet))
{
print '<select name="character_set_database" '.$disabled.'>';
print '<select name="dolibarr_main_db_charaster_set" '.$disabled.'>';
$selected="";
foreach ($listOfCharacterSet as $characterSet)
{
......@@ -252,12 +252,12 @@ if (! $error && $db->connected)
}
print '</select>';
if ($disabled=="disabled"){
print '<input type="hidden" name="character_set_database" value="'.$defaultCharacterSet.'">';
print '<input type="hidden" name="dolibarr_main_db_charaster_set" value="'.$defaultCharacterSet.'">';
}
}
else
{
print '<input type="text" name="character_set_database" value="'.$defaultCharacterSet.'">';
print '<input type="text" name="dolibarr_main_db_charaster_set" value="'.$defaultCharacterSet.'">';
}
?></td>
<td class="label">
......
......@@ -149,7 +149,7 @@ if ($_POST["action"] == "set")
fputs($fp, '$dolibarr_main_db_type="'.$_POST["db_type"].'";');
fputs($fp,"\n");
fputs($fp, '$dolibarr_main_db_character_set="'.$_POST["character_set_database"].'";');
fputs($fp, '$dolibarr_main_db_character_set="'.$_POST["dolibarr_main_db_charaster_set"].'";');
fputs($fp,"\n");
fputs($fp, '$dolibarr_main_db_collation="'.$_POST["dolibarr_main_db_collation"].'";');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment