Translation for dbtools
This commit is contained in:
parent
e11b06bc5b
commit
86ab9171a7
@ -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-tables-contraintes.php
|
||||
\brief Page d'info des contraintes de la base
|
||||
\version $Revision$
|
||||
*/
|
||||
* \file htdocs/admin/system/database-tables-contraintes.php
|
||||
* \brief Page d'info des contraintes de la base
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
include_once $dolibarr_main_document_root."/lib/databases/".$conf->db->type.".lib.php";
|
||||
@ -38,12 +35,18 @@ if (!$user->admin)
|
||||
accessforbidden();
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
|
||||
print_fiche_titre($langs->trans("Constraints"),'','setup');
|
||||
|
||||
|
||||
// Define request to get table description
|
||||
$base=0;
|
||||
if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli')
|
||||
if (eregi('mysql',$conf->db->type))
|
||||
{
|
||||
$sql = "SHOW TABLE STATUS";
|
||||
$base=1;
|
||||
|
||||
@ -22,11 +22,11 @@
|
||||
* $Source$
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/admin/system/database-tables.php
|
||||
\brief Page d'infos des tables de la base
|
||||
\version $Revision$
|
||||
*/
|
||||
/**
|
||||
\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/databases/".$conf->db->type.".lib.php";
|
||||
@ -34,36 +34,41 @@ include_once $dolibarr_main_document_root."/lib/databases/".$conf->db->type.".li
|
||||
$langs->load("admin");
|
||||
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
accessforbidden();
|
||||
|
||||
|
||||
|
||||
if ($_GET["action"] == 'convert')
|
||||
{
|
||||
$db->query("alter table ".$_GET["table"]." type=INNODB");
|
||||
$db->query("alter table ".$_GET["table"]." type=INNODB");
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
|
||||
|
||||
print_fiche_titre($langs->trans("Tables")." ".ucfirst($conf->db->type),'','setup');
|
||||
|
||||
|
||||
// Define request to get table description
|
||||
$base=0;
|
||||
if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli')
|
||||
if (eregi('mysql',$conf->db->type))
|
||||
{
|
||||
$sql = "SHOW TABLE STATUS";
|
||||
$base=1;
|
||||
$sql = "SHOW TABLE STATUS";
|
||||
$base=1;
|
||||
}
|
||||
else if ($conf->db->type == 'pgsql')
|
||||
{
|
||||
$sql = "SELECT conname, contype FROM pg_constraint;";
|
||||
$base=2;
|
||||
$sql = "SELECT conname, contype FROM pg_constraint;";
|
||||
$base=2;
|
||||
}
|
||||
else if ($conf->db->type == 'mssql')
|
||||
{
|
||||
//TODO: récupérer les infos du serveur
|
||||
//$sqls[0] = "";
|
||||
//$base=3;
|
||||
//$base=3;
|
||||
}
|
||||
|
||||
|
||||
@ -75,99 +80,98 @@ else
|
||||
{
|
||||
if ($base == 1)
|
||||
{
|
||||
print '<br>';
|
||||
print '<table class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("TableName").'</td>';
|
||||
print '<td colspan="2">'.$langs->trans("Type").'</td>';
|
||||
print '<td>'.$langs->trans("Format").'</td>';
|
||||
print '<td>'.$langs->trans("NbOfRecord").'</td>';
|
||||
print '<td>Avg_row_length</td>';
|
||||
print '<td>Data_length</td>';
|
||||
print '<td>Max_Data_length</td>';
|
||||
print '<td>Index_length</td>';
|
||||
print '<td>Increment</td>';
|
||||
print '<td>Last check</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$sql = "SHOW TABLE STATUS";
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$var=True;
|
||||
$i=0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
print '<td>'.$obj->Name.'</td>';
|
||||
print '<td>'.$obj->Engine.'</td>';
|
||||
if ($row[1] == "MyISAM")
|
||||
{
|
||||
print '<td><a href="database-tables.php?action=convert&table='.$row[0].'">'.$langs->trans("Convert").'</a></td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td> </td>';
|
||||
}
|
||||
print '<td>'.$obj->Row_format.'</td>';
|
||||
print '<td align="right">'.$obj->Rows.'</td>';
|
||||
print '<td align="right">'.$obj->Avg_row_length.'</td>';
|
||||
print '<td align="right">'.$obj->Data_length.'</td>';
|
||||
print '<td align="right">'.$obj->Max_data_length.'</td>';
|
||||
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 '</tr>';
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
print '<table class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("TableName").'</td>';
|
||||
print '<td colspan="2">'.$langs->trans("Type").'</td>';
|
||||
print '<td>'.$langs->trans("Format").'</td>';
|
||||
print '<td>'.$langs->trans("NbOfRecord").'</td>';
|
||||
print '<td>Avg_row_length</td>';
|
||||
print '<td>Data_length</td>';
|
||||
print '<td>Max_Data_length</td>';
|
||||
print '<td>Index_length</td>';
|
||||
print '<td>Increment</td>';
|
||||
print '<td>Last check</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$sql = "SHOW TABLE STATUS";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$var=True;
|
||||
$i=0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
print '<td><a href="dbtable.php?table='.$obj->Name.'">'.$obj->Name.'</a></td>';
|
||||
print '<td>'.$obj->Engine.'</td>';
|
||||
if ($row[1] == "MyISAM")
|
||||
{
|
||||
print '<td><a href="database-tables.php?action=convert&table='.$row[0].'">'.$langs->trans("Convert").'</a></td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td> </td>';
|
||||
}
|
||||
print '<td>'.$obj->Row_format.'</td>';
|
||||
print '<td align="right">'.$obj->Rows.'</td>';
|
||||
print '<td align="right">'.$obj->Avg_row_length.'</td>';
|
||||
print '<td align="right">'.$obj->Data_length.'</td>';
|
||||
print '<td align="right">'.$obj->Max_data_length.'</td>';
|
||||
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 '</tr>';
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
print '</table>';
|
||||
}
|
||||
|
||||
|
||||
if ($base == 2)
|
||||
{
|
||||
print '<br>';
|
||||
print '<table class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("TableName").'</td>';
|
||||
print '<td>Nombre de tuples lu</td>';
|
||||
print '<td>Nb index fetcher.</td>';
|
||||
print '<td>Nbre de tuples inserer</td>';
|
||||
print '<td>Nbre de tuple modifier</td>';
|
||||
print '<td>Nbre de tuple supprimer</td>';
|
||||
print "</tr>\n";
|
||||
$sql = "select relname,seq_tup_read,idx_tup_fetch,n_tup_ins,n_tup_upd,n_tup_del from pg_stat_user_tables;";
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
$var=True;
|
||||
$i=0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$row = $db->fetch_row($i);
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td align="right">'.$row[0].'</td>';
|
||||
print '<td align="right">'.$row[1].'</td>';
|
||||
print '<td align="right">'.$row[2].'</td>';
|
||||
print '<td align="right">'.$row[3].'</td>';
|
||||
print '<td align="right">'.$row[4].'</td>';
|
||||
print '<td align="right">'.$row[5].'</td>';
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
print '<table class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("TableName").'</td>';
|
||||
print '<td>Nombre de tuples lu</td>';
|
||||
print '<td>Nb index fetcher.</td>';
|
||||
print '<td>Nbre de tuples inserer</td>';
|
||||
print '<td>Nbre de tuple modifier</td>';
|
||||
print '<td>Nbre de tuple supprimer</td>';
|
||||
print "</tr>\n";
|
||||
$sql = "select relname,seq_tup_read,idx_tup_fetch,n_tup_ins,n_tup_upd,n_tup_del from pg_stat_user_tables;";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$var=True;
|
||||
$i=0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$row = $db->fetch_row($resql);
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td align="right">'.$row[0].'</td>';
|
||||
print '<td align="right">'.$row[1].'</td>';
|
||||
print '<td align="right">'.$row[2].'</td>';
|
||||
print '<td align="right">'.$row[3].'</td>';
|
||||
print '<td align="right">'.$row[4].'</td>';
|
||||
print '<td align="right">'.$row[5].'</td>';
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
print '</table>';
|
||||
}
|
||||
}
|
||||
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
|
||||
?>
|
||||
|
||||
@ -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/dbtable.php
|
||||
\brief Page d'info des contraintes d'une table
|
||||
\version $Revision$
|
||||
*/
|
||||
\file htdocs/admin/system/dbtable.php
|
||||
\brief Page d'info des contraintes d'une table
|
||||
\version $Id$
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
include_once $dolibarr_main_document_root."/lib/databases/".$conf->db->type.".lib.php";
|
||||
@ -35,93 +32,107 @@ $langs->load("admin");
|
||||
|
||||
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
accessforbidden();
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
|
||||
|
||||
print_fiche_titre($langs->trans("Table") . " ".$_GET["table"],'','setup');
|
||||
|
||||
if ($conf->db->type == 'mysql')
|
||||
// Define request to get table description
|
||||
$base=0;
|
||||
if (eregi('mysql',$conf->db->type))
|
||||
{
|
||||
$sql = "SHOW TABLE STATUS LIKE '".$_GET["table"]."'";
|
||||
$base=1;
|
||||
$sql = "SHOW TABLE STATUS LIKE '".$_GET["table"]."'";
|
||||
$base=1;
|
||||
}
|
||||
|
||||
if ($conf->db->type == 'pgsql')
|
||||
{
|
||||
$sql = "SELECT conname,contype FROM pg_constraint;";
|
||||
$base=2;
|
||||
}
|
||||
|
||||
print '<br>';
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
$var=True;
|
||||
$i=0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$row = $db->fetch_row();
|
||||
$i++;
|
||||
}
|
||||
$sql = "SELECT conname,contype FROM pg_constraint";
|
||||
$base=2;
|
||||
}
|
||||
|
||||
|
||||
if ($base==1)
|
||||
if (! $base)
|
||||
{
|
||||
print $langs->trans("FeatureNotAvailableWithThisDatabaseDriver");
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<br>';
|
||||
|
||||
$cons = explode(";",$row[14]);
|
||||
|
||||
foreach ($cons as $cc)
|
||||
{
|
||||
$cx = ereg_replace("\) REFER", "", $cc);
|
||||
$cx = ereg_replace("\(`", "", $cx);
|
||||
$cx = ereg_replace("`\)", "", $cx);
|
||||
$cx = ereg_replace("` ", "", $cx);
|
||||
|
||||
$val = explode("`",$cx);
|
||||
|
||||
$link[trim($val[0])][0] = $val[1];
|
||||
$link[trim($val[0])][1] = $val[2];
|
||||
|
||||
}
|
||||
|
||||
// var_dump($link);
|
||||
|
||||
print '<table>';
|
||||
print '<tr class="liste_titre"><td>Champs</td><td>Type</td><td>Index</td><td>Champ lié</td></tr>';
|
||||
|
||||
$sql = "DESCRIBE ".$_GET["table"];
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
$var=True;
|
||||
$i=0;
|
||||
while ($i < $num)
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$row = $db->fetch_row($i);
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
|
||||
print "<td>$row[0]</td>";
|
||||
print "<td>$row[1]</td>";
|
||||
print "<td>$row[3]</td>";
|
||||
print "<td>".$link[$row[0]][0].".";
|
||||
print $link[$row[0]][1]."</td>";
|
||||
|
||||
|
||||
print '</tr>';
|
||||
$i++;
|
||||
$num = $db->num_rows($resql);
|
||||
$var=True;
|
||||
$i=0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$row = $db->fetch_row($resql);
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
|
||||
if ($base==1)
|
||||
{
|
||||
|
||||
$cons = explode(";",$row[14]);
|
||||
|
||||
foreach ($cons as $cc)
|
||||
{
|
||||
$cx = ereg_replace("\) REFER", "", $cc);
|
||||
$cx = ereg_replace("\(`", "", $cx);
|
||||
$cx = ereg_replace("`\)", "", $cx);
|
||||
$cx = ereg_replace("` ", "", $cx);
|
||||
|
||||
$val = explode("`",$cx);
|
||||
|
||||
$link[trim($val[0])][0] = $val[1];
|
||||
$link[trim($val[0])][1] = $val[2];
|
||||
|
||||
}
|
||||
|
||||
// var_dump($link);
|
||||
|
||||
print '<table>';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Fields").'</td><td>'.$langs->trans("Type").'</td><td>'.$langs->trans("Index").'</td>';
|
||||
print '<td>'.$langs->trans("FieldsLinked").'</td></tr>';
|
||||
|
||||
$sql = "DESCRIBE ".$_GET["table"];
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
$var=True;
|
||||
$i=0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$row = $db->fetch_row($i);
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
|
||||
print "<td>$row[0]</td>";
|
||||
print "<td>$row[1]</td>";
|
||||
print "<td>$row[3]</td>";
|
||||
print "<td>".$link[$row[0]][0].".";
|
||||
print $link[$row[0]][1]."</td>";
|
||||
|
||||
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
print '</table>';
|
||||
}
|
||||
}
|
||||
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
|
||||
@ -37,6 +37,7 @@ UsePopupCalendar=Use popup for dates input
|
||||
UsePreviewTabs=Use preview tabs
|
||||
ShowPreview=Show preview
|
||||
ThemeCurrentlyActive=Theme currently active
|
||||
Fields=Fields
|
||||
Mask=Mask
|
||||
NextValue=Next value
|
||||
NextValueForInvoices=Next value (invoices)
|
||||
|
||||
@ -37,6 +37,7 @@ UsePopupCalendar=Utiliser les popups pour la saisie des dates
|
||||
UsePreviewTabs=Afficher les onglets "Aperçu"
|
||||
ShowPreview=Afficher aperçu
|
||||
ThemeCurrentlyActive=Theme actuellement actif
|
||||
Fields=Champs
|
||||
Mask=Masque
|
||||
NextValue=Prochaine valeur
|
||||
NextValueForInvoices=Prochaine valeur (factures)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user