forked from Wavyzz/dolibarr
More info on utf8 setup in database
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<?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,16 +17,13 @@
|
||||
* 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 syst<73>me de la base de donn<6E>e
|
||||
\version $Revision$
|
||||
*/
|
||||
* \file htdocs/admin/system/database.php
|
||||
* \brief Page des infos syst<73>me de la base de donn<6E>e
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
include_once $dolibarr_main_document_root."/lib/databases/".$conf->db->type.".lib.php";
|
||||
@@ -34,13 +31,15 @@ include_once $dolibarr_main_document_root."/lib/databases/".$conf->db->type.".li
|
||||
$langs->load("admin");
|
||||
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
accessforbidden();
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Afficahge page
|
||||
*/
|
||||
* Afficahge page
|
||||
*/
|
||||
|
||||
$html=new Form($db);
|
||||
|
||||
llxHeader();
|
||||
|
||||
@@ -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"].'";');
|
||||
|
||||
Reference in New Issue
Block a user