Translation for dbtools

This commit is contained in:
Laurent Destailleur 2008-10-27 20:34:31 +00:00
parent e11b06bc5b
commit 86ab9171a7
5 changed files with 205 additions and 185 deletions

View File

@ -17,15 +17,12 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*/ */
/** /**
\file htdocs/admin/system/database-tables-contraintes.php * \file htdocs/admin/system/database-tables-contraintes.php
\brief Page d'info des contraintes de la base * \brief Page d'info des contraintes de la base
\version $Revision$ * \version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
@ -38,12 +35,18 @@ if (!$user->admin)
accessforbidden(); accessforbidden();
/*
* View
*/
llxHeader(); llxHeader();
print_fiche_titre($langs->trans("Constraints"),'','setup'); print_fiche_titre($langs->trans("Constraints"),'','setup');
// Define request to get table description
$base=0; $base=0;
if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli') if (eregi('mysql',$conf->db->type))
{ {
$sql = "SHOW TABLE STATUS"; $sql = "SHOW TABLE STATUS";
$base=1; $base=1;

View File

@ -37,19 +37,24 @@ if (!$user->admin)
accessforbidden(); accessforbidden();
if ($_GET["action"] == 'convert') if ($_GET["action"] == 'convert')
{ {
$db->query("alter table ".$_GET["table"]." type=INNODB"); $db->query("alter table ".$_GET["table"]." type=INNODB");
} }
llxHeader();
/*
* View
*/
llxHeader();
print_fiche_titre($langs->trans("Tables")." ".ucfirst($conf->db->type),'','setup'); print_fiche_titre($langs->trans("Tables")." ".ucfirst($conf->db->type),'','setup');
// Define request to get table description
$base=0; $base=0;
if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli') if (eregi('mysql',$conf->db->type))
{ {
$sql = "SHOW TABLE STATUS"; $sql = "SHOW TABLE STATUS";
$base=1; $base=1;
@ -92,19 +97,19 @@ else
$sql = "SHOW TABLE STATUS"; $sql = "SHOW TABLE STATUS";
$result = $db->query($sql); $resql = $db->query($sql);
if ($result) if ($resql)
{ {
$num = $db->num_rows($result); $num = $db->num_rows($resql);
$var=True; $var=True;
$i=0; $i=0;
while ($i < $num) while ($i < $num)
{ {
$obj = $db->fetch_object($result); $obj = $db->fetch_object($resql);
$var=!$var; $var=!$var;
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
print '<td>'.$obj->Name.'</td>'; print '<td><a href="dbtable.php?table='.$obj->Name.'">'.$obj->Name.'</a></td>';
print '<td>'.$obj->Engine.'</td>'; print '<td>'.$obj->Engine.'</td>';
if ($row[1] == "MyISAM") if ($row[1] == "MyISAM")
{ {
@ -143,15 +148,15 @@ else
print "</tr>\n"; 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;"; $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); $resql = $db->query($sql);
if ($result) if ($resql)
{ {
$num = $db->num_rows(); $num = $db->num_rows($resql);
$var=True; $var=True;
$i=0; $i=0;
while ($i < $num) while ($i < $num)
{ {
$row = $db->fetch_row($i); $row = $db->fetch_row($resql);
$var=!$var; $var=!$var;
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
print '<td align="right">'.$row[0].'</td>'; print '<td align="right">'.$row[0].'</td>';
@ -169,5 +174,4 @@ else
} }
llxFooter('$Date$ - $Revision$'); llxFooter('$Date$ - $Revision$');
?> ?>

View File

@ -17,15 +17,12 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*/ */
/** /**
\file htdocs/admin/system/dbtable.php \file htdocs/admin/system/dbtable.php
\brief Page d'info des contraintes d'une table \brief Page d'info des contraintes d'une table
\version $Revision$ \version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
@ -38,12 +35,18 @@ if (!$user->admin)
accessforbidden(); accessforbidden();
/*
* View
*/
llxHeader(); llxHeader();
print_fiche_titre($langs->trans("Table") . " ".$_GET["table"],'','setup'); 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"]."'"; $sql = "SHOW TABLE STATUS LIKE '".$_GET["table"]."'";
$base=1; $base=1;
@ -51,21 +54,28 @@ if ($conf->db->type == 'mysql')
if ($conf->db->type == 'pgsql') if ($conf->db->type == 'pgsql')
{ {
$sql = "SELECT conname,contype FROM pg_constraint;"; $sql = "SELECT conname,contype FROM pg_constraint";
$base=2; $base=2;
} }
if (! $base)
{
print $langs->trans("FeatureNotAvailableWithThisDatabaseDriver");
}
else
{
print '<br>'; print '<br>';
$result = $db->query($sql); $result = $db->query($sql);
if ($result) if ($result)
{ {
$num = $db->num_rows(); $num = $db->num_rows($resql);
$var=True; $var=True;
$i=0; $i=0;
while ($i < $num) while ($i < $num)
{ {
$row = $db->fetch_row(); $row = $db->fetch_row($resql);
$i++; $i++;
} }
} }
@ -93,7 +103,8 @@ if ($base==1)
// var_dump($link); // var_dump($link);
print '<table>'; print '<table>';
print '<tr class="liste_titre"><td>Champs</td><td>Type</td><td>Index</td><td>Champ lié</td></tr>'; 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"]; $sql = "DESCRIBE ".$_GET["table"];
$result = $db->query($sql); $result = $db->query($sql);
@ -121,7 +132,7 @@ if ($base==1)
} }
} }
print '</table>'; print '</table>';
}
} }
llxFooter('$Date$ - $Revision$'); llxFooter('$Date$ - $Revision$');

View File

@ -37,6 +37,7 @@ UsePopupCalendar=Use popup for dates input
UsePreviewTabs=Use preview tabs UsePreviewTabs=Use preview tabs
ShowPreview=Show preview ShowPreview=Show preview
ThemeCurrentlyActive=Theme currently active ThemeCurrentlyActive=Theme currently active
Fields=Fields
Mask=Mask Mask=Mask
NextValue=Next value NextValue=Next value
NextValueForInvoices=Next value (invoices) NextValueForInvoices=Next value (invoices)

View File

@ -37,6 +37,7 @@ UsePopupCalendar=Utiliser les popups pour la saisie des dates
UsePreviewTabs=Afficher les onglets "Aperçu" UsePreviewTabs=Afficher les onglets "Aperçu"
ShowPreview=Afficher aperçu ShowPreview=Afficher aperçu
ThemeCurrentlyActive=Theme actuellement actif ThemeCurrentlyActive=Theme actuellement actif
Fields=Champs
Mask=Masque Mask=Masque
NextValue=Prochaine valeur NextValue=Prochaine valeur
NextValueForInvoices=Prochaine valeur (factures) NextValueForInvoices=Prochaine valeur (factures)