mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Modifications pour la mise en place de l'UTF8.
A faire : * Approfondir les test d'installation pouvant entrainer des erreurs * Finir de complet les fichiers de langue afin de ne plus avoir de terme en dur dans les pages. Dans le cas contraire, il y a des problèmes d'affichage de caractère lorsqu'ils sont accentués
This commit is contained in:
parent
03da98e445
commit
ac18091256
11
.project
Normal file
11
.project
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>dolibarrAuguria</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
|
|
@ -51,7 +51,7 @@ function llxHeader($head = "") {
|
|||
$menu->add_submenu(DOL_URL_ROOT."/exports/index.php?leftmenu=export",$langs->trans("Datas"));
|
||||
$menu->add_submenu(DOL_URL_ROOT."/adherents/htpasswd.php",$langs->trans("Filehtpasswd"));
|
||||
$menu->add_submenu(DOL_URL_ROOT."/adherents/cartes/carte.php",$langs->trans("MembersCards"));
|
||||
$menu->add_submenu(DOL_URL_ROOT."/adherents/cartes/etiquette.php","Etiquettes d'adhérents");
|
||||
$menu->add_submenu(DOL_URL_ROOT."/adherents/cartes/etiquette.php",$langs->trans("MembersTickets"));
|
||||
|
||||
$langs->load("compta");
|
||||
$menu->add(DOL_URL_ROOT."/adherents/index.php",$langs->trans("Accountancy"));
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ function llxHeader($head = "")
|
|||
$menu->add_submenu(DOL_URL_ROOT."/exports/index.php?leftmenu=export",$langs->trans("Datas"));
|
||||
$menu->add_submenu(DOL_URL_ROOT."/adherents/htpasswd.php",$langs->trans("Filehtpasswd"));
|
||||
$menu->add_submenu(DOL_URL_ROOT."/adherents/cartes/carte.php",$langs->trans("MembersCards"));
|
||||
$menu->add_submenu(DOL_URL_ROOT."/adherents/cartes/etiquette.php","Etiquettes d'adhérents");
|
||||
$menu->add_submenu(DOL_URL_ROOT."/adherents/cartes/etiquette.php",$langs->trans("MembersTickets"));
|
||||
|
||||
$langs->load("compta");
|
||||
$menu->add(DOL_URL_ROOT."/adherents/index.php",$langs->trans("Accountancy"));
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit')
|
|||
|
||||
// Message d'accueil'
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("MessageHome").'</td><td>';
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("MessageLogin").'</td><td>';
|
||||
if ($conf->fckeditor->enabled)
|
||||
{
|
||||
// Editeur wysiwyg
|
||||
|
|
|
|||
|
|
@ -743,7 +743,7 @@ class MenuLeft {
|
|||
if ($conf->export->enabled && $leftmenu=="export") $newmenu->add_submenu(DOL_URL_ROOT."/exports/index.php?leftmenu=export",$langs->trans("Datas"),1,$user->rights->adherent->export);
|
||||
if ($leftmenu=="export") $newmenu->add_submenu(DOL_URL_ROOT."/adherents/htpasswd.php?leftmenu=export",$langs->trans("Filehtpasswd"),1,$user->rights->adherent->export);
|
||||
if ($leftmenu=="export") $newmenu->add_submenu(DOL_URL_ROOT."/adherents/cartes/carte.php?leftmenu=export",$langs->trans("MembersCards"),1,$user->rights->adherent->export,'_new');
|
||||
if ($leftmenu=="export") $newmenu->add_submenu(DOL_URL_ROOT."/adherents/cartes/etiquette.php?leftmenu=export","Etiquettes d'adhérents",1,$user->rights->adherent->export,'_new');
|
||||
if ($leftmenu=="export") $newmenu->add_submenu(DOL_URL_ROOT."/adherents/cartes/etiquette.php?leftmenu=export",$langs->trans("MembersTickets"),1,$user->rights->adherent->export,'_new');
|
||||
|
||||
$newmenu->add(DOL_URL_ROOT."/public/adherents/index.php?leftmenu=member_public",$langs->trans("MemberPublicLinks"));
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -748,7 +748,7 @@ class MenuLeft {
|
|||
if ($conf->export->enabled && $leftmenu=="export") $newmenu->add_submenu(DOL_URL_ROOT."/exports/index.php?leftmenu=export",$langs->trans("Datas"),1,$user->rights->adherent->export);
|
||||
if ($leftmenu=="export") $newmenu->add_submenu(DOL_URL_ROOT."/adherents/htpasswd.php?leftmenu=export",$langs->trans("Filehtpasswd"),1,$user->rights->adherent->export);
|
||||
if ($leftmenu=="export") $newmenu->add_submenu(DOL_URL_ROOT."/adherents/cartes/carte.php?leftmenu=export",$langs->trans("MembersCards"),1,$user->rights->adherent->export,'_new');
|
||||
if ($leftmenu=="export") $newmenu->add_submenu(DOL_URL_ROOT."/adherents/cartes/etiquette.php?leftmenu=export","Etiquettes d'adhérents",1,$user->rights->adherent->export,'_new');
|
||||
if ($leftmenu=="export") $newmenu->add_submenu(DOL_URL_ROOT."/adherents/cartes/etiquette.php?leftmenu=export",$langs->trans("MembersTickets"),1,$user->rights->adherent->export,'_new');
|
||||
|
||||
$newmenu->add(DOL_URL_ROOT."/public/adherents/index.php?leftmenu=member_public",$langs->trans("MemberPublicLinks"));
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@ llxHeader();
|
|||
|
||||
print_fiche_titre($langs->trans("HomeArea"));
|
||||
|
||||
|
||||
if (defined("MAIN_MOTD") && strlen(trim(MAIN_MOTD)))
|
||||
{
|
||||
print '<table width="100%" class="notopnoleftnoright"><tr><td>';
|
||||
|
|
|
|||
120
htdocs/install/etape0.php
Normal file
120
htdocs/install/etape0.php
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
<?php
|
||||
/* Copyright (C) 2004-2007 Cyrille de Lambert <cyrille.delambert@auguria.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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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/install/etape1.php
|
||||
\brief Pemet d'afficher et de confirmer le charset par rapport aux informations précedntes -> sélection suite à connection'
|
||||
\version $Revision$
|
||||
*/
|
||||
|
||||
define('DONOTLOADCONF',1); // To avoid loading conf by file inc..php
|
||||
|
||||
include_once("./inc.php");
|
||||
|
||||
$setuplang=isset($_POST["selectlang"])?$_POST["selectlang"]:(isset($_GET["selectlang"])?$_GET["selectlang"]:'auto');
|
||||
$langs->setDefaultLang($setuplang);
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("install");
|
||||
|
||||
pHeader($langs->trans("ConfigurationFile"),"etape1");
|
||||
|
||||
$error = 0;
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
if ($_POST["action"] == "set")
|
||||
{
|
||||
umask(0);
|
||||
foreach($_POST as $cle=>$valeur)
|
||||
{
|
||||
echo '<input type="hidden" name="'.$cle.'" value="'.$valeur.'">';
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Récuparation des information de connexion
|
||||
*/
|
||||
$userroot=isset($_POST["db_user_root"])?$_POST["db_user_root"]:"";
|
||||
$passroot=isset($_POST["db_pass_root"])?$_POST["db_pass_root"]:"";
|
||||
// Répertoire des pages dolibarr
|
||||
$main_dir=isset($_POST["main_dir"])?trim($_POST["main_dir"]):'';
|
||||
/**
|
||||
* Si l'utilisateur n'est pas créé déjà créé, on se connecte à l'aide du login root'
|
||||
*/
|
||||
require_once($main_dir."/lib/databases/".$_POST["db_type"].".lib.php");
|
||||
if (isset($_POST["db_create_user"]) && $_POST["db_create_user"] == "on")
|
||||
{
|
||||
|
||||
$databasefortest=$conf->db->name;
|
||||
if ($_POST["db_type"] == 'mysql' ||$_POST["db_type"] == 'mysqli')
|
||||
{
|
||||
$databasefortest='mysql';
|
||||
}else{
|
||||
$databasefortest='postgres';
|
||||
}
|
||||
$db = new DoliDb($_POST["db_type"],$_POST["db_host"],$userroot,$passroot,$databasefortest);
|
||||
}else{
|
||||
$db = new DoliDb($_POST["db_type"],$_POST["db_host"],$_POST["db_user"],$_POST["db_pass"],$_POST["db_name"]);
|
||||
}
|
||||
if ($db->error)
|
||||
{
|
||||
print $langs->trans("ThisPHPDoesNotSupportTypeBase",$conf->db->type);
|
||||
$error++;
|
||||
}
|
||||
|
||||
/*
|
||||
* Si creation database demandée, il est possible de faire un choix
|
||||
*/
|
||||
$disabled="";
|
||||
if (! $error && (isset($_POST["db_create_database"]) && $_POST["db_create_database"] == "on"))
|
||||
{
|
||||
$disabled="";
|
||||
}else{
|
||||
$disabled="disabled";
|
||||
}
|
||||
if ($db->connected){
|
||||
?>
|
||||
<table border="0" cellpadding="1" cellspacing="0">
|
||||
<tr><td valign="top" class="label" colspan="3"><?php echo $langs->trans("CharsetChoice");?></td></tr>
|
||||
<tr>
|
||||
<td valign="top" class="label"><?php echo $langs->trans("CharacterSetClient"); ?></td>
|
||||
<td valign="top" class="label"><select name="character_set_client"/><option>ISO-8859-1</option><option>ISO-8859-15</option><option>UTF-8</option><option>cp866</option><option>cp1251</option><option>cp1252</option><option>KOI8-R</option><option>BIG5</option><option>GB2312</option><option>BIG5-HKSCS</option><option>Shift_JIS</option><option>EUC-JP</option></select></td>
|
||||
<td class="label"><div class="comment"><?php echo $langs->trans("CharacterSetClientComment"); ?></div></td>
|
||||
</tr>
|
||||
<?php
|
||||
include($_POST["db_type"].'.php');?>
|
||||
<?php
|
||||
}else{
|
||||
|
||||
if (isset($_POST["db_create_user"]) && $_POST["db_create_user"] == "on")
|
||||
{
|
||||
print 'Vous avez demandé la création du login Dolibarr "<b>'.$dolibarr_main_db_user.'</b>", mais pour cela, ';
|
||||
print 'Dolibarr doit se connecter sur le serveur "<b>'.$dolibarr_main_db_host.'</b>" via le super utilisateur "<b>'.$userroot.'</b>".<br>';
|
||||
print 'La connexion ayant échoué, les paramètres du serveur ou du super utilisateur sont peut-etre incorrects.<br>';
|
||||
print $langs->trans("ErrorGoBackAndCorrectParameters").'<br><br>';
|
||||
}else{
|
||||
print 'La connexion ayant échoué, les paramètres de connexion de l\'utilisateur sont peut-etre incorrects.<br>';
|
||||
print $langs->trans("ErrorGoBackAndCorrectParameters").'<br><br>';
|
||||
}
|
||||
}
|
||||
pFooter($err,$setuplang);
|
||||
?>
|
||||
|
|
@ -135,6 +135,16 @@ if ($_POST["action"] == "set")
|
|||
fputs($fp, '$dolibarr_main_db_type="'.$_POST["db_type"].'";');
|
||||
fputs($fp,"\n");
|
||||
|
||||
/* Choix des charsets*/
|
||||
fputs($fp, '$character_set_client="'.$_POST["character_set_client"].'";');
|
||||
fputs($fp,"\n");
|
||||
|
||||
fputs($fp, '$character_set_database="'.$_POST["character_set_database"].'";');
|
||||
fputs($fp,"\n");
|
||||
|
||||
fputs($fp, '$collation_connection="'.$_POST["collation_connection"].'";');
|
||||
fputs($fp,"\n");
|
||||
|
||||
/* Preparation integration SMARTY */
|
||||
fputs($fp, '$dolibarr_smarty_libs_dir="";');
|
||||
fputs($fp,"\n");
|
||||
|
|
@ -260,9 +270,12 @@ if ($_POST["action"] == "set")
|
|||
if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli')
|
||||
{
|
||||
$databasefortest='mysql';
|
||||
}else{
|
||||
$databasefortest='postgres';
|
||||
}
|
||||
|
||||
// Creation handler de base, verification du support et connexion
|
||||
|
||||
$db = new DoliDb($conf->db->type,$conf->db->host,$userroot,$passroot,$databasefortest);
|
||||
if ($db->error)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -239,6 +239,10 @@ if ($_POST["action"] == "set")
|
|||
{
|
||||
//print "<tr><td>Création des clés et index de la table $name: '$buffer'</td>";
|
||||
$requestnb++;
|
||||
if ($character_set_client=="UTF-8"){
|
||||
$buffer=utf8_encode ($buffer);
|
||||
}
|
||||
|
||||
if ($db->query(trim($buffer)))
|
||||
{
|
||||
//print "<td>OK requete ==== $buffer</td></tr>";
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ $langs->setDefaultLang($setuplang);
|
|||
$langs->load("install");
|
||||
|
||||
|
||||
pHeader($langs->trans("ConfigurationFile"),"etape1");
|
||||
pHeader($langs->trans("ConfigurationFile"),"etape0");
|
||||
|
||||
|
||||
print '<table border="0" cellpadding="1" cellspacing="0">';
|
||||
|
|
@ -76,7 +76,7 @@ if(! isset($dolibarr_main_url_root) || strlen($dolibarr_main_url_root) == 0)
|
|||
$dolibarr_main_document_root = ereg_replace('[\\\/]+$','',$dolibarr_main_document_root);
|
||||
}
|
||||
}
|
||||
|
||||
echo $PMA_MYSQL_INT_VERSION;
|
||||
?>
|
||||
<td class="label" valign="top"><input type="text" size="60" value="<?php print $dolibarr_main_document_root; ?>" name="main_dir">
|
||||
</td><td class="comment">
|
||||
|
|
|
|||
|
|
@ -39,9 +39,11 @@ if (isset($_SERVER["DOCUMENT_URI"]) && $_SERVER["DOCUMENT_URI"])
|
|||
|
||||
|
||||
$conffile = "../conf/conf.php";
|
||||
$charset="ISO-8859-1";
|
||||
if (file_exists($conffile))
|
||||
{
|
||||
include_once($conffile);
|
||||
$charset=$character_set_client;
|
||||
if ($dolibarr_main_document_root)
|
||||
{
|
||||
require_once($dolibarr_main_document_root . "/conf/conf.class.php");
|
||||
|
|
@ -95,18 +97,20 @@ $bc[true]=' class="bg2"';
|
|||
|
||||
function pHeader($soutitre,$next,$action='set')
|
||||
{
|
||||
|
||||
global $charset;
|
||||
global $langs;
|
||||
$langs->load("main");
|
||||
$langs->load("admin");
|
||||
|
||||
// On force contenu en ISO-8859-1
|
||||
header("Content-type: text/html; charset=iso-8859-1");
|
||||
header("Content-type: text/html; charset=".$charset);
|
||||
//header("Content-type: text/html; charset=UTF-8");
|
||||
|
||||
print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">'."\n";
|
||||
print '<html>';
|
||||
print '<head>';
|
||||
print '<meta http-equiv="content-type" content="text/html; charset='.$langs->trans("charset").'">';
|
||||
print '<meta http-equiv="content-type" content="text/html; charset='.$charset.'">';
|
||||
print '<link rel="stylesheet" type="text/css" href="./default.css">';
|
||||
print '<title>'.$langs->trans("DolibarrSetup").'</title>';
|
||||
print '</head>';
|
||||
|
|
|
|||
79
htdocs/install/mysql.php
Normal file
79
htdocs/install/mysql.php
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
<?php
|
||||
/* Copyright (C) 2004-2007 Cyrille de Lambert <cyrille.delambert@auguria.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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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$
|
||||
*/
|
||||
|
||||
$listOfCharacterSet=$db->getListOfCharacterSet();
|
||||
$listOfCollation=$db->getListOfCollation();
|
||||
?>
|
||||
<tr>
|
||||
<td valign="top" class="label"><?php echo $langs->trans("CharacterSetDatabase"); ?></td>
|
||||
<td valign="top" class="label">
|
||||
<?php
|
||||
$listOfCharacterSet=$db->getListOfCharacterSet();
|
||||
?>
|
||||
<select name="character_set_database" <?php echo $disabled ?>>
|
||||
<?php
|
||||
$selected="";
|
||||
foreach ($listOfCharacterSet as $characterSet) {
|
||||
if ($db->getDefaultCharacterSetDatabase() ==$characterSet['charset'] ){
|
||||
$selected="selected";
|
||||
}else{
|
||||
$selected="";
|
||||
}
|
||||
?>
|
||||
<option value="<?php echo $characterSet['charset'];?>" <?php echo $selected;?>> <?php echo $characterSet['charset'];?> (<?php echo $characterSet['description'];?>)</option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<td class="label"><div class="comment"><?php echo $langs->trans("CharacterSetDatabaseComment"); ?></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" class="label"><?php echo $langs->trans("CollationConnection"); ?></td>
|
||||
<td valign="top" class="label">
|
||||
<?php
|
||||
$listOfCollation=$db->getListOfCollation();
|
||||
?>
|
||||
<select name="collation_connection" <?php echo $disabled ?>>
|
||||
<?php
|
||||
$selected="";
|
||||
foreach ($listOfCollation as $collation) {
|
||||
if ($db->getDefaultCollationConnection() ==$collation['collation'] ){
|
||||
$selected="selected";
|
||||
}else{
|
||||
$selected="";
|
||||
}
|
||||
?>
|
||||
<option value="<?php echo $collation['collation'];?>" <?php echo $selected;?>> <?php echo $collation['collation'];?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?if ($disabled && $disabled=="disabled"){
|
||||
?>
|
||||
<input type="hidden" name="character_set_database" value="<?php echo $collation['charset'] ?>">
|
||||
<input type="hidden" name="collation_connection" value="<?php echo $collation['collation'] ?>">
|
||||
<?
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td class="label"><div class="comment"><?php echo $langs->trans("CollationConnectionComment"); ?></div></td>
|
||||
</tr>
|
||||
79
htdocs/install/mysqli.php
Normal file
79
htdocs/install/mysqli.php
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
<?php
|
||||
/* Copyright (C) 2004-2007 Cyrille de Lambert <cyrille.delambert@auguria.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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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$
|
||||
*/
|
||||
|
||||
$listOfCharacterSet=$db->getListOfCharacterSet();
|
||||
$listOfCollation=$db->getListOfCollation();
|
||||
?>
|
||||
<tr>
|
||||
<td valign="top" class="label"><?php echo $langs->trans("CharacterSetDatabase"); ?></td>
|
||||
<td valign="top" class="label">
|
||||
<?php
|
||||
$listOfCharacterSet=$db->getListOfCharacterSet();
|
||||
?>
|
||||
<select name="character_set_database" <?php echo $disabled ?>>
|
||||
<?php
|
||||
$selected="";
|
||||
foreach ($listOfCharacterSet as $characterSet) {
|
||||
if ($db->getDefaultCharacterSetDatabase() ==$characterSet['charset'] ){
|
||||
$selected="selected";
|
||||
}else{
|
||||
$selected="";
|
||||
}
|
||||
?>
|
||||
<option value="<?php echo $characterSet['charset'];?>" <?php echo $selected;?>> <?php echo $characterSet['charset'];?> (<?php echo $characterSet['description'];?>)</option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<td class="label"><div class="comment"><?php echo $langs->trans("CharacterSetDatabaseComment"); ?></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" class="label"><?php echo $langs->trans("CollationConnection"); ?></td>
|
||||
<td valign="top" class="label">
|
||||
<?php
|
||||
$listOfCollation=$db->getListOfCollation();
|
||||
?>
|
||||
<select name="collation_connection" <?php echo $disabled ?>>
|
||||
<?php
|
||||
$selected="";
|
||||
foreach ($listOfCollation as $collation) {
|
||||
if ($db->getDefaultCollationConnection() ==$collation['collation'] ){
|
||||
$selected="selected";
|
||||
}else{
|
||||
$selected="";
|
||||
}
|
||||
?>
|
||||
<option value="<?php echo $collation['collation'];?>" <?php echo $selected;?>> <?php echo $collation['collation'];?></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?if ($disabled && $disabled=="disabled"){
|
||||
?>
|
||||
<input type="hidden" name="character_set_database" value="<?php echo $db->getDefaultCharacterSetDatabase() ?>">
|
||||
<input type="hidden" name="collation_connection" value="<?php echo $db->getDefaultCollationConnection() ?>">
|
||||
<?
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td class="label"><div class="comment"><?php echo $langs->trans("CollationConnectionComment"); ?></div></td>
|
||||
</tr>
|
||||
28
htdocs/install/pgsql.php
Normal file
28
htdocs/install/pgsql.php
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
/* Copyright (C) 2004-2007 Cyrille de Lambert <cyrille.delambert@auguria.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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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$
|
||||
*/
|
||||
?>
|
||||
<tr>
|
||||
<td valign="top" class="label"><?php echo $langs->trans("CharacterSetDatabase"); ?></td>
|
||||
<td valign="top" class="label">
|
||||
<input name="character_set_database" <?php echo $disabled ?> value="<?php echo $db->getDefaultCharacterSetDatabase()?>">
|
||||
</td>
|
||||
<td class="label"><div class="comment"><?php echo $langs->trans("CharacterSetDatabaseComment"); ?></div></td>
|
||||
</tr>
|
||||
|
|
@ -30,6 +30,7 @@ NoMaxSizeByPHPLimit=Note: No limit are built in your PHP
|
|||
MaxSizeForUploadedFiles=Maximum size for uploaded files (0 to disallow any upload)
|
||||
ComptaSetup=Accounting module setup
|
||||
UserSetup=Users' management setup
|
||||
MenuSetup=Menus management setup
|
||||
Setup=Setup
|
||||
Activation=Activation
|
||||
SetupShort=Setup
|
||||
|
|
@ -198,6 +199,8 @@ Module1200Name=Mantis
|
|||
Module1200Desc=Mantis integration
|
||||
Module1780Name=Categories
|
||||
Module1780Desc=Categories' management
|
||||
Module2300Name=Menus
|
||||
Module2300Desc=Menus' management
|
||||
Permission11=Read invoices
|
||||
Permission12=Create invoices
|
||||
Permission13=Modify invoices
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ PublicMembersArea=Public members area
|
|||
MemberCard=Member card
|
||||
Member=Member
|
||||
Members=Members
|
||||
MembersTickets=Members Tickets
|
||||
FundationMembers=Fundation members
|
||||
Attributs=Attributes
|
||||
Person=Person
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ UsePopupCalendar=Utiliser des popup pour l'introduction de dates
|
|||
NextValue=Valeur suivante
|
||||
ComptaSetup=Configuration du module Comptabilité
|
||||
UserSetup=Configuration de la gestion des utilisateurs
|
||||
MenuSetup=Administration des menus par base de données
|
||||
Setup=Configuration
|
||||
Activation=Activation
|
||||
SetupShort=Config
|
||||
|
|
@ -112,6 +113,8 @@ Module40Name=Fournisseurs
|
|||
Module40Desc=Gestion fournisseurs
|
||||
Module42Name=Logs système
|
||||
Module42Desc=Installations de logging (logs système)
|
||||
Module49Name=Éditeurs
|
||||
Module49Desc=Gestion des éditeurs
|
||||
Module50Name=Produits
|
||||
Module50Desc=Gestion des produits
|
||||
Module52Name=Stocks
|
||||
|
|
@ -144,6 +147,8 @@ Module200Name=LDAP
|
|||
Module200Desc=Synchronisation d'annuaire LDAP
|
||||
Module210Name=PostNuke
|
||||
Module210Desc=Intégration de PostNuke
|
||||
Module240Name=Exports utilisateurs
|
||||
Module240Desc= Permet exports par les utilisateurs, via un assistant, de lot de données personalisées
|
||||
Module310Name=Membres
|
||||
Module310Desc=Gestion des membres de la fondation
|
||||
Module320Name=Flux RSS
|
||||
|
|
@ -166,6 +171,10 @@ Module900Name=OSCommerce 2
|
|||
Module900Desc=Interface d'affichage d'un magasin OS Commerce via les Web Services.\nCe module nécessite l'installations de composants de /oscommerce_ws/ws_server dans votre serveur OSCommerce. Lisez le fichier README dans /oscommerce_ws/ws_server.
|
||||
Module1780Name=Catégories
|
||||
Module1780Desc=Gestion des catégories
|
||||
Module2200Name=Droit de prêts
|
||||
Module2200Desc=Gestion du droit de prêts
|
||||
Module2300Name=Menus
|
||||
Module2300Desc=Administration des menus par base de données
|
||||
Permission11=Voir les factures
|
||||
Permission12=Créer des factures
|
||||
Permission13=Modifier des factures
|
||||
|
|
|
|||
|
|
@ -88,11 +88,12 @@ Start=D
|
|||
InstallNotAllowed=Configuration non autorisée par les permissions de <b>conf.php</b>
|
||||
NotAvailable=Non disponible
|
||||
YouMustCreateWithPermission=Vous devez créer le fichier %s et donner les permissions d'écrire dans ce fichier à votre serveur web pendant le processus d'installation.
|
||||
CharacterSetDatabase
|
||||
CorrectProblemAndReloadPage=Corrigez le problème et <a href="%s">rechargez la page</a> (Pressez la touche F5).
|
||||
AlreadyDone=Déjà migré
|
||||
DatabaseVersion=Version de la base de données
|
||||
ServerVersion=Version du serveur de bases de données
|
||||
=
|
||||
|
||||
#########=
|
||||
# upgrade=
|
||||
MigrationOrder=Migration des données de commandes clients
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ PublicMembersArea=Section membres publique
|
|||
MemberCard=Fiche membres
|
||||
Member=Membre
|
||||
Members=Membres
|
||||
MembersTickets=Etiquettes d'adhérents
|
||||
FundationMembers=
|
||||
Attributs=Attributs
|
||||
Person=Personne
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ NoMaxSizeByPHPLimit=Aucune limite interne
|
|||
MaxSizeForUploadedFiles=Taille maximum des documents uploadés (0 pour interdire l'upload)
|
||||
ComptaSetup=Configuration du module Comptabilité
|
||||
UserSetup=Configuration gestion des utilisateurs
|
||||
MenuSetup=Administration des menus par base de données
|
||||
Setup=Configuration
|
||||
Activation=Activation
|
||||
SetupShort=Config
|
||||
|
|
@ -143,6 +144,8 @@ Module40Name=Fournisseurs
|
|||
Module40Desc=Gestion des fournisseurs
|
||||
Module42Name=Syslog
|
||||
Module42Desc=Utilisation de logs (syslog)
|
||||
Module49Name=Éditeurs
|
||||
Module49Desc=Gestion des éditeurs
|
||||
Module50Name=Produits
|
||||
Module50Desc=Gestion des produits
|
||||
Module52Name=Stocks de produits
|
||||
|
|
@ -175,6 +178,8 @@ Module200Name=LDAP
|
|||
Module200Desc=Synchronisation avec un annuaire LDAP
|
||||
Module210Name=PostNuke
|
||||
Module210Desc=Intégration avec PostNuke
|
||||
Module240Name=Exports utilisateurs
|
||||
Module240Desc= Permet exports par les utilisateurs, via un assistant, de lot de données personalisées
|
||||
Module310Name=Adhérents
|
||||
Module310Desc=Gestion des adhérents d'une association
|
||||
Module320Name=Fils RSS
|
||||
|
|
@ -199,6 +204,10 @@ Module1200Name=Mantis
|
|||
Module1200Desc=Interface avec le bug tracking Mantis
|
||||
Module1780Name=Catégories
|
||||
Module1780Desc=Gestion des catégories
|
||||
Module2200Name=Droit de prêts
|
||||
Module2200Desc=Gestion du droit de prêts
|
||||
Module2300Name=Menus
|
||||
Module2300Desc=Administration des menus par base de données
|
||||
Permission11=Consulter les factures
|
||||
Permission12=Créer les factures
|
||||
Permission13=Modifier les factures
|
||||
|
|
|
|||
|
|
@ -100,6 +100,13 @@ AlreadyDone=D
|
|||
DatabaseVersion=Version de la base
|
||||
ServerVersion=Version du serveur de base de donnée
|
||||
YouMustCreateItAndAllowServerToWrite=Vous devez créer ce dossier et permettre au serveur web d'écrire dans celui-ci.
|
||||
CharsetChoice=Choix du codage des caractères
|
||||
CharacterSetClient=Codage utilisé pour l'affichage des pages
|
||||
CharacterSetClientComment=Veuillez choisir le codage que vous souhaitez pour l'affichage des pages.<br/> Le codage par défaut est celui définie sur la base mysql par défaut
|
||||
CollationConnection=Collation utilisée pour la base de données
|
||||
CollationConnectionComment=Veuillez choisir la collation que vous désirez choisir pour la création de la base de données.<br/> Ce paramètre n'est pas sélectionnable si votre base est déjà créée.
|
||||
CharacterSetDatabase=Codage utilisé pour la base de données
|
||||
CharacterSetDatabaseComment=Veuillez choisir le codage que vous désirez choisir pour la création de la base de données.<br/> Ce paramètre n'est pas sélectionnable si votre base est déjà créée.
|
||||
|
||||
#########
|
||||
# upgrade
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ PublicMembersArea=Espace public des adh
|
|||
MemberCard=Fiche adhérent
|
||||
Member=Adhérent
|
||||
Members=Adhérents
|
||||
MembersTickets=Etiquettes d'adhérents
|
||||
FundationMembers=Membres de l'association
|
||||
Attributs=Attributs
|
||||
Person=Personne
|
||||
|
|
|
|||
|
|
@ -266,7 +266,7 @@ class CMailFile
|
|||
|
||||
if ($this->msgishtml)
|
||||
{
|
||||
$out.= "Content-Type: text/html; charset=iso-8859-1".$this->eol;
|
||||
$out.= "Content-Type: text/html; charset=".$_SESSION['charset'].$this->eol;
|
||||
$out.= "Content-Transfer-Encoding: 8bit".$this->eol;
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -46,6 +46,8 @@ class DoliDb
|
|||
var $type='mysql';
|
||||
//! Charset
|
||||
var $forcecharset='latin1';
|
||||
//! Charset client
|
||||
var $forcecharsetclient='iso-8859-1';
|
||||
//! Collate
|
||||
var $forcecollate='latin1_swedish_ci';
|
||||
//! Version min database
|
||||
|
|
@ -57,7 +59,9 @@ class DoliDb
|
|||
//! 1 si base sélectionné, 0 sinon
|
||||
var $database_selected;
|
||||
//! Nom base sélectionnée
|
||||
var $database_name;
|
||||
var $database_name;
|
||||
//! Nom user base
|
||||
var $database_user;
|
||||
//! 1 si une transaction est en cours, 0 sinon
|
||||
var $transaction_opened;
|
||||
//! Derniere requete exécutée
|
||||
|
|
@ -71,7 +75,7 @@ class DoliDb
|
|||
|
||||
var $ok;
|
||||
var $error;
|
||||
|
||||
|
||||
|
||||
// Constantes pour conversion code erreur MySql en code erreur générique
|
||||
var $errorcode_map = array(
|
||||
|
|
@ -115,6 +119,13 @@ class DoliDb
|
|||
function DoliDb($type='mysql', $host, $user, $pass, $name='', $newlink=0)
|
||||
{
|
||||
global $conf,$langs;
|
||||
$conffile = "../conf/conf.php";
|
||||
if (file_exists($conffile)) {
|
||||
include($conffile);
|
||||
$this->forcecharset=$character_set_database;
|
||||
$this->forcecollate=$collation_connection;
|
||||
$this->db_user=$dolibarr_main_db_user;
|
||||
}
|
||||
$this->transaction_opened=0;
|
||||
|
||||
if (! function_exists("mysql_connect"))
|
||||
|
|
@ -224,6 +235,23 @@ class DoliDb
|
|||
return mysql_get_server_info($this->db);
|
||||
}
|
||||
|
||||
/**
|
||||
\brief Renvoie la version du serveur sous forme de nombre
|
||||
\return string Chaine version
|
||||
*/
|
||||
function getIntVersion()
|
||||
{
|
||||
$version= $this->getVersion();
|
||||
$vlist=split('[.-]',$version);
|
||||
if (strlen($vlist[1])==1){
|
||||
$vlist[1]="0".$vlist[1];
|
||||
}
|
||||
if (strlen($vlist[2])==1){
|
||||
$vlist[2]="0".$vlist[2];
|
||||
}
|
||||
return $vlist[0].$vlist[1].$vlist[2];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Renvoie la version du serveur dans un tableau
|
||||
|
|
@ -633,13 +661,12 @@ class DoliDb
|
|||
$sql = 'CREATE DATABASE '.$database;
|
||||
$sql.= ' DEFAULT CHARACTER SET '.$this->forcecharset.' DEFAULT COLLATE '.$this->forcecollate;
|
||||
$ret=$this->query($sql);
|
||||
if (! $ret)
|
||||
{
|
||||
// On réessaie pour compatibilité avec Mysql < 5.0
|
||||
$sql = 'CREATE DATABASE '.$database;
|
||||
$ret=$this->query($sql);
|
||||
}
|
||||
|
||||
if (! $ret)
|
||||
{
|
||||
// On réessaie pour compatibilité avec Mysql < 4.1.1
|
||||
$sql = 'CREATE DATABASE '.$database;
|
||||
$ret=$this->query($sql);
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
|
@ -820,7 +847,68 @@ class DoliDb
|
|||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
function getDefaultCharacterSetDatabase(){
|
||||
$resql=$this->query('SHOW VARIABLES LIKE \'character_set_database\'');
|
||||
if (!$resql)
|
||||
{
|
||||
// version Mysql < 4.1.1
|
||||
return $this->forcecharset;
|
||||
}
|
||||
$liste=$this->fetch_array($resql);
|
||||
return $liste['Value'];
|
||||
}
|
||||
|
||||
function getListOfCharacterSet(){
|
||||
$resql=$this->query('SHOW CHARSET');
|
||||
$liste = array();
|
||||
if ($resql)
|
||||
{
|
||||
$i = 0;
|
||||
while ($obj = $this->fetch_object($resql) )
|
||||
{
|
||||
$liste[$i]['charset'] = $obj->Charset;
|
||||
$liste[$i]['description'] = $obj->Description;
|
||||
$i++;
|
||||
}
|
||||
$this->free($resql);
|
||||
} else {
|
||||
// version Mysql < 4.1.1
|
||||
return null;
|
||||
}
|
||||
return $liste;
|
||||
}
|
||||
|
||||
function getDefaultCollationConnection(){
|
||||
$resql=$this->query('SHOW VARIABLES LIKE \'collation_connection\'');
|
||||
if (!$resql)
|
||||
{
|
||||
// version Mysql < 4.1.1
|
||||
return $this->forcecollate;
|
||||
}
|
||||
$liste=$this->fetch_array($resql);
|
||||
return $liste['Value'];
|
||||
}
|
||||
|
||||
function getListOfCollation(){
|
||||
$resql=$this->query('SHOW COLLATION');
|
||||
$liste = array();
|
||||
if ($resql)
|
||||
{
|
||||
$i = 0;
|
||||
while ($obj = $this->fetch_object($resql) )
|
||||
{
|
||||
$liste[$i]['collation'] = $obj->Collation;
|
||||
$i++;
|
||||
}
|
||||
$this->free($resql);
|
||||
} else {
|
||||
// version Mysql < 4.1.1
|
||||
return null;
|
||||
}
|
||||
return $liste;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -46,6 +46,8 @@ class DoliDb
|
|||
var $type='mysqli';
|
||||
//! Charset
|
||||
var $forcecharset='latin1';
|
||||
//! Charset client
|
||||
var $forcecharsetclient='iso-8859-1';
|
||||
//! Collate
|
||||
var $forcecollate='latin1_swedish_ci';
|
||||
//! Version min database
|
||||
|
|
@ -57,7 +59,9 @@ class DoliDb
|
|||
//! 1 si base sélectionné, 0 sinon
|
||||
var $database_selected;
|
||||
//! Nom base sélectionnée
|
||||
var $database_name;
|
||||
var $database_name;
|
||||
//! Nom user base
|
||||
var $database_user;
|
||||
//! 1 si une transaction est en cours, 0 sinon
|
||||
var $transaction_opened;
|
||||
//! Derniere requete exécutée
|
||||
|
|
@ -114,6 +118,14 @@ class DoliDb
|
|||
function DoliDb($type='mysqli', $host, $user, $pass, $name='', $newlink=0)
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
$conffile = "../../conf/conf.php";
|
||||
if (file_exists($conffile)) {
|
||||
include($conffile);
|
||||
$this->forcecharset=$character_set_database;
|
||||
$this->forcecollate=$collation_connection;
|
||||
$this->db_user=$dolibarr_main_db_user;
|
||||
}
|
||||
$this->transaction_opened=0;
|
||||
|
||||
//print "Name DB: $host,$user,$pass,$name<br>";
|
||||
|
|
@ -230,6 +242,22 @@ class DoliDb
|
|||
return mysqli_get_server_info($this->db);
|
||||
}
|
||||
|
||||
/**
|
||||
\brief Renvoie la version du serveur sous forme de nombre
|
||||
\return string Chaine version
|
||||
*/
|
||||
function getIntVersion()
|
||||
{
|
||||
$version= $this->getVersion();
|
||||
$vlist=split('[.-]',$version);
|
||||
if (strlen($vlist[1])==1){
|
||||
$vlist[1]="0".$vlist[1];
|
||||
}
|
||||
if (strlen($vlist[2])==1){
|
||||
$vlist[2]="0".$vlist[2];
|
||||
}
|
||||
return $vlist[0].$vlist[1].$vlist[2];
|
||||
}
|
||||
|
||||
/**
|
||||
\brief Renvoie la version du serveur dans un tableau
|
||||
|
|
@ -631,22 +659,20 @@ class DoliDb
|
|||
\return resource resource définie si ok, null si ko
|
||||
\remarks Ne pas utiliser les fonctions xxx_create_db (xxx=mysql, ...) car elles sont deprecated
|
||||
*/
|
||||
function DDLCreateDb($database)
|
||||
{
|
||||
$sql = 'CREATE DATABASE '.$database;
|
||||
$sql.= ' DEFAULT CHARACTER SET '.$this->forcecharset.' DEFAULT COLLATE '.$this->forcecollate;
|
||||
$ret=$this->query($sql);
|
||||
if (! $ret)
|
||||
{
|
||||
// On réessaie pour compatibilité avec Mysql < 5.0
|
||||
$sql = 'CREATE DATABASE '.$database;
|
||||
$ret=$this->query($sql);
|
||||
}
|
||||
|
||||
//print "database=".$this->database_name." ret=".$ret." mysqlerror=".mysqli_error($this->db);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
function DDLCreateDb($database)
|
||||
{
|
||||
// ALTER DATABASE dolibarr_db DEFAULT CHARACTER SET latin DEFAULT COLLATE latin1_swedish_ci
|
||||
$sql = 'CREATE DATABASE '.$database;
|
||||
$sql.= ' DEFAULT CHARACTER SET '.$this->forcecharset.' DEFAULT COLLATE '.$this->forcecollate;
|
||||
$ret=$this->query($sql);
|
||||
if (! $ret)
|
||||
{
|
||||
// On réessaie pour compatibilité avec Mysql < 4.1.1
|
||||
$sql = 'CREATE DATABASE '.$database;
|
||||
$ret=$this->query($sql);
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
\brief Liste des tables dans une database.
|
||||
|
|
@ -825,6 +851,67 @@ class DoliDb
|
|||
|
||||
return 1;
|
||||
}
|
||||
|
||||
function getDefaultCharacterSetDatabase(){
|
||||
$resql=$this->query('SHOW VARIABLES LIKE \'character_set_database\'');
|
||||
if (!$resql)
|
||||
{
|
||||
// version Mysql < 4.1.1
|
||||
return $this->forcecharset;
|
||||
}
|
||||
$liste=$this->fetch_array($resql);
|
||||
return $liste['Value'];
|
||||
}
|
||||
|
||||
function getListOfCharacterSet(){
|
||||
$resql=$this->query('SHOW CHARSET');
|
||||
$liste = array();
|
||||
if ($resql)
|
||||
{
|
||||
$i = 0;
|
||||
while ($obj = $this->fetch_object($resql) )
|
||||
{
|
||||
$liste[$i]['charset'] = $obj->Charset;
|
||||
$liste[$i]['description'] = $obj->Description;
|
||||
$i++;
|
||||
}
|
||||
$this->free($resql);
|
||||
} else {
|
||||
// version Mysql < 4.1.1
|
||||
return null;
|
||||
}
|
||||
return $liste;
|
||||
}
|
||||
|
||||
function getDefaultCollationConnection(){
|
||||
$resql=$this->query('SHOW VARIABLES LIKE \'collation_connection\'');
|
||||
if (!$resql)
|
||||
{
|
||||
// version Mysql < 4.1.1
|
||||
return $this->forcecollate;
|
||||
}
|
||||
$liste=$this->fetch_array($resql);
|
||||
return $liste['Value'];
|
||||
}
|
||||
|
||||
function getListOfCollation(){
|
||||
$resql=$this->query('SHOW COLLATION');
|
||||
$liste = array();
|
||||
if ($resql)
|
||||
{
|
||||
$i = 0;
|
||||
while ($obj = $this->fetch_object($resql) )
|
||||
{
|
||||
$liste[$i]['collation'] = $obj->Collation;
|
||||
$i++;
|
||||
}
|
||||
$this->free($resql);
|
||||
} else {
|
||||
// version Mysql < 4.1.1
|
||||
return null;
|
||||
}
|
||||
return $liste;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -44,6 +44,8 @@ class DoliDb
|
|||
{
|
||||
var $db; // Handler de base
|
||||
var $type='pgsql'; // Nom du gestionnaire
|
||||
//! Charset
|
||||
var $forcecharset='latin1';
|
||||
var $versionmin=array(8,1,0); // Version min database
|
||||
|
||||
var $results; // Resultset de la dernière requete
|
||||
|
|
@ -51,12 +53,14 @@ class DoliDb
|
|||
var $connected; // 1 si connecté, 0 sinon
|
||||
var $database_selected; // 1 si base sélectionné, 0 sinon
|
||||
var $database_name; // Nom base sélectionnée
|
||||
var $database_user; //! Nom user base
|
||||
var $transaction_opened; // 1 si une transaction est en cours, 0 sinon
|
||||
var $lastquery;
|
||||
var $lastqueryerror; // Ajout d'une variable en cas d'erreur
|
||||
|
||||
var $ok;
|
||||
var $error;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -71,6 +75,12 @@ class DoliDb
|
|||
function DoliDb($type='pgsql', $host, $user, $pass, $name='')
|
||||
{
|
||||
global $conf,$langs;
|
||||
$conffile = "../conf/conf.php";
|
||||
if (file_exists($conffile)) {
|
||||
include($conffile);
|
||||
$this->forcecharset=$character_set_database;
|
||||
$this->db_user=$dolibarr_main_db_user;
|
||||
}
|
||||
$this->transaction_opened=0;
|
||||
|
||||
//print "Name DB: $host,$user,$pass,$name<br>";
|
||||
|
|
@ -161,7 +171,10 @@ class DoliDb
|
|||
*/
|
||||
function connect($host, $login, $passwd, $name)
|
||||
{
|
||||
$con_string = "host=$host dbname=$name user=$login password=--hidden--";
|
||||
if (!$name){
|
||||
$name="postgres";
|
||||
}
|
||||
$con_string = "host=$host dbname=$name user=$login password=$passwd";
|
||||
$this->db = pg_connect($con_string);
|
||||
if ($this->db)
|
||||
{
|
||||
|
|
@ -177,10 +190,28 @@ class DoliDb
|
|||
*/
|
||||
function getVersion()
|
||||
{
|
||||
return '?';
|
||||
$resql=$this->query('SHOW server_version');
|
||||
$liste=$this->fetch_array($resql);
|
||||
return $liste['server_version'];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Renvoie la version du serveur sous forme de nombre
|
||||
\return string Chaine version
|
||||
*/
|
||||
function getIntVersion()
|
||||
{
|
||||
$version= $this->getVersion();
|
||||
$vlist=split('[.-]',$version);
|
||||
if (strlen($vlist[1])==1){
|
||||
$vlist[1]="0".$vlist[1];
|
||||
}
|
||||
if (strlen($vlist[2])==1){
|
||||
$vlist[2]="0".$vlist[2];
|
||||
}
|
||||
return $vlist[0].$vlist[1].$vlist[2];
|
||||
}
|
||||
|
||||
/**
|
||||
\brief Renvoie la version du serveur dans un tableau
|
||||
\return array Tableau de chaque niveau de version
|
||||
|
|
@ -266,8 +297,11 @@ class DoliDb
|
|||
function query($query)
|
||||
{
|
||||
$query = trim($query);
|
||||
$ret = pg_query($this->db, $query);
|
||||
|
||||
|
||||
if ($this->forcecharset=="UTF-8"){
|
||||
$buffer=utf8_encode ($buffer);
|
||||
}
|
||||
$ret = pg_query($this->db, $query);
|
||||
if (! eregi("^COMMIT",$query) && ! eregi("^ROLLBACK",$query))
|
||||
{
|
||||
// Si requete utilisateur, on la sauvegarde ainsi que son resultset
|
||||
|
|
@ -528,7 +562,7 @@ class DoliDb
|
|||
$nbre = pg_num_rows($result);
|
||||
$row = pg_fetch_result($result,0,0);
|
||||
return $row;
|
||||
|
||||
}
|
||||
|
||||
// Next function are not required. Only minor features use them.
|
||||
//--------------------------------------------------------------
|
||||
|
|
@ -593,10 +627,9 @@ class DoliDb
|
|||
*/
|
||||
function DDLCreateDb($database)
|
||||
{
|
||||
$ret=$this->query('CREATE DATABASE '.$database.';');
|
||||
$ret=$this->query('CREATE DATABASE '.$database.' OWNER '.$this->db_user.' ENCODING \''.$this->forcecharset.'\' ;');
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
\brief Liste des tables dans une database.
|
||||
|
|
@ -630,6 +663,11 @@ class DoliDb
|
|||
|
||||
return 1;
|
||||
}
|
||||
|
||||
function getDefaultCharacterSetDatabase(){
|
||||
$resql=$this->query('SHOW SERVER_ENCODING');
|
||||
$liste=$this->fetch_array($resql);
|
||||
return $liste['server_encoding'];
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -536,7 +536,7 @@ function top_htmlhead($head, $title="", $target="")
|
|||
if (! $conf->css) $conf->css ='/theme/eldy/eldy.css.php';
|
||||
|
||||
//header("Content-type: text/html; charset=UTF-8");
|
||||
header("Content-type: text/html; charset=iso-8859-1");
|
||||
header("Content-type: text/html; charset=".$_SESSION['charset']);
|
||||
|
||||
print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">';
|
||||
// print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd>';
|
||||
|
|
|
|||
|
|
@ -130,6 +130,13 @@ require_once(DOL_DOCUMENT_ROOT ."/menu.class.php");
|
|||
require_once(DOL_DOCUMENT_ROOT ."/html.form.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT ."/lib/databases/".$conf->db->type.".lib.php");
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT ."/conf/conf.class.php");
|
||||
if ($character_set_client ){
|
||||
$_SESSION['charset'] = $character_set_client;
|
||||
}else{
|
||||
$_SESSION['charset'] =$langs->trans("charset");
|
||||
}
|
||||
|
||||
/*
|
||||
* Creation objet $db
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ $langs->load("products");
|
|||
$langs->load("main");
|
||||
|
||||
//header("Content-type: text/html; charset=UTF-8");
|
||||
header("Content-type: text/html; charset=iso-8859-1");
|
||||
header("Content-type: text/html; charset=$character_set_client");
|
||||
print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">';
|
||||
print "\n<html>";
|
||||
print "\n<body>";
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ class Translate {
|
|||
*/
|
||||
function Translate($dir = "")
|
||||
{
|
||||
$this->charset=$_SESSION['charset'];
|
||||
$this->dir=$dir;
|
||||
}
|
||||
|
||||
|
|
@ -236,7 +237,9 @@ class Translate {
|
|||
$newstr=ereg_replace('"','__quot__',$newstr);
|
||||
|
||||
// Cryptage en html de la chaine
|
||||
$newstr=htmlentities($newstr,ENT_QUOTES,$this->charset);
|
||||
$this->load("main");
|
||||
$charset=sprintf($this->tab_translate["charset"]);
|
||||
$newstr=htmlentities($newstr,ENT_QUOTES,$charset);
|
||||
|
||||
// On restaure les tags HTML
|
||||
$newstr=ereg_replace('__lt__','<',$newstr);
|
||||
|
|
@ -311,12 +314,8 @@ class Translate {
|
|||
|
||||
function lang_header()
|
||||
{
|
||||
$this->load("main");
|
||||
$charset=$this->trans("charset");
|
||||
if (! $charset) $charset="iso-8859-1";
|
||||
|
||||
//header("Content-Type: text/html; charset=$charset");
|
||||
$texte = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=$charset\">\n";
|
||||
$texte = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=$this->charset\">\n";
|
||||
|
||||
return $texte;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
create table llx_paiementfourn_facturefourn
|
||||
(
|
||||
rowid SERIAL PRIMARY KEY,
|
||||
"fk_paiementfourn" INT(11) DEFAULT NULL,
|
||||
"fk_facturefourn" INT(11) DEFAULT NULL,
|
||||
"fk_paiementfourn" integer DEFAULT NULL,
|
||||
"fk_facturefourn" integer DEFAULT NULL,
|
||||
"amount" real DEFAULT '0'
|
||||
);
|
||||
Loading…
Reference in New Issue
Block a user